You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Christian Egli <ch...@wyona.com> on 2003/09/05 10:51:01 UTC
Re: cvs commit: cocoon-lenya/src/webapp/lenya/content/info overview.xsp meta.xsp
Hi Andreas
Just the other day I was trying to solve the same problem (calculate
an URL in an xsp based on publication-id, area, document-id and
language). I wrote a helper class which you could use in your xsp as
well. Have a look at
org.apache.lenya.cms.publication.xsp.DocumentLanguagesHelper#getUrl
and its usage in
src/webapp/lenya/content/exception/missing-language.xsp.
andreas@apache.org writes:
> Modified: src/webapp/lenya/content/info overview.xsp meta.xsp
> Log:
> implemented missing language handling
>
> Revision Changes Path
> 1.7 +62 -35 cocoon-lenya/src/webapp/lenya/content/info/overview.xsp
>
> + String[] documentLanguages = (String[]) doc.getLanguages();
> + for (int i = 0; i < documentLanguages.length; i++) {
> +
> + DefaultDocumentBuilder builder = DefaultDocumentBuilder.getInstance();
> + String url = builder.buildCanonicalUrl(
> + doc.getPublication(),
> + doc.getArea(),
> + doc.getId(),
> + documentLanguages[i]
> + );
> + Document languageDocument = builder.buildDocument(doc.getPublication(), url);
--
Christian Egli christian.egli@wyona.com +41 1 272 9161
Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS http://www.wyona.org http://www.wyona.com
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org
Re: cvs commit: cocoon-lenya/src/webapp/lenya/content/info overview.xsp
meta.xsp
Posted by Andreas Hartmann <an...@apache.org>.
Christian Egli wrote:
> Hi Andreas
>
> Just the other day I was trying to solve the same problem (calculate
> an URL in an xsp based on publication-id, area, document-id and
> language). I wrote a helper class which you could use in your xsp as
> well. Have a look at
> org.apache.lenya.cms.publication.xsp.DocumentLanguagesHelper#getUrl
> and its usage in
> src/webapp/lenya/content/exception/missing-language.xsp.
Thanks! I've added another method to the class and use it
in overview.xsp.
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org