You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by shahira samra <sh...@yahoo.com> on 2005/08/01 08:56:37 UTC

problem with different doctypes

hi all
 
I want to make different doctypes each with their associated xsl files for the interface but I have this problem; when I request a new page of any type, it creates it using the correct xml file but always giving it the resource type of only one of the doctypes I have and thus overriding the xsl files of the intended doctype and always using the same xsl file whatever the doctype I requested.
I don't know what I'm doing wrong, so here are the files I used (the new doctypes are shdoc and shdoc02):
 
The sample file for shdoc:
 
<?xml version="1.0" encoding="UTF-8"?>
<shdoc:html
      xmlns:shdoc="http://www.w3.org/1999/xhtml" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      xmlns:dcterms="http://purl.org/dc/terms/"
      xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
      shdoc:dummy="FIXME:keepNamespace" dc:dummy="FIXME:keepNamespace" 
      lenya:dummy="FIXME:keepNamespace" dcterms:dummy="FIXME:keepNamespace"
>
    <lenya:meta>
        <dc:title>dctitle</dc:title>
        <dc:creator>dccreator</dc:creator>
        <dc:subject>dcsubject</dc:subject>
        <dc:description>Abstract that can be used on an overview page</dc:description>
        <dc:publisher/>
        <dc:contributor/>
        <dc:date>2003-5-21</dc:date>
        <dc:type/>
        <dc:format/>
        <dc:identifier/>
        <dc:source/>
        <dc:language>en</dc:language>
        <dc:relation/>
        <dc:coverage/>
        <dc:rights>dcrights</dc:rights>
    </lenya:meta>
  <shdoc:head>
    <shdoc:title>Shahira pub Publication</shdoc:title>
  </shdoc:head>
  <shdoc:body>
    <shdoc:h1>Shahira pub Publication</shdoc:h1>
    <shdoc:p>hellloooooooooooooooooooooooooooooooooooooooooSHAHIRA</shdoc:p>
    <shdoc:p>C'est moi</shdoc:p>
    <shdoc:ul>
      <shdoc:li>CMS, CMS, CMS, CMS, CMS, CMS, CMS, CMS, CMS, CMS, CMS, </shdoc:li>
      <shdoc:li>to provide an "out of the box" publication that can be easily adapted and used, and</shdoc:li>
      <shdoc:li>to provide a basis for reference implementations of new concepts and best practices.</shdoc:li>
    </shdoc:ul>
    <shdoc:p>
    You won't find any fancy and confusing bells and whistles here, but the
    publication contains everything you need to get started.
    </shdoc:p>
  </shdoc:body>
</shdoc:html>
 
THE SCHEMA FOR shdoc
 
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: xhtml.rng 42702 2004-03-13 12:34:18Z gregor $ -->
<!--+
    | XHTML doctype
    +-->
<grammar ns="http://www.w3.org/1999/xhtml"
         xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:dcterms="http://purl.org/dc/terms/"
         xmlns:shdoc="http://www.w3.org/1999/sh"
         >
<include href="lenya.rng"/>

<!-- include original XHTML transitional schema -->
<include href="shdoc/shdoc-basic.rng">
  <define name="html">
    <element name="html">
      <ref name="html.attlist"/>
      <ref name="lenya.meta"/>
      <ref name="head"/>
      <ref name="body"/>
    </element>
  </define>
  <define name="html.attlist">
    <ref name="shdoc.version.attrib"/>
    <ref name="I18n.attrib"/>
    <ref name="dummy.attlist"/>
  </define>
</include>

<!-- additional block elements -->
<define name="Block.class" combine="choice">
  <choice>
    <ref name="lenya.asset"/>
  </choice>
</define>

</grammar>
 
THE SAMPLE FILE FOR shdoc02:
 
<?xml version="1.0" encoding="UTF-8"?>
<shdoc02:html
      xmlns:shdoc02="http://www.w3.org/1999/xhtml" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      xmlns:dcterms="http://purl.org/dc/terms/"
      xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
      shdoc02:dummy="FIXME:keepNamespace" dc:dummy="FIXME:keepNamespace" 
      lenya:dummy="FIXME:keepNamespace" dcterms:dummy="FIXME:keepNamespace"
>
    <lenya:meta>
        <dc:title>dctitle</dc:title>
        <dc:creator>dccreator</dc:creator>
        <dc:subject>dcsubject</dc:subject>
        <dc:description>Abstract that can be used on an overview page</dc:description>
        <dc:publisher/>
        <dc:contributor/>
        <dc:date>2003-5-21</dc:date>
        <dc:type/>
        <dc:format/>
        <dc:identifier/>
        <dc:source/>
        <dc:language>en</dc:language>
        <dc:relation/>
        <dc:coverage/>
        <dc:rights>dcrights</dc:rights>
    </lenya:meta>
   
  <shdoc02:head>
    <shdoc02:title>Shahira pub Publication</shdoc02:title>
  </shdoc02:head>
  <shdoc02:body>
    <shdoc02:h1>Shahira pub Publication</shdoc02:h1>
    <shdoc02:p>my second doctype</shdoc02:p>
    <shdoc02:p>C'est moi</shdoc02:p>
    <shdoc02:ul>
      <shdoc02:li>shshshshshshshshS, CMS, CMS, </shdoc02:li>
      <shdoc02:li>to provide an "out of the box" publication that can be easily adapted and used, and</shdoc02:li>
      <shdoc02:li>to provide a basis for reference implementations of new concepts and best practices.</shdoc02:li>
    </shdoc02:ul>
    <shdoc02:p>
    You won't find any fancy and confusing bells and whistles here, but the
    publication contains everything you need to get started.
    </shdoc02:p>
  </shdoc02:body>
</shdoc02:html>
 
THE SCHEMA FOR shdoc02
 
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: xhtml.rng 42702 2004-03-13 12:34:18Z gregor $ -->
<!--+
    | XHTML doctype
    +-->
<grammar ns="http://www.w3.org/1999/xhtml"
         xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:dcterms="http://purl.org/dc/terms/"
         xmlns:shdoc02="http://www.w3.org/1999/xhtml"
         >
<include href="lenya.rng"/>

<!-- include original XHTML transitional schema -->
<include href="shdoc02/shdoc02-basic.rng">
  <define name="html">
    <element name="html">
      <ref name="html.attlist"/>
      <ref name="lenya.meta"/>
      <ref name="head"/>
      <ref name="body"/>
    </element>
  </define>
  <define name="html.attlist">
    <ref name="shdoc02.version.attrib"/>
    <ref name="I18n.attrib"/>
    <ref name="dummy.attlist"/>
  </define>
</include>

<!-- additional block elements -->
<define name="Block.class" combine="choice">
  <choice>
    <ref name="lenya.asset"/>
  </choice>
</define>

</grammar>

THE doctype.xconf FILE
 
<?xml version="1.0"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: doctypes.xconf 106148 2004-11-22 03:29:33Z gregor $ -->
<doctypes>
<!-- shahira  -->
<doc type="shdoc">
    <children>
      <doc type="shdoc"/>
      <doc type="xhtml"/>  
      <doc type="shdoc02"/>    
    </children>
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
      <sample-name>shdoc.xml</sample-name>
    </creator>
    <tasks>
      <task id="publish"/>
    </tasks>
    <workflow src="workflow.xml"/>
  </doc>
<doc type="shdoc02">
    <children>
      <doc type="shdoc02"/>
      <doc type="xhtml"/>      
    </children>
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
      <sample-name>shdoc02.xml</sample-name>
    </creator>
    <tasks>
      <task id="publish"/>
    </tasks>
    <workflow src="workflow.xml"/>
  </doc>
  <doc type="homepage">
    <children>
      <doc type="xhtml"/>
      <doc type="shdoc"/>
      <doc type="shdoc02"/>    
    </children>
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
      <sample-name>homepage.xml</sample-name>
    </creator>
    <tasks>
      <task id="publish"/>
    </tasks>
    <workflow src="workflow.xml"/>
  </doc>
  <doc type="links">
    <children>
      <doc type="xhtml"/>
    </children>
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
      <sample-name>links.xml</sample-name>
    </creator>
    <tasks>
      <task id="publish"/>
    </tasks>
    <workflow src="workflow.xml"/>
  </doc>
  <doc type="xhtml">
    <children>
      <doc type="xhtml"/>
      <doc type="shdoc"/>
      <doc type="shdoc02"/>    
    </children>
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
      <sample-name>xhtml.xml</sample-name>
    </creator>
    <tasks>
      <task id="publish"/>
    </tasks>
    <workflow src="workflow.xml"/>
  </doc>
</doctypes>

THE parameter-doctype.xmap FILE
 
<?xml version="1.0"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: parameter-doctype.xmap 106151 2004-11-22 03:45:37Z gregor $ -->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:actions>
      <map:action logger="sitemap.action.sourcetype" name="sourcetype" src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
 <!-- shahira --> 
       
        <sourcetype name="shdoc">
          <document-element local-name="shdoc"
                            namespace="http://www.w3.org/1999/xhtml"
                            schema-location="shdoc.rng"/>                                     
   <w3c-xml-schema target="shdoc.rng"/>   
        </sourcetype>
 <sourcetype name="shdoc02">
          <document-element local-name="shdoc02"
                            namespace="http://www.w3.org/1999/xhtml"
                            schema-location="shdoc02.rng"/>                                     
        </sourcetype>
        <sourcetype name="xhtml">
          <document-element local-name="xhml"
                            namespace="http://www.w3.org/1999/xhtml"
                            schema-location="xhtml.rng"/>                                     
        </sourcetype>
        <sourcetype name="links">
          <document-element namespace="http://apache.org/lenya/pubs/default/1.0"/>
        </sourcetype>
      </map:action>
    </map:actions>
  </map:components>
  <map:views/>
  <map:resources/>
  <map:pipelines>
    <map:pipeline>
      <!-- {area}/index.html -->
      <map:match pattern="*/index*.html">
        <map:generate type="serverpages" src="../../config/parameters/default.xsp">
          <map:parameter name="value" value="homepage"/>
        </map:generate>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>
    <map:pipeline>
      <!-- {area}/{uri} -->
      <map:match pattern="*/**.html">
 <map:act type="sourcetype" src="content/{1}/{page-envelope:document-path}">
   <map:generate type="serverpages" src="../../config/parameters/default.xsp">
     <map:parameter name="value" value="{sourcetype}"/>
   </map:generate>
   <map:serialize type="xml"/>
 </map:act>
      </map:match>
    </map:pipeline>
    
    <map:pipeline>
      <!-- {area}/{uri} -->
      <map:match pattern="*/**.xml">
 <map:act type="sourcetype" src="content/{1}/{2}.xml">
   <map:generate type="serverpages" src="../../config/parameters/default.xsp">
     <map:parameter name="value" value="{sourcetype}"/>
   </map:generate>
   <map:serialize type="xml"/>
 </map:act>
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>

 
THE generic.xsp FILE
 
<?xml version="1.0"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: generic.xsp 170900 2005-05-19 09:58:37Z thorsten $ -->
<xsp:page
    language="java"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
>
  <xsp:structure>
    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
    <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
  </xsp:structure>
  <menu>
    <xsp:logic>
      String projectid = parameters.getParameter("projectid","null");
      String xmlSource = <input:get-attribute module="page-envelope" as="string" name="document-path"/>;
      String documentId = <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/authoring" + <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "_" + <input:get-attribute module="page-envelope" as="string" name="document-language"/>;
      String urisParameter = "uris=" + <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/live" + <input:get-attribute module="page-envelope" as="string" name="document-url"/>;
      String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
      String docType = "";
      try {
      Document document = (Document) <input:get-attribute as="object" module="page-envelope" name="document"/>;
          if (document.exists()) {
              docType = <input:get-attribute as="string" module="page-envelope" name="document-type"/>;
          }
      }
      catch (Exception e) {
          throw new ProcessingException(e);
      }
      boolean isDocument = false;
      {
        Object document = <input:get-attribute module="page-envelope" as="object" name="document"/>;
        try {
          if (document != "" &amp;&amp; ((Document) document).exists()) {
            isDocument = true;
          }
        }
        catch (Exception e) {
          throw new ProcessingException(e);
        }
      }
    </xsp:logic>
    <menus>
      <menu i18n:attr="name" name="File" label="File">
 <block>
   <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=xhtml"><i18n:text>New Document</i18n:text></item>
 <!-- shahira -->
   <item uc:usecase="create" uc:step="showscreen" href="?doctype=shdoc"><i18n:text>my sh Document</i18n:text></item>
   <item uc:usecase="create" uc:step="showscreen" href="?doctype=shdoc02"><i18n:text>my sh Document02</i18n:text></item>
   
        }
     }
   </xsp:logic>
 </block>
 <block>
   <xsp:logic>
     {
       if (isDocument
            &amp;&amp; Publication.AUTHORING_AREA.equals(area)
           ) {
          <xsp:content>
            <item uc:usecase="create-language" uc:step="showscreen" href="?"><i18n:text>New Language Version</i18n:text></item>
          </xsp:content>
       }
       else {
          <xsp:content>
            <item><i18n:text>New Language Version</i18n:text></item>
          </xsp:content>
       }
       String[] availableLanguages = (String[])<input:get-attribute module="page-envelope" as="object" name="document-languages"/>;
       if (isDocument
            &amp;&amp; Publication.AUTHORING_AREA.equals(area)
           &amp;&amp; availableLanguages.length &gt; 1
           ) {
         <xsp:content>
           <item uc:usecase="removelabel" uc:step="showscreen" href="?"><i18n:text>Remove Language Version</i18n:text></item>
         </xsp:content>
       } else {
         <xsp:content>
           <item><i18n:text>Remove Language Version</i18n:text></item>
         </xsp:content>
       }
     }
   </xsp:logic>
 </block>
 <block>
   <item uc:usecase="logout" href="?"><i18n:text>Logout</i18n:text></item>
 </block>
      </menu>
      <menu i18n:attr="name" name="Edit" label="Search">
        <block info="false">
          <item wf:event="edit" uc:usecase="kupu" uc:step="open" href="?"><i18n:text>Edit with Kupu</i18n:text></item>
          <item wf:event="edit" uc:usecase="bxeng" uc:step="open" href="?"><i18n:text>Edit with BXE</i18n:text></item>
          <item wf:event="edit" uc:usecase="edit" uc:step="open"><xsp:attribute name="href"><xsp:expr>"?form=" + docType</xsp:expr></xsp:attribute><i18n:text>Edit with Forms</i18n:text></item>
          <item wf:event="edit" uc:usecase="1formedit" uc:step="open" href="?"><i18n:text>Edit with one Form</i18n:text></item>
        </block>
        <block info="false">
          <item wf:event="edit" uc:usecase="info-meta" uc:step="showscreen"><xsp:attribute name="href"><xsp-request:get-context-path/>/<input:get-attribute module="page-envelope" as="string" name="publication-id"/>/info-<input:get-attribute module="page-envelope" as="string" name="area"/><input:get-attribute module="page-envelope" as="string" name="document-url"/>?</xsp:attribute><i18n:text>Edit Metadata</i18n:text></item>
          <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen"><xsp:attribute name="href"><xsp-request:get-uri/>?</xsp:attribute><i18n:text>Edit Navigation Title</i18n:text></item>
        </block>
        <block authoring="false">
        <xsp:logic>
        {
          String docId = <input:get-attribute module="page-envelope" as="string" name="document-id"/>;
          if (isDocument
              &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
              &amp;&amp; !"/index".equals(docId)) {
            <item uc:usecase="cut" uc:step="showscreen" href="?"><i18n:text>Cut</i18n:text></item>
          }
          else {
            <item><i18n:text>Cut</i18n:text></item>
          }
          if (isDocument
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
              &amp;&amp; !"/index".equals(docId)) {
            <item uc:usecase="copy" uc:step="showscreen" href="?"><i18n:text>Copy</i18n:text></item>
          }
          else {
            <item><i18n:text>Copy</i18n:text></item>
          }
         String clipboard = (String) <input:get-attribute module="session-attr" as="object" name="org.apache.lenya.cms.info.firstdocid"/> + "/";
         String currentDocumentId = <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "/";
         if (clipboard != null
             &amp;&amp; !"".equals(clipboard)
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
              &amp;&amp; !currentDocumentId.startsWith(clipboard)
              &amp;&amp; !"/index".equals(docId)) {
          <item uc:usecase="paste" uc:step="showscreen" href="?"><i18n:text>Paste</i18n:text></item>
         }
         else {
          <item><i18n:text>Paste</i18n:text></item>
         }
        }
        </xsp:logic>
      </block>
      <block authoring="false">
        <xsp:logic>
          if (isDocument &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)) {
            <item uc:usecase="rename" uc:step="showscreen" href="?"><i18n:text>Rename URL</i18n:text></item>
          }
          else {
            <item>Rename URL</item>
          }
          if (isDocument) {
            <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen" href="?"><i18n:text>Edit Navigation Title</i18n:text></item>
          }
          else {
            <item>Edit Navigation Title</item>
          }
          if (isDocument) {
            <item wf:event="edit" uc:usecase="change-visibility" uc:step="showscreen" href="?"><i18n:text>Change node visibility</i18n:text></item>
          }
          else {
            <item>Change node visibility</item>
          }
        </xsp:logic>
      </block>
      <block authoring="false">
        <xsp:logic>
          if (isDocument
              &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
              &amp;&amp; !"/index".equals(<input:get-attribute module="sitetree" as="string" name="document-id"/>)) {
            <item uc:usecase="move-node" uc:step="move-node"><xsp:attribute name="href"><xsp-request:get-uri/>?properties.movenode.direction=up</xsp:attribute><i18n:text>Move Up</i18n:text></item>
            <item uc:usecase="move-node" uc:step="move-node"><xsp:attribute name="href"><xsp-request:get-uri/>?properties.movenode.direction=down</xsp:attribute><i18n:text>Move Down</i18n:text></item>
          }
          else {
            <item><i18n:text>Move Up</i18n:text></item>
            <item><i18n:text>Move Down</i18n:text></item>
          }
        </xsp:logic>
      </block>
      <block authoring="false">
        <xsp:logic>
        {
          if (isDocument &amp;&amp;
            !"/index".equals(<input:get-attribute module="page-envelope" as="string" name="document-id"/>)) {
            <item wf:event="delete" uc:usecase="delete" uc:step="showscreen" href="?"><i18n:text>Delete</i18n:text></item>
            <item wf:event="archive" uc:usecase="archive" uc:step="showscreen" href="?"><i18n:text>Archive</i18n:text></item>
          }
          else {
            <item><i18n:text>Delete</i18n:text></item>
            <item><i18n:text>Archive</i18n:text></item>
          }
         if (isDocument &amp;&amp; (area.equals(Publication.TRASH_AREA) || area.equals(Publication.ARCHIVE_AREA))) {
            <item wf:event="restore" uc:usecase="restore" uc:step="showscreen" href="?">Restore</item>
         }
         else {
            <item><i18n:text>Restore</i18n:text></item>
         }
       }
        </xsp:logic>
      </block>
      </menu>
      <menu i18n:attr="name" name="Workflow" label="Help">
   <xsp:logic>
      {
        if (isDocument &amp;&amp; Publication.AUTHORING_AREA.equals(area)) {
 <block>
          <item uc:usecase="submit" uc:step="showscreen" wf:event="submit" href="?"><i18n:text>Submit</i18n:text></item>
          <item uc:usecase="reject" uc:step="showscreen" wf:event="reject" href="?"><i18n:text>Reject</i18n:text></item>
          <item uc:usecase="publish" uc:step="showscreen" wf:event="publish"><xsp:attribute name="href">?<xsp:expr>urisParameter</xsp:expr>&amp;sources=<xsp:expr>xmlSource</xsp:expr>&amp;task-id=publish</xsp:attribute><i18n:text>Publish</i18n:text></item>
          <item uc:usecase="deactivate" uc:step="showscreen" wf:event="deactivate" href="?task-id=deactivateDocument"><i18n:text>Deactivate</i18n:text></item>
       </block><block>
          <item uc:usecase="schedule" uc:step="showscreen" href="?"><i18n:text>Schedule</i18n:text></item>
 </block>
        }
        else {
 <block>
          <item><i18n:text>Submit</i18n:text></item>
          <item><i18n:text>Reject</i18n:text></item>
          <item><i18n:text>Publish</i18n:text></item>
          <item><i18n:text>Deactivate</i18n:text></item>
       </block><block>
          <item><i18n:text>Schedule</i18n:text></item>
 </block>
        }
      }
   </xsp:logic>
      </menu>
      <menu i18n:attr="name" name="Help" label="Debug">
        <block>
            <item href="Documentationhttp://lenya.apache.org/1_2_x/index.html"><i18n:text>Documentation</i18n:text></item>
            <item href="Wikihttp://wiki.apache.org/lenya/"><i18n:text>Wiki</i18n:text></item>
        </block>
        <block>
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/index.html</xsp:attribute><i18n:text>Apache Lenya Homepage</i18n:text></item>
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/about.html</xsp:attribute><i18n:text>About Apache Lenya</i18n:text></item>
        </block>
        <block>
          <item uc:usecase="view-logs" uc:step="overview" href="?"><i18n:text>View Task Logs</i18n:text></item>
       </block>
      </menu>
    </menus>
  </menu>
</xsp:page>

 
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: problem with different doctypes

Posted by shahira samra <sh...@yahoo.com>.
yes, you were right.
now the doctypes are working correctly.
 
thanks alot

Edith Chevrier <ed...@wyona.com> wrote:
shahira samra wrote:

> hi all
> 
> I want to make different doctypes each with their associated xsl files 
> for the interface but I have this problem; when I request a new page 
> of any type, it creates it using the correct xml file but always 
> giving it the resource type of only one of the doctypes I have 
> and thus overriding the xsl files of the intended doctype and always 
> using the same xsl file whatever the doctype I requested.
> I don't know what I'm doing wrong, so here are the files I used (the 
> new doctypes are shdoc and shdoc02):
> 

The root tags of your xml file don't correspond to the doctypes' 
identification in your parameter-doctype.xmap.
You mix up the namespace and the local name of the element.

Edith

-- 
Edith Chevrier
Wyona Inc. - Open Source Content Management - Apache Lenya
http://wyona.com http://lenya.apache.org
edith.chevrier@wyona.com edith@apache.org




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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: problem with different doctypes

Posted by Edith Chevrier <ed...@wyona.com>.
shahira samra wrote:

> hi all
>  
> I want to make different doctypes each with their associated xsl files 
> for the interface but I have this problem; when I request a new page 
> of any type, it creates it using the correct xml file but always 
> giving it the resource type of only one of the doctypes I have 
> and thus overriding the xsl files of the intended doctype and always 
> using the same xsl file whatever the doctype I requested.
> I don't know what I'm doing wrong, so here are the files I used (the 
> new doctypes are shdoc and shdoc02):
>  

The root tags of your xml file don't correspond to the doctypes' 
identification in your parameter-doctype.xmap.
You mix up the namespace and the local name of the element.

Edith

-- 
Edith Chevrier
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                          http://lenya.apache.org
edith.chevrier@wyona.com                         edith@apache.org




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