Content Management Guide
CHAPTER 22
This chapter describes how to use the Content Query action and related artifacts to query the Content Management subsystem. It has these sections:
NOTE: To use this application your project must include the Content Management and the Rule subsystems.
The Content Query action (CQA) allows you to query published documents in the Content Management (CM) subsystem. You can query by folder, category, document type, or by specific document. Searches can be designated as either inclusive or exclusive. The results of the query are captured in XML and processed as a query in the CM subsystem.
Content Query consists of a portlet and sample rules that use the installed Content Query action. The application artifacts are provided in your exteNd Director directory at:
Portal/WEB-INF/lib/cqa-portlets.jar
Application contents The CQA-Portlets JAR includes:
The Content Query action provides a custom user interface in the Rule Editor for specifying the folders, categories, document types, and documents to include (or exclude) in the query results. It also provides an interface for selecting the properties (content fields) that should be displayed in the query output and for specifying sort rules. The Content Query action also includes a query builder to allow you to specify selection criteria.
If you have not yet created content, you need to add some content using the Director Administration console (DAC) or WebDAV.
Start your server and open the ContentList rule in exteNd Director.
For more information, see Using the Rule and Macro Editors in the Rules Guide.
NOTE: You can also create a new rule and add the Query action. If you are creating your own rule, skip the next step.
Select the Edit query against the content management system action, then right-click and select Edit from the popup menu.
A popup asks you to specify the URL to your project's ContentMgmtService folder.
Specify the correct URLfor example:
http://localhost/MyDirectorProj/ContentMgmtService/
On the Search tab, specify which documents you want to include (or exclude) in your query:
Each property panel allows you to specify an URL to a whiteboard key for the documents:
You can either enter the value or specify a whiteboard key that holds the value you want. Use this format:
!valueOf.keyname
You can also specify a key that holds the name of another key. To get a value from another key, specify !valueOf.anotherkey.
For more information about the !valueOf construct, see the section on using whiteboard values in the Rules Guide.
To build a query condition, click the Whose button:
The Whose query builder lets you specify selection criteria for individual CM properties. To build a query condition:
Step |
Action |
---|---|
1 |
If you've already added one or more conditions to the query, select a logical operator (and or or). |
2 |
Select Standard Document Properties. |
3 |
Select a property (such as Author). |
4 |
Select an operator (such as ends with). |
5 |
Select <literal>. TIP: Only literal strings or whiteboard keys are supported at this time. |
6 |
Enter a value that will be used for the expression. You can either enter the literal value or a whiteboard key that holds a value. Use this format: !valueOf.keyname
You can also specify a key that holds the name of another key. To get a value from another key, specify !valueOf.anotherkey. For more information about the !valueOf construct, see the chapter on using whiteboard values in the Rules Guide. |
7 |
Click Add to add the condition. |
The query specifications you provide on the Search tab are ANDed together. That means that to be included in the result set for the query, a document must satisfy all criteria specified on the Search tab.
On the Properties tab, select the document properties that you want to appear in the query output. You can select one or more properties from the list on the left and add them to the list on the right by using the arrows. You can also move the properties up or down to adjust the display order by using the arrows on the right side of the dialog.
TIP: You must select at least one property on the Properties tab to see data in the query output. In the ContentList rule, some properties are selected by default.
On the Sort tab, specify how the data will be sorted in the query output. For each property you select, you can specify the sort order (ascending or descending).
To test your query, add the ContentList portlet to a portal page and test the page.
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...