예제 #1
0
        protected void Identifier_Edit(object sender, DataGridCommandEventArgs e)
        {
            int index = e.Item.ItemIndex;

            grid.EditItemIndex = index;
            SetEditMode();

            PopulateDataGrid();

            if (index >= identifierBag.Count)
            {
                identifierBag.Add();
            }

            KeyedReference keyedReference = identifierBag[index];

            DropDownList list = (DropDownList)grid.Items[index].Cells[0].FindControl("tModelKey");

            if (null != list)
            {
                ListItem item = list.Items.FindByValue(keyedReference.TModelKey.Substring(5));

                if (null != item)
                {
                    item.Selected = true;
                }
            }
        }
예제 #2
0
        protected void CategoryChooser_OnSelect(object sender, DataGridCommandEventArgs e)
        {
            KeyedReference keyedReference = categoryBag[categoryBag.Add()];


            CategoryBrowserControl b = (CategoryBrowserControl)GetControl("browser", 1);


            keyedReference.TModelKey = "uuid:" + b.TModelKey;
            keyedReference.KeyName   = HttpUtility.HtmlDecode(b.KeyName);
            keyedReference.KeyValue  = b.KeyValue;

            if (null != entity)
            {
                entity.Save();
            }

            if (null != cache)
            {
                cache.Save();
            }

            grid.EditItemIndex = -1;
            CancelEditMode();

            CategoryBag_DataBind(false);
        }
예제 #3
0
        /// <summary>
        /// Creates the T model.
        /// </summary>
        /// <param name="tMName">Name of the t Model.</param>
        /// <param name="tMDescription">The t Model description.</param>
        /// <param name="tMKeyedRefence">The t Model keyed refence.</param>
        /// <returns></returns>
        public static TModel CreateTModel(string tMName, string tMDescription, KeyedReference tMKeyedRefence)
        {
            TModel tModel = new TModel(tMName);

            tModel.Descriptions.Add(tMDescription);
            tModel.CategoryBag.KeyedReferences.Add(tMKeyedRefence);
            return(tModel);
        }
예제 #4
0
 public AssertionStatusItem(CompletionStatusType completionStatus,
                            string fromKey,
                            string toKey,
                            KeyedReference keyedReference,
                            KeysOwned keysOwned)
 {
     this.CompletionStatus = completionStatus;
     this.FromKey          = fromKey;
     this.ToKey            = toKey;
     this.KeyedReference   = keyedReference;
     this.KeysOwned        = keysOwned;
 }
예제 #5
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);
            }
        }
예제 #6
0
        /// <summary>
        /// Adds the T model.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="keyValue">The key value.</param>
        /// <param name="keyName">Name of the key.</param>
        public void AddTModel(string name, string description, string parent, string keyValue, string keyName)
        {
            TModel tm = UDDIDataCreater.CreateTModel(name, description);

            //search if tmodel has parent tmodel
            string parentKey = UDDISearcher.GetTModelKey(UDDIConnection, parent);

            if (parentKey != string.Empty)
            {
                //set the parent tmodel key of child tmodel
                KeyedReference kf = UDDIDataCreater.CreateKeyedReference(parentKey, keyValue, keyName);
                tm.CategoryBag.KeyedReferences.Add(kf);
            }
            try
            {
                UDDIPublisher.SaveTModel(UDDIConnection, tm);
            }
            catch (Exception exception)
            {
                throw new Exception("Unable to save the TModel " + exception.Message);
            }
        }
예제 #7
0
        protected void Identifier_Update(object sender, DataGridCommandEventArgs e)
        {
            Page.Validate();

            if (Page.IsValid)
            {
                int          index = grid.EditItemIndex;
                DataGridItem item  = grid.Items[index];

                if (index >= identifierBag.Count)
                {
                    identifierBag.Add();
                }

                KeyedReference keyedReference = identifierBag[index];

                string tModelKey = ((DropDownList)item.FindControl("tModelKey")).SelectedItem.Value;

                keyedReference.TModelKey = "uuid:" + tModelKey;
                keyedReference.KeyName   = ((TextBox)item.FindControl("keyName")).Text;
                keyedReference.KeyValue  = ((TextBox)item.FindControl("keyValue")).Text;

                if (null != entity)
                {
                    entity.Save();
                }

                if (null != cache)
                {
                    cache.Save();
                }

                grid.EditItemIndex = -1;
                CancelEditMode();

                PopulateDataGrid();
            }
        }
예제 #8
0
        public void Get(CompletionStatusType completionStatus)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_publisher_assertionStatus_get");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.SetString("@PUID", Context.User.ID);

            if (CompletionStatusType.Uninitialized != completionStatus)
            {
                //
                // If the completion status was not specified get all
                // of the assertions by not specifying a completionStatus value
                // in the stored procedure.
                //
                sp.Parameters.Add("@completionStatus", SqlDbType.Int);
                sp.Parameters.SetInt("@completionStatus", (int)completionStatus);
            }

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    KeyedReference keyedReference = new KeyedReference(
                        reader.GetString("keyName"),
                        reader.GetString("keyValue"),
                        reader.GetKeyFromGuid("tModelKey"));

                    CompletionStatusType status =
                        (CompletionStatusType)reader.GetInt("flag");

                    string fromKey = reader.GetGuidString("fromKey");
                    string toKey   = reader.GetGuidString("toKey");

                    int ownerFlag = reader.GetInt("ownerFlag");

                    KeysOwned keysOwned = new KeysOwned();

                    if (0x02 == (ownerFlag & 0x02))
                    {
                        keysOwned.FromKey = fromKey;
                    }

                    if (0x01 == (ownerFlag & 0x01))
                    {
                        keysOwned.ToKey = toKey;
                    }

                    this.Add(
                        new AssertionStatusItem(
                            status,
                            fromKey,
                            toKey,
                            keyedReference,
                            keysOwned));
                }
            }
            finally
            {
                reader.Close();
            }
        }
예제 #9
0
 public int Add(string fromKey, string toKey, KeyedReference keyedReference)
 {
     return(List.Add(new PublisherAssertion(fromKey, toKey, keyedReference)));
 }
예제 #10
0
 /// ****************************************************************
 ///   public PublisherAssertion [constructor]
 /// ----------------------------------------------------------------
 ///   <summary>
 ///   </summary>
 /// ----------------------------------------------------------------
 ///   <param name="fromKey">
 ///   </param>
 ///
 ///   <param name="toKey">
 ///   </param>
 ///
 ///   <param name="keyedReference">
 ///   </param>
 /// ****************************************************************
 ///
 public PublisherAssertion(string fromKey, string toKey, string keyName, string keyValue, string tModelKey)
 {
     this.FromKey        = fromKey;
     this.ToKey          = toKey;
     this.KeyedReference = new KeyedReference(keyName, keyValue, tModelKey);
 }
예제 #11
0
 /// ****************************************************************
 ///   public PublisherAssertion [constructor]
 /// ----------------------------------------------------------------
 ///   <summary>
 ///   </summary>
 /// ----------------------------------------------------------------
 ///   <param name="fromKey">
 ///   </param>
 ///
 ///   <param name="toKey">
 ///   </param>
 ///
 ///   <param name="keyedReference">
 ///   </param>
 /// ****************************************************************
 ///
 public PublisherAssertion(string fromKey, string toKey, KeyedReference keyedReference)
 {
     this.FromKey        = fromKey;
     this.ToKey          = toKey;
     this.KeyedReference = keyedReference;
 }
예제 #12
0
 /// ****************************************************************
 ///   public PublisherAssertion [constructor]
 /// ----------------------------------------------------------------
 ///   <summary>
 ///   </summary>
 /// ----------------------------------------------------------------
 ///   <param name="assertion">
 ///   </param>
 /// ****************************************************************
 ///
 public PublisherAssertion(PublisherAssertion assertion)
 {
     this.FromKey        = assertion.FromKey;
     this.ToKey          = assertion.ToKey;
     this.KeyedReference = assertion.KeyedReference;
 }
예제 #13
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;
        }
예제 #14
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;
            }
        }
예제 #15
0
        /// <summary>
        /// Creates the keyed reference.
        /// </summary>
        /// <param name="tModelKey">The t model key.</param>
        /// <param name="keyValue">The key value.</param>
        /// <param name="keyName">Name of the key.</param>
        /// <returns></returns>
        public static KeyedReference CreateKeyedReference(string tModelKey, string keyValue, string keyName)
        {
            KeyedReference bKeyedReference = new KeyedReference(tModelKey, keyValue, keyName);

            return(bKeyedReference);
        }
예제 #16
0
        /// <summary>
        /// Creates the business entity.
        /// </summary>
        /// <param name="bName">Name of the business.</param>
        /// <param name="bDescription">The business description.</param>
        /// <param name="bContact">The business contact.</param>
        /// <param name="bURL">The business URL.</param>
        /// <param name="bKeyedReference">The business keyed reference.</param>
        /// <returns></returns>
        public static BusinessEntity CreateBusinessEntity(string bName, string bDescription, Contact bContact, string bURL, KeyedReference bKeyedReference)
        {
            BusinessEntity bEntity = new BusinessEntity();

            bEntity.Names.Add(bName);
            bEntity.Descriptions.Add(bDescription);
            bEntity.Contacts.Add(bContact);
            bEntity.DiscoveryUrls.Add(CreateDiscoveryURL(bURL));
            bEntity.CategoryBag.KeyedReferences.Add(bKeyedReference);
            return(bEntity);
        }