Available for: Content Management Server, Template Engine
Task: Searches for all IDs of files that meet the specified search criteria. Only files for which the user has read permission are output.
Additional information: The command does not return implicit mirror files (created automatically by the system).
Syntax:
obj where {parameter value}
Function parameters:
parameter
specifies the search
criteria or restricts the search result list in another way.
The following parameters are available.
ids
is a list of file IDs. If
this parameter is specified, only the files with the IDs in
the list are searched, otherwise all files.
maxResults
specifies the
maximum number of hits to be returned. The value 0 (default)
deactivates this limitation. See also the
maxSearchResultSize
system configuration entry.
The value of this entry has priority over the value of
maxResults
.
condition
:
value
is a condition a file must meet
to be included in the search result list.
value
is a list composed of three
elements, a property, a comparison operator, and a value with
which the property is to be compared. The following table
contains all possible combinations of these three items:
Property | Operator | Comparison value |
---|---|---|
name
|
is |
String |
objType |
is
|
document List of file types (see is )
|
state |
is |
edited List of workflow states (see is )
|
object |
is |
inactive (from version 6.5.0) |
Several conditions can be specified, which are then combined with and. Example:
obj where condition {name contains foo} \ condition {objType isOneOf {document publication}}
If an empty list is specified for
objType isOneOf
or state isOneOf
, the
results list is empty.
state isNot
is
the only negation available. It is required because
workflow states are not exclusive (a file can have an
edited or a committed version plus, optionally, a
released version.
object is inactive
returns all
objects without any or without a temporally valid version.
The obj where
conditions can also be used in the Template Engine.
However, since only released files exist in the Template Engine, state
returns the following:
state is
/ isOneOf
...
released:
the condition is ignoredcommitted
/ edited
: the results list is always emptystate isNot
...
released
: the results list is always emptycommitted
/ edited
: the condition is ignoredThe object
property is not available in the Template Engine.
value
contains the value for the corresponding parameter.
Return value if successful: the list of IDs of the matching files (stringlist)
Necessary permissions (CM only): no restrictions
Examples:
CM>obj where condition {state isOneOf {edited committed}} CM>obj where ids {2001 3002} condition {name contains foo} CM>obj where condition {name is bar} condition {title contains foo} CM>obj where condition {name is foo} maxResults 20