Good morning
Am 04.12.2007 um 17:12 schrieb Jürgen Ragaller:
Hi
Am 03.12.2007 um 16:40 schrieb Andreas Hartmann:
Jürgen Ragaller schrieb:
Hi
We use ResourceType usecase for CForms. The views of these
documents/resource types sometimes contain content that should be
indexed (the "content" is in our case in a jx template: a cform
surrounded by some text).
Right now I can only think of dirty hacks/workarounds to this
phenomenon (douplication of content and redirection, or insertion
of douplicated content in the ResourceType usecases's content
document and switch on indexing for usecase ResourceTypes).
IIUC the usecase view would have to be rendered for the Lucene
index resource type format. What happens if you call the
executeUsecase function in the Lucene index format matcher in
modules/usecasedocument/sitemap.xmap?
Thanks for that information!
In resource-type-usecase.xconf I have the following format:
<format name="luceneIndex" uri="cocoon://modules/usecasedocument/
lucene-index"/>
In the usecasedocument module I now match it as follows:
<map:pipeline>
<map:match pattern="executeusecase.xml">
<map:call function="executeUsecase">
<map:parameter name="usecaseName" value="{usecase-
document:usecase}"/>
</map:call>
</map:match>
<!-- Generates the lenya metadata to be aggregated for each
page -->
<!-- {1:pubId}/{2:area}/{3:uuid}/{4:language}/{5:revision} -->
<map:match pattern="lenyametadata.xml/*/*/*/*/*">
<map:generate type="lenyaMetaData" src="lenya-document:
{3},pub={1},area={2},lang={4},rev={5}"/>
<map:serialize type="xml"/>
</map:match>
<!-- {pub-id}/{area}/{uuid}/{language} -->
<map:match pattern="lucene-index/*/*/*/*">
<map:aggregate element="cmsbody">
<map:part src="cocoon:/executeusecase.xml"/>
<map:part src="cocoon:/lenyametadata.xml/{1}/{2}/{3}/
{4}/-1"/>
</map:aggregate>
<map:transform src="fallback://lenya/modules/xhtml/xslt/
xhtml2index.xsl">
<map:parameter name="url" value="{request:requestURI}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
The lenyametadata part of the above pipeline is copied from the
resource module.
Testing a bit, I just realized, that things are still buggy in my
approach:
- The pages are indexed but all usecasedocuments appear in the result
list (for a search string only found on one particular page)
I'll keep trying...
Jürgen
null-oder-eins GmbH Zürich
web & graphic design
www.null-oder-eins.ch
[EMAIL PROTECTED]
Skype: callto://ragaller
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]