Skip Headers
Oracle® Fusion Middleware Content Management Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14230-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

13 Metadata Searching

Content Management supports metadata search as well as full-text search. This chapter describes searching for both published and versioned metadata. Published content is either content from a repository that does not have library services enabled or content that has completed a workflow and is a Published state. Versioned content is content in a library services-enabled repository that is not yet published. Searching for published content returns Nodes while searching for unpublished content return Versions. For more information about enabling library services, see Section 3.2.1, "Enabling Library Services for a WLP Repository."

Note:

Searching for published content and searching for versioned content are mutually exclusive because these search types use different APIs. and You use ISearchManager.search to search for published content and IVersionManager.search to search for versioned content. This means that the search queries go against different data sources to return the data.

This chapter contains the following sections:

13.1 Introduction

The metadata search feature uses the content expression language. You use different properties when searching for metadata in published content and versioned content. The differences are discussed in the relevant sections. A full list of supported properties is available in com.bea.content.expression in the Oracle Fusion Middleware Java API Reference for Oracle WebLogic Portal.

13.2 Searching for Metadata in Published Content

This section describes searching for metadata in published content. The following sections provide more detail:

13.2.1 Properties

The following tables describe commonly used properties and operators A full list of supported properties is available in com.bea.content.expression in the Oracle Fusion Middleware Java API Reference for Oracle WebLogic Portal.

Table 13-1 System Properties

System Property Description and Example
cm_path

The Virtual Content Repository path to the content item.

cm_path = 'WLP Repository/books/Ulysses' 
cm_uid

The unique ID for a content item.

cm_uid = '0003456' 
cm_parent_uid

The ID of the parent for a content item.

cm_parent_uid = '87543'
cm_createdBy

The user who created the content item.

cm_createdBy = 'jjoyce'
cm_modifiedDate

The date the content item was last modified.

cm_modifiedDate = '04/01/2008'
cm_nodeName

The name of the content item.

cm_nodeName != 'abc'
cm_isHierarchy

Deprecated.

cm_isContent

Deprecated.

cm_objectClass

The content type associated with a content item.

cm_objectClass = 'simpleType'
cm_binaryName

The file name of the binary value of a content item.

cm_binaryName = 'foo.gif'
cm_binarySize

The size of the binary value of a content item (in bytes)

cm_binarySize = '188' 
cm_contentType

The MIME type for content item binary properties.

cm_contentType = 'image/gif'
cm_objectClassInstance

Finds all instances of a given object class and all of its children.

cm_objectClassInstance = 'Product'
cm_value

Find any property value on any nodes of a particular value.

cm_value = 'red' 

Table 13-2 Operators

Operator Purpose
like

Syntax textual like operator.

likeignorecase

Syntax textual like (case insensitive) operator.

=

Syntax textual equals operator.

!=

Syntax textual not equals operator.

&&

Syntax textual and logical operator.

in()

Syntax textual in operator.

! [negate]

Syntax textual not operator.

||

Syntax textual or logical operator.

>

Syntax textual greater than operator.

<

Syntax textual less than operator.

contains

Syntax textual contains operator.

containsall()

Syntax textual contains all operator.

containsany()

Syntax textual contains any operator.

toProperty('<propertyName>')

Use for special characters in property names such as spaces, backslash, and so on.


Table 13-3 Wildcards

Wildcard Description Example
*

Supports any characters.

cm_NodeName like "ab*" matches "abcde", "ab", "ab234", "abc", and so on.

_

Supports one character.

cm_nodeName like "ab_" matches "abc", "abd", "ab2", and so on.


13.2.2 The Search Object

You can search for metadata in a content repository using the com.bea.content.search object. The search object takes in an expression that the API processes and return search results as com.bea.content.Node objects. Example 13-1 shows an example of a simple search.

Example 13-1 Simple Search Example

ISearchManager searchManager = ContentManagerFactory.getSearchManager();
Search search = new Search("cm_nodeName != null");
search.setSortCriteria("cm_objectClass, cm_nodeName");
ISortableFilterablePagedList<Node> nodes = 
   searchManager.search(context, search);

The search manager API also supports various other types of searches like idSearch. For more information, see the Oracle Fusion Middleware Java API Reference for Oracle WebLogic Portal.

13.2.3 Limitations

When using the WLP repository, metadata search results on implicit properties cannot be sorted. To sort the returned data you must use postSearchSort method in the ISearchManager API. That method is slower than native sorting, which is done using the search.setSortCriteria method.

13.2.4 Examples

The expression language supported by search is based on a simple, easy to use grammar. It supports a rich set of operations, and easily allows building complex queries using nested expressions. To look at the various data types, such as strings, dates, numbers, and booleans supported by the expression language, For more information, see the Oracle Fusion Middleware Java API Reference for Oracle WebLogic Portal.

Table 13-4 Simple Examples

Example Description

cm_nodeName = 'hello'

Returns all the nodes matching the name "hello".

cm_nodeName = 'hello' || cm_nodeName = 'world'

Finds any node name that has the name "hello" or "world".

cm_nodeName = 'hello' && city = 'boston'

Find any node name of name "hello" and city of "boston".

cm_nodeName = 'hello' && (color = 'red' || color = 'blue')

Use the brackets ( and ) to find nested expressions. Nesting follows a left to right order of evaluation. This expression finds all nodes named hello, and whose color property is either "red" or "blue".


Table 13-5 Complex Nesting Examples

Example Description

cm_nodeName = 'hello' && ( (city = 'boston' || city = 'boulder' ) && (color = 'red') )

Finds any node named "hello" and whose color property is "red" and whose city property is either "boulder" or "boston".

!(cm_nodeName = 'hello' && city = 'boston')

The negation ! operator returns an inverse result. In this example, all the nodes that do not have the name "hello" and the city "boston" are returned.


13.3 Searching for Metadata in Versioned Content

This chapter describes searching for metadata search in versioned content. It contains the following sections:

13.3.1 Specific Properties for Versions

Table 13-6 Properties for Versions

Property Description and Example
cm_version

The version number of the content.

cm_version = '6'
cm_versionComment

Text describing the changes to the version.

cm_versionComment = 'Updates from Marketing'
cm_checkedOut

Version is checked out.

cm_checkedOut = 'false'
cm_assignedToUser

The user to which the node is assigned.

cm_assignedToUser = 'rjordan'
cm_role

The role to which the node is assigned.

cm_role = 'Admin'
cm_latestVersion

The latest version of the content.

cm_latestVersion = 'true'

13.3.2 Limitations

Search for versioned content has some limitations because the tables that store versioned data can be in a different data store than the ones that store published data. This means that you cannot search for both published and versioned metadata with SQL queries. Therefore some properties are not supported when searching on versioned content. Here's a list of unsupported properties:

  • cm_isContent

  • cm_isHierarchy

  • cm_objectClass

  • cm_path

  • cm_createdBy

  • cm_objectClassInstance

  • cm_parent_uid

  • cm_createdDate

  • Paths set via setSearthPaths in the Search object throw an error when that search object is used in a versioned system search.

Searching for versioned content and searching for published content are mutually exclusive because these search types use different APIs.

13.3.3 Supported Attributes

Attributes that retain their meaning from searching on versioned content are:

Table 13-7 Supported Attributes for Versioned Content Search

Attribute Description
cm_nodeName

Search for node name.

cm_uid

Search for node by UID (User Identifier).

cm_value

Search for any value in versioned data

cm_lifeCycleStatus

Searching for nodes in any workflow state. For example, cm_lifeCycleStatus = '3' (Ready for Approval).


13.3.4 Examples

Table 13-8 shows some examples for searching versioned content (content used in a workflow).

Table 13-8 Searching Versioned Content

Example Description

name = 'matt' && (age = 33 || age = 13)

Returns node versions matching the name "matt" and age of "13" or "33".

cm_version = '1' && city = 'calcutta'

Returns the first version of nodes and city of "calcutta".

cm_versionComment = 'DevUpdates' && product = 'portal'

Returns node versions that equal comments with "DevUpdates" for the "portal" product.

cm_modifiedBy = 'weblogic' && product = 'portal'

Finds node versions modified by "weblogic" for the "portal" product.

cm_lifeCycleStatus > 0 && article = 'development'

Returns node versions in any workflow state and articles about "development".

cm_nodeName = 'matt_2' && city = 'calcutta'

Returns node versions matching the name "matt_2" and city of "calcutta".

cm_checkedOut = true

Finds node versions that are checked out.

cm_assignedToUser != null

Returns versioned nodes that are assigned to users.

cm_value > 30 || cm_binaryName = null

Finds node versions for any property with a value greater than "30" or whose file name of a binary value is unknown or undefined.

cm_role in ('weblogic','Admin') && cm_value > 30

Finds node versions that have roles in "weblogic" and "Admin" and any property with a value greater than "30".

cm_version = '5'

Returns node versions with a version number of "5".

age > 10 && (city in ('calcutta','boulder') || cm_role = 'Admin')

Finds node versions with an age value greater than "10" and city of "calcutta" and "boulder" or role assigned to "Admin".

cm_uid = '2051' && city = 'boulder'

Finds node versions with node ID "2051" and city of "boulder"

cm_nodeName = 'foo' && cm_latestVersion = true

Returns the latest version of nodes named "foo".