You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Doug Chestnut <dh...@virginia.edu> on 2005/05/25 22:55:22 UTC

Document-Type in 1.4

Hi All,
How is tech doctype determined in Lenya 1.4?  It doesn't appear that the 
URI Parametrizer applies (and there is no parameter-doctype.xmap in the 
default pub).

The reason I ask:  I wanted to try out pub templates, so I used the "New 
publication" tool which seemed to work.  Made my new pub, but when I 
login I get a "No definition found for doctype 'null" error.  I don't 
get this with the default pub.

Thanks,
--Doug

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


Re: Document-Type in 1.4

Posted by Andreas Hartmann <an...@apache.org>.
Doug Chestnut wrote:
> Hi Andreas,
> Thanks!  That did the trick. :)  Didn't notice those meta files.
> 
> It sees like the entire content directory should be copied to the 
> inherited pub.  The way it is now, the sitetree files references 
> documents that don't exist, and only the authoring directory is created.
> 
> Here is a patch that copies the contents directory (if indeed that is 
> necessary):

[...]

Thanks! I applied your patch (LCR 178766).

-- Andreas


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


Re: Document-Type in 1.4

Posted by Doug Chestnut <dh...@virginia.edu>.
Hi Andreas,
Thanks!  That did the trick. :)  Didn't notice those meta files.

It sees like the entire content directory should be copied to the 
inherited pub.  The way it is now, the sitetree files references 
documents that don't exist, and only the authoring directory is created.

Here is a patch that copies the contents directory (if indeed that is 
necessary):


Index: 
C:/src/lenya-1.4.x/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java
===================================================================
--- 
C:/src/lenya-1.4.x/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java 
(revision 178646)
+++ 
C:/src/lenya-1.4.x/src/webapp/lenya/pubs/default/java/src/org/apache/lenya/defaultpub/cms/publication/templating/Instantiator.java 
(working copy)
@@ -16,6 +16,8 @@
   */
  package org.apache.lenya.defaultpub.cms.publication.templating;

+import java.util.Iterator;
+import java.util.Collection;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
@@ -34,6 +36,7 @@
  import org.apache.excalibur.source.ModifiableSource;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.impl.FileSource;
  import org.apache.lenya.cms.publication.Publication;
  import org.apache.lenya.cms.publication.PublicationImpl;
  import org.apache.lenya.xml.DocumentHelper;
@@ -58,7 +61,7 @@
              "config/ac/passwd/admin.rml", 
"config/ac/passwd/admin.gml", "config/ac/ac.xconf",
              "config/ac/usecase-policies.xml", 
"config/doctypes/doctypes.xconf",
              "config/workflow/workflow.xml", 
"content/authoring/sitetree.xml",
-            "content/authoring/index/index_en.xml", 
"content/authoring/index/index_en.xml.meta" };
+            "content/"};

      /**
       * @see 
org.apache.lenya.cms.publication.templating.Instantiator#instantiate(org.apache.lenya.cms.publication.Publication,
@@ -80,7 +83,11 @@
              for (int i = 0; i < sourcesToCopy.length; i++) {

                  String source = sourcesToCopy[i];
-                copySource(template, newPublicationId, resolver, 
publicationsUri, source);
+                if (source.endsWith("/")) {
+                    copyDirSource(template, newPublicationId, resolver, 
publicationsUri, source);
+                } else {
+                    copySource(template, newPublicationId, resolver, 
publicationsUri, source);                	
+                }
              }

              metaSource = (ModifiableSource) 
resolver.resolveURI(publicationsUri + "/"
@@ -132,6 +139,25 @@
          }
      }

+    protected void copyDirSource(Publication template,
+            String publicationId,
+            SourceResolver resolver,
+            String publicationsUri,
+            String source) throws MalformedURLException, IOException {
+        Source templateSource = null;
+        ModifiableSource targetSource = null;
+        FileSource directory = new FileSource(publicationsUri + "/" + 
template.getId() + "/" + source);
+        Collection files = directory.getChildren();
+        for(Iterator iter = files.iterator(); iter.hasNext();){
+        	FileSource filesource = (FileSource)iter.next();
+        	if (filesource.isCollection()) {
+        		copyDirSource(template, publicationId, resolver, 
publicationsUri, source+"/"+filesource.getName());
+        	} else {
+        		copySource(template, publicationId, resolver, 
publicationsUri, source+"/"+filesource.getName());
+        	}
+        }
+    }
+
      protected void copySource(Publication template,
              String publicationId,
              SourceResolver resolver,




Andreas Hartmann wrote:
> Doug Chestnut wrote:
> 
>> Hi All,
>> How is tech doctype determined in Lenya 1.4?  It doesn't appear that 
>> the URI Parametrizer applies (and there is no parameter-doctype.xmap 
>> in the default pub).
> 
> 
> The doctype is now added to the meta data during document creation.
> This is possible because the meta data are now separated from the
> actual document.
> 
>> The reason I ask:  I wanted to try out pub templates, so I used the 
>> "New publication" tool which seemed to work.  Made my new pub, but 
>> when I login I get a "No definition found for doctype 'null" error.  I 
>> don't get this with the default pub.
> 
> 
> That should work now, the meta file was not copied to the new publication.
> 
> Actually the publication instanciation is in a very early stage and needs
> quite a lot of work.
> 
> Thanks for reporting!
> 
> -- Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 

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


Re: Document-Type in 1.4

Posted by Andreas Hartmann <an...@apache.org>.
Doug Chestnut wrote:
> Hi All,
> How is tech doctype determined in Lenya 1.4?  It doesn't appear that the 
> URI Parametrizer applies (and there is no parameter-doctype.xmap in the 
> default pub).

The doctype is now added to the meta data during document creation.
This is possible because the meta data are now separated from the
actual document.

> The reason I ask:  I wanted to try out pub templates, so I used the "New 
> publication" tool which seemed to work.  Made my new pub, but when I 
> login I get a "No definition found for doctype 'null" error.  I don't 
> get this with the default pub.

That should work now, the meta file was not copied to the new publication.

Actually the publication instanciation is in a very early stage and needs
quite a lot of work.

Thanks for reporting!

-- Andreas


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