You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Jörn Nettingsmeier <po...@uni-duisburg.de> on 2006/02/11 22:09:20 UTC

Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

hi *!


i thought i'd better revive this old thread instead of starting a new one:

Thorsten Scherler wrote:
> El mié, 04-01-2006 a las 13:22 +0000, thorsten@apache.org escribió:
>> Author: thorsten
>> Date: Wed Jan  4 05:21:44 2006
>> New Revision: 365905
>>
>> URL: http://svn.apache.org/viewcvs?rev=365905&view=rev
>> Log:
>> added the lenya meta data generator. It is an abstract generator that can produce the metadata to any given docid. Added an example how one can use it within the tutorial.html (only in english).
> 
> Hi all,
> 
> I checked in a meta data generator. I needed to extend the metaData
> interface and update some other classes.
> 
> The generator will get the custom, dublin and lenya meta data and
> generate a xml file with it. The generator is connecting each
> implementation and gets the meta data. It is *not* directly contacting
> the *_*.xml.meta to be able to ease the switch to jcr (where I assume we
> will not have such file anymore.)
> 
> Please test the new generator and report bugs to our issue tracker and
> problems to this list. 
> 
> I added a small example to the default pub (tutorial.html -> eng only)
> which is actually only a showcase. 
> 
> salu2

i just played around with the generator. since i want to access the 
metadata from my page2shtml.xsl, i added the following to my publication 
sitemap:
<map:match pattern="lenyabody-*/*/*/*/**">
  <map:aggregate element="cmsbody">
   <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
   <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
   <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
   <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
   <map:part
        src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}"/>
   <map:part src="{resource-type:format-xhtml}"/>
...



i came across two issues i don't understand:

(1) why are namespaces stripped by default? i had to comment out
  <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
later in the pipeline to get the lenya: prefix back.


(2) what is the format of <lenya:workflowVersion/> ? is there any way to 
get the information in sane xml? the information i want to extract is 
"page last updated on <date> by <user>". would be simple by accessing 
the metadata files directly, but i'm listening to andreas' advice and 
try not to bypass the lenya api...


regards,


jörn



-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-duisburg.de, Telefon: 0203/379-2736

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


Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

Posted by Thorsten Scherler <th...@wyona.com>.
El lun, 13-02-2006 a las 09:37 +0100, Thorsten Scherler escribió:
> El lun, 13-02-2006 a las 08:49 +0100, Thorsten Scherler escribió:
> > El dom, 12-02-2006 a las 19:52 +0100, Jörn Nettingsmeier escribió:
> > > Jörn Nettingsmeier wrote:
> > > > 
> > > > Thorsten Scherler wrote:
> > > >>
> > > >> Please test the new generator and report bugs to our issue tracker and
> > > >> problems to this list.
> > > >> I added a small example to the default pub (tutorial.html -> eng only)
> > > >> which is actually only a showcase.
> > > >> salu2
> > >  >
> > > > i just played around with the generator. since i want to access the 
> > > > metadata from my page2shtml.xsl, i added the following to my publication 
> > > > sitemap:
> > > > <map:match pattern="lenyabody-*/*/*/*/**">
> > > >  <map:aggregate element="cmsbody">
> > > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
> > > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
> > > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
> > > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
> > > >   <map:part
> > > >        src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}"/>
> > > >   <map:part src="{resource-type:format-xhtml}"/>
> > > 
> > > 
> > > the LenyaMetaDataGenerator barfs when i create a new document:
> > > 
> > > The source 
> > > [context://lenya/pubs/politik/content/authoring/personen/index_en.xml.meta] 
> > > does not exist!
> > 
...
> 
> Well if you used the example of the default pub then we have set
> lang="en"
> http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap?rev=365905&view=markup
> ...
> <map:match pattern="**meta">
>   <map:generate type="lenyaMetaData">
>     <map:parameter name="docid" value="{request-param:docid}"/>
>     <map:parameter name="lang" value="en"/>
>   </map:generate>
>   <map:serialize type="xml"/>
> </map:match>
> ...
> I will change it right now 

http://svn.apache.org/viewcvs?rev=377340&view=rev

done

After adopting above commit for your pub, change:
<map:part
src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}&lang={page-envelope:document-language}"/>

Thanks for the feedback. :)

HTH

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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


Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

Posted by Thorsten Scherler <th...@apache.org>.
El lun, 13-02-2006 a las 08:49 +0100, Thorsten Scherler escribió:
> El dom, 12-02-2006 a las 19:52 +0100, Jörn Nettingsmeier escribió:
> > Jörn Nettingsmeier wrote:
> > > 
> > > Thorsten Scherler wrote:
> > >>
> > >> Please test the new generator and report bugs to our issue tracker and
> > >> problems to this list.
> > >> I added a small example to the default pub (tutorial.html -> eng only)
> > >> which is actually only a showcase.
> > >> salu2
> >  >
> > > i just played around with the generator. since i want to access the 
> > > metadata from my page2shtml.xsl, i added the following to my publication 
> > > sitemap:
> > > <map:match pattern="lenyabody-*/*/*/*/**">
> > >  <map:aggregate element="cmsbody">
> > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
> > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
> > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
> > >   <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
> > >   <map:part
> > >        src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}"/>
> > >   <map:part src="{resource-type:format-xhtml}"/>
> > 
> > 
> > the LenyaMetaDataGenerator barfs when i create a new document:
> > 
> > The source 
> > [context://lenya/pubs/politik/content/authoring/personen/index_en.xml.meta] 
> > does not exist!
> 
> Yeah, that is the default behavior, if you do not specify which language
> you want:
> org.apache.lenya.cms.cocoon.generation.LenyaMetaDataGenerator
> ....
>  if (this.language == null) {
>    this.language = pub.getDefaultLanguage();
>  }
> ...
> 

Well if you used the example of the default pub then we have set
lang="en"
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap?rev=365905&view=markup
...
<map:match pattern="**meta">
  <map:generate type="lenyaMetaData">
    <map:parameter name="docid" value="{request-param:docid}"/>
    <map:parameter name="lang" value="en"/>
  </map:generate>
  <map:serialize type="xml"/>
</map:match>
...
I will change it right now to 
<map:parameter name="lang" value="{page-envelope:document-language}"/>

> HTH
> 
> salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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


Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

Posted by Thorsten Scherler <th...@apache.org>.
El dom, 12-02-2006 a las 19:52 +0100, Jörn Nettingsmeier escribió:
> Jörn Nettingsmeier wrote:
> > 
> > Thorsten Scherler wrote:
> >>
> >> Please test the new generator and report bugs to our issue tracker and
> >> problems to this list.
> >> I added a small example to the default pub (tutorial.html -> eng only)
> >> which is actually only a showcase.
> >> salu2
>  >
> > i just played around with the generator. since i want to access the 
> > metadata from my page2shtml.xsl, i added the following to my publication 
> > sitemap:
> > <map:match pattern="lenyabody-*/*/*/*/**">
> >  <map:aggregate element="cmsbody">
> >   <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
> >   <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
> >   <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
> >   <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
> >   <map:part
> >        src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}"/>
> >   <map:part src="{resource-type:format-xhtml}"/>
> 
> 
> the LenyaMetaDataGenerator barfs when i create a new document:
> 
> The source 
> [context://lenya/pubs/politik/content/authoring/personen/index_en.xml.meta] 
> does not exist!

Yeah, that is the default behavior, if you do not specify which language
you want:
org.apache.lenya.cms.cocoon.generation.LenyaMetaDataGenerator
....
 if (this.language == null) {
   this.language = pub.getDefaultLanguage();
 }
...

HTH

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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


Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

Posted by so...@apache.org.
On 2/12/06, Jörn Nettingsmeier <po...@uni-duisburg.de> wrote:
> i still want to include the metadata in my pipeline. Is there some xmap
> setting that will make the pipeline continue if a generator fails?

See <map:handle-errors>
http://cocoon.apache.org/2.1/userdocs/concepts/errorhandling.html

There are examples in publication-sitemap.xmap in the default pub. 
You can only have one <map:handle-errors> per <map:pipeline>, so you
probably want to wrap your <map:match>:

<map:pipeline>
   <map:match></map:match>
   <map:match></map:match> (Optional additional matches using the same
error handling.)
   <map:handle-errors>
   </map:handle-errors>
</map:pipeline>
<map:pipeline>
 ... Another pipeline with different error handling.

solprovider

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


Re: LenyaMetaDataGenerator (was Re: svn commit: r365905)

Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Jörn Nettingsmeier wrote:
> 
> Thorsten Scherler wrote:
>>
>> Please test the new generator and report bugs to our issue tracker and
>> problems to this list.
>> I added a small example to the default pub (tutorial.html -> eng only)
>> which is actually only a showcase.
>> salu2
 >
> i just played around with the generator. since i want to access the 
> metadata from my page2shtml.xsl, i added the following to my publication 
> sitemap:
> <map:match pattern="lenyabody-*/*/*/*/**">
>  <map:aggregate element="cmsbody">
>   <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
>   <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
>   <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
>   <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
>   <map:part
>        src="cocoon:/{2}/{3}/meta?docid={page-envelope:document-id}"/>
>   <map:part src="{resource-type:format-xhtml}"/>


the LenyaMetaDataGenerator barfs when i create a new document:

The source 
[context://lenya/pubs/politik/content/authoring/personen/index_en.xml.meta] 
does not exist!
org.apache.cocoon.ProcessingException: Failed to process pipeline at 
<map:serialize type="xml"> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:150:36 
at <map:transform type="link-rewrite"> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:147:49 
at <map:transform type="i18n"> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:141:36 
at <map:transform> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:121:69 
at <map:transform> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:117:79 
at <map:serialize type="xhtml"> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:231:50 
at <map:transform> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:227:83 
at <map:transform> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:199:164 
at <map:generate> - 
file:/build/lenya_1_4_X/build/lenya/webapp/lenya/pubs/unidue/sitemap.xmap:188:171 
at <map:mount> - 
file:/build/lenya_1_4_X/build/lenya/webapp/global-sitemap.xmap:425:113 
at <map:mount> - 
file:/build/lenya_1_4_X/build/lenya/webapp/sitemap.xmap:591:106
cause: org.apache.lenya.cms.repository.RepositoryException: The source 
[context://lenya/pubs/politik/content/authoring/personen/index_en.xml.meta] 
does not exist!

(i'm not sure why it looks for the english version here, since my 
default locale is DE and i have not created a "language version" yet.)

i still want to include the metadata in my pipeline. is there some xmap 
setting that will make the pipeline continue if a generator fails?


regards,

jörn



-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-duisburg.de, Telefon: 0203/379-2736

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