logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

svn commit: r202183 - in /lenya/trunk/src/webapp/lenya: doctypes/ pubs/blog: msg#00274

Subject: svn commit: r202183 - in /lenya/trunk/src/webapp/lenya: doctypes/ pubs/blog/java/src/org/apache/lenya/cms/site/usecases/ pubs/default/ pubs/default/config/ pubs/default/config/menus/ pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav...
Author: andreas
Date: Tue Jun 28 06:54:26 2005
New Revision: 202183

URL: http://svn.apache.org/viewcvs?rev=202183&view=rev
Log:
Introducing publet infrastructure

Added:
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/homepage.xsp
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/publet.xconf
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/menus.xmap
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/homepage.xml
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/sitemap.xmap
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/
    
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/homepage2xhtml.xsl
    lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl
    lenya/trunk/src/webapp/lenya/xslt/publets/
    lenya/trunk/src/webapp/lenya/xslt/publets/publets2xinclude.xsl
Removed:
    lenya/trunk/src/webapp/lenya/doctypes/
    lenya/trunk/src/webapp/lenya/pubs/default/config/menus/links.xsp
    lenya/trunk/src/webapp/lenya/pubs/default/doctypes.xmap
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/doctypes/
    lenya/trunk/src/webapp/lenya/pubs/default/xslt/homepage2xhtml.xsl
    lenya/trunk/src/webapp/lenya/pubs/default/xslt/links2xhtml.xsl
    lenya/trunk/src/webapp/lenya/pubs/default/xslt/xhtml2xhtml.xsl
Modified:
    
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
    lenya/trunk/src/webapp/lenya/pubs/default/config/menus/generic.xsp
    lenya/trunk/src/webapp/lenya/pubs/default/config/publication.xconf
    
lenya/trunk/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav/Put.java
    lenya/trunk/src/webapp/lenya/pubs/default/menus.xmap
    lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap

Modified: 
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
 (original)
+++ 
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
 Tue Jun 28 06:54:26 2005
@@ -22,6 +22,7 @@
 import java.util.Map;
 import java.util.HashMap;
 
+import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
@@ -33,8 +34,7 @@
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.DocumentManager;
-import org.apache.lenya.cms.publication.DocumentType;
-import org.apache.lenya.cms.publication.DocumentTypeBuilder;
+import org.apache.lenya.cms.publication.ResourceType;
 import org.apache.lenya.cms.usecase.DocumentUsecase;
 
 /**
@@ -97,13 +97,11 @@
         // document id (full path) and document id-name (this leaf's id)
         // are the same
         DocumentManager documentManager = null;
-        DocumentTypeBuilder documentTypeBuilder = null;
+        ServiceSelector selector = null;
+        ResourceType resourceType = null;
         try {
-            documentTypeBuilder = (DocumentTypeBuilder) this.manager
-                    .lookup(DocumentTypeBuilder.ROLE);
-
-            DocumentType documentType = documentTypeBuilder
-                    .buildDocumentType(getDocumentTypeName(), 
getSourceDocument().getPublication());
+            selector = (ServiceSelector) this.manager.lookup(ResourceType.ROLE 
+ "Selector");
+            resourceType = (ResourceType) 
selector.select(getDocumentTypeName());
 
             documentManager = (DocumentManager) 
this.manager.lookup(DocumentManager.ROLE);
 
@@ -114,15 +112,18 @@
                     .getArea(), documentId, language);
 
             documentManager.add(document,
-                    documentType,
+                    resourceType,
                     getParameterAsString(DublinCore.ELEMENT_TITLE),
                     allParameters);
         } finally {
             if (documentManager != null) {
                 this.manager.release(documentManager);
             }
-            if (documentTypeBuilder != null) {
-                this.manager.release(documentTypeBuilder);
+            if (selector != null) {
+                if (resourceType != null) {
+                    selector.release(resourceType);
+                }
+                this.manager.release(selector);
             }
         }
     }

Modified: lenya/trunk/src/webapp/lenya/pubs/default/config/menus/generic.xsp
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/config/menus/generic.xsp?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/config/menus/generic.xsp 
(original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/config/menus/generic.xsp Tue Jun 
28 06:54:26 2005
@@ -46,11 +46,9 @@
       }
 
       boolean isDocument = false;
-      String docType = "";
       try {
           if (document != null && document.exists()) {
               isDocument = true;
-              docType = <input:get-attribute as="string" 
module="page-envelope" name="document-type"/>;
           }
       }
       catch (Exception e) {
@@ -61,10 +59,6 @@
     <menus>
       <menu i18n:attr="name" name="File">
         <block>
-          <item uc:usecase="site.create" 
href="?doctype=xhtml"><i18n:text>XHTML Document</i18n:text></item>
-          <item uc:usecase="site.create" 
href="?doctype=links"><i18n:text>Links Document</i18n:text></item>
-        </block>
-        <block>
           <item uc:usecase="site.createLanguage" href="?"><i18n:text>New 
Language Version</i18n:text></item>
           <item uc:usecase="site.deleteLanguage" href="?"><i18n:text>Remove 
Language Version</i18n:text></item>
         </block>
@@ -74,13 +68,6 @@
       </menu>
       
       <menu i18n:attr="name" name="Edit">
-        
-        <block info="false">
-          <item wf:event="edit" uc:usecase="kupu" uc:step="open" 
href="?"><i18n:text>With Kupu</i18n:text></item>
-          <item wf:event="edit" uc:usecase="edit.bxe" href="?"><i18n:text>With 
BXE</i18n:text></item>
-          <item wf:event="edit" uc:usecase="edit.forms"><xsp:attribute 
name="href"><xsp:expr>"?form=" + 
docType</xsp:expr></xsp:attribute><i18n:text>With Forms</i18n:text></item>
-          <item wf:event="edit" uc:usecase="edit.oneform" 
href="?"><i18n:text>With one Form</i18n:text></item>
-        </block>
         
         <block info="false">
           <item wf:event="edit" uc:usecase="tab.meta"><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>

Modified: lenya/trunk/src/webapp/lenya/pubs/default/config/publication.xconf
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/config/publication.xconf?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/config/publication.xconf 
(original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/config/publication.xconf Tue Jun 
28 06:54:26 2005
@@ -32,6 +32,10 @@
   <resource-type name="homepage" workflow="workflow.xml"/>
   <resource-type name="links" workflow="workflow.xml"/>
   
+  <publet name="xhtml"/>
+  <publet name="links"/>
+  <publet name="homepage"/>
+  
   <!--
        For information about these settings, read 
        http://lenya.apache.org/docs/1_2_x/components/deployment/proxying.html

Modified: 
lenya/trunk/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav/Put.java
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav/Put.java?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav/Put.java
 (original)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/usecases/webdav/Put.java
 Tue Jun 28 06:54:26 2005
@@ -22,6 +22,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.cms.cocoon.source.SourceUtil;
 import org.apache.lenya.cms.metadata.dublincore.DublinCore;
@@ -30,19 +31,16 @@
 import org.apache.lenya.cms.publication.DocumentIdToPathMapper;
 import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.DocumentManager;
-import org.apache.lenya.cms.publication.DocumentTypeBuilder;
+import org.apache.lenya.cms.publication.ResourceType;
 import org.apache.lenya.cms.publication.util.DocumentSet;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.publication.PublicationException;
 import org.apache.lenya.cms.publication.PublicationFactory;
-import org.apache.lenya.cms.site.SiteException;
-import org.apache.lenya.cms.site.SiteStructure;
 import org.apache.lenya.cms.site.SiteUtil;
 import org.apache.lenya.cms.usecase.DocumentUsecase;
 import org.apache.lenya.cms.usecase.UsecaseException;
 import org.apache.lenya.transaction.Transactionable;
 import org.apache.lenya.workflow.WorkflowManager;
-import org.apache.lenya.cms.publication.DocumentType;
 import org.apache.excalibur.source.Source;
 import org.xml.sax.InputSource;
 import org.apache.lenya.xml.RelaxNG;
@@ -53,7 +51,7 @@
  * @version $Id$
  */
 public class Put extends DocumentUsecase {
-       
+
     /**
      * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
      */
@@ -61,37 +59,31 @@
         super.doExecute();
         SourceResolver resolver = null;
         WorkflowManager wfManager = null;
- 
+
         try {
             resolver = (SourceResolver) 
this.manager.lookup(SourceResolver.ROLE);
 
             Document doc = getSourceDocument();
-            //sanity check
+            // sanity check
             if (doc == null)
                 throw new IllegalArgumentException("illegal usage, source 
document may not be null");
 
             if (!doc.exists()) {
                 DocumentManager documentManager = null;
-                DocumentTypeBuilder documentTypeBuilder = null;
+                ServiceSelector selector = null;
+                ResourceType resourceType = null;
                 try {
-
-                    documentTypeBuilder = (DocumentTypeBuilder) this.manager
-                            .lookup(DocumentTypeBuilder.ROLE);
+                    selector = (ServiceSelector) 
this.manager.lookup(ResourceType.ROLE + "Selector");
 
                     documentManager = (DocumentManager) 
this.manager.lookup(DocumentManager.ROLE);
-     
-                    DocumentIdentityMap map = (DocumentIdentityMap) 
getUnitOfWork().getIdentityMap();
-                    Document document = map.get(getPublication(),
-                            doc.getArea(),
-                            doc.getId(),
-                            doc.getLanguage());
-                    
-                    DocumentType documentType = documentTypeBuilder
-                            .buildDocumentType("xhtml", getPublication());
-                    documentManager.add(document,
-                            documentType,
-                            doc.getName(),
-                            null);
+
+                    DocumentIdentityMap map = (DocumentIdentityMap) 
getUnitOfWork()
+                            .getIdentityMap();
+                    Document document = map.get(getPublication(), 
doc.getArea(), doc.getId(), doc
+                            .getLanguage());
+
+                    resourceType = (ResourceType) selector.select("xhtml");
+                    documentManager.add(document, resourceType, doc.getName(), 
null);
 
                     setMetaData(document);
                     doc = document;
@@ -99,8 +91,11 @@
                     if (documentManager != null) {
                         this.manager.release(documentManager);
                     }
-                    if (documentTypeBuilder != null) {
-                        this.manager.release(documentTypeBuilder);
+                    if (selector != null) {
+                        if (resourceType != null) {
+                            selector.release(resourceType);
+                        }
+                        this.manager.release(selector);
                     }
                 }
             }
@@ -109,24 +104,24 @@
             String path = mapper.getPath(doc.getId(), 
getSourceDocument().getLanguage());
             String sourceUri = doc.getSourceURI();
             String pubId = doc.getPublication().getId();
-            String uploadSourceUri = "cocoon:/request/PUT"; 
+            String uploadSourceUri = "cocoon:/request/PUT";
 
-            //lets copy the source to temp work area
+            // lets copy the source to temp work area
             String tempSourceUri = "context://lenya/pubs/" + pubId + 
"/work/webdav/content/"
                     + doc.getArea() + "/" + path + ".tmp";
             tempSourceUri = tempSourceUri.substring("lenya://".length());
             tempSourceUri = "context://" + tempSourceUri;
 
             SourceUtil.copy(resolver, uploadSourceUri, tempSourceUri, true);
-            
+
             Source tempSource = resolver.resolveURI(tempSourceUri);
             if (!tempSource.exists()) {
                 throw new IllegalArgumentException("The temp file [" + 
tempSource.getURI()
                         + "] does not exist.");
             }
-            
-            //validity check
-            DocumentType resourceType = doc.getResourceType();
+
+            // validity check
+            ResourceType resourceType = doc.getResourceType();
             String schemaUri = resourceType.getSchemaDefinitionSourceURI();
             Source schemaSource = resolver.resolveURI(schemaUri);
             if (!schemaSource.exists()) {
@@ -134,20 +129,21 @@
                         + "] does not exist.");
             }
 
-            InputSource schemaInputSource = 
org.apache.cocoon.components.source.SourceUtil.getInputSource(schemaSource);
-            InputSource xmlInputSource = 
org.apache.cocoon.components.source.SourceUtil.getInputSource(tempSource);
+            InputSource schemaInputSource = 
org.apache.cocoon.components.source.SourceUtil
+                    .getInputSource(schemaSource);
+            InputSource xmlInputSource = 
org.apache.cocoon.components.source.SourceUtil
+                    .getInputSource(tempSource);
 
             String message = RelaxNG.validate(schemaInputSource, 
xmlInputSource);
             if (message != null) {
-                addErrorMessage("error-validation", new String[]{message});
-            }            
-            
+                addErrorMessage("error-validation", new String[] { message });
+            }
+
             if (SourceUtil.exists(tempSourceUri, this.manager)) {
                 SourceUtil.copy(resolver, tempSourceUri, sourceUri, true);
                 SourceUtil.delete(tempSourceUri, this.manager);
             }
 
-
         } finally {
             if (resolver != null) {
                 this.manager.release(resolver);
@@ -158,7 +154,6 @@
         }
     }
 
-
     /**
      * @see org.apache.lenya.cms.usecase.AbstractUsecase#getObjectsToLock()
      */
@@ -166,29 +161,29 @@
         try {
             List nodes = new ArrayList();
             Document doc = getSourceDocument();
-            Document liveVersion = doc.getIdentityMap().getAreaVersion(doc, 
Publication.LIVE_AREA);
-            
+
             DocumentSet set = SiteUtil.getSubSite(this.manager, doc);
             Document[] documents = set.getDocuments();
             for (int i = 0; i < documents.length; i++) {
                 nodes.addAll(Arrays.asList(documents[i].getRepositoryNodes()));
             }
 
-            nodes.add(SiteUtil.getSiteStructure(this.manager,
-                    doc.getIdentityMap(),
-                    doc.getPublication(),
-                    Publication.LIVE_AREA).getRepositoryNode());
+            nodes.add(SiteUtil.getSiteStructure(this.manager, 
doc.getIdentityMap(),
+                    doc.getPublication(), 
Publication.LIVE_AREA).getRepositoryNode());
             return (Transactionable[]) nodes.toArray(new 
Transactionable[nodes.size()]);
 
         } catch (Exception e) {
             throw new UsecaseException(e);
         }
-    }    
-    
+    }
+
     /**
      * Sets the meta data of the created document.
-     * @param document The document.
-     * @throws DocumentException if an error occurs.
+     * 
+     * @param document
+     *            The document.
+     * @throws DocumentException
+     *             if an error occurs.
      */
     protected void setMetaData(Document document) throws DocumentException {
 
@@ -198,9 +193,8 @@
         Map dcMetaData = new HashMap();
         dcMetaData.put(DublinCore.ELEMENT_TITLE, document.getName());
         dcMetaData.put(DublinCore.ELEMENT_CREATOR, "");
-        dcMetaData.put(DublinCore.ELEMENT_PUBLISHER,"");
-        dcMetaData
-                .put(DublinCore.ELEMENT_SUBJECT, "");
+        dcMetaData.put(DublinCore.ELEMENT_PUBLISHER, "");
+        dcMetaData.put(DublinCore.ELEMENT_SUBJECT, "");
         dcMetaData.put(DublinCore.ELEMENT_DATE, "");
         dcMetaData.put(DublinCore.ELEMENT_RIGHTS, "");
         dcMetaData.put(DublinCore.ELEMENT_LANGUAGE, document.getLanguage());
@@ -211,9 +205,10 @@
     private Publication publication;
 
     /**
-     * Access to the current publication. Use this when the publication is not 
yet known in the
-     * usecase: e.g. when creating a global asset. When adding a resource or a 
child to a document,
-     * access the publication via that document's interface instead.
+     * Access to the current publication. Use this when the publication is not
+     * yet known in the usecase: e.g. when creating a global asset. When adding
+     * a resource or a child to a document, access the publication via that
+     * document's interface instead.
      * 
      * @return the publication in which the use-case is being executed
      */
@@ -229,6 +224,4 @@
         return this.publication;
     }
 
-
-    
 }

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/homepage.xsp
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/homepage.xsp?rev=202183&view=auto
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/homepage.xsp
 (added)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/menus/homepage.xsp
 Tue Jun 28 06:54:26 2005
@@ -0,0 +1,56 @@
+<?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 155806 2005-03-01 17:55:42Z andreas $ -->
+
+<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>
+
+    <menus>
+      <menu i18n:attr="name" name="Edit">
+          <xsp:logic>
+            String doctype = <input:get-attribute module="page-envelope" 
as="string" name="document-type"/>;
+            if ("homepage".equals(doctype)) {
+                <block info="false">
+                  <item wf:event="edit" uc:usecase="kupu" uc:step="open" 
href="?"><i18n:text>With Kupu</i18n:text></item>
+                  <item wf:event="edit" uc:usecase="edit.bxe" 
href="?"><i18n:text>With BXE</i18n:text></item>
+                  <item wf:event="edit" uc:usecase="edit.forms"><xsp:attribute 
name="href"><xsp:expr>"?form=" + 
doctype</xsp:expr></xsp:attribute><i18n:text>With Forms</i18n:text></item>
+                  <item wf:event="edit" uc:usecase="edit.oneform" 
href="?"><i18n:text>With one Form</i18n:text></item>
+                </block>
+            }
+          </xsp:logic>
+      </menu>
+      
+    </menus>
+    
+  </menu>
+</xsp:page>

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/publet.xconf
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/publet.xconf?rev=202183&view=auto
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/publet.xconf
 (added)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/config/publet.xconf
 Tue Jun 28 06:54:26 2005
@@ -0,0 +1,32 @@
+<?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 164635 2005-04-25 20:01:43Z tschlabach $ -->
+
+<xconf xpath="/cocoon/resource-types" 
unless="/cocoon/resource-types/component-instance[@name = 'homepage']">
+
+  <component-instance name="homepage"
+                      logger="lenya.resourcetypes.homepage"
+                      
class="org.apache.lenya.cms.publication.ResourceTypeImpl">
+    <schema src="homepage.rng"/>
+    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
+      <sample-name>homepage.xml</sample-name>
+    </creator>
+    <link-attribute xpath="//*[namespace-uri() = 
'http://www.w3.org/1999/xhtml']/@href"/>
+  </component-instance>
+
+</xconf>

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/menus.xmap
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/menus.xmap?rev=202183&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/menus.xmap 
(added)
+++ lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/menus.xmap 
Tue Jun 28 06:54:26 2005
@@ -0,0 +1,34 @@
+<?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: menus.xmap 178738 2005-05-27 03:42:09Z gregor $ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
+
+  <map:pipelines>
+
+    <map:pipeline>
+       
+      <map:match pattern="**">
+        <map:generate type="serverpages" src="config/menus/homepage.xsp"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+    </map:pipeline>
+    
+  </map:pipelines>
+</map:sitemap>

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/homepage.xml
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/homepage.xml?rev=202183&view=auto
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/homepage.xml
 (added)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/samples/homepage.xml
 Tue Jun 28 06:54:26 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml"; 
+      xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
+      xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0";
+>
+  <head>
+    <title>Default Publication</title>
+  </head>
+  <body>
+    <h1>Default Publication</h1>
+    <p>Welcome to the default Lenya publication!</p>
+    <p>The purpose of this publication is</p>
+    <ul>
+      <li>to show beginners the basic functionality of the Lenya CMS,</li>
+      <li>to provide an "out of the box" publication that can be easily 
adapted and used, and</li>
+      <li>to provide a basis for reference implementations of new concepts and 
best practices.</li>
+    </ul>
+    <p>
+    You won't find any fancy and confusing bells and whistles here, but the
+    publication contains everything you need to get started.
+    </p>
+  </body>
+</html>

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/sitemap.xmap
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/sitemap.xmap?rev=202183&view=auto
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/sitemap.xmap 
(added)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/sitemap.xmap 
Tue Jun 28 06:54:26 2005
@@ -0,0 +1,55 @@
+<?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: doctypes.xmap 179488 2005-06-02 02:29:39Z gregor $ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
+
+  <map:pipelines>
+
+    <map:pipeline>
+      <!-- View Revision? -->
+      <map:match pattern="*.xml">
+        <map:match type="step" pattern="view-revision">
+          <map:generate type="serverpages" src="../../content/rc/view.xsp">
+          </map:generate>
+          <map:transform src="../../xslt/rc/toDoc.xsl"/>
+          <map:transform 
src="fallback://lenya/publets/homepage/xslt/homepage2xhtml.xsl">
+            <map:parameter name="rendertype" value="{1}"/>
+            <map:parameter name="nodeid" 
value="{page-envelope:document-name}"/>
+            <map:parameter name="language" 
value="{page-envelope:document-language}"/>
+          </map:transform>
+          <map:serialize type="xml"/>
+        </map:match>
+      </map:match>
+
+      <!-- parametrized doctype matcher -->
+      <!-- pattern="{rendertype}" -->
+      <map:match pattern="*.xml">
+        <map:generate 
src="../../pubs/{page-envelope:publication-id}/content/{page-envelope:area}/{page-envelope:document-path}"/>
+        <map:transform 
src="fallback://lenya/publets/homepage/xslt/homepage2xhtml.xsl">
+          <map:parameter name="rendertype" value="{1}"/>
+          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
+          <map:parameter name="language" 
value="{page-envelope:document-language}"/>
+        </map:transform>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+    
+  </map:pipelines>
+</map:sitemap>

Added: 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/homepage2xhtml.xsl
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/homepage2xhtml.xsl?rev=202183&view=auto
==============================================================================
--- 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/homepage2xhtml.xsl
 (added)
+++ 
lenya/trunk/src/webapp/lenya/pubs/default/lenya/publets/homepage/xslt/homepage2xhtml.xsl
 Tue Jun 28 06:54:26 2005
@@ -0,0 +1,24 @@
+<?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.
+-->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+>
+  
+<xsl:import href="fallback://xslt/xhtml2xhtml.xsl"/>
+  
+</xsl:stylesheet>

Modified: lenya/trunk/src/webapp/lenya/pubs/default/menus.xmap
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/menus.xmap?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/menus.xmap (original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/menus.xmap Tue Jun 28 06:54:26 
2005
@@ -19,14 +19,6 @@
 
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
 
-  <map:components>
-    <map:matchers default="wildcard">
-      <map:matcher name="doctype" logger="sitemap.matcher.doctype" 
src="org.apache.cocoon.matching.WildcardRequestParameterMatcher">
-        <parameter-name>doctype</parameter-name>
-      </map:matcher>
-    </map:matchers>
-  </map:components>
-
   <map:pipelines>
 
     <map:pipeline>
@@ -36,15 +28,7 @@
         <map:serialize type="xml"/>
       </map:match>
       
-      <!-- document type: links -->
-      <!--
-      <map:match type="doctype" pattern="links">
-        <map:generate type="serverpages" src="config/menus/links.xsp"/>
-        <map:serialize type="xml"/>
-      </map:match>
-      -->
-      
-      <!-- all other document types: xhtml, ... -->
+      <!-- all document types -->
       <map:match pattern="**">
         <map:generate type="serverpages" 
src="fallback://config/menus/generic.xsp"/>
         <map:serialize type="xml"/>

Modified: lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap?rev=202183&r1=202182&r2=202183&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap (original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/sitemap.xmap Tue Jun 28 06:54:26 
2005
@@ -115,7 +115,7 @@
           <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
           <map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
           <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
-          <map:part 
src="cocoon:/lenya-document/{1}/{3}/{4}/{page-envelope:document-path}"/>
+          <map:part 
src="cocoon://publets/{page-envelope:document-type}/{1}.xml"/>
         </map:aggregate>
         <map:transform src="fallback://xslt/page2xhtml-{4}.xsl">
           <map:parameter name="root" 
value="{page-envelope:context-prefix}/{2}/{3}"/>
@@ -130,7 +130,7 @@
         <map:select type="parameter">
           <map:parameter name="parameter-selector-test" value="{1}"/>
           <map:when test="view">
-             <map:transform type="link-rewrite"/>
+            <map:transform type="link-rewrite"/>
           </map:when>
         </map:select>
         <map:serialize type="xml"/>
@@ -185,9 +185,9 @@
                   <map:transform 
src="../../xslt/authoring/edit/removeSourceTags.xsl"/>
                 </map:when>
               </map:select>
-             <map:serialize type="xhtml"/>
+              <map:serialize type="xhtml"/>
             </map:otherwise>
-          </map:select>
+            </map:select>
             </map:otherwise>
           </map:select>
         </map:act>

Added: lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl?rev=202183&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl (added)
+++ lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl Tue Jun 28 06:54:26 
2005
@@ -0,0 +1,60 @@
+<?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: menu2xhtml.xsl 178289 2005-05-24 21:30:01Z andreas $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1";
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0";
+  xmlns:menu="http://apache.org/cocoon/lenya/menubar/1.0";
+  xmlns="http://www.w3.org/1999/xhtml";
+  >
+
+<xsl:template match="/menu:menu">
+  <xsl:copy>
+    <xsl:apply-templates select="menu:menus"/>
+  </xsl:copy>
+</xsl:template>
+
+
+<xsl:template match="menu:menus[not(preceding-sibling::menu:menus)]">
+  <xsl:copy>
+    <xsl:apply-templates select="menu:menu"/>
+  </xsl:copy>
+</xsl:template>
+
+
+<xsl:template match="/menu:menu/menu:menus[1]/menu:menu">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:apply-templates 
select="/menu:menu/menu:menus[preceding-sibling::menu:menus]/menu:menu[@name = 
current()/@name]/*"/>
+    <xsl:apply-templates select="*"/>
+  </xsl:copy>
+</xsl:template>
+
+
+<xsl:template match="menu:menus[preceding-sibling::menu:menus]"/>
+
+
+<xsl:template match="@*|node()">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+  
+</xsl:stylesheet>

Added: lenya/trunk/src/webapp/lenya/xslt/publets/publets2xinclude.xsl
URL: 
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/publets/publets2xinclude.xsl?rev=202183&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/publets/publets2xinclude.xsl (added)
+++ lenya/trunk/src/webapp/lenya/xslt/publets/publets2xinclude.xsl Tue Jun 28 
06:54:26 2005
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  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: xinclude.xsl 123414 2004-12-27 14:52:24Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+    xmlns:xi="http://www.w3.org/2001/XInclude";
+    xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0";
+    xmlns:dir="http://apache.org/cocoon/directory/2.0";
+    xmlns="http://apache.org/cocoon/lenya/menubar/1.0";
+    >
+
+<xsl:param name="area"/>
+
+<xsl:template match="publication">
+  <menu>
+    <xsl:for-each select="publet">
+      <xi:include 
href="cocoon:/menu-xml/publet/{$area}/{@name}.xml#xpointer(/*/*)"/>
+    </xsl:for-each>
+  </menu>
+</xsl:template>
+
+</xsl:stylesheet>


<Prev in Thread] Current Thread [Next in Thread>