You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jürgen Ragaller <ra...@apache.org> on 2007/12/03 16:18:04 UTC

[2.0] - indexing of usecase documents

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).


Any hints are appreciated

Jürgen





null-oder-eins GmbH Zürich
web & graphic design

www.null-oder-eins.ch

ragaller@apache.org
Skype: callto://ragaller




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: [2.0] - indexing of usecase documents

Posted by Jürgen Ragaller <ra...@apache.org>.
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

ragaller@apache.org
Skype: callto://ragaller




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: [2.0] - indexing of usecase documents

Posted by Jürgen Ragaller <ra...@apache.org>.
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.


Is it safe to say that the view (executeUsecase's output) of a  
usecasedocument always should be indexed; or could there be cases  
where such an approach will break the searching (depending on how the  
usecase is written)?


What do you think about the approach?


Thanks a lot!

Jürgen





null-oder-eins GmbH Zürich
web & graphic design

www.null-oder-eins.ch

ragaller@apache.org
Skype: callto://ragaller




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: [2.0] - indexing of usecase documents

Posted by Andreas Hartmann <an...@apache.org>.
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?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org