Пример #1
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;
        }
Пример #2
0
        /// <summary>
        ///   Callback-ul apelat după completarea noii valori in UpdateForm.
        ///   Modifica valoarea pe serverul UDDI si in lista de ontologii.
        /// </summary>
        void updateForm_ValueUpdated(object sender, ValueUpdateEventArgs e)
        {
            GetTModelDetail getTModelDetail = new GetTModelDetail(((OntInfo)selectedItem.Tag).tModelKey);
            TModelDetail tModelDetail       = getTModelDetail.Send(uddiConnection);

            TModel tModel = tModelDetail.TModels[0];

            tModel.OverviewDoc.OverviewUrl  = e.NewValue;

            SaveTModel saveTModel = new SaveTModel(tModel);

            saveTModel.Send(uddiConnection);

            selectedItem.SubItems[2].Text  = e.NewValue;
        }
Пример #3
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;
            }
        }