Hans Wichman wrote:
> I need to search the repository for a simple value, and got this:
>
> HierarchyManager configManager =
> MgnlContext.getHierarchyManager(ContentRepository.CONFIG);
> QueryManager configQueryManager = configManager.getQueryManager();
> Query configQuery = configQueryManager.createQuery("//*[jcr:contains(.,
> '"+searchKey+"')]", "xpath");
> QueryResult configResult = configQuery.execute();
> Collection<Content> configResults = configResult.getContent("nt:base");
>
> Is there a less verbose way (beside wrapping it in a class myself)?
Try the info.magnolia.cms.util.QueryUtil class and its query method.
Or you could take a look at the Criteria API provided by Openmind:
http://www.openmindlab.com/lab/products/mgnlcriteria.html
Nils.
------------------------------------------------------------------------
VPRO www.vpro.nl
------------------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------