You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2003/11/09 06:03:02 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/authoring create-language.xsl
gregor 2003/11/08 21:03:02
Modified: src/webapp/lenya/pubs/default/config/tasks targets.xml
tasks.xconf
src/webapp/lenya/pubs/default/config/menus generic.xsp
Added: src/webapp/lenya/pubs/default/lenya/content/authoring
create-language.xsp
src/webapp/lenya/pubs/default/lenya/xslt/authoring
create-language.xsl
Log:
added multilingual features to menu
sanitized menu
Revision Changes Path
1.20 +587 -164 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.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- targets.xml 16 Oct 2003 22:02:50 -0000 1.19
+++ targets.xml 9 Nov 2003 05:03:01 -0000 1.20
@@ -13,43 +13,94 @@
<property name="text" value="Hello World!"/>
<property name="pub.dir" value=""/>
-
-<!-- publishing properties -->
-<property name="authoring.dir" value="content/authoring"/>
-<property name="authoring.area" value="authoring"/>
+<property name="pub.id" value=""/>
<property name="sitetree" value="sitetree.xml"/>
-<property name="authoring.resource.dir" value="resources/images/authoring"/>
-<property name="live.area" value="live"/>
+<property name="authoring.area" value="authoring"/>
+<property name="authoring.dir" value="content/authoring"/>
+<property name="authoring.resource.dir" value="resources/authoring"/>
<property name="live.dir" value="content/live"/>
-<property name="live.resource.dir" value="resources/images/live"/>
-<property name="replication.dir" value="content/replication/pending"/>
+<property name="live.resource.dir" value="resources/live"/>
+<property name="live.area" value="live"/>
+<property name="archive.dir" value="content/archive"/>
+<property name="archive.area" value="archive"/>
+<property name="archive.resource.dir" value="resources/archive"/>
+<property name="trash.dir" value="content/trash"/>
+<property name="trash.area" value="trash"/>
+<property name="trash.resource.dir" value="resources/trash"/>
<property name="rcml.dir" value="content/rcml"/>
<property name="rcbak.dir" value="content/rcbak"/>
+<property name="policies.dir" value="config/ac/policies"/>
-<property name="export.server" value="http://localhost:8080"/>
-<property name="export.dir" value="resources/export/pending"/>
-<property name="export.expression" value="/lenya/default"/>
-<property name="export.replacement" value=""/>
+<!-- workflow-->
+<property name="wf.history.trash.dir" value="content/workflow/history/trash"/>
+
+<!-- publishing properties -->
+<property name="replication.dir" value="content/replication/pending"/>
+<property name="export.server-port" value=""/>
+<property name="export.context-path" value=""/>
+<property name="export.dir" value="work/export/pending"/>
+<property name="export.expression" value="/lenya/unicom/live/"/>
+<property name="export.replacement" value="/"/>
<property name="export.uris" value=""/>
-<property name="publish.documentid" value=""/>
-<property name="publish.language" value=""/>
-<property name="publish.sources" value=""/>
<property name="servlet.context" value=""/>
<!--copy/move/rename properties -->
<property name="node.firstdocumentid" value=""/>
<property name="node.secdocumentid" value=""/>
<property name="node.newdocumentid" value=""/>
-
<property name="file.firstdocumentdir" value=""/>
<property name="file.secdocumentdir" value=""/>
-
-<target name="test">
- <echo>This is a test of the AntTask: ${text}</echo>
+<property name="firstarea" value=""/>
+<property name="secarea" value=""/>
+<property name="copy.userid" value=""/>
+<property name="copy.ipaddress" value=""/>
+<property name="node.refdocumentid" value=""/>
+
+<!--properties setted by task SetAreaProperties-->
+<property name="firstarea.dir" value=""/>
+<property name="secarea.dir" value=""/>
+<property name="secarea.resource.dir" value=""/>
+
+<taskdef name="copyresources" classname="org.apache.lenya.cms.ant.CopyResourcesTask"/>
+
+ <taskdef name="mapdocumentidtofile" classname="org.apache.lenya.cms.ant.DocumentIdToFile"/>
+
+ <target name="test">
+ <echo>This is a test of the AntTask: ${text}</echo>
+ </target>
+
+
+<target name="notification">
+ <property name="notification.from" value="andreas@apache.org"/>
+ <property name="notification.tolist" value=""/>
+ <property name="notification.subject" value=""/>
+ <property name="notification.message" value=""/>
+ <property name="mail.mailhost" value="mail.wyona.com"/>
+
+ <echo>Sending Mail</echo>
+ <echo>From: [${notification.from}]</echo>
+ <echo>To: [${notification.tolist}]</echo>
+ <echo>Subject: [${notification.subject}]</echo>
+ <echo>Message: [${notification.message}]</echo>
+ <echo>Mailhost: [${mail.mailhost}]</echo>
+
+ <mail
+ from="${notification.from}"
+ tolist="${notification.tolist}"
+ subject="${notification.subject}"
+ message="${notification.message}"
+ mailhost="${mail.mailhost}"
+ />
</target>
+
<target name="publish">
+
+ <property name="publish.documentid" value=""/>
+ <property name="publish.language" value=""/>
+ <property name="publish.sources" value=""/>
+
<echo>-${servlet.context}-</echo>
<echo>Publish document</echo>
<echo>Copying files ${publish.sources}</echo>
@@ -59,23 +110,20 @@
<echo>pub dir : ${pub.dir}</echo>
<copy todir="${pub.dir}/${live.dir}">
- <!-- FIXME: copy only the file that corresponds to the node that
- we're publishing -->
<fileset dir="${pub.dir}/${authoring.dir}">
<include name="${publish.sources}"/>
</fileset>
</copy>
-
+
<echo>Publish resources</echo>
- <echo>Copying files ${publish.documentid}</echo>
+ <echo>Copying files ${publish.resourcepath}/*</echo>
<echo>from ${pub.dir}/${authoring.resource.dir}</echo>
<echo>to ${pub.dir}/${live.resource.dir}</echo>
- <copy todir="${pub.dir}/${live.resource.dir}/${publish.documentid}">
- <fileset dir="${pub.dir}">
- <include name="${authoring.resource.dir}/${publish.documentid}/*"/>
- </fileset>
- </copy>
+ <taskdef name="publishresources" classname="org.apache.lenya.cms.ant.ResourcePublisher"/>
+ <publishresources
+ documentid="${publish.documentid}"
+ />
<taskdef name="publishtree" classname="org.apache.lenya.cms.ant.TreePublisher"/>
@@ -85,239 +133,614 @@
<echo>from tree ${pub.dir}/${authoring.dir}/${sitetree}</echo>
<echo>and insert it in tree ${pub.dir}/${live.dir}/${sitetree}</echo>
-<!-- FIXME: language seems not to be implemented yet -->
<publishtree
- documentid= "${publish.documentid}"
+ documentid="${publish.documentid}"
language="${publish.language}"
/>
-
-
<taskdef name="export" classname="org.apache.lenya.cms.ant.StaticHTMLExporter"/>
- <echo>Export:</echo>
+ <echo>Export page as static HTML: ${export.uris}</echo>
<export
- path="${export.dir}"
+ server="http://127.0.0.1:${export.server-port}${export.context-path}/${pub.id}/live/"
uris="${export.uris}"
expression="${export.expression}"
replacement="${export.replacement}"
- server="${export.server}"
- />
+ path="${export.dir}"
+ />
</target>
-<taskdef name="init-history" classname="org.apache.lenya.cms.ant.InitWorkflowHistoryTask"/>
-
-<target name="create">
+ <taskdef name="init-history" classname="org.apache.lenya.cms.ant.InitWorkflowHistoryTask"/>
+ <target name="create">
+
+ <property name="create.parent-id" value=""/>
+ <property name="create.child-id" value=""/>
+ <property name="create.child-name" value=""/>
+ <property name="create.child-type" value=""/>
+ <property name="create.doctype" value=""/>
+ <property name="create.language" value=""/>
+ <property name="create.title" value=""/>
+ <property name="create.creator" value=""/>
+ <property name="create.description" value=""/>
+ <property name="create.subject" value=""/>
+ <property name="create.publisher" value=""/>
+ <property name="create.date" value=""/>
+ <property name="create.rights" value=""/>
+ <property name="create.columns" value=""/>
+ <property name="create.userid" value=""/>
+ <property name="create.ipaddress" value=""/>
- <property name="create.parent-id" value=""/>
- <property name="create.child-id" value=""/>
- <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
+ <taskdef name="create" classname="org.apache.lenya.cms.ant.DocumentCreatorTask"/>
+ <create
+ authoringpath="${authoring.dir}"
+ area="${authoring.area}"
parentid="${create.parent-id}"
childid="${create.child-id}"
childname="${create.child-name}"
childtype="${create.child-type}"
- authoringpath="${authoring.dir}"
documenttype="${create.doctype}"
language="${create.language}"
- area="${authoring.area}"/>
-
+ />
+
+ <!-- Init the workflow history -->
<echo>init the workflow history with document-id: ${create.parent-id}/${create.child-id}</echo>
<echo>with document-type: ${create.doctype}</echo>
<echo>with language: ${create.language}</echo>
- <init-history
+ <echo>with user ID: ${create.userid}</echo>
+ <echo>with IP address: ${create.ipaddress}</echo>
+ <init-history
documentid="${create.parent-id}/${create.child-id}"
documenttype="${create.doctype}"
language="${create.language}"
+ userid="${create.userid}"
+ machineip="${create.ipaddress}"
+ />
+
+ <!-- Add the meta data to the newly created file. -->
+ <property name="document.file" value=""/>
+ <mapdocumentidtofile
+ area="${authoring.area}"
+ documentid="${create.parent-id}/${create.child-id}"
+ language="${create.language}"
+ propertyname="document.file"
+ />
+ <tempfile property="temp.file"/>
+ <xslt in="${document.file}"
+ out="${temp.file}"
+ force="true"
+ style="${pub.dir}/../unizh/xslt/authoring/addMetaData.xsl">
+ <param name="title" expression="${create.title}"/>
+ <param name="creator" expression="${create.creator}"/>
+ <param name="subject" expression="${create.subject}"/>
+ <param name="description" expression="${create.description}"/>
+ <param name="language" expression="${create.language}"/>
+ <param name="publisher" expression="${create.publisher}"/>
+ <param name="date" expression="${create.date}"/>
+ <param name="rights" expression="${create.rights}"/>
+ <param name="columns" expression="${create.columns}"/>
+ </xslt>
+ <move file="${temp.file}" tofile="${document.file}"/>
+ </target>
+
+ <!-- Create a copy of an existing document for a new language -->
+ <target name="create-language">
+
+ <property name="create.document-id" value=""/>
+ <property name="create.doctype" value=""/>
+ <property name="create.child-name" value=""/>
+ <property name="create.old.language" value=""/>
+ <property name="create.new.language" value=""/>
+ <property name="create.title" value=""/>
+ <property name="create.creator" value=""/>
+ <property name="create.description" value=""/>
+ <property name="create.subject" value=""/>
+ <property name="create.publisher" value=""/>
+ <property name="create.date" value=""/>
+ <property name="create.rights" value=""/>
+ <property name="create.userid" value=""/>
+ <property name="create.ipaddress" value=""/>
+
+ <!-- Add a node to the tree -->
+ <taskdef name="insertlabel" classname="org.apache.lenya.cms.ant.InsertLabelTask"/>
+ <insertlabel
+ documentid="${create.document-id}"
+ labelName="${create.child-name}"
+ language="${create.new.language}"
+ area="${authoring.area}"
+ />
+
+ <!-- Init the workflow history -->
+ <echo>init the workflow history with document-id: ${create.document-id}</echo>
+ <echo>with document-type: ${create.doctype}</echo>
+ <echo>with language: ${create.new.language}</echo>
+ <init-history
+ documentid="${create.document-id}"
+ documenttype="${create.doctype}"
+ language="${create.new.language}"
+ userid="${create.userid}"
+ machineip="${create.ipaddress}"
+ />
+
+ <!-- Copy the existing file over -->
+ <property name="document.old.file" value=""/>
+ <mapdocumentidtofile
+ area="${authoring.area}"
+ documentid="${create.document-id}"
+ language="${create.old.language}"
+ propertyname="document.old.file"
+ />
+ <echo>Old file: ${document.old.file}</echo>
+ <property name="document.new.file" value=""/>
+ <mapdocumentidtofile
+ area="${authoring.area}"
+ documentid="${create.document-id}"
+ language="${create.new.language}"
+ propertyname="document.new.file"
+ />
+ <echo>New file: ${document.new.file}</echo>
+
+ <echo>Add the meta data to the newly created file: ${document.new.file}</echo>
+ <!-- Add the meta data to the newly created file. -->
+ <xslt in="${document.old.file}"
+ out="${document.new.file}"
+ force="true"
+ style="${pub.dir}/../unizh/xslt/authoring/addMetaData.xsl">
+ <param name="title" expression="${create.title}"/>
+ <param name="creator" expression="${create.creator}"/>
+ <param name="subject" expression="${create.subject}"/>
+ <param name="description" expression="${create.description}"/>
+ <param name="language" expression="${create.new.language}"/>
+ <param name="publisher" expression="${create.publisher}"/>
+ <param name="date" expression="${create.date}"/>
+ <param name="rights" expression="${create.rights}"/>
+ </xslt>
+ </target>
+
+ <!-- Remove a language from an existing document -->
+ <target name="remove-language">
+
+ <property name="remove.label.document-id" value=""/>
+ <property name="remove.label.label-name" value=""/>
+ <property name="remove.label.language" value=""/>
+
+ <!-- Remove a label from a node in the tree -->
+ <echo>Remove label: ${remove.label.label-name}</echo>
+ <echo>for language: ${remove.label.language}</echo>
+ <echo>from document: ${remove.label.document-id}</echo>
+ <echo>in area: ${authoring.area}</echo>
+ <taskdef name="removelabel" classname="org.apache.lenya.cms.ant.RemoveLabelTask"/>
+ <removelabel
+ documentid="${remove.label.document-id}"
+ labelName="${remove.label.label-name}"
+ language="${remove.label.language}"
+ area="${authoring.area}"
+ />
+ <!-- Remove the language document -->
+ <property name="document.file" value=""/>
+ <mapdocumentidtofile
+ area="${authoring.area}"
+ documentid="${remove.label.document-id}"
+ language="${remove.label.language}"
+ propertyname="document.file"
+ />
+ <echo>Remove file: ${document.file}</echo>
+ <delete file="${document.file}"/>
+ </target>
+
+ <!-- Save the dublin core meta data -->
+ <target name="save-meta-data">
+
+ <property name="save.meta.documentid" value=""/>
+ <property name="save.meta.area" value=""/>
+ <property name="save.meta.creator" value=""/>
+ <property name="save.meta.title" value=""/>
+ <property name="save.meta.description" value=""/>
+ <property name="save.meta.subject" value=""/>
+ <property name="save.meta.language" value=""/>
+ <property name="save.meta.publisher" value=""/>
+ <property name="save.meta.rights" value=""/>
+
+ <echo>Writing meta data</echo>
+ <echo>meta.documentid ${save.meta.documentid}</echo>
+ <echo>meta.area ${save.meta.area}</echo>
+ <echo>meta.creator ${save.meta.creator}</echo>
+ <echo>meta.title ${save.meta.title}</echo>
+ <echo>meta.description ${save.meta.description}</echo>
+ <echo>meta.subject ${save.meta.subject}</echo>
+ <echo>meta.language ${save.meta.language}</echo>
+ <echo>meta.publisher ${save.meta.publisher}</echo>
+ <echo>meta.rights ${save.meta.rights}</echo>
+
+ <taskdef name="write-dc-params" classname="org.apache.lenya.cms.ant.WriteDCParametersTask"/>
+ <write-dc-params
+ documentid="${save.meta.documentid}"
+ area="${save.meta.area}"
+ language="${save.meta.language}"
+ title="${save.meta.title}"
+ creator="${save.meta.creator}"
+ subject="${save.meta.subject}"
+ description="${save.meta.description}"
+ publisher="${save.meta.publisher}"
+ rights="${save.meta.rights}"
+ />
+ </target>
+
+ <!-- Remove an asset -->
+ <target name="remove-asset">
+ <property name="remove.asset.document-id" value=""/>
+ <property name="remove.asset.name" value=""/>
+ <echo>Remove file: ${pub.dir}/${authoring.resource.dir}/${remove.asset.document-id}/${remove.asset.name}</echo>
+ <echo>Remove file: ${pub.dir}/${authoring.resource.dir}/${remove.asset.document-id}/${remove.asset.name}.meta</echo>
+ <delete file="${pub.dir}/${authoring.resource.dir}/${remove.asset.document-id}/${remove.asset.name}"/>
+ <delete file="${pub.dir}/${authoring.resource.dir}/${remove.asset.document-id}/${remove.asset.name}.meta"/>
+ </target>
+
+ <!-- Insert an asset -->
+ <target name="insert-asset">
+ <property name="insert.asset.assetXPath" value=""/>
+ <property name="insert.asset.insertWhere" value=""/>
+ <property name="insert.asset.insertTemplate" value="insertAsset.xml"/>
+ <property name="insert.asset.area" value=""/>
+ <property name="insert.asset.document-id" value=""/>
+ <property name="insert.asset.language" value=""/>
+ <property name="asset.data" value=""/>
+ <property name="insert.asset.type" value=""/>
+ <property name="insert.asset.size" value=""/>
+ <property name="insert.asset.caption" value=""/>
+ <property name="insert.asset.link" value=""/>
+
+ <echo>Generate temporary xsl style sheet with ${pub.dir}/../xslt/util/generate-insertAsset-xsl.xsl </echo>
+ <echo>from ${pub.dir}/config/assets/${insert.asset.insertTemplate}</echo>
+ <tempfile property="temp.stylesheet"/>
+ <tempfile property="temp.file"/>
+ <xslt in="${pub.dir}/config/assets/${insert.asset.insertTemplate}"
+ out="${temp.stylesheet}"
+ force="true"
+ style="${pub.dir}/../../xslt/util/generate-insertAsset-xsl.xsl">
+ <param name="assetXPath" expression="${insert.asset.assetXPath}"/>
+ <param name="insertWhere" expression="${insert.asset.insertWhere}"/>
+ </xslt>
+
+ <property name="document.file" value=""/>
+ <mapdocumentidtofile
+ area="${insert.asset.area}"
+ documentid="${insert.asset.document-id}"
+ language="${insert.asset.language}"
+ propertyname="document.file"
/>
-
-</target>
-<target name = "newcopydocumentid">
+ <basename property="asset.filename" file="${asset.data}"/>
+ <echo>Apply temporary stylesheet (${temp.file}) on document ${document.file}</echo>
+ <echo>with args data: ${asset.filename}</echo>
+ <echo>type: ${insert.asset.type}</echo>
+ <echo>size: ${insert.asset.size}</echo>
+ <echo>caption: ${insert.asset.caption}</echo>
+ <echo>link: ${insert.asset.link}</echo>
+ <xslt in="${document.file}"
+ out="${temp.file}"
+ force="true"
+ style="${temp.stylesheet}">
+ <param name="data" expression="${asset.filename}"/>
+ <param name="type" expression="${insert.asset.type}"/>
+ <param name="size" expression="${insert.asset.size}"/>
+ <param name="caption" expression="${insert.asset.caption}"/>
+ <param name="link" expression="${insert.asset.link}"/>
+ </xslt>
+ <move file="${temp.file}" tofile="${document.file}"/>
+ </target>
+
<taskdef name="computesecdocumentid" classname="org.apache.lenya.cms.ant.ComputeCopyDocumentId"/>
- <computesecdocumentid
- firstdocumentid="${node.firstdocumentid}"
- secdocumentid="${node.secdocumentid}"
- absolutetreepath="${pub.dir}/${authoring.dir}/${sitetree}"
- />
- <echo>the document id for the copy is now ${node.newdocumentid}</echo>
-</target>
+ <target name = "newcopydocumentid">
+ <computesecdocumentid
+ area="${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secdocumentid="${node.secdocumentid}"
+ />
+ <echo>the document id for the copy is now ${node.newdocumentid}</echo>
+ </target>
-<target name = "newnamedocumentid">
- <taskdef name="computerenamedocumentid" classname="org.apache.lenya.cms.ant.ComputeRenameDocumentId"/>
- <computerenamedocumentid
- firstdocumentid="${node.firstdocumentid}"
- secdocumentid="${node.secdocumentid}"
- absolutetreepath="${pub.dir}/${authoring.dir}/${sitetree}"
- />
- <echo>the document id for the renamed file is now ${node.newdocumentid}</echo>
-</target>
+ <target name = "newnamedocumentid">
+ <taskdef name="computerenamedocumentid" classname="org.apache.lenya.cms.ant.ComputeRenameDocumentId"/>
+ <computerenamedocumentid
+ area="authoring"
+ firstdocumentid="${node.firstdocumentid}"
+ secdocumentid="${node.secdocumentid}"
+ />
+ <echo>the document id for the renamed file is now ${node.newdocumentid}</echo>
+ </target>
+
+ <taskdef name="computearchivedocumentid" classname="org.apache.lenya.cms.ant.ComputeArchiveDocumentId"/>
+
+ <target name = "newarchivedocumentid">
+ <computearchivedocumentid
+ area="${secarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secdocumentid="${node.secdocumentid}"
+ />
+ <echo>the document id for the ${secarea} is ${node.newdocumentid}</echo>
+ </target>
<taskdef name="mapdocumentidtopath" classname="org.apache.lenya.cms.ant.DocumentIdToPath"/>
-<target name = "authdocumentpaths">
+<target name = "firstdocumentpath">
<mapdocumentidtopath
- area="${authoring.area}"
+ area="${firstarea}"
documentid="${node.firstdocumentid}"
propertyname="file.firstdocumentdir"
/>
+</target>
+<target name = "secdocumentpath">
<mapdocumentidtopath
- area="${authoring.area}"
+ area="${secarea}"
documentid="${node.newdocumentid}"
propertyname="file.secdocumentdir"
/>
</target>
-<target name = "copyDocument" depends="newcopydocumentid, authdocumentpaths">
- <echo>Copy Content</echo>
- <copy todir="${file.secdocumentdir}">
- <fileset dir="${file.firstdocumentdir}"/>
- </copy>
-
- <echo>Copy Resources</echo>
- <mkdir dir="${pub.dir}/${authoring.resource.dir}/${node.firstdocumentid}"/>
- <copy todir="${pub.dir}/${authoring.resource.dir}/${node.newdocumentid}">
- <fileset dir="${pub.dir}/${authoring.resource.dir}/${node.firstdocumentid}/"/>
- </copy>
+<target name = "livedocumentpath">
+ <mapdocumentidtopath
+ area="${live.area}"
+ documentid="${node.firstdocumentid}"
+ propertyname="file.firstdocumentdir"
+ />
+</target>
- <echo>Copy Workflow</echo>
- <!-- To Do -->
+<taskdef name="copycontent" classname="org.apache.lenya.cms.ant.CopyContentTask"/>
+<taskdef name="copyworkflow" classname="org.apache.lenya.cms.ant.InitCopyWorkflowTask"/>
+
+<target name = "copyDocument" depends="newcopydocumentid">
+ <echo>Copy Content</echo>
+ <copycontent
+ firstarea = "${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secarea="${secarea}"
+ secdocumentid="${node.newdocumentid}"
+ />
+
+ <copyresources
+ firstarea = "${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secarea="${secarea}"
+ secdocumentid="${node.newdocumentid}"
+ />
- <echo> Copy node of firstdocumentid to secdocumentid in</echo>
- <echo> the tree ${pub.dir}/${authoring.dir}/${sitetree}</echo>
+ <echo> Insert copied node</echo>
<taskdef name="insertcopynode" classname="org.apache.lenya.cms.ant.InsertCopyNode"/>
+ <copyworkflow
+ firstdocumentid="${node.firstdocumentid}"
+ secdocumentid="${node.newdocumentid}"
+ firstarea="${firstarea}"
+ secarea="${secarea}"
+ userid="${copy.userid}"
+ machineip="${copy.ipaddress}"
+ />
+
<insertcopynode
firstdocumentid="${node.firstdocumentid}"
secdocumentid="${node.newdocumentid}"
- absolutefirsttreepath="${pub.dir}/${authoring.dir}/${sitetree}"
- absolutesectreepath="${pub.dir}/${authoring.dir}/${sitetree}"
+ firstarea="${firstarea}"
+ secarea="${secarea}"
+ />
+
+</target>
+
+<taskdef name="setareaproperties" classname="org.apache.lenya.cms.ant.SetAreaProperties"/>
+<target name = "firstareaproperties">
+ <setareaproperties
+ area="${firstarea}"
+ dirpropertyname="firstarea.dir"
/>
</target>
+<target name = "secareaproperties">
+ <setareaproperties
+ area="${secarea}"
+ dirpropertyname="secarea.dir"
+ />
+</target>
+
+<taskdef name="movenode" classname="org.apache.lenya.cms.ant.MoveNode"/>
+<taskdef name="moveworkflow" classname="org.apache.lenya.cms.ant.MoveWorkflowTask"/>
+<taskdef name="copypolicies" classname="org.apache.lenya.cms.ant.CopyPoliciesTask"/>
<target name = "move">
<echo>Copy Content</echo>
- <copy todir="${file.secdocumentdir}">
- <fileset dir="${file.firstdocumentdir}"/>
- </copy>
-
+ <copycontent
+ firstarea = "${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secarea="${secarea}"
+ secdocumentid="${node.newdocumentid}"
+ />
+
<echo>Copy Resources</echo>
- <mkdir dir="${pub.dir}/${authoring.resource.dir}/${node.firstdocumentid}"/>
- <copy todir="${pub.dir}/${authoring.resource.dir}/${node.newdocumentid}">
- <fileset dir="${pub.dir}/${authoring.resource.dir}/${node.firstdocumentid}/"/>
- </copy>
+ <copyresources
+ firstarea = "${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secarea="${secarea}"
+ secdocumentid="${node.newdocumentid}"
+ />
+
+ <echo>Copy Policies</echo>
+ <copypolicies
+ firstarea = "${firstarea}"
+ firstdocumentid="${node.firstdocumentid}"
+ secarea="${secarea}"
+ secdocumentid="${node.newdocumentid}"
+ policiesDir="${pub.dir}/${policies.dir}"
+ />
<echo>Copy Revision</echo>
- <mkdir dir="${pub.dir}/${rcml.dir}/${authoring.dir}/${node.firstdocumentid}"/>
- <copy todir="${pub.dir}/${rcml.dir}/${authoring.dir}/${node.newdocumentid}">
- <fileset dir="${pub.dir}/${rcml.dir}/${authoring.dir}/${node.firstdocumentid}/"/>
+ <mkdir dir="${pub.dir}/${rcml.dir}/${firstarea.dir}/${file.firstdocumentdir}"/>
+ <copy todir="${pub.dir}/${rcml.dir}/${secarea.dir}/${file.secdocumentdir}">
+ <fileset dir="${pub.dir}/${rcml.dir}/${firstarea.dir}/${file.firstdocumentdir}/"/>
</copy>
<echo>Copy Backups</echo>
- <mkdir dir="${pub.dir}/${rcbak.dir}/${authoring.dir}${node.firstdocumentid}"/>
- <copy todir="${pub.dir}/${rcbak.dir}/${authoring.dir}/${node.newdocumentid}">
- <fileset dir="${pub.dir}/${rcbak.dir}/${authoring.dir}${node.firstdocumentid}/"/>
+ <mkdir dir="${pub.dir}/${rcbak.dir}/${firstarea.dir}/${file.firstdocumentdir}"/>
+ <copy todir="${pub.dir}/${rcbak.dir}/${secarea.dir}/${file.secdocumentdir}">
+ <fileset dir="${pub.dir}/${rcbak.dir}/${firstarea.dir}/${file.firstdocumentdir}/"/>
</copy>
- <echo>Copy Workflow</echo>
- <!-- To Do -->
-
- <echo> Move node of firstdocumentid to secdocumentid in</echo>
- <echo> the tree ${pub.dir}/${authoring.dir}/${sitetree}</echo>
+ <moveworkflow
+ firstdocumentid="${node.firstdocumentid}"
+ secdocumentid="${node.newdocumentid}"
+ firstarea="${firstarea}"
+ secarea="${secarea}"
+ />
- <taskdef name="movenode" classname="org.apache.lenya.cms.ant.MoveNode"/>
<movenode
firstdocumentid="${node.firstdocumentid}"
secdocumentid="${node.newdocumentid}"
- absolutefirsttreepath="${pub.dir}/${authoring.dir}/${sitetree}"
- absolutesectreepath="${pub.dir}/${authoring.dir}/${sitetree}"
+ firstarea="${firstarea}"
+ secarea="${secarea}"
+ refdocumentid = "${node.refdocumentid}"
/>
<echo> Delete document with id ${node.firstdocumentid}</echo>
+ <delete includeEmptyDirs="true">
+ <fileset dir="${pub.dir}/">
+ <include name="**/${firstarea}/**/${file.firstdocumentdir}/"/>
+ <include name="**/${policies.dir}/${live.area}/${file.firstdocumentdir}/"/>
+ <exclude name="**/${secarea}/**/${file.secdocumentdir}/"/>
+ </fileset>
+ </delete>
- <echo>Delete Content</echo>
- <delete dir="${file.firstdocumentdir}" includeemptydirs="true"/>
-
- <echo>Delete Resources</echo>
- <delete dir="${pub.dir}/${authoring.resource.dir}/${node.firstdocumentid}" includeemptydirs="true"/>
-
- <echo>Delete Revision</echo>
- <delete dir="${pub.dir}/${rcml.dir}/${authoring.dir}/${node.firstdocumentid}"/>
+</target>
- <echo>Delete Backups</echo>
- <delete dir="${pub.dir}/${rcbak.dir}/${authoring.dir}/${node.firstdocumentid}"/>
+ <target name = "rewrite-links">
- <echo>Delete Workflow</echo>
- <!-- To Do -->
-
-</target>
+ <taskdef name="linkRewrite" classname="org.apache.lenya.cms.ant.LinkRewriteTask"/>
+
+ <linkRewrite baseDir="${pub.dir}/${authoring.dir}"
+ stylesheet="${pub.dir}/../unizh/xslt/linkRewrite.xsl"
+ area="${authoring.area}"
+ oldDocumentId="${node.firstdocumentid}"
+ newDocumentId="${node.newdocumentid}"/>
+
+ </target>
+
+ <taskdef name="renameLabel" classname="org.apache.lenya.cms.ant.RenameLabelTask"/>
+
+ <target name = "rename-label">
+ <property name="rename.label.document-id" value=""/>
+ <property name="rename.label.label-name" value=""/>
+ <property name="rename.label.language" value=""/>
+ <property name="rename.label.area" value=""/>
+
+ <echo>Rename Label</echo>
+ <renameLabel
+ documentid="${rename.label.document-id}"
+ labelName="${rename.label.label-name}"
+ language="${rename.label.language}"
+ area="${rename.label.area}"
+ />
+ </target>
-<target name = "moveDocument" depends="newcopydocumentid, authdocumentpaths, move">
+<target name = "moveDocument" depends="firstareaproperties,
+ secareaproperties, newcopydocumentid, firstdocumentpath,
+ secdocumentpath, move, rewrite-links">
<echo>moveDocument</echo>
</target>
-<target name = "renameDocument" depends="newnamedocumentid, authdocumentpaths, move">
+<target name = "renameDocument" depends="firstareaproperties,
+ secareaproperties, newnamedocumentid, firstdocumentpath,
+ secdocumentpath, move, rewrite-links">
+ <echo>renameDocument</echo>
</target>
-<taskdef name="mapdocumentidtopath" classname="org.apache.lenya.cms.ant.DocumentIdToPath"/>
-
-<target name = "livedocumentpath">
- <mapdocumentidtopath
- area="${live.area}"
+<target name = "setIdentifier">
+ <taskdef name="setidentifier" classname="org.apache.lenya.cms.ant.SetIdentifier"/>
+ <setidentifier
+ area="${firstarea}"
documentid="${node.firstdocumentid}"
- propertyname="file.firstdocumentdir"
/>
</target>
+<target name = "archiveDocument" depends="firstareaproperties,
+ secareaproperties, newarchivedocumentid, firstdocumentpath,
+ secdocumentpath, setIdentifier, move">
+ <echo>archiveDocument</echo>
+</target>
+
+<target name = "deleteDocument" depends="firstareaproperties,
+ secareaproperties, newarchivedocumentid, firstdocumentpath,
+ secdocumentpath, setIdentifier, move">
+ <echo>deleteDocument</echo>
+</target>
+
+<target name = "restoreDocument" depends="firstareaproperties,
+ secareaproperties, newcopydocumentid, firstdocumentpath,
+ secdocumentpath, move">
+ <echo>restore Document</echo>
+</target>
+
<target name = "deactivateDocument" depends="livedocumentpath">
- <echo>deactivateDocument</echo>
- <echo> Delete node of document ${node.firstdocumentid} from </echo>
- <echo> the area ${live.area}</echo>
+ <echo>deactivate Document</echo>
- <taskdef name="deletenode" classname="org.apache.lenya.cms.ant.DeleteNodeTask"/>
+ <taskdef name="deletelanguagenode" classname="org.apache.lenya.cms.ant.DeleteLanguageNodeTask"/>
- <deletenode
+ <deletelanguagenode
+ language ="${node.language}"
documentid="${node.firstdocumentid}"
area="${live.area}"
/>
- <echo> Delete document with id ${node.firstdocumentid} from live</echo>
+ <echo>Delete Content</echo>
+ <taskdef name="deletecontent" classname="org.apache.lenya.cms.ant.DeleteContentTask"/>
- <echo>Delete Content from live</echo>
- <delete dir="${file.firstdocumentdir}" includeemptydirs="true"/>
+ <deletecontent
+ language ="${node.language}"
+ documentid="${node.firstdocumentid}"
+ area="${live.area}"
+ />
- <echo>Delete Resources from live</echo>
- <delete dir="${pub.dir}/${live.resource.dir}/${node.firstdocumentid}" includeemptydirs="true"/>
+ <echo>Delete Resources</echo>
+ <taskdef name="deactivateresources" classname="org.apache.lenya.cms.ant.DeactivateResourcesTask"/>
- <echo>Delete Meta (To Do)</echo>
- <!-- To Do -->
+ <deactivateresources
+ language ="${node.language}"
+ documentid="${node.firstdocumentid}"
+ area="${live.area}"
+ />
- <echo>Delete Workflow (To Do)</echo>
- <!-- To Do -->
-
</target>
+<target name = "deleteTrash">
+ <echo>delete the trash</echo>
+ <!-- To do workflow -->
+ <delete includeEmptyDirs="true">
+ <fileset dir="${pub.dir}/">
+ <include name="**/${trash.dir}/**"/>
+ <exclude name="**/${trash.dir}/${sitetree}"/>
+ <exclude name="**/${trash.dir}"/>
+ <include name="**/${trash.resource.dir}/**"/>
+ <exclude name="**/${trash.resource.dir}"/>
+ <include name="**/${wf.history.trash.dir}/**"/>
+ <exclude name="**/${wf.history.trash.dir}"/>
+ </fileset>
+ </delete>
-<target name="initworkflow">
- <echo>init the workflow history</echo>
- <echo>document-id: ${initworkflow.document-id}</echo>
- <echo>document-type: ${initworkflow.document-type}</echo>
- <echo>language: ${initworkflow.language}</echo>
- <echo>user-id: ${initworkflow.user-id}</echo>
- <echo>machine-ip: ${initworkflow.machine-ip}</echo>
- <init-history
- documentid="${initworkflow.document-id}"
- documenttype="${initworkflow.document-type}"
- language="${initworkflow.language}"
- userid="${initworkflow.user-id}"
- machineip="${initworkflow.machine-ip}"
- />
+ <taskdef name="resetsitetree" classname="org.apache.lenya.cms.ant.SiteTreeResetTask"/>
+ <resetsitetree
+ area="${trash.area}"
+ />
+
+</target>
+
+<target name="movenode">
+ <property name="movenode.documentid" value=""/>
+ <property name="movenode.direction" value=""/>
+
+ <echo>Moving sitetree node</echo>
+ <echo>Document ID: ${movenode.documentid}</echo>
+ <echo>Direction: ${movenode.direction}</echo>
+
+ <taskdef name="movenodeupdown" classname="org.apache.lenya.cms.ant.MoveSiteTreeNodeTask"/>
+ <movenodeupdown
+ documentid="${movenode.documentid}"
+ direction="${movenode.direction}"
+ />
</target>
</project>
1.9 +57 -2 cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/tasks.xconf
Index: tasks.xconf
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/tasks.xconf,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- tasks.xconf 16 Oct 2003 22:02:50 -0000 1.8
+++ tasks.xconf 9 Nov 2003 05:03:01 -0000 1.9
@@ -12,12 +12,32 @@
<label>Publish</label>
<parameter name="target" value="publish"/>
</task>
-
+
<task id="create" class="org.apache.lenya.cms.task.AntTask">
<label>Create</label>
<parameter name="target" value="create"/>
</task>
+ <task id="create-language" class="org.apache.lenya.cms.task.AntTask">
+ <label>CreateLanguage</label>
+ <parameter name="target" value="create-language"/>
+ </task>
+
+ <task id="remove-language" class="org.apache.lenya.cms.task.AntTask">
+ <label>RemoveLanguage</label>
+ <parameter name="target" value="remove-language"/>
+ </task>
+
+ <task id="rename-label" class="org.apache.lenya.cms.task.AntTask">
+ <label>Edit Navigation Title</label>
+ <parameter name="target" value="rename-label"/>
+ </task>
+
+ <task id="save-meta-data" class="org.apache.lenya.cms.task.AntTask">
+ <label>SaveMetaData</label>
+ <parameter name="target" value="save-meta-data"/>
+ </task>
+
<task id="copyDocument" class="org.apache.lenya.cms.task.AntTask">
<label>CopyOfDocument</label>
<parameter name="target" value="copyDocument"/>
@@ -34,8 +54,43 @@
</task>
<task id="deactivateDocument" class="org.apache.lenya.cms.task.AntTask">
- <label>DeactivateDocument</label>
+ <label>Deactivate</label>
<parameter name="target" value="deactivateDocument"/>
+ </task>
+
+ <task id="movenode" class="org.apache.lenya.cms.task.AntTask">
+ <label>Move Node</label>
+ <parameter name="target" value="movenode"/>
+ </task>
+
+ <task id="deleteDocument" class="org.apache.lenya.cms.task.AntTask">
+ <label>DeleteDocument</label>
+ <parameter name="target" value="deleteDocument"/>
+ </task>
+
+ <task id="archiveDocument" class="org.apache.lenya.cms.task.AntTask">
+ <label>ArchiveDocument</label>
+ <parameter name="target" value="archiveDocument"/>
+ </task>
+
+ <task id="remove-asset" class="org.apache.lenya.cms.task.AntTask">
+ <label>RemoveAsset</label>
+ <parameter name="target" value="remove-asset"/>
+ </task>
+
+ <task id="insert-asset" class="org.apache.lenya.cms.task.AntTask">
+ <label>InsertAsset</label>
+ <parameter name="target" value="insert-asset"/>
+ </task>
+
+ <task id="restoreDocument" class="org.apache.lenya.cms.task.AntTask">
+ <label>RestoreDocument</label>
+ <parameter name="target" value="restoreDocument"/>
+ </task>
+
+ <task id="deleteTrash" class="org.apache.lenya.cms.task.AntTask">
+ <label>DeleteTrash</label>
+ <parameter name="target" value="deleteTrash"/>
</task>
</tasks>
1.1 cocoon-lenya/src/webapp/lenya/pubs/default/lenya/content/authoring/create-language.xsp
Index: create-language.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<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:dc="http://purl.org/dc/elements/1.1/"
>
<xsp:structure>
<xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
<xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
<xsp:include>org.apache.lenya.cms.publication.DocumentException</xsp:include>
<xsp:include>java.util.HashMap</xsp:include>
</xsp:structure>
<parent-child>
<xsp:logic>
String status = <xsp-request:get-parameter name="status"/>;
// get the parentId
String parentId = <xsp-request:get-parameter name="parent-uri"/>;
if (parentId == null) {
parentId = <input:get-attribute module="page-envelope" as="string" name="document-id"/>;
// for creation purposes the parentid "/index" (the home page) is special.
if (parentId.equals("/index")) {
parentId = "/";
}
}
if ((status != null) && (status.equals("failed"))) {
<xsp:content><exception/></xsp:content>
}
HashMap map = new HashMap();
Publication pub = (Publication) <input:get-attribute module="page-envelope" as="object" name="publication"/>;
String[] languages = pub.getLanguages();
for (int i = 0; i < languages.length; i++) {
map.put(languages[i], null);
}
Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
String[] usedLanguages = null;
try {
usedLanguages = doc.getLanguages();
} catch (DocumentException e) {}
if (usedLanguages != null) {
for (int i = 0; i < usedLanguages.length; i++) {
map.remove(usedLanguages[i]);
}
}
String[] validLanguages = (String[])map.keySet().toArray(new String[map.keySet().size()]);
</xsp:logic>
<document-id><input:get-attribute module="page-envelope" as="string" name="document-id"/></document-id>
<referer><xsp-request:get-uri/></referer>
<doctype><xsp:expr><xsp-request:get-parameter name="doctype"/></xsp:expr></doctype>
<user-id><input:get-attribute module="access-control" name="user-id"/></user-id>
<ip-address><input:get-attribute module="access-control" name="ip-address"/></ip-address>
<document-language><input:get-attribute module="page-envelope" name="document-language"/></document-language>
<dc:creator><input:get-attribute module="access-control" name="user-id"/> (<input:get-attribute module="access-control" name="user-name"/>)</dc:creator>
<dc:subject></dc:subject>
<dc:publisher>University of Zurich</dc:publisher>
<dc:date><input:get-attribute module="date" name="currentDate"/></dc:date>
<dc:rights>University of Zurich</dc:rights>
<dc:languages>
<xsp:logic>
for (int i = 0; i < validLanguages.length; i++) {
<xsp:content>
<dc:language><xsp:expr>validLanguages[i]</xsp:expr></dc:language>
</xsp:content>
}
</xsp:logic>
</dc:languages>
</parent-child>
</xsp:page>
1.48 +227 -68 cocoon-lenya/src/webapp/lenya/pubs/default/config/menus/generic.xsp
Index: generic.xsp
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/config/menus/generic.xsp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- generic.xsp 5 Nov 2003 10:32:50 -0000 1.47
+++ generic.xsp 9 Nov 2003 05:03:01 -0000 1.48
@@ -1,92 +1,251 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsp:page
- language="java"
- xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
- xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
- xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
- xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xsp-lenya="http://apache.org/cocoon/lenya/xsp/1.0"
- xmlns:xsp-request="http://apache.org/xsp/request/2.0"
- >
-
+
+<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: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");
+ </xsp:logic>
+
<xsp:logic>
- String xmlSource = <input:get-attribute as="string" module="page-envelope" name="document-path"/>;
- String sourcesParameter = "sources=" + xmlSource;
- String urisParameter = "uris=" + <input:get-attribute as="string" module="page-envelope" name="document-url"/>;
- 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"/>;
+ 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="document-url"/>;
+
+ boolean isDocument = false;
+ {
+ Object document = <input:get-attribute module="page-envelope" as="object" name="document"/>;
+ try {
+ if (document != "" && ((Document) document).exists()) {
+ isDocument = true;
}
- }
- catch (Exception e) {
+ }
+ catch (Exception e) {
throw new ProcessingException(e);
+ }
}
- 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"/>;
</xsp:logic>
-
+
<menus>
+ <menu name="File" label="File">
+ <block>
+
+ <xsp:logic>
+ {
+ String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
+ if (Publication.ARCHIVE_AREA.equals(area) || Publication.TRASH_AREA.equals(area)) {
+ <item>New Document</item>
+ }
+ else {
+ <item uc:usecase="create" uc:step="showscreen" href="?doctype=xhtml">New Document</item>
+ }
+ }
+ </xsp:logic>
+ </block>
+ <block>
+ <xsp:logic>
+ {
+
+ if (isDocument) {
+ <xsp:content>
+ <item uc:usecase="create-language" uc:step="showscreen" href="?">New language version</item>
+ </xsp:content>
+ }
+ else {
+ <xsp:content>
+ <item>New language version</item>
+ </xsp:content>
+ }
+
+ String[] availableLanguages = (String[])<input:get-attribute module="page-envelope" as="object" name="document-languages"/>;
+ if (isDocument && availableLanguages.length > 1) {
+ <xsp:content>
+ <item uc:usecase="removelabel" uc:step="showscreen" href="?">Remove language version</item>
+ </xsp:content>
+ } else {
+ <xsp:content>
+ <item>Remove language version</item>
+ </xsp:content>
+ }
+ }
+ </xsp:logic>
+ </block>
+ <block>
+ <item uc:usecase="logout" href="?">Logout</item>
+ </block>
+ </menu>
- <menu label="File" name="File">
- <block>
- <item uc:step="showscreen" uc:usecase="create">
- <xsp:attribute name="href">?doctype=simple</xsp:attribute>New Document (simple)</item>
- <item uc:step="showscreen" uc:usecase="create">
- <xsp:attribute name="href">?doctype=xhtml</xsp:attribute>New Document (xhtml)</item>
+ <menu name="Edit" label="Search">
+
+ <block info="false">
+ <item wf:event="edit" uc:usecase="bxeng" uc:step="open" href="?">Edit with BXE</item>
+ <item wf:event="edit" uc:usecase="edit" uc:step="open" href="?form=content">Edit with Forms</item>
+ <item wf:event="edit" uc:usecase="1formedit" uc:step="open" href="?">Edit with one Form</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>Edit Metadata</item>
+ <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen"><xsp:attribute name="href"><xsp-request:get-uri/>?</xsp:attribute>Edit Navigation Title</item>
+ <item>XML Upload</item>
</block>
- <block>
+
+ <block authoring="false">
+
+ <xsp:logic>
+
+ {
+ String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
+ String docId = <input:get-attribute module="page-envelope" as="string" name="document-id"/>;
+
+ if (isDocument
+ && "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
+ && Publication.AUTHORING_AREA.equals(area)
+ && !"/index".equals(docId)) {
+ <item uc:usecase="cut" uc:step="showscreen" href="?">Cut</item>
+ }
+ else {
+ <item>Cut</item>
+ }
+
+ if (isDocument
+ && Publication.AUTHORING_AREA.equals(area)
+ && !"/index".equals(docId)) {
+ <item uc:usecase="copy" uc:step="showscreen" href="?">Copy</item>
+ }
+ else {
+ <item>Copy</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
+ && !"".equals(clipboard)
+ && Publication.AUTHORING_AREA.equals(area)
+ && !currentDocumentId.startsWith(clipboard)
+ && !"/index".equals(docId)) {
+ <item uc:usecase="paste" uc:step="showscreen" href="?">Paste</item>
+ }
+ else {
+ <item>Paste</item>
+ }
+ }
+ </xsp:logic>
+
+ </block>
+ <block authoring="false">
+ <xsp:logic>
+ if (isDocument && "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)) {
+ <item uc:usecase="rename" uc:step="showscreen" href="?">Rename URL</item>
+ }
+ else {
+ <item>Rename URL</item>
+ }
+
+ if (isDocument) {
+ <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen" href="?">Edit Navigation Title</item>
+ }
+ else {
+ <item>Edit Navigation Title</item>
+ }
+ </xsp:logic>
+ </block>
+ <block authoring="false">
+ <xsp:logic>
+ if (isDocument
+ && "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
+ && !"/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>Move Up</item>
+ <item uc:usecase="move-node" uc:step="move-node"><xsp:attribute name="href"><xsp-request:get-uri/>?properties.movenode.direction=down</xsp:attribute>Move Down</item>
+ }
+ else {
+ <item>Move Up</item>
+ <item>Move Down</item>
+ }
+ </xsp:logic>
+ </block>
+ <block authoring="false">
+
+ <xsp:logic>
+ {
+
+ if (isDocument &&
+ !"/index".equals(<input:get-attribute module="page-envelope" as="string" name="document-id"/>)) {
+ <item wf:event="delete" uc:usecase="delete" uc:step="showscreen" href="?">Delete</item>
+ <item wf:event="archive" uc:usecase="archive" uc:step="showscreen" href="?">Archive</item>
+ }
+ else {
+ <item>Delete</item>
+ <item>Archive</item>
+ }
+
+ String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
+ if (isDocument && (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>Restore</item>
+ }
+ }
+ </xsp:logic>
+
+ </block>
+
+ </menu>
+
+ <menu name="Workflow" label="Help">
+ <block>
+ <xsp:logic>
+ {
+ if (isDocument) {
<item uc:usecase="submit" uc:step="showscreen" wf:event="submit" href="?">Submit</item>
<item uc:usecase="reject" uc:step="showscreen" wf:event="reject" href="?">Reject</item>
- <item uc:usecase="publish" uc:step="showscreen" wf:event="publish">
- <xsp:attribute name="href">?<xsp:expr>urisParameter</xsp:expr>&<xsp:expr>sourcesParameter</xsp:expr>&task-id=publish</xsp:attribute>Publish</item>
- <item uc:usecase="deactivate" uc:step="showscreen" wf:event="deactivate" href="?">Deactivate</item>
- </block>
- <block>
- <item uc:usecase="logout" uc:step="showscreen" href="?">Logout</item>
- </block>
+ <item uc:usecase="publish" uc:step="showscreen" wf:event="publish"><xsp:attribute name="href">?<xsp:expr>urisParameter</xsp:expr>&sources=<xsp:expr>xmlSource</xsp:expr>&task-id=publish</xsp:attribute>Publish</item>
+ <item uc:usecase="deactivate" uc:step="showscreen" wf:event="deactivate" href="?task-id=deactivateDocument">Deactivate</item>
+ }
+ else {
+ <item>Submit</item>
+ <item>Reject</item>
+ <item>Publish</item>
+ <item>Deactivate</item>
+ }
+ }
+ </xsp:logic>
+ </block>
</menu>
-
- <menu label="Search" name="Edit">
-<xsp:logic>
+
+ <menu name="Help" label="Debug">
+ <block>
+ <item><xsp:attribute name="href"><xsp-request:get-context-path/>/docs-new/docs/index.html</xsp:attribute>User Documentation</item>
+ <item>System Documentation</item>
+ </block>
+ <block>
+ <item href="http://cocoon.apache.org/lenya">About Apache Lenya</item>
+ </block>
+
<block>
- <item uc:usecase="edit" uc:step="open" wf:event="edit"><xsp:attribute name="href"><xsp:expr>"?form=" + docType</xsp:expr></xsp:attribute>Edit with Forms</item>
- <item uc:usecase="bxe" uc:step="open" wf:event="edit" href="?">Edit with BXE</item>
- <item uc:usecase="1formedit" uc:step="open" wf:event="edit" href="?">Edit with one Form</item>
- </block>
-</xsp:logic>
+ <item uc:usecase="view-logs" uc:step="overview" href="?">View Task Logs</item>
+ <item uc:usecase="schedule" uc:step="showscreen" href="?">Scheduler</item>
<!--
- <block>
- <item><xsp:attribute name="href"><xsp:expr>documentId + "-bxeng.html"</xsp:expr></xsp:attribute>HTML for BXE</item>
- <item><xsp:attribute name="href"><xsp:expr>documentId + "-config-bxeng.xml"</xsp:expr></xsp:attribute>Config for BXE</item>
- <item><xsp:attribute name="href"><xsp:expr>documentId + "-bxeng.xml"</xsp:expr></xsp:attribute>XML for BXE</item>
- <item href="simple-bxeng.xsl">XSLT for BXE</item>
- <item href="simple-bxeng.css">CSS for BXE</item>
- </block>
+ <item><xsp:attribute name="href">?lenya.usecase=rollback&lenya.step=showscreen&documentid=<xsp:expr>xmlSource</xsp:expr></xsp:attribute>Rollback</item>
-->
+ </block>
</menu>
-
- <menu label="Help" name="Tools">
- <block>
- <item href="?lenya.usecase=view-logs&lenya.step=overview">View Task Logs</item>
- <item href="?lenya.usecase=schedule&lenya.step=showscreen">Scheduler</item>
- <item><xsp:attribute name="href">?lenya.usecase=rollback&lenya.step=showscreen&documentid=<xsp:expr>xmlSource</xsp:expr></xsp:attribute>Rollback</item>
- </block>
- </menu>
-
- <menu label="Debug" name="Help">
- <block>
- <item><xsp:attribute name="href"><xsp-request:get-context-path/>/docs-new/docs/index.html</xsp:attribute>Documentation</item>
- <item href="http://cocoon.apache.org/lenya/">About Lenya</item>
- </block>
- </menu>
-
</menus>
+
</menu>
</xsp:page>
+
1.1 cocoon-lenya/src/webapp/lenya/pubs/default/lenya/xslt/authoring/create-language.xsl
Index: create-language.xsl
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>
<xsl:param name="lenya.usecase" select="'create-language'"/>
<xsl:template match="/">
<page:page xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0">
<page:title>Create new language version</page:title>
<page:body>
<xsl:apply-templates/>
</page:body>
</page:page>
</xsl:template>
<xsl:template match="parent-child">
<xsl:apply-templates select="exception"/>
<xsl:if test="count(//dc:language) = 0">
<div class="lenya-box">
<div class="lenya-box-title">New language for existing Document</div>
<div class="lenya-box-body">
<form method="GET" action="{/parent-child/referer}">
<table class="lenya-table-noborder">
<tr>
<td>
<p>There are already versions for all languages for this document</p>
</td>
</tr>
<tr>
<td>
<input type="button" onClick="location.href='{/parent-child/referer}';" value="Cancel"/>
</td>
</tr>
</table>
</form>
</div>
</div>
</xsl:if>
<xsl:if test="not(exception) and count(//dc:language) > 0">
<div class="lenya-box">
<div class="lenya-box-title">New language for existing Document</div>
<div class="lenya-box-body">
<form method="GET"
action="{/parent-child/referer}">
<input type="hidden" name="lenya.usecase" value="{$lenya.usecase}"/>
<input type="hidden" name="lenya.step" value="create"/>
<input type="hidden" name="properties.create.document-id" value="{/parent-child/document-id}"/>
<input type="hidden" name="properties.create.old.language" value="{/parent-child/document-language}"/>
<input type="hidden" name="properties.create.userid" value="{/parent-child/user-id}"/>
<input type="hidden" name="properties.create.ipaddress" value="{/parent-child/ip-address}"/>
<table class="lenya-table-noborder">
<tr>
<td class="lenya-form-caption">Document ID:</td><td>hidden value="<xsl:value-of select="/parent-child/document-id"/>"</td>
</tr>
<tr>
<td class="lenya-form-caption">Navigation Title*:</td><td><input class="lenya-form-element" type="text" name="properties.create.child-name"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Title*:</td><td><input class="lenya-form-element" type="text" name="properties.create.title"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Language:</td><td><select class="lenya-form-element" name="properties.create.new.language"><xsl:apply-templates select="dc:languages"/></select></td>
</tr>
<tr>
<td class="lenya-form-caption">Creator:</td><td><input class="lenya-form-element" type="hidden" name="properties.create.creator" value="{/parent-child/dc:creator}"/><xsl:value-of select="/parent-child/dc:creator"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Subject:</td><td><input class="lenya-form-element" type="text" name="properties.create.subject"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Publisher:</td><td><input class="lenya-form-element" type="text" name="properties.create.publisher" value="{/parent-child/dc:publisher}"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Date:</td><td><input class="lenya-form-element" type="hidden" name="properties.create.date" value="{/parent-child/dc:date}"/><xsl:value-of select="/parent-child/dc:date"/></td>
</tr>
<tr>
<td class="lenya-form-caption">Rights:</td><td><input class="lenya-form-element" type="text" name="properties.create.rights" value="{/parent-child/dc:rights}"/></td>
</tr>
<tr>
<td>* required fields</td>
</tr>
<tr>
<td/>
<td>
<input type="submit" value="Create"/> 
<input type="button" onClick="location.href='{/parent-child/referer}';" value="Cancel"/>
</td>
</tr>
</table>
</form>
</div>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="dc:languages">
<xsl:for-each select="dc:language">
<option><xsl:value-of select="."/></option>
</xsl:for-each>
</xsl:template>
<xsl:template match="exception">
<font color="red">EXCEPTION</font><br />
Go <a href="{../referer}">back</a> to page.<br />
<p>
Exception handling isn't very good at the moment.
For further details please take a look at the log-files
of Cocoon. In most cases it's one of the two possible exceptions:
<ol>
<li>The id is not allowed to have whitespaces</li>
<li>The id is already in use</li>
</ol>
Exception handling will be improved in the near future.
</p>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org