/// <summary> /// Builds a domain consisting of the names of the system groups to which the current /// user can assign a job. /// </summary> /// <param name="wmxDb">A reference to the active Workflow Manager database</param> /// <returns>A coded value domain as an IGPDomain</returns> public static IGPDomain BuildAssignableGroupsDomain(IJTXDatabase3 wmxDb) { return(WmauGpDomainBuilder.BuildAssignableGroupsDomain( wmxDb, ESRI.ArcGIS.JTXUI.ConfigurationCache.GetCurrentSystemUser(ESRI.ArcGIS.JTXUI.ConfigurationCache.UseUserDomain), null)); }
/// <summary> /// Helper function to recursively extract the queries stored in a job query /// container and add them to a list. /// </summary> /// <param name="container">The container in which the queries are stored</param> /// <param name="prefix"> /// A "prefix" string to prepend to the query names before they're inserted into /// the list /// </param> /// <param name="queryList"> /// A sorted list into which the extracted queries will be added. This function /// is intended to be called recursively in the case of job queries contained /// within subcontainers, so the list is *not* cleared by the function. /// </param> private static void AddQueriesFromContainer( IJTXJobQueryContainer container, string prefix, SortedList <string, string> queryList) { // Add the queries from the container at the current level IJTXJobQuerySet querySet = container.Queries; for (int i = 0; i < querySet.Count; i++) { IJTXJobQuery query = querySet.get_Item(i) as IJTXJobQuery; queryList.Add(prefix + query.Name, null); } // Iterate through each of the subcontainers and add them as well IJTXJobQueryContainerSet subcontainers = container.SubContainers; for (int i = 0; i < subcontainers.Count; i++) { IJTXJobQueryContainer tempContainer = subcontainers.get_Item(i); WmauGpDomainBuilder.AddQueriesFromContainer( tempContainer, prefix + tempContainer.Name + Properties.Resources.CONST_JOB_QUERY_SEP, queryList); } }
/// <summary> /// Builds a domain consisting of the available job queries in the system. /// </summary> /// <param name="wmxDb">A reference to the active Workflow Manager database</param> /// <returns>A coded value domain as an IGPDomain</returns> public static IGPDomain BuildJobQueryDomain(IJTXDatabase3 wmxDb) { IGPCodedValueDomain domain = new GPCodedValueDomainClass(); IJTXConfiguration3 configMgr = wmxDb.ConfigurationManager as IJTXConfiguration3; IJTXJobQueryContainer publicQueriesContainer = configMgr.GetPublicQueryContainer(); // Sort the queries first SortedList <string, string> sortedValues = new SortedList <string, string>(); WmauGpDomainBuilder.AddQueriesFromContainer(publicQueriesContainer, string.Empty, sortedValues); // Add the sorted types to the domain foreach (string value in sortedValues.Keys) { domain.AddStringCode(value, value); } return(domain as IGPDomain); }
/// <summary> /// Builds a domain consisting of the names of the system groups to which a /// user can assign a job. /// </summary> /// <param name="wmxDb">A reference to the active Workflow Manager database</param> /// <param name="username">The name of the user to be tested</param> /// <returns>A coded value domain as an IGPDomain</returns> public static IGPDomain BuildAssignableGroupsDomain(IJTXDatabase3 wmxDb, string username) { return(WmauGpDomainBuilder.BuildAssignableGroupsDomain(wmxDb, username, null)); }
/// <summary> /// Builds a domain consisting of all of the usernames in the system /// </summary> /// <param name="wmxDb">A reference to the active Workflow Manager database</param> /// <returns>A coded value domain as an IGPDomain</returns> public static IGPDomain BuildUsersDomain(IJTXDatabase3 wmxDb) { return(WmauGpDomainBuilder.BuildUsersDomain(wmxDb, null)); }
/// <summary> /// Builds a domain consisting of the Workflow Manager privileges /// </summary> /// <returns>A coded value domain of strings</returns> public static IGPDomain BuildPrivilegesDomain(IJTXDatabase3 wmxDb) { return(WmauGpDomainBuilder.BuildPrivilegesDomain(wmxDb)); }