Beispiel #1
0
        internal ServerModelNode AddWMSServer(WMSServerUri oUri, bool blEnabled, bool blUpdateHomeView, bool blSubmitToDappleSearch)
        {
            lock (m_oLock)
            {
                // --- Don't add the server if it's already in the model ---

                ServerModelNode result = m_oRootNode.WMSServers.GetServer(oUri);
                if (result != null)
                {
                    return(result);
                }

                // --- Add the server ---

                result = m_oRootNode.WMSServers.AddServer(oUri, blEnabled);

                // --- Update home view if necessary ---

                if (blUpdateHomeView)
                {
                    result.AddToHomeView();
                }

                // --- Submit to DappleSearch if necessary ---

                if (blSubmitToDappleSearch)
                {
                    SubmitServerToSearchEngine(oUri.ToBaseUri(), ServerModelNode.ServerType.WMS);
                }

                OnServerAdded(EventArgs.Empty);
                return(result);
            }
        }
Beispiel #2
0
 private static void RemoveWMSServer(XmlDocument doc, WMSServerUri uri)
 {
     foreach (XmlElement oDapCatalog in doc.SelectNodes("/dappleview/servers/builderentry/builderdirectory/builderentry/wmscatalog"))
     {
         if (new WMSServerUri(oDapCatalog.GetAttribute("capabilitiesurl")).ToString().Equals(uri.ToString()))
         {
             oDapCatalog.ParentNode.ParentNode.RemoveChild(oDapCatalog.ParentNode);
         }
     }
 }
Beispiel #3
0
 private static void SetWMSServerEnabled(XmlDocument doc, WMSServerUri uri, bool blValue)
 {
     foreach (XmlElement oWmsCatalog in doc.SelectNodes("/dappleview/servers/builderentry/builderdirectory/builderentry/wmscatalog"))
     {
         if (new WMSServerUri(oWmsCatalog.GetAttribute("capabilitiesurl")).ToString().Equals(uri.ToString()))
         {
             oWmsCatalog.SetAttribute("enabled", blValue.ToString());
         }
     }
 }
Beispiel #4
0
        internal WMSServerModelNode AddServer(WMSServerUri oUri, bool blEnabled)
        {
            WMSServerModelNode result = new WMSServerModelNode(m_oModel, oUri, blEnabled);

            AddChild(result);
            if (blEnabled)
            {
                result.BeginLoad();
            }
            return(result);
        }
Beispiel #5
0
        private static bool ContainsWMSServer(XmlDocument doc, WMSServerUri uri)
        {
            foreach (XmlAttribute oAttr in doc.SelectNodes("//wmscatalog/@capabilitiesurl"))
            {
                if (new WMSServerUri(oAttr.Value).ToString().Equals(uri.ToString()))
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #6
0
        private static void AddWMSServer(XmlDocument doc, WMSServerUri uri)
        {
            XmlElement oWMSRoot      = doc.SelectSingleNode("/dappleview/servers/builderentry/builderdirectory[@specialcontainer=\"WMSServers\"]") as XmlElement;
            XmlElement oBuilderEntry = doc.CreateElement("builderentry");

            oWMSRoot.AppendChild(oBuilderEntry);
            XmlElement oDapCatalog = doc.CreateElement("wmscatalog");

            oDapCatalog.SetAttribute("capabilitiesurl", uri.ToString());
            oDapCatalog.SetAttribute("enabled", "true");
            oBuilderEntry.AppendChild(oDapCatalog);
        }
Beispiel #7
0
        internal WMSServerModelNode GetServer(WMSServerUri oUri)
        {
            foreach (WMSServerModelNode oServer in UnfilteredChildren)
            {
                if (oServer.Uri.Equals(oUri))
                {
                    return(oServer);
                }
            }

            return(null);
        }
Beispiel #8
0
 internal WMSServerModelNode(DappleModel oModel, WMSServerUri oUri, bool blEnabled)
     : base(oModel, blEnabled)
 {
     m_oUri     = oUri;
     m_strTitle = oUri.ServerTreeDisplayName;
 }