SearchConditionList

Build 1501 on 14/Nov/2017  This topic last edited on: 26/Feb/2014, at 11:07

The ConditionSearchList is other way to construct a search condition.

Return all articles that have the author = 'Armando Trovati'

<SearchConditions

xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

ObjectTypeName="article">

 <SearchNode xsi:type="SearchConditionList">

   <List Path="[article.author]" Op="Equal"

       FromValue="Armando Trovati" ToValue="" />

 </SearchNode>

</SearchConditions>

 

The search condition above returns all articles with the author = 'Armando Trovati'.

Assuming this search condition has been loaded into the database from the file Search_articleAuthor.xml, the search is executed with a statement such as:

http://localhost/tark4/do.ashx?cmd=search&name=articleAuthor

Assuming the search condition has been saved in the file Search_articleAuthor.xml in the same folder where cm4 resides, you can execute it in cmd4 as:

C:\tera\GN4\main\bin>cmd4 get -conditions search_articleAuthor.xml -out output.xml -username bruno -password ifra

It stores results in the output.xml file.

Return all articles linked to a specified edition, or to any edition of the specified title

<SearchConditions

  xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  ObjectTypeName="article">

  <SearchNode xsi:type="SearchConditionList">

    <List xsi:type="SearchCondition" Path="[linkObject.pageLayers~editionRef]" Description="Linked to edition" Op="In">

      <Ids xsi:type="VariableSearchNode" Name="editionIds" Type="IdList" Optional="true" />

    </List>

    <List xsi:type="SearchCondition" Path="[linkObject.pageLayers~editionRef.titleRef]" Description="Linked to title" Op="In">

      <Ids xsi:type="VariableSearchNode" Name="titleIds" Type="IdList" Optional="false" />

    </List>

  </SearchNode>

</SearchConditions>

See also

Variable Nodes