Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

Beginning in version R28, XperienCentral no longer uses the Apache Jackrabbit JCR index solution by default. This topic is only relevant to users of XperienCentral versions R27 and lower. See the XperienCentral upgrades notes for version R28 for more information.


This topic This page contains some example XPath *** queries that can be used in the [XperienCentral JCR browser].

 Don't forget to look at the online help in the JCR Browser, it contains a lot of extra tips.

. Jackrabbit supports a subset of XPath 2.0 which is a subset of XQuery1.0). See also JCR Browser for complete information and other examples.


  • Retrieve all All templates:
    //element(*, wm:template)
  • Template Retrieve the template with ID = X:
    //element(*, wm:template)[@wm:templateid=1190]
  •  Siteworks Retrieve the Siteworks object with ID = X:
    //element(*)[@wm:id=72430]
  • All Retrieve all objecttypes:
    //wm:webmanager//element(*, wm:objecttypeinfo)
  • Webpage Retrieve the webpage item with Siteworks name '"Queries'":
    //wm:webmanager/wm:websites/wo:webpage_item[@wm:name = 'Queries']
  • Webpage Retrieve the web page item with reference to the node Siteworks object of objecttype itemtype and name '"370eea2b4dcbba2700212ab636f5'":
    wm:webmanager/wm:websites/wo:webpage_item/jcr:deref(@wo:itemtype, '370eea2b4dcbba2700212ab636f5')
  • Retrieve the JCR item with UUID "8d38de7b-cec9-4fd6-a714-65e1a61b5bba":
    //*[@jcr:uuid='8d38de7b-cec9-4fd6-a714-65e1a61b5bba'
    :
    ]
    Or
    //element(*)[@jcr:uuid='8d38de7b-cec9-4fd6-a714-65e1a61b5bba']
  • All Retrieve all SiteWorks tasks:
    //element(*, wo:wm_taskmanager_task)
  • All Retrieve all web pages, in descending name order
    //element(*, wo:ss_mastersection) order by @wm:name descending
  • All Retrieve all objects for of the given objecttype
    //element(*)[@jcr:primaryType='wo:personalization_expression']
  • All Retrieve all paragraph elements with containing the text '"XX'"
    //element(*, wo:ss_element_text ) [@wo:text='XX']
  • All Retrieve all objects of type X with property Y:
    //element(*, X)[@Y]
  • All Retrieve all objects of type X without property Y:
    //element(*, X)[not(@Y)]
  • Find nodes containing a property with value 'XX'
    //* [jcr:contains(@*,'XX')]
  • If you wish to find Find all elements - containing "XX" that use wo:text to save their data (rich text, paragraph, etc.) - containing 'XX'
    //* [jcr:contains(@wo:text,'*XX*')]
  • To see Retrieve a list of WebManager XperienCentral language labels in the edit environment use the following query:
    //element(*, wo:wm_edit_language)
  • To see Retrieve a list of all webinitiatives
    //element(*, wo:wm_webinitiatif)
  • To see Retrieve a list of ss_element_external_content where "last X days" > 100 use the following query:
    //element(*, wo:ss_element_external_content) [@wo:lastxdays>100]
  • When comparing date properties, use the xs:dateTime function. Caution: JackRabbit only accepts a fully specified date, including the time in milliseconds:
    //element(*, wo:wm_content_info)[@wo:lastmodified < xs:dateTime('2008-01-01T00:00:00.000Z')]
  • Retrieving Retrieve the meta data metadata of a media item
    1. Get the exact type of the mediaitem: //wm:components
    2. Hex-code the first number in the media item contentid (e.g. for mediaitem 202209, encode '2' into 0032 via the [http://www.easycalculation.com/ascii-hex.php] site)
    3. Retrieve the meta data using //<exact-type>/allContainerNode/_x<hex>_restofnumber (e.g. //nl.gx.elsevier.elseviermediaitems.AbonneeMediaItemVersionImpl/allContainerNode/_x0032_02209
  • Find an Retrieve a link which refers to a page of on the nu.nl website:
    //element(*, wo:ss_element_internal_externallink)[jcr:like(@wo:URL,'http://www.nu.nl/%')]

  • Find Retrieve all pages which have a link that refers to a page of on the nu.nl website:
    //element(*, wo:ss_section)[jcr:like(wo:related/wo:URL,'http://www.nu.nl/%')]

  • Find Retrieve all articles (element holders) which have a link that refers to a page of on the nu.nl website:
    //element(*, wo:wm_element_holder)[jcr:like(wo:related/wo:URL,'http://www.nu.nl/%')]

  • Find Retrieve all page versions which have an a preload form attribute

    //element(*, wo:ss_section)[@wo:preload_form]

  • All Retrieve all page versions containing with an element containing the text '"XX'":

    //element(*, wo:ss_section)[jcr:contains(wo:element/@wo:text,'*XX*')]

  • Find Retrieve all pages which contain a specific element

    //element(*,wo:ss_section)[wo:element/@jcr:primaryType = 'mywcb:element']

     

*** Please note that Jackrabbit supports a subset of XPath 2.0 which is a subset of XQuery1.0.

...



Info

Although Jackrabbit uses the XQuery grammar, it only implements the set of XPath features required by JCR-170 (and some
extras, like predicates on location steps).

...

For more information about XPath see

...

https://www.w3schools.com/xml/xpath_intro.asp.