You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/07/15 16:11:10 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/pubs/default/content/authoring create.xsp
egli 2003/07/15 07:11:10
Modified: src/webapp/lenya/pubs/default/config/tasks targets.xml
src/webapp/lenya/pubs/default/xslt/authoring create.xsl
src/java/org/apache/lenya/cms/ant DocumentCreatorTask.java
src/test/org/apache/lenya/cms/authoring
DocumentCreatorTest.java
src/webapp/lenya/pubs/default/content/authoring create.xsp
Log:
Enhanced the creator tool chain (java, xsp and xslt) to
be able to handle multi-lingual creates.
Revision Changes Path
1.10 +4 -2 cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml
Index: targets.xml
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- targets.xml 10 Jul 2003 17:26:40 -0000 1.9
+++ targets.xml 15 Jul 2003 14:11:10 -0000 1.10
@@ -84,7 +84,7 @@
<echo>and insert it in tree ${pub.dir}/${live.dir}/${sitetree}</echo>
<publishtree
- documentid= "${publish.documentid}"
+ documentid= "${publish.documentid}"
language= "${publish.language}"
absolutetreeauthoringpath= "${pub.dir}/${authoring.dir}/${sitetree}"
absolutetreelivepath = "${pub.dir}/${live.dir}/${sitetree}"
@@ -109,7 +109,8 @@
<property name="create.child-name" value=""/>
<property name="create.child-type" value=""/>
<property name="create.doctype" value=""/>
-
+ <property name="create.language" value=""/>
+
<taskdef name="create" classname="org.apache.lenya.cms.ant.DocumentCreatorTask"/>
<create
parentid="${create.parent-id}"
@@ -118,6 +119,7 @@
childtype="${create.child-type}"
authoringpath="${authoring.dir}"
documenttype="${create.doctype}"
+ language="${create.language}"
treefile="${sitetree}"/>
<taskdef name="init-history" classname="org.apache.lenya.cms.ant.InitWorkflowHistoryTask"/>
1.2 +1 -0 cocoon-lenya/src/webapp/lenya/pubs/default/xslt/authoring/create.xsl
Index: create.xsl
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/xslt/authoring/create.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- create.xsl 8 May 2003 08:34:42 -0000 1.1
+++ create.xsl 15 Jul 2003 14:11:10 -0000 1.2
@@ -29,6 +29,7 @@
<input type="hidden" name="lenya.step" value="create"/>
<input type="hidden" name="childtype" value="branch"/>
<input type="hidden" name="doctype" value="{/parent-child/doctype}"/>
+ <input type="hidden" name="language" value="{/parent-child/default-language}"/>
<table>
<tr>
<td>parentid:</td><td>hidden value="<xsl:value-of select="/parent-child/parentid"/>"</td>
1.4 +21 -2 cocoon-lenya/src/java/org/apache/lenya/cms/ant/DocumentCreatorTask.java
Index: DocumentCreatorTask.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ant/DocumentCreatorTask.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DocumentCreatorTask.java 8 Jul 2003 16:13:20 -0000 1.3
+++ DocumentCreatorTask.java 15 Jul 2003 14:11:10 -0000 1.4
@@ -77,6 +77,7 @@
private String documentType;
private String treeFile;
private String authoringPath;
+ private String language;
/**
* (non-Javadoc)
@@ -89,7 +90,7 @@
try {
creator.create(getPublication(),
new File(getPublication().getDirectory(), getAuthoringPath()), getTreeFile(),
- getParentId(), getChildId(), getChildName(), getChildType(), documentType);
+ getParentId(), getChildId(), getChildName(), getChildType(), documentType, getLanguage());
} catch (CreatorException e) {
throw new BuildException(e);
}
@@ -241,4 +242,22 @@
assertString(string);
treeFile = string;
}
+ /**
+ * Get the language
+ *
+ * @return the language
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ /**
+ * Set the language
+ *
+ * @param language the language
+ */
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
}
1.4 +4 -3 cocoon-lenya/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java
Index: DocumentCreatorTest.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DocumentCreatorTest.java 30 Jun 2003 11:53:54 -0000 1.3
+++ DocumentCreatorTest.java 15 Jul 2003 14:11:10 -0000 1.4
@@ -1,5 +1,5 @@
/*
-$Id
+$Id$
<License>
============================================================================
@@ -123,7 +123,7 @@
File authoringDirectory = new File(publication.getDirectory(), AUTHORING_DIR);
creator.create(publication, authoringDirectory, TREE_FILE, PARENT_ID, CHILD_ID, CHILD_NAME,
- CHILD_TYPE, DOCUMENT_TYPE);
+ CHILD_TYPE, DOCUMENT_TYPE, DOCUMENT_LANGUAGE);
File documentFile = new File(authoringDirectory, CREATED_FILE);
assertTrue(documentFile.exists());
@@ -135,7 +135,7 @@
SiteTreeNode node = sitetree.getNode(PARENT_ID + "/" + CHILD_ID);
assertNotNull(node);
System.out.println("Sitetree node was created: " + node.getId() + " (label: " +
- node.getLabel("de") + ")");
+ node.getLabel(DOCUMENT_LANGUAGE) + ")");
}
protected static final String AUTHORING_DIR = "content" + File.separator + "authoring";
@@ -146,6 +146,7 @@
protected static final String CHILD_TYPE = "leaf";
protected static final String DOCUMENT_TYPE = "simple";
protected static final String CREATED_FILE = "tutorial/test-document/index.xml";
+ protected static final String DOCUMENT_LANGUAGE = "en";
/** @see junit.framework.TestCase#setUp() */
protected void setUp() throws Exception {
1.6 +8 -1 cocoon-lenya/src/webapp/lenya/pubs/default/content/authoring/create.xsp
Index: create.xsp
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/content/authoring/create.xsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- create.xsp 20 May 2003 18:23:39 -0000 1.5
+++ create.xsp 15 Jul 2003 14:11:10 -0000 1.6
@@ -7,6 +7,10 @@
xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
>
+ <xsp:structure>
+ <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
+ </xsp:structure>
+
<parent-child>
<xsp:logic>
@@ -25,12 +29,15 @@
if ((status != null) && (status.equals("failed"))) {
<xsp:content><exception/></xsp:content>
}
+
+ Publication pub = (Publication) <input:get-attribute module="page-envelope" as="object" name="publication"/>;
+
</xsp:logic>
<parentid><xsp:expr>parentId</xsp:expr></parentid>
<referer><xsp-request:get-uri/></referer>
<doctype><xsp:expr><xsp-request:get-parameter name="doctype"/></xsp:expr></doctype>
-
+ <default-language><xsp:expr>pub.getDefaultLanguage()</xsp:expr></default-language>
</parent-child>
</xsp:page>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org