Exemplo n.º 1
0
        /// <summary>
        /// Gets the Tmodel key.
        /// </summary>
        /// <param name="UDDIConnection">The UDDI connection.</param>
        /// <param name="tMName">Name of the tModel.</param>
        /// <returns></returns>
        public static string GetTModelKey(UddiConnection UDDIConnection, string tMName)
        {
            FindTModel findTModel = new FindTModel(tMName);
            TModelList tMList     = findTModel.Send(UDDIConnection);

            if (tMList.TModelInfos.Count > 0)
            {
                return(tMList.TModelInfos[0].TModelKey);
            }
            return(String.Empty);
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Publica ontologie cu numele si URL-ul specificat in campurile corespunzatoare (daca nu exista deja).
        /// </summary>
        private void performPublish()
        {
            String ontologyName = txbOntologyName.Text.Trim();
            String ontologyURL  = txbOntologyURL.Text.Trim();

            if (ontologyName == String.Empty || ontologyURL == String.Empty) {

                MessageBox.Show("All values must be set", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try {

                FindTModel findTModel = new FindTModel(ontologyName);

                // uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4  == uddi-org:general_keywords key
                KeyedReference categoryOntology = new KeyedReference("uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4", "ontology", "QoS");

                findTModel.CategoryBag.Add(categoryOntology);

                findTModel.FindQualifiers.Add(FindQualifier.ExactNameMatch);

                TModelList tModelList = findTModel.Send(uddiConnection);

                if (0 == tModelList.TModelInfos.Count) {

                    TModel ontologyTModel = new TModel(ontologyName);

                    ontologyTModel.CategoryBag.Add(categoryOntology);

                    ontologyTModel.OverviewDoc.OverviewUrl = ontologyURL;

                    SaveTModel saveOntologyTModel = new SaveTModel(ontologyTModel);

                    saveOntologyTModel.Send(uddiConnection);

                    MessageBox.Show("Publish successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else {

                    MessageBox.Show("Ontology already exists");
                }
            }
            catch (UddiException e) {

                MessageBox.Show("Uddi error: "+ e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception e){

                MessageBox.Show("General exception: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all T models.
        /// </summary>
        /// <param name="UDDIConnection">The UDDI connection.</param>
        /// <returns></returns>
        public static List <string> GetAllTModels(UddiConnection UDDIConnection)
        {
            List <string> retList    = new List <string>();
            FindTModel    findTModel = new FindTModel("%");

            findTModel.FindQualifiers.Add(FindQualifier.ApproximateMatch);
            findTModel.FindQualifiers.Add(FindQualifier.SortByNameAscending);
            TModelList tMList = findTModel.Send(UDDIConnection);

            foreach (TModelInfo tMInfo in tMList.TModelInfos)
            {
                retList.Add(tMInfo.Name.Text);
            }
            return(retList);
        }
Exemplo n.º 4
0
        protected override void OnSearch(object sender, string query)
        {
            base.OnSearch(sender, query);

            if (query.IndexOf("%") < 0)
            {
                query += "%";
            }

            FindTModel find = new FindTModel();

            find.Name = query;

            TModelList list = find.Find();

            grid.DataSource = list.TModelInfos;
            grid.DataBind();

            count.Text = String.Format(
                Localization.GetString("TEXT_QUERY_COUNT"),
                list.TModelInfos.Count);
        }
Exemplo n.º 5
0
        public TModelList FindTModel([XmlElement(Namespace = Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable = false)] FindTModel findTModel)
        {
            object[] results = InvokeWebMethod("FindTModel", new object[] { findTModel });

            return((TModelList)results[0]);
        }
Exemplo n.º 6
0
 public TModelList Send(FindTModel findTModel)
 {
     return(soapClient.FindTModel(findTModel));
 }
Exemplo n.º 7
0
        /// <summary>
        ///   Cauta ontologii pe baza informatiilor specificate.
        /// </summary>
        /// <returns>Lista cu informatii despre ontologiile (tModel-uri) care respecta criteriile specificate</returns>
        public List<OntInfo> search()
        {
            FindTModel findTModel = new FindTModel(ontologyName);

            // uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4  == uddi-org:general_keywords key
            KeyedReference categoryOntology = new KeyedReference("uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4", "ontology", "QoS");

            findTModel.CategoryBag.Add(categoryOntology);

            if (exactMatch) {

                findTModel.FindQualifiers.Add(FindQualifier.ExactNameMatch);
            }

            if (caseSensitive) {

                findTModel.FindQualifiers.Add(FindQualifier.CaseSensitiveMatch);
            }

            TModelList tModelList = findTModel.Send(uddiConnection);

            if (0 == tModelList.TModelInfos.Count) {

                return null;
            }

            List<OntInfo> list = new List<OntInfo>();

            OntInfo ontInfo;

            foreach (TModelInfo tModelInfo in tModelList.TModelInfos) {

                GetTModelDetail getTModelDetail = new GetTModelDetail(tModelInfo.TModelKey);

                TModelDetail tModelDetail       = getTModelDetail.Send(uddiConnection);

                TModel  tModel = tModelDetail.TModels[0];

                ontInfo = new OntInfo(tModel.AuthorizedName, tModel.TModelKey, tModel.Name.Text, tModel.OverviewDoc.OverviewUrl);

                list.Add(ontInfo);
            }

            return list;
        }
Exemplo n.º 8
0
        /// <summary>
        ///   Reinnoieste toate functionalitatile.
        /// </summary>
        public void updateFunctionalities(string UDDIAddress)
        {
            this._functionalities = new List<Functionality>();

            try
            {

                UddiConnection uddiConnection = new UddiConnection(UDDIAddress);

                FindTModel findTModel = new FindTModel();

                // uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4  == uddi-org:general_keywords key
                KeyedReference categoryOntology = new KeyedReference("uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4", "ontology", "QoS");

                findTModel.CategoryBag.Add(categoryOntology);

                TModelList tModelList = findTModel.Send(uddiConnection);

                foreach (TModelInfo tModelInfo in tModelList.TModelInfos)
                {

                    // Provide the unique tModel key.
                    GetTModelDetail getTModelDetail = new GetTModelDetail(tModelInfo.TModelKey);

                    // Send the GetTModelDetail request over the connection.
                    TModelDetail tModelDetail = getTModelDetail.Send(uddiConnection);

                    this.addFunctionalityFromXml(tModelDetail.TModels[0].TModelKey, tModelDetail.TModels[0].OverviewDoc.OverviewUrl);
                }

                this._lastError = null;
            }
            catch (UddiException e)
            {

                this._lastError = "Uddi error: " + e.Message;
            }
            catch (Exception e)
            {

                this._lastError = "General exception: " + e.Message;
            }
        }
Exemplo n.º 9
0
        public void LoadTModels( )
        {
            FindTModel ft = new FindTModel();

            ft.CategoryBag.Add(CommonCanonical.UddiOrgTypes, "categorization", "Categorization (taxonomy)");

            TModelList list = null;

            try
            {
                list = ft.Send(_connection);
            }
            catch (Exception e)
            {
                MessageBox.Show(this, e.Message, @"Error loading Category Tree", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (null == list)
            {
                MessageBox.Show(this, @"An unknown error occurred while loading the Category Tree.", @"Error loading Category Tree", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            GetRelatedCategories grc = new GetRelatedCategories();
            Category             c   = new Category();

            c.RelationshipQualifiers.Add(RelationshipQualifier.root);

            foreach (TModelInfo info in list.TModelInfos)
            {
                bool categorization = false;
                c.TModelKey = info.TModelKey;
                grc.Categories.Add(c);

                CategoryList cl = null;
                try
                {
                    cl             = grc.Send(_connection);
                    categorization = true;
                }
                catch (InvalidKeyPassedException)
                {
                    //
                    // tModel doesn't represent a categorization.  So, don't show
                    // it in the tree.
                    //
                }
                catch (Exception e)
                {
                    //
                    // if anything else happened, re-throw & let the app deal with it.
                    //
                    throw e;
                }

                if (categorization)
                {
                    //
                    // Create a new node and wrap the tModelInfo into a
                    // CategoryInfo object.
                    //
                    CategoryTreeNode catnode = new CategoryTreeNode(new CategoryInfo(info.TModelKey));

                    catnode.Nodes.Clear();

                    //
                    // Set the Text of the node to the text of the tModel.
                    //
                    catnode.Text = info.Name.Text;

                    CategoryValueCollection values = cl.CategoryInfos[0].Roots;

                    foreach (CategoryValue val in values)
                    {
                        CategoryTreeNode subnode = new CategoryTreeNode(val);
                        subnode.CategoryValue.TModelKey = catnode.CategoryValue.TModelKey;
                        catnode.Nodes.Add(subnode);
                    }

                    catnode.HasDownloadedChildren = true;

                    //
                    // Add the node to the root.
                    //
                    Nodes.Add(catnode);
                }
            }
        }