Start of changeIBM Content Navigator, Version 2.0.3     Supports:  CMIS for Content Manager

Administering saved searches

You can create saved searches that are filed as a search folder that runs when opened, or by using administrative tools. You can do administrative tasks for saved searches, such as list, view, modify, delete, verify, or run a saved search.

Before you begin

Before you can use the saved search feature, you must add the saved search data model definition to the repository. Use the PathModelCreate tool or run the configuration program again. When you run the configuration program again, it runs the PathModelCreate tool. If you upgraded from an earlier version without saved search support, you must run the configuration program to add the saved search data model definitions to the repository. After you run the configuration tool or program, the saved search data model definitions are visible only to repository administrators.

You must also configure ACLs, libraries, and item types for users. You must adjust the access control for the saved search item type to provide read access to run the saved search. You can create or edit ACLs and change the ACL settings for the ClbSavedSearch item type by using the system administration client.

About this task

By using the SavedSearchAdmin tool, you can do the following tasks:
  • List existing saved searches
  • Create new saved searches or saved search folders
  • Create predefined saved searches
  • Select location within repository to store saved searches
  • Build queries by using the query builder
  • Modify saved searches
  • Delete saved searches
  • Run saved searches
  • Detect and fix incorrect search folder usage by other applications
  • Validate existing saved searches
A saved search stores any valid Content Manager EE parametric query expression. The SavedSearchAdmin tool can help you build a simple query, or you can type any valid query expression. You can use the SavedSearchAdmin tool to create your own saved search by using one of the following options:
  • Use a predefined set of available saved searches. You can use the predefined set of saved searches that are already available with IBM® CMIS for Content Manager after you initialize them by using the SavedSearchAdmin tool.
  • Use the interactive query builder. You can build query expressions without knowing the Content Manager EE query syntax.
  • Enter your Content Manager EE XPath query expression.

You can select whether you want to initialize all predefined saved searches, create a subset of the list of predefined searches, or select any particular predefined saved search to use. Some predefined search queries might return large number of results and run slowly. For some applications, the search is truncated at a maximum number of results. When you use administrative tools to run searches, you can override the configuration settings for maximum number of search results by using the m or max option.

All predefined saved searches are defined to be displayed in all libraries. The predefined saved searches are initially created with English names, titles, and descriptions, but you can edit the name, title, or description by using the SavedSearchAdmin and Browser tools. The initial set of predefined searches is not created during installation, but the searches can be initialized at any time by using the SavedSearchAdmin tool. You can review the full list of predefined saved searches and even if you renamed a search, you can identify which searches were created, are new, or are not created. You can also use the SavedSearchAdmin or Browser tools to edit any existing saved searches. Predefined saved searches are visible only to administrators by using the administrative tools and provide examples. The users can see saved searches as folders only if you create and save a search as a folder.

You can reuse existing saved searches if the search that runs the same query as you want but is not accessible by a user who needs it. For example, if you have a saved search that contains the query, instead of copying it, you can reuse it by changing the ACL or the scope of the search. You can browse the saved searches and see what the ACLs are set to, and whether they are filed in a location that is accessible to the intended users. Then, you can decide whether you want to create another saved search or edit the permissions and scope for the intended users.

By using the SavedSearchAdmin tool, you can create saved searches that you can run in the following ways:
  • Run through administrative tools, such as the SavedSearchAdmin tool or the Browser tool
  • Run by opening a search folder that contains the stored search, if you file the search folder where users can access it.

Search folders run only when opened through an application that uses IBM CMIS for Content Manager. In other applications, the search folder appears as a blank folder. This tool detects the incorrect search folder usage by other applications as a real blank folder. After you confirm, the tool automatically removes the improper relationships.

You can administer saved searches from other applications if the application supports editing the saved item type and you file the search folder where you can access it.

In an interactive mode, the tool prompts you for all required options. You can also run the tool in a silent mode by specifying the options and values. You can use either the single character or the full name of the option.

To display a list of available options, enter java com.ibm.content.cm.tools.SavedSearchAdmin -? or java com.ibm.content.cm.tools.SavedSearchAdmin -help.

Procedure

To run the SavedSearchAdmin tool:

Run the Java command with the following format: java com.ibm.content.cm.tools.SavedSearchAdmin -options values.
Use the following command options for the SavedSearchAdmin tool:
r or repository
The Content Manager EE database name or the alias name.
u or user
The Content Manager EE user ID that you use to log in.
p or password
The Content Manager EE password that you use to log in.
o or options
The Content Manager EE connection options that you can use to connect to Content Manager EE. For more information about connection options, see the DKDatastoreICM::connect() method or the SConnectDisconnectICM.java sample.
f or fix
If other applications added any items in the search folder, fix the search folder automatically. The value can be either true or false.

If you set the f or fix option to true, the tool automatically fixes the incorrect folder relationships. However, if the option is set to false, the tool prompts you whether you want to delete the incorrect folder relationships. Depending on your choice, the SavedSearchAdmin removes all incorrect folder relationships.

m or max
The maximum number of results. You can specify a maximum number of results instead of using the configuration parameter setting in cmpathservice.properties file. When you open folders, this setting does not override the configuration setting for maximum number of child components.
to or timeout
Timeout in seconds. You can specify a search timeout instead of using the existing configuration parameter setting in cmpathservice.properties file.
v or validate
Enable step-by-step validation in the interactive query builder. The query is always validated at confirmation, but you can validate the query as you enter it and see the current results count. The value can be either true or false. The default value is false. When you use the interactive query builder to build queries, you can manually toggle this option.
a or action
Actions that you want to do. The choices are create, list, view, run, edit, or delete.
scope or listScope
Scope of the saved searches that you want to list. The choices are all, global, librarySpecific, librarySpecificAndGlobal.
i or id
Existing saved search ID.
l or label
The label or the short name of your saved search.
t or title
The title or the long name of your saved search.
d or desc
The description of your saved search.
grp or showOnlyGrp
Displays the saved search only within a specific library by specifying both a library group and the library to limit the scope of listing.
lib or showOnlyLib
Display the saved search only within a specific library by specifying both a library group and library to limit the scope of listing.
pf or parentFolder
The folder in which the saved search item is filed. You can specify one of the following options:
  • Absolute path of the folder, starting with '/'
  • Content Manager EE item ID of the folder
  • Unfiled, which means that the saved search item is not filed in a folder
h or hidden
Saved search item that is hidden from view as an item in some applications. The value can be either true or false.
sf or searchFolder
Search folder item or non-folder item. If saved as a folder, the item appears as a folder that you can open to run the search, and the search results are displayed as child documents. The value can be either true or false.
en or listed
Search is listed in saved search listings or unlisted (offline), not listed in saved search listings. The value can be either true or false.
s or shared
Shared or public saved search or a private user personal saved search. The value can be either true or false.
g or acl
The ACL name that exists in Content Manager EE to give access to the application that you create.
q or query
Content Manager EE query expression. You can use saved search implicit variables in your query expression.

To silently create all predefined saved searches that are not yet created, specify the query option with value \"PREDEFINED\" instead of specifying a specific query.

z or throwExc
The exception message. The value can be either true or false. The default value is false.

Example

The following code sample shows how to run the tool in an interactive mode:
Operating system Code sample
Linux or UNIX systems ./configure-repository.sh SavedSearchAdmin
Windows configure-repository.bat SavedSearchAdmin
The following code sample shows how to run the tool in a silent mode. You must enter the command in one line.
java com.ibm.content.cm.tools.SavedSearchAdmin -r icmnlsdb 
-u icmadmin -p password -o SCHEMA=ICMADMIN -f true -z true -a 
create -l "Documents I Created in Last 3 days" -t 
"Documents I Created in Last 3 days" -d "no description" 
-scope all -grp "default group" -lib "default library" -pf UNFILED -h false 
-sf false -listed true -shared true -acl PublicReadACL 
-q "/*[@SEMANTICTYPE!=2 AND @CREATEUSERID=\"icmadmin\" 
AND @CREATETS>\"{DATETIME_OFFSET(-,0000,00,03,00,00,00)}\"]"  
Important: Follow these guidelines for query strings:
  • Use double quotation marks to surround a value with spaces. The double quotation marks are removed from the actual value.
  • If your query string contains double quotation marks, use \" where you want " to appear.
End of change