Exemple #1
0
        /// <summary>
        /// Parse the extract progress response.
        /// </summary>
        /// <param name="hDocument">The GeosoftXML response</param>
        /// <param name="eStatus">The status of the extraction</param>
        /// <param name="iProgress">The percent completion of the extraction</param>
        /// <param name="szStatus">The current extraction task</param>
        public void ExtractProgress(System.Xml.XmlDocument hDocument, out Constant.ExtractStatus eStatus, out Int32 iProgress, out String szStatus)
        {
            System.Xml.XmlNode hKey;
            System.Xml.XmlNode hAttr;

            eStatus = Constant.ExtractStatus.UNKNOWN;
            iProgress = 0;
            szStatus = null;

            try
            {

                // --- find the extract key element ---

                hKey = hDocument.SelectSingleNode("/" + Constant.Tag.GEO_XML_TAG + "/" + Constant.Tag.RESPONSE_TAG + "/" + Constant.Tag.EXTRACT_STATUS_TAG + "/" + Constant.Tag.STATUS_TAG);

                if (hKey == null) throw new DapException("No status information found in extract progress");

                hAttr = hKey.Attributes.GetNamedItem(Constant.Attribute.VALUE_ATTR);
                if (hAttr == null)
                {
                    eStatus = Constant.ExtractStatus.UNKNOWN;
                }
                else
                {
                    if (hAttr.Value == "IN PROGRESS")
                        eStatus = Constant.ExtractStatus.IN_PROGRESS;
                    else if (hAttr.Value == "COMPLETED")
                        eStatus = Constant.ExtractStatus.COMPLETED;
                    else if (hAttr.Value == "CANCELLED")
                        eStatus = Constant.ExtractStatus.CANCELLED;
                }

                hAttr = hKey.Attributes.GetNamedItem(Constant.Attribute.PROGRESS_ATTR);
                if (hAttr != null) iProgress = Convert.ToInt32(hAttr.Value);

                hAttr = hKey.Attributes.GetNamedItem(Constant.Attribute.STATUS_ATTR);
                if (hAttr != null) szStatus = hAttr.Value;
            }
            catch (Exception e)
            {
                throw new DapException("Error retrieving status information in extract progress", e);
            }
        }
Exemple #2
0
 /// <summary>
 /// Get the extract progress from the dap server
 /// </summary>
 /// <param name="szKey">The extraction key</param>
 /// <param name="eStatus">The status of the extraction</param>
 /// <returns></returns>
 public void ExtractProgress(string szKey, out Constant.ExtractStatus eStatus)
 {
     ExtractProgress(szKey, out eStatus, null);
 }
Exemple #3
0
        /// <summary>
        /// Get the extract progress from the dap server
        /// </summary>
        /// <param name="szKey">The extraction key</param>
        /// <param name="eStatus">The status of the extraction</param>
        /// <param name="progressCallBack">Progress handler (may be null)</param>
        /// <returns></returns>
        public void ExtractProgress(string szKey, out Constant.ExtractStatus eStatus, UpdateProgessCallback progressCallBack)
        {
            System.Xml.XmlDocument hResponseDocument;
            Int32 iProgress;
            string szStatus;

            hResponseDocument = ExtractProgress(szKey, progressCallBack);
            m_hParse.ExtractProgress(hResponseDocument, out eStatus, out iProgress, out szStatus);
        }
Exemple #4
0
        /// <summary>
        /// Create the url, base of the xml version and whether it is secure or not
        /// </summary>
        /// <param name="eRequest"></param>
        /// <returns></returns>
        public string CreateUrl(Constant.Request eRequest)
        {
            m_oLock.AcquireReaderLock(-1);

            string strUrl = m_strUrl;

            switch (m_hEncodeRequest.Version)
            {
                case Version.GEOSOFT_XML_1_0:
                    strUrl += Constant.ServerV1[Convert.ToInt32(eRequest)];
                    break;
                case Version.GEOSOFT_XML_1_1:
                    strUrl += Constant.ServerV1_1[Convert.ToInt32(eRequest)];
                    break;
            }

            if (m_oCommunication.Secure && eRequest != Constant.Request.CONFIGURATION)
                strUrl += Constant.RequestXmlSecure;
            else
                strUrl += Constant.RequestXmlNormal;

            m_oLock.ReleaseReaderLock();

            return strUrl;
        }