Esempio n. 1
0
        public void Save(string TModelKey)
        {
            Debug.Enter();

            if (!Utility.StringEmpty(ParentKeyValue))
            {
                Debug.Verify(KeyValue != ParentKeyValue, "UDDI_ERROR_FATALERROR_PARENTKEYEQUALSVALUE", ErrorType.E_fatalError);
            }

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_taxonomyValue_save");

            sp.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue);
            sp.Parameters.Add("@parentKeyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue);
            sp.Parameters.Add("@keyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyName);
            sp.Parameters.Add("@valid", SqlDbType.Bit);

            sp.Parameters.SetGuidFromKey("@tModelKey", TModelKey);
            sp.Parameters.SetString("@keyValue", KeyValue);
            sp.Parameters.SetString("@parentKeyValue", ParentKeyValue);
            sp.Parameters.SetString("@keyName", KeyName);
            sp.Parameters.SetBool("@valid", IsValid);

            sp.ExecuteNonQuery();

            Debug.Leave();
        }
Esempio n. 2
0
        public HighWaterMarkDetail Get()
        {
            HighWaterMarkDetail detail = new HighWaterMarkDetail();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_highWaterMarks_get";

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    detail.HighWaterMarks.Add(
                        reader.GetString("operatorKey"),
                        reader.GetLong("USN"));
                }
            }
            finally
            {
                reader.Close();
            }

            return(detail);
        }
Esempio n. 3
0
        /// ****************************************************************
        ///   public Delete
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ****************************************************************
        ///
        public override void Delete()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_delete");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);

            sp.Parameters.SetString("@PUID", Context.User.ID);
            sp.Parameters.SetGuidFromString("@businessKey", BusinessKey);
            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            sp.ExecuteNonQuery();

            //
            // Save the change log entry.
            //
            if (Context.LogChangeRecords)
            {
                ChangeRecord changeRecord = new ChangeRecord();

                changeRecord.Payload = new ChangeRecordDelete(EntityType.BusinessEntity, BusinessKey);
                changeRecord.Log();
            }

            Debug.Leave();
        }
Esempio n. 4
0
        public int FindByParentKey(string parentKey)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            switch (entityType)
            {
            case EntityType.BusinessService:
                sp.ProcedureName = "net_find_businessService_businessKey";

                sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
                sp.Parameters.SetGuidFromString("@businessKey", parentKey);

                break;

            case EntityType.BindingTemplate:
                sp.ProcedureName = "net_find_bindingTemplate_serviceKey";

                sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier);
                sp.Parameters.SetGuidFromString("@serviceKey", parentKey);
                break;

            default:
                throw new UDDIException(ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_UNEXPECTEDENTITYTYPE", entityType.ToString());
            }

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@rows", SqlDbType.Int, ParameterDirection.Output);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            sp.ExecuteNonQuery();

            return(sp.Parameters.GetInt("@rows"));
        }
Esempio n. 5
0
        public void GetForCurrentPublisher()
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_publisher_businessInfos_get");

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

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    Add(reader.GetGuidString("businessKey"));
                }
            }
            finally
            {
                reader.Close();
            }

            foreach (BusinessInfo businessInfo in this)
            {
                businessInfo.Get(true);
            }
        }
Esempio n. 6
0
        /// ****************************************************************
        ///   public FindByDiscoveryUrls
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ----------------------------------------------------------------
        ///   <param name="discoveryUrls">
        ///   </param>
        /// ****************************************************************
        ///
        public int FindByDiscoveryUrls(DiscoveryUrlCollection discoveryUrls)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_find_" + entityName + "_discoveryURL";

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType);
            sp.Parameters.Add("@discoveryURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.DiscoveryURL);
            sp.Parameters.Add("@rows", SqlDbType.Int, ParameterDirection.Output);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            int rows = 0;

            foreach (DiscoveryUrl discoveryUrl in discoveryUrls)
            {
                sp.Parameters.SetString("@useType", discoveryUrl.UseType);
                sp.Parameters.SetString("@discoveryURL", discoveryUrl.Value);

                sp.ExecuteNonQuery();

                rows = sp.Parameters.GetInt("@rows");
            }

            return(ScratchCommit());
        }
Esempio n. 7
0
        public void Save(long contactID)
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_contact_address_save";

            sp.Parameters.Add("@contactID", SqlDbType.BigInt);
            sp.Parameters.Add("@sortCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.SortCode);
            sp.Parameters.Add("@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType);
            sp.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@addressID", SqlDbType.BigInt, ParameterDirection.Output);

            sp.Parameters.SetLong("@contactID", contactID);
            sp.Parameters.SetString("@sortCode", SortCode);
            sp.Parameters.SetString("@useType", UseType);
            sp.Parameters.SetGuidFromKey("@tModelKey", TModelKey);

            sp.ExecuteNonQuery();

            long addressID = sp.Parameters.GetLong("@addressID");

            //
            // Call save on individual address line instances
            //
            AddressLines.Save(addressID);

            Debug.Leave();
        }
Esempio n. 8
0
        public void Save()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "UI_savePublisher";

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode);
            sp.Parameters.Add("@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name);
            sp.Parameters.Add("@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email);
            sp.Parameters.Add("@phone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone);
            sp.Parameters.Add("@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName);
            sp.Parameters.Add("@altphone", SqlDbType.NVarChar, UDDI.Constants.Lengths.Phone);
            sp.Parameters.Add("@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine);
            sp.Parameters.Add("@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine);
            sp.Parameters.Add("@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City);
            sp.Parameters.Add("@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince);
            sp.Parameters.Add("@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode);
            sp.Parameters.Add("@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country);
            sp.Parameters.Add("@flag", SqlDbType.Int);
            sp.Parameters.Add("@securityToken", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@tier", SqlDbType.NVarChar, UDDI.Constants.Lengths.Tier);


            sp.Parameters.SetString("@PUID", Puid);
            sp.Parameters.SetString("@isoLangCode", IsoLangCode);
            sp.Parameters.SetString("@name", Name);
            sp.Parameters.SetString("@email", Email);
            sp.Parameters.SetString("@phone", Phone);
            sp.Parameters.SetString("@companyName", CompanyName);
            sp.Parameters.SetString("@altphone", AltPhone);
            sp.Parameters.SetString("@addressLine1", AddressLine1);
            sp.Parameters.SetString("@addressLine2", AddressLine2);
            sp.Parameters.SetString("@city", City);
            sp.Parameters.SetString("@stateProvince", StateProvince);
            sp.Parameters.SetString("@postalCode", PostalCode);
            sp.Parameters.SetString("@country", Country);
            sp.Parameters.SetString("@tier", Config.GetString("Publisher.DefaultTier", "2"));

            int flag = 0;

            if (!TrackPassport)
            {
                flag = flag | 0x02;
            }

            if (Validated)
            {
                flag = flag | 0x01;
            }

            sp.Parameters.SetInt("@flag", flag);
            sp.Parameters.SetGuidFromString("@securityToken", SecurityToken);

            sp.ExecuteNonQuery();

            Debug.Leave();
        }
Esempio n. 9
0
        public void Get()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_operator_get";

            sp.Parameters.Add("@operatorKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.SetGuidFromString("@operatorKey", OperatorNodeID);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                if (reader.Read())
                {
                    OperatorStatus     = (OperatorStatus)reader.GetShort("operatorStatusID");
                    Name               = reader.GetString("name");
                    SoapReplicationURL = reader.GetString("soapReplicationURL");
                    CertIssuerName     = reader.GetString("certIssuer");
                    CertSubjectName    = reader.GetString("certSubject");
                    Certificate        = reader.GetBinary("certificate");
                }
            }
            finally
            {
                reader.Close();
            }

            Debug.Leave();
        }
Esempio n. 10
0
        public void Get(long contactID)
        {
            //
            // Create a command object to invoke the stored procedure net_get_contacts
            //
            SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor("net_contact_emails_get");

            //
            // Add parameters and set values
            //
            cmd.Parameters.Add("@contactID", SqlDbType.BigInt, ParameterDirection.Input);
            cmd.Parameters.SetLong("@contactID", contactID);

            //
            // Run the stored procedure
            //
            SqlDataReaderAccessor reader = cmd.ExecuteReader();

            try
            {
#if never
                while (reader.Read())
                {
                    //
                    // Construct a new Email from the data in this row
                    //
                    this.Add(dracc.GetString(EmailIndex), dracc.GetString(UseTypeIndex));
                }
#endif
            }
            finally
            {
                reader.Close();
            }
        }
Esempio n. 11
0
        public string Get()
        {
            string AuthorizedName;

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_publisher_assertions_get");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output);

            sp.Parameters.SetString("@PUID", Context.User.ID);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    Add(
                        reader.GetGuidString("fromKey"),
                        reader.GetGuidString("toKey"),
                        reader.GetGuidString("keyName"),
                        reader.GetGuidString("keyValue"),
                        reader.GetKeyFromGuid("tModelKey"));
                }
            }
            finally
            {
                reader.Close();
            }
            AuthorizedName = sp.Parameters.GetString("@authorizedName");
            return(AuthorizedName);
        }
        public void SaveCache()
        {
            Debug.Enter();

            //
            // Serialize the data into a stream.
            //
            XmlSerializer serializer = new XmlSerializer(this.GetType());
            StringWriter  writer     = new StringWriter();

            serializer.Serialize(writer, this);

            //
            // Write the cache object to the database.
            //

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("UI_setSessionCache");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar);
            sp.Parameters.Add("@cacheValue", SqlDbType.NText);
            sp.Parameters.Add("@context", SqlDbType.NVarChar);

            sp.Parameters.SetString("@PUID", Key);
            sp.Parameters.SetString("@cacheValue", writer.ToString());
            sp.Parameters.SetString("@context", "ReplicationServer");


            sp.ExecuteNonQuery();

            sp.Close();
            writer.Close();
            Debug.Leave();
        }
Esempio n. 13
0
        static ArrayList GetBusinessEntities()
        {
            ArrayList businessKeyList = new ArrayList();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_find_businessKeysWithDiscoveryURLs";

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            ArrayList businessEntities = new ArrayList();

            try
            {
                while (reader.Read())
                {
                    BusinessEntity businessEntity = new BusinessEntity(reader.GetGuidString(0));
                    businessEntities.Add(businessEntity);
                }
            }
            finally
            {
                reader.Close();
            }

            return(businessEntities);
        }
Esempio n. 14
0
        public void Get(string fromKey, string toKey)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_businessEntity_assertions_get";

            sp.Parameters.Add("@fromKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@toKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@completionStatus", SqlDbType.Int);

            sp.Parameters.SetGuidFromString("@fromKey", fromKey);
            sp.Parameters.SetGuidFromString("@toKey", toKey);
            sp.Parameters.SetInt("@completionStatus", (int)CompletionStatusType.Complete);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    KeyedReferences.Add(
                        reader.GetString("keyName"),
                        reader.GetString("keyValue"),
                        reader.GetKeyFromGuid("tModelKey"));
                }
            }
            finally
            {
                reader.Close();
            }
        }
Esempio n. 15
0
        /// ****************************************************************
        ///   public FindByNames
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ----------------------------------------------------------------
        ///   <param name="names">
        ///   </param>
        /// ****************************************************************
        ///
        public int FindByNames(NameCollection names)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_find_" + entityName + "_name";

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name);
            sp.Parameters.Add("@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode);
            sp.Parameters.Add("@exactNameMatch", SqlDbType.Bit);
            sp.Parameters.Add("@caseSensitiveMatch", SqlDbType.Bit);
            sp.Parameters.Add("@rows", SqlDbType.Int, ParameterDirection.Output);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);
            sp.Parameters.SetBool("@exactNameMatch", ExactNameMatch);
            sp.Parameters.SetBool("@caseSensitiveMatch", CaseSensitiveMatch);

            foreach (Name name in names)
            {
                sp.Parameters.SetString("@name", LikeEncode(name.Value));

                if (Utility.StringEmpty(name.IsoLangCode))
                {
                    sp.Parameters.SetString("@isoLangCode", "%");
                }
                else
                {
                    sp.Parameters.SetString("@isoLangCode", name.IsoLangCode);
                }

                sp.ExecuteNonQuery();
            }

            return(ScratchCommit());
        }
Esempio n. 16
0
        public static void Write(QueryType queryType, EntityType entityType)
        {
            //
            // This can sometimes be an expensive call, so avoid it if possible.
            //
            if (1 == Config.GetInt("Audit.LogQueries", 0))
            {
                SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_queryLog_save");

                sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
                sp.Parameters.Add("@lastChange", SqlDbType.BigInt);
                sp.Parameters.Add("@contextTypeID", SqlDbType.TinyInt);
                sp.Parameters.Add("@entityKey", SqlDbType.UniqueIdentifier);
                sp.Parameters.Add("@queryTypeID", SqlDbType.TinyInt);
                sp.Parameters.Add("@entityTypeID", SqlDbType.TinyInt);

                //
                // TODO: add the entityKey
                //
                sp.Parameters.SetGuidFromString("@entityKey", "00000000-0000-0000-0000-000000000000");

                sp.Parameters.SetGuid("@contextID", Context.ContextID);

                sp.Parameters.SetLong("@lastChange", DateTime.UtcNow.Ticks);
                sp.Parameters.SetShort("@contextTypeID", (short)Context.ContextType);
                sp.Parameters.SetShort("@queryTypeID", (short)queryType);
                sp.Parameters.SetShort("@entityTypeID", (short)entityType);

                sp.ExecuteNonQuery();
            }
        }
Esempio n. 17
0
        public void Login(string userid, string email)
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_publisher_login";

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email, ParameterDirection.InputOutput);

            sp.Parameters.Add("@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name, ParameterDirection.Output);
            sp.Parameters.Add("@phone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output);
            sp.Parameters.Add("@companyName", SqlDbType.NVarChar, UDDI.Constants.Lengths.CompanyName, ParameterDirection.Output);
            sp.Parameters.Add("@altPhone", SqlDbType.VarChar, UDDI.Constants.Lengths.Phone, ParameterDirection.Output);
            sp.Parameters.Add("@addressLine1", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output);
            sp.Parameters.Add("@addressLine2", SqlDbType.NVarChar, UDDI.Constants.Lengths.AddressLine, ParameterDirection.Output);
            sp.Parameters.Add("@city", SqlDbType.NVarChar, UDDI.Constants.Lengths.City, ParameterDirection.Output);
            sp.Parameters.Add("@stateProvince", SqlDbType.NVarChar, UDDI.Constants.Lengths.StateProvince, ParameterDirection.Output);
            sp.Parameters.Add("@postalCode", SqlDbType.NVarChar, UDDI.Constants.Lengths.PostalCode, ParameterDirection.Output);
            sp.Parameters.Add("@country", SqlDbType.NVarChar, UDDI.Constants.Lengths.Country, ParameterDirection.Output);
            sp.Parameters.Add("@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode, ParameterDirection.Output);
            sp.Parameters.Add("@businessLimit", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@businessCount", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@tModelLimit", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@tModelCount", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@serviceLimit", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@bindingLimit", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@assertionLimit", SqlDbType.Int, ParameterDirection.Output);
            sp.Parameters.Add("@assertionCount", SqlDbType.Int, ParameterDirection.Output);

            sp.Parameters.SetString("@PUID", userid);
            sp.Parameters.SetString("@email", email);

            sp.ExecuteNonQuery();

            Email         = sp.Parameters.GetString("@email");
            Name          = sp.Parameters.GetString("@name");
            Phone         = sp.Parameters.GetString("@phone");
            CompanyName   = sp.Parameters.GetString("@companyName");
            AltPhone      = sp.Parameters.GetString("@altPhone");
            AddressLine1  = sp.Parameters.GetString("@addressLine1");
            AddressLine2  = sp.Parameters.GetString("@addressLine2");
            City          = sp.Parameters.GetString("@city");
            StateProvince = sp.Parameters.GetString("@stateProvince");
            PostalCode    = sp.Parameters.GetString("@postalCode");
            Country       = sp.Parameters.GetString("@country");
            IsoLangCode   = sp.Parameters.GetString("@isoLangCode");

            BusinessLimit  = sp.Parameters.GetInt("@businessLimit");
            BusinessCount  = sp.Parameters.GetInt("@businessCount");
            TModelLimit    = sp.Parameters.GetInt("@tModelLimit");
            TModelCount    = sp.Parameters.GetInt("@tModelCount");
            ServiceLimit   = sp.Parameters.GetInt("@serviceLimit");
            BindingLimit   = sp.Parameters.GetInt("@bindingLimit");
            AssertionLimit = sp.Parameters.GetInt("@assertionLimit");
            AssertionCount = sp.Parameters.GetInt("@assertionCount");

            Debug.Leave();
        }
Esempio n. 18
0
        public void Get(long addressID)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_address_addressLines_get";

            sp.Parameters.Add("@addressID", SqlDbType.BigInt);
            sp.Parameters.SetLong("@addressID", addressID);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    Add(
                        reader.GetString("addressLine"),
                        reader.GetString("keyName"),
                        reader.GetString("keyValue"));
                }
            }
            finally
            {
                reader.Close();
            }
        }
Esempio n. 19
0
        public static int GetTaxonomyID(string tModelKey)
        {
            int taxonomyID;

            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "UI_getTaxonomies";

            sp.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.SetGuidFromKey("@tModelKey", tModelKey);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                if (reader.Read())
                {
                    taxonomyID = reader.GetInt("taxonomyID");
                }
                else
                {
                    taxonomyID = -1;
                }
            }
            finally
            {
                reader.Close();
            }

            Debug.Leave();
            return(taxonomyID);
        }
Esempio n. 20
0
        /// ****************************************************************
        ///   public InnerSave
        ///	----------------------------------------------------------------
        ///	  <summary>
        ///		Stores the bindingTemplate details into the database.
        ///	  </summary>
        /// ****************************************************************
        ///
        internal void InnerSave(string serviceKey)
        {
            if (0 == ServiceKey.Length)
            {
                ServiceKey = serviceKey;
            }
            else
            {
                Debug.Verify(0 == String.Compare(ServiceKey, serviceKey, true), "UDDI_ERROR_INVALIDKEYPASSED_BINDINGPROJECTION", ErrorType.E_invalidKeyPassed);
            }

            if (Utility.StringEmpty(BindingKey))
            {
                //
                // This is an insert so, generate a bindingkey
                //
                BindingKey = Guid.NewGuid().ToString();
            }

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_save");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@generic", SqlDbType.VarChar, UDDI.Constants.Lengths.generic);
            sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt);
            sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint);
            sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@lastChange", SqlDbType.BigInt);

            sp.Parameters.SetString("@PUID", Context.User.ID);
            sp.Parameters.SetGuidFromString("@bindingKey", BindingKey);
            sp.Parameters.SetGuidFromString("@serviceKey", ServiceKey);
            sp.Parameters.SetString("@generic", Constants.Version);
            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            if (null != AccessPoint)
            {
                sp.Parameters.SetShort("@URLTypeID", (short)AccessPoint.URLType);
                sp.Parameters.SetString("@accessPoint", AccessPoint.Value);
            }

            if (null != HostingRedirector)
            {
                sp.Parameters.SetGuidFromString("@hostingRedirector", HostingRedirector.BindingKey);
            }

            sp.Parameters.SetLong("@lastChange", DateTime.UtcNow.Ticks);
            sp.ExecuteNonQuery();

            //
            // Save all contained objects.
            //
            Descriptions.Save(BindingKey, EntityType.BindingTemplate);
            TModelInstanceInfos.Save(BindingKey);
        }
Esempio n. 21
0
        /// ****************************************************************
        ///   public Abort
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ****************************************************************
        ///
        public void Abort()
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_find_cleanup");

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            sp.ExecuteNonQuery();
        }
Esempio n. 22
0
        public static void CleanUp()
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_find_changeRecords_cleanup";

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            sp.ExecuteNonQuery();
        }
Esempio n. 23
0
        public void Save(long parentID, EntityType parentType)
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            switch (parentType)
            {
            case EntityType.Contact:
                sp.ProcedureName = "net_contact_description_save";

                sp.Parameters.Add("@contactID", SqlDbType.BigInt);
                sp.Parameters.SetLong("@contactID", parentID);

                break;

            case EntityType.TModelInstanceInfo:
                sp.ProcedureName = "net_bindingTemplate_tModelInstanceInfo_description_save";

                sp.Parameters.Add("@instanceID", SqlDbType.BigInt);
                sp.Parameters.SetLong("@instanceID", parentID);

                break;

            case EntityType.InstanceDetail:
                sp.ProcedureName = "net_bindingTemplate_instanceDetails_description_save";

                sp.Parameters.Add("@instanceID", SqlDbType.BigInt);
                sp.Parameters.SetLong("@instanceID", parentID);

                break;

            case EntityType.InstanceDetailOverviewDoc:
                sp.ProcedureName = "net_bindingTemplate_instanceDetails_overviewDoc_description_save";

                sp.Parameters.Add("@instanceID", SqlDbType.BigInt);
                sp.Parameters.SetLong("@instanceID", parentID);

                break;

            default:
                throw new UDDIException(ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_DESCRPTION_INVALIDPARENTTYPE", parentType.ToString());
            }

            sp.Parameters.Add("@isoLangCode", SqlDbType.VarChar, UDDI.Constants.Lengths.IsoLangCode);
            sp.Parameters.Add("@description", SqlDbType.NVarChar, UDDI.Constants.Lengths.Description);

            sp.Parameters.SetString("@isoLangCode", IsoLangCode);
            sp.Parameters.SetString("@description", Value);

            sp.ExecuteNonQuery();

            Debug.Leave();
        }
Esempio n. 24
0
        public static void SetTaxonomyBrowsable(string tModelKey, bool enabled)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "UI_setTaxonomyBrowsable";

            sp.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@enabled", SqlDbType.TinyInt);

            sp.Parameters.SetGuidFromKey("@tModelKey", tModelKey);
            sp.Parameters.SetInt("@enabled", Convert.ToInt32(enabled));
            sp.ExecuteNonQuery();
        }
Esempio n. 25
0
        /// ****************************************************************
        ///   private ScratchCommit
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ----------------------------------------------------------------
        ///   <returns>
        ///   </returns>
        /// ****************************************************************
        ///
        private int ScratchCommit()
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_find_scratch_commit");

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@rows", SqlDbType.Int, ParameterDirection.Output);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            sp.ExecuteNonQuery();

            return(sp.Parameters.GetInt("@rows"));
        }
Esempio n. 26
0
        public void Get()
        {
            Debug.Enter();

            //
            // Retrieve the taxonomy
            //

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_taxonomy_get");

            sp.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@flag", SqlDbType.Int, ParameterDirection.InputOutput);

            sp.Parameters.SetGuidFromKey("@tModelKey", tModelKey);
            sp.Parameters.SetNull("@flag");

            sp.ExecuteScalar();

            //
            // Set the flag value
            //

            CategorizationSchemeFlag = sp.Parameters.GetInt("@flag");

            //
            // Retrieve the taxonomy values
            //

            CategoryValues.Clear();

            SqlStoredProcedureAccessor sp2 = new SqlStoredProcedureAccessor("net_taxonomyValues_get");

            sp2.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            sp2.Parameters.SetGuidFromKey("@tModelKey", tModelKey);
            SqlDataReaderAccessor reader = sp2.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    CategoryValues.Add(reader.GetString("keyName"), reader.GetString("keyValue"), reader.GetString("parentKeyValue"), ((reader.GetInt("valid") == 1) ? true : false));
                }
            }
            finally
            {
                reader.Close();
            }

            Debug.Leave();
        }
Esempio n. 27
0
        /// ****************************************************************
        ///   internal Validate
        ///	----------------------------------------------------------------
        ///	  <summary>
        ///	  </summary>
        /// ****************************************************************
        ///
        internal void Validate()
        {
            //
            // Check to make sure that either the hosting redirector or the accessPoint were specified
            //
            if (Utility.StringEmpty(AccessPoint.Value) && Utility.StringEmpty(HostingRedirector.BindingKey))
            {
                throw new UDDIException(ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_BINDING_APVALUEMISSING");
            }

            //
            // Check for a circular reference
            //
            if (0 == String.Compare(BindingKey, HostingRedirector.BindingKey, true))
            {
                throw new UDDIException(ErrorType.E_fatalError, "UDDI_ERROR_FATALERROR_BINDING_HRSELFREFERENCE");
            }

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_validate");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@flag", SqlDbType.Int);

            sp.Parameters.SetString("@PUID", Context.User.ID);
            sp.Parameters.SetGuidFromString("@bindingKey", BindingKey);
            sp.Parameters.SetGuidFromString("@serviceKey", ServiceKey);
            sp.Parameters.SetGuidFromString("@hostingRedirector", HostingRedirector.BindingKey);
            if (Context.User.AllowPreassignedKeys)
            {
                sp.Parameters.SetInt("@flag", 1);
            }
            else
            {
                sp.Parameters.SetInt("@flag", 0);
            }

            sp.ExecuteNonQuery();

            //
            // Validate field length for AccessPoint.Value
            //
            Utility.ValidateLength(ref AccessPoint.Value, "accessPoint", UDDI.Constants.Lengths.AccessPoint);

            Descriptions.Validate();
            TModelInstanceInfos.Validate();
        }
Esempio n. 28
0
        public void Get()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "UI_getPublisher";

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

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            Exists = false;

            try
            {
                if (reader.Read())
                {
                    int flag;

                    IsoLangCode   = reader.GetString(1);
                    Name          = reader.GetString(2);
                    Email         = reader.GetString(3);
                    Phone         = reader.GetString(4);
                    CompanyName   = reader.GetString(5);
                    AltPhone      = reader.GetString(6);
                    AddressLine1  = reader.GetString(7);
                    AddressLine2  = reader.GetString(8);
                    City          = reader.GetString(9);
                    StateProvince = reader.GetString(10);
                    PostalCode    = reader.GetString(11);
                    Country       = reader.GetString(12);
                    flag          = reader.GetInt(13);
                    SecurityToken = reader.GetGuidString(14);

                    TrackPassport = (0x00 == (flag & 0x02));
                    Validated     = (0x01 == (flag & 0x01));

                    Exists = true;
                }
            }
            finally
            {
                reader.Close();
            }

            Debug.Leave();
        }
Esempio n. 29
0
        public static SqlDataReaderAccessor RetrieveResults(int maxRows)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_find_changeRecords_commit";

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@responseLimitCount", SqlDbType.Int);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);
            sp.Parameters.SetInt("@responseLimitCount", maxRows);

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            return(reader);
        }
Esempio n. 30
0
        /// ****************************************************************
        ///   public RetrieveResults
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ----------------------------------------------------------------
        ///   <param name="maxRows">
        ///   </param>
        ///
        ///   <param name="truncated">
        ///   </param>
        /// ****************************************************************
        ///
        public SqlStoredProcedureAccessor RetrieveResults(int maxRows)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            if (ServiceSubset)
            {
                sp.ProcedureName = "net_find_businessEntity_serviceSubset_commit";
            }
            else
            {
                sp.ProcedureName = "net_find_" + entityName + "_commit";
            }

            if (entityName != "bindingTemplate")
            {
                sp.Parameters.Add("@sortByNameAsc", SqlDbType.Bit);
                sp.Parameters.Add("@sortByNameDesc", SqlDbType.Bit);
            }

            sp.Parameters.Add("@contextID", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@sortByDateAsc", SqlDbType.Bit);
            sp.Parameters.Add("@sortByDateDesc", SqlDbType.Bit);
            sp.Parameters.Add("@maxRows", SqlDbType.Int);
            sp.Parameters.Add("@truncated", SqlDbType.Bit, ParameterDirection.Output);

            sp.Parameters.SetGuid("@contextID", Context.ContextID);

            if (entityName != "bindingTemplate")
            {
                sp.Parameters.SetBool("@sortByNameAsc", SortByNameAsc);
                sp.Parameters.SetBool("@sortByNameDesc", SortByNameDesc);
            }

            sp.Parameters.SetBool("@sortByDateAsc", SortByDateAsc);
            sp.Parameters.SetBool("@sortByDateDesc", SortByDateDesc);

            int defaultMaxRows = Config.GetInt("Find.MaxRowsDefault");

            if (maxRows < 0 || maxRows > defaultMaxRows)
            {
                maxRows = defaultMaxRows;
            }

            sp.Parameters.SetInt("@maxRows", maxRows);

            return(sp);
        }