Document: Working with Documents URL: https://lenya.zones.apache.org/cms/docu/live/docu20/concepts/documents.html Changed by user: Thorsten Scherler (thorsten)
---- Added: /document/body/section[4] <section> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/title <title> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/title/text() FAQ ---- Added: /document/body/section[4]/section[1] <section> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/title <title> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/title/text() What is the preferred method in lenya to get all documents of a certain resource type? ---- Added: /document/body/section[4]/section[1]/p[1] <p> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/p[1]/text() The most performant way is to use Lucene. The query would be: ---- Added: /document/body/section[4]/section[1]/source <source> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/source/@space [attr] space=preserve (http://www.w3.org/XML/1998/namespace) ---- Added: /document/body/section[4]/section[1]/source/text() {http://apache.org/lenya/metadata/document/1.0}resourceType:foobar ---- Added: /document/body/section[4]/section[1]/p[2] <p> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/p[2]/text() See also ---- Added: /document/body/section[4]/section[1]/p[2]/a <a> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/p[2]/a/@href [attr] href=lenya-document:5b454cb0-e986-11dc-b04f-af2277a493d7 (null) ---- Added: /document/body/section[4]/section[1]/p[2]/a/text() https://lenya.zones.apache.org/cms/docu/authoring/docu20/reference/metadata.html#N100BF ---- Added: /document/body/section[4]/section[1]/p[3] <p> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/p[3]/text()[1] A while ago Andreas started to implement a convenient API to do such queries, see thread ---- Added: /document/body/section[4]/section[1]/p[3]/a <a> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[1]/p[3]/a/@href [attr] href=http://markmail.org/thread/ozr3dunbk7q6mcbz (null) ---- Added: /document/body/section[4]/section[1]/p[3]/a/text() API for document search ---- Added: /document/body/section[4]/section[1]/p[3]/text()[3] on the users list. Maybe we can discuss this again? ---- Added: /document/body/section[4]/section[2] <section> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[2]/title <title> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[2]/title/text() How can I control the caching of the this call, since I can use a cached version of the listing until one of the documents get edit? ---- Added: /document/body/section[4]/section[2]/p[1] <p> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[2]/p[1]/text() The Lucene query should be pretty fast, so caching the resulting list might not be necessary. ---- Added: /document/body/section[4]/section[2]/p[2] <p> (http://apache.org/forrest/document/v20) ---- Added: /document/body/section[4]/section[2]/p[2]/text() If you don't want to use Lucene, you could write a custom generator that stores an index of the relevant meta data and uses the last modification date for the cache validity. The generator also has to check the sitetree to see if documents have been added or removed. This is a rather complex task, but we used it for a customer in Lenya 1.2 and up to now it works very well (in combination with mod_cache, though). ---- Added: /document/body/section[4]/comment() <section> <title>FAQ</title> </section> ---- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
