Find articles which name contains specific letters
<SearchConditions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd">
<SearchNode
xsi:type="SearchConditionList">
<List Op="In" Path="ObjectType.Id" >
<IdList>
<IdName Name="article" />
</IdList>
</List>
<List
Path="[article.name]"
Op="Ending"
FromValue="10"
IsFulltext="false"
/>
</SearchNode>
</SearchConditions>
Find imgs in specified folder, created in last 24 hours which name ends with specified string
This search condition has four criteria:
1.Object has to be of the "img" type.
2.It has to be in specific folder.
3.It has to be created in last 24 hours.
4.Its title has to end with "A00100".
In other words, use it if you need to search in a workflow for a specific folder for an img that has a title that ends in A00100 and was created in the last 24 hours.
<SearchConditions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd"
ObjectTypeName="img">
<SearchNode
xsi:type="ConditionSearchNode"
Op="And">
<Left
xsi:type="ConditionSearchNode"
Op="GreaterEqual">
<!--
This is the attribute used to determine the age of the object,
it can be 'modifiedDate' to use the last modification or
'creationDate' to use the creation date/time
-->
<Left
xsi:type="AttributeSearchNode"
Path="folderObject.modifiedDate"/>
<!--
This is the specification of how old: day.hours:minutes:seconds
-->
<Right
xsi:type="DateTimeRelativeSearchNode"
Interval="-01.00:00:00" />
</Left>
<Right
xsi:type="SearchConditionList">
<List
Op="InSubtree"
Path="[folderObject.folderRef]"
TreeParentRefAttributeName="folderParent"
IsFulltext="false">
<IdList>
<!--
This is the database id of the folder
-->
<IdName Id="103021"/>
</IdList>
</List>
<List
Path="[img.title]"
Op="Ending"
FromValue="A00100"
IsFulltext="false"/>
</Right>
</SearchNode>
</SearchConditions>
To test it save the SearchConditions as is in the file ‘c:\temp\searchConditions.xml’ and then execute it with cmd4, like:
cmd4 get -conditions c:\temp\searchConditions.xml -out c:\temp\output.xml -username ... -password ...
The introduction and the structure is standard: there are two name spaces and one SearchNode with type ConditionSearchNode. Of course, a search condition as the one below, does not find anything as no criteria was specified. <SearchConditions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd" <SearchNode xsi:type="ConditionSearchNode" </SearchNode> </SearchConditions> The first criteria is simple: being a single objectType, it's simply added above the <SearchNode and that's it. <SearchConditions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd" ObjectTypeName="img"> <SearchNode xsi:type="ConditionSearchNode" </SearchNode> </SearchConditions> |