Ejemplo n.º 1
0
        /// <summary>
        /// Creates a property type contract and sets mandatory and optional fields
        /// on the contract.
        ///
        /// The name of the property type contract is passed as an argument.
        /// Calls the CreatePropertyType method on an instance of the InfoShareService.CommonClient
        /// class and passes the connection id of the administrator, and the property
        /// type contract as arguments.
        /// </summary>
        /// <param name="connAdminUserID">the connection id of the administrator</param>
        /// <param name="propertyName">the property name</param>
        /// <param name="fieldType">the field type</param>
        /// <param name="multiKey">make a multikey property or not. If true, the property can have several values.</param>
        /// <param name="schemaCulture">the schema culture</param>
        /// <returns>the property type id of the created property type</returns>
        public string CreatePropertyType(string connAdminUserID, string propertyName, string fieldType, bool multiKey, string schemaCulture)
        {
            StringGlobalContract strGlobalContract = Utility.ConvertStringToStringGlobalContract(propertyName, schemaCulture);

            PropertyTypeConfigurationContract propertyTypeConf = new PropertyTypeConfigurationContract
            {
                StringMaximumLength = 100 // mandatory
            };

            PropertyTypeContract propertyTypeContract = new PropertyTypeContract
            {
                // Set mandatory fields
                Name = strGlobalContract,
                PropertyTypePluginTypeEnum = fieldType,
                Configuration = propertyTypeConf,
                Searchable    = true, // Makes properties searchable in document search

                // Sets optional fields
                Active   = true,
                Multikey = multiKey
            };

            string propertyTypeID = CommonClient.CreatePropertyType(connAdminUserID, propertyTypeContract);

            this.RefreshSchemaStore(connAdminUserID);

            return(propertyTypeID);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an import template contract and sets mandatory and optional fields.
        ///
        /// The name of the import template contract is passed as an argument.
        /// Calls the CreateImportTemplate method on an instance of the InfoShareService.CommonClient
        /// class and passes the connection id of the administrator, and the import
        /// template contract as arguments.
        /// </summary>
        /// <param name="connAdminUserID">the connection id of the administrator</param>
        /// <param name="importTemplateName">the import template name</param>
        /// <param name="schemaCulture">the schema culture</param>
        /// <returns>the import template id of the created import template</returns>
        public string CreateImportTemplate(string connAdminUserID, string importTemplateName, string schemaCulture)
        {
            StringGlobalContract strGlobalContract = Utility.ConvertStringToStringGlobalContract(importTemplateName, schemaCulture);

            ImportTemplateContract importTemplateContract = new ImportTemplateContract
            {
                // Sets mandatory field
                Name = strGlobalContract,

                // Sets optional fields
                CanChangeFolders          = true,
                CanChangeInfoStore        = true,
                CanChangeLifeCycle        = true,
                CanChangeLinks            = true,
                CanChangeProcessTemplate  = true,
                CanChangeSignatureProfile = true,
                CanChangeProtectionDomain = true,
                CanChangeProperties       = true
            };

            string importTemplateID = CommonClient.CreateImportTemplate(connAdminUserID, importTemplateContract);

            this.RefreshSchemaStore(connAdminUserID);

            return(importTemplateID);
        }
Ejemplo n.º 3
0
        public static string GetValue(StringGlobalContract stringGlobal, string schemaCulture)
        {
            foreach (StringGlobalEntry strGlobalEntry in stringGlobal.Values)
            {
                if (strGlobalEntry.Culture == schemaCulture)
                {
                    return(strGlobalEntry.Text);
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a property page template contract and sets mandatory fields on
        /// the contract.
        ///
        /// The name of the property page template contract is passed as an argument.
        /// Calls the CreatePropertyPageTemplate method on an instance of the
        /// InfoShareService.CommonClient class and passes the connection id of the administrator,
        /// and the property page template contract as arguments.
        /// </summary>
        /// <param name="connAdminUserID">the connection id of the administrator</param>
        /// <param name="propertyPageTemplateName">the property page template name</param>
        /// <param name="schemaCulture">the schema culture</param>
        /// <returns>the property page template id of the created property page template</returns>
        public string CreatePropertyPageTemplate(string connAdminUserID, string propertyPageTemplateName, string schemaCulture)
        {
            StringGlobalContract strGlobalContract = Utility.ConvertStringToStringGlobalContract(propertyPageTemplateName, schemaCulture);

            PropertyPageTemplateContract propertyPageTemplateContract = new PropertyPageTemplateContract
            {
                Name = strGlobalContract
            };

            string propertyPageTemplateID = CommonClient.CreatePropertyPageTemplate(connAdminUserID, propertyPageTemplateContract);

            this.RefreshSchemaStore(connAdminUserID);

            return(propertyPageTemplateID);
        }
Ejemplo n.º 5
0
        public static bool StringGlobalContains(StringGlobalContract stringGlobal, String value, String schemaCulture)
        {
            foreach (StringGlobalEntry strGlobalEntry in stringGlobal.Values)
            {
                if (strGlobalEntry.Culture == schemaCulture)
                {
                    if (strGlobalEntry.Text == value)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a protection domain contract and sets a mandatory field on the contract.
        ///
        /// The name of the protection domain contract is passed as an argument.
        /// Calls the CreateProtectionDomain method on an instance of the InfoShareService.CommonClient
        /// class and passes the connection id of the administrator, and the
        /// contract as arguments.
        /// </summary>
        /// <param name="connAdminUserID">the connection id of the administrator</param>
        /// <param name="protectionDomainName">the protection domain name</param>
        /// <param name="schemaCulture">the schema culture</param>
        /// <returns>the id of the created protection domain</returns>
        public string CreateProtectionDomain(string connAdminUserID, string protectionDomainName, string schemaCulture)
        {
            StringGlobalContract strGlobalContract = Utility.ConvertStringToStringGlobalContract(protectionDomainName, schemaCulture);

            ProtectionDomainContract protDomainContract = new ProtectionDomainContract
            {
                // Sets mandatory field
                Name = strGlobalContract
            };

            string protectionDomainID = CommonClient.CreateProtectionDomain(connAdminUserID, protDomainContract);

            this.RefreshSecurityStore(connAdminUserID);

            return(protectionDomainID);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Converts the specified string to a string global contract object.
        /// </summary>
        /// <param name="str">the string to be converted</param>
        /// <param name="culture">the culture</param>
        /// <returns>a string global contract object</returns>
        public static StringGlobalContract ConvertStringToStringGlobalContract(string str, string culture)
        {
            StringGlobalEntry entry = new StringGlobalEntry
            {
                Culture = culture,
                Text    = str
            };

            StringGlobalEntry[] arrayOfStringGlobalEntries = new StringGlobalEntry[1];
            arrayOfStringGlobalEntries[0] = entry;

            StringGlobalContract strGlobalContract = new StringGlobalContract
            {
                Values = arrayOfStringGlobalEntries
            };

            return(strGlobalContract);
        }