You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Markus Vaterlaus <mv...@mus.ch> on 2004/03/19 07:41:23 UTC

Adding a custom doctype

Hi list,

yesterday I tried to add a new doctype to the lenya default 
publication. It's a very simple doctype. However, I took 
<http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType> as a 
guideline and failed with "configure the menus (either 1. or 2.)". I 
can't figure out how to enhance the existing menu with the possibility 
to create a new document based on my new doctype. Any hints?

Thanks in advance

--mv


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


Re: Adding a custom doctype

Posted by Markus Vaterlaus <mv...@mus.ch>.
Hi all,

got a step further with adding a new doctype. My sample file get's  
copied in the authoring area... However, I got stuck again :-(

Seems like I forgot something somewhere.

> An Error Occurred org.apache.cocoon.sitemap.PatternException Cannot  
> get variable 'document-type' in expression  
> 'cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope: 
> area}/{page-envelope:document-type}{page-envelope:document-url}'  
> org.apache.cocoon.sitemap.PatternException: Cannot get variable  
> 'document-type' in expression  
> 'cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope: 
> area}/{page-envelope:document-type}{page-envelope:document-url}'  
> org.apache.lenya.cms.cocoon.uriparameterizer.URIParameterizerException: 
>  org.apache.cocoon.ResourceNotFoundException: No pipeline matched  
> request: uri-parameter/default/doctype/authoring/6667.html Original  
> Exception:  
> org.apache.avalon.framework.configuration.ConfigurationException:  
> Getting attribute for name [document-type] failed: at  
> org.apache.lenya.cms.cocoon.components.modules.input.PageEnvelopeModule 
> .getAttribute(PageEnvelopeModule.java:172) at  
> org.apache.cocoon.components.treeprocessor.variables.PreparedVariableRe 
> solver.resolve(PreparedVariableResolver.java:317) at <snip/>

I defined the doctype simple in config/doctypes/doctypes.xconf
Created a relax NG schema: config/doctypes/schemas/simple.rng
Added a doctype matcher in parameter-doctype.xmap
Added a sample file: config/doctypes/samples/simple.xml
Created a XSLT: xslt/simple2xhtml.xsl
Added a menu entry in config/generic.xsp

Confused and tiered... Maybe a cap of sleep will help

Cheers

--mv


>> yesterday I tried to add a new doctype to the lenya default  
>> publication. It's a very simple doctype. However, I took  
>> <http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType> as  
>> a guideline and failed with "configure the menus (either 1. or 2.)".  
>> I can't figure out how to enhance the existing menu with the  
>> possibility to create a new document based on my new doctype. Any  
>> hints?
>
> add
>
> <xsp:logic>
> {if (Publication.ARCHIVE_AREA.equals(area) ||  
> Publication.TRASH_AREA.equals(area)) {
>
> <item><i18n:text>New Document</i18n:text></item>
> } else {
>
> <item uc:usecase="create" uc:step="showscreen"  
> href="?doctype=yourdoctype"><i18n:text>New Document</i18n:text></item>
> }
> }
> </xsp:logic>
>
> at the appropriate place
>
> can you update the wiki with your experiences?
>
>
>
> -- 
> Gregor J. Rothfuss
> Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
> http://wyona.com                   http://cocoon.apache.org/lenya
> gregor.rothfuss@wyona.com                       gregor@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
>


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


Re: Adding a custom doctype

Posted by Markus Vaterlaus <mv...@mus.ch>.
Hi Gregor, hi list,

thanks for the response. I will have a look at this problem on monday. 
And, yes, if I succeed, I'll update the wiki. :-)

Happy weekend!

--mv


Am 19.03.2004 um 14:29 schrieb Gregor J. Rothfuss:

> Markus Vaterlaus wrote:
>
>> yesterday I tried to add a new doctype to the lenya default 
>> publication. It's a very simple doctype. However, I took 
>> <http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType> as 
>> a guideline and failed with "configure the menus (either 1. or 2.)". 
>> I can't figure out how to enhance the existing menu with the 
>> possibility to create a new document based on my new doctype. Any 
>> hints?
>
> add
>
> <xsp:logic>
> {if (Publication.ARCHIVE_AREA.equals(area) || 
> Publication.TRASH_AREA.equals(area)) {
>
> <item><i18n:text>New Document</i18n:text></item>
> } else {
>
> <item uc:usecase="create" uc:step="showscreen" 
> href="?doctype=yourdoctype"><i18n:text>New Document</i18n:text></item>
> }
> }
> </xsp:logic>
>
> at the appropriate place
>
> can you update the wiki with your experiences?
>
>
>
> -- 
> Gregor J. Rothfuss
> Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
> http://wyona.com                   http://cocoon.apache.org/lenya
> gregor.rothfuss@wyona.com                       gregor@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
>


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


Re: How to set character set encoding

Posted by Michael Wechner <mi...@wyona.com>.
Jean Pierre LeJacq wrote:

>I'm trying to set the character encoding for serialized document to
>UTF-8 and seem unable to do so.  It always reverts to ISO-8859-1.
> I'm using tomcat-4.1.29, cocoon-2.1.4, and a recent cvs version of
>lenya.
>
>I've done the following:
>
>* Set the encoding element on the xhtml serializer to utf-8 in the
>  sitemap.xmap file.
>  
>

the serializer might be taken from another sitemap:


michi@neptun:~/src/cocoon-lenya$ find src/webapp -name "*.xmap" -exec 
grep -l "iso-8859-1" {} \;
src/webapp/sitemap.xmap
src/webapp/lenya/pubs/blog/sitemap.xmap
src/webapp/lenya/pubs/default/usecase-bxeng.xmap
src/webapp/lenya/pubs/oscom/xopus.xmap
src/webapp/lenya/admin.xmap
src/webapp/lenya/info.xmap
src/webapp/lenya/lucene.xmap
src/webapp/lenya/usecase.xmap


HTH

Michi


>* Set the init-params, container-encoding and form-encoding, in
>  WEB-INF/web.xml to utf-8.
>
>* Explicitly added <meta content="text/html; charset=UTF-8"
>  http-equiv="Content-Type">.
>
>Using a sniffer I see that the server is setting the Content-Type to
>ISO-8859-1.
>
>Anyone else having this problem?  Any solutions?
>
>  
>


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


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


Re: How to set character set encoding

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jean Pierre LeJacq wrote:

> I'm trying to set the character encoding for serialized document to
> UTF-8 and seem unable to do so.  It always reverts to ISO-8859-1.
>  I'm using tomcat-4.1.29, cocoon-2.1.4, and a recent cvs version of
> lenya.
> 
> I've done the following:
> 
> * Set the encoding element on the xhtml serializer to utf-8 in the
>   sitemap.xmap file.
> 
> * Set the init-params, container-encoding and form-encoding, in
>   WEB-INF/web.xml to utf-8.
> 
> * Explicitly added <meta content="text/html; charset=UTF-8"
>   http-equiv="Content-Type">.

cocoon has a bug with serialization:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26997




-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


How to set character set encoding

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
I'm trying to set the character encoding for serialized document to
UTF-8 and seem unable to do so.  It always reverts to ISO-8859-1.
 I'm using tomcat-4.1.29, cocoon-2.1.4, and a recent cvs version of
lenya.

I've done the following:

* Set the encoding element on the xhtml serializer to utf-8 in the
  sitemap.xmap file.

* Set the init-params, container-encoding and form-encoding, in
  WEB-INF/web.xml to utf-8.

* Explicitly added <meta content="text/html; charset=UTF-8"
  http-equiv="Content-Type">.

Using a sniffer I see that the server is setting the Content-Type to
ISO-8859-1.

Anyone else having this problem?  Any solutions?

-- 
JP



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


Re: Adding a custom doctype

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Markus Vaterlaus wrote:

> yesterday I tried to add a new doctype to the lenya default publication. 
> It's a very simple doctype. However, I took 
> <http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType> as a 
> guideline and failed with "configure the menus (either 1. or 2.)". I 
> can't figure out how to enhance the existing menu with the possibility 
> to create a new document based on my new doctype. Any hints?

add

<xsp:logic>
{if (Publication.ARCHIVE_AREA.equals(area) || 
Publication.TRASH_AREA.equals(area)) {

<item><i18n:text>New Document</i18n:text></item>
} else {

<item uc:usecase="create" uc:step="showscreen" 
href="?doctype=yourdoctype"><i18n:text>New Document</i18n:text></item>
}
}
</xsp:logic>

at the appropriate place

can you update the wiki with your experiences?



-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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