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/07/03 15:29:59 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/content/info info.xsp
gregor 2003/07/03 06:29:59
Modified: src/webapp/lenya/resources/javascript tabs.js
src/webapp/lenya/xslt/info info.xsl
src/webapp/lenya/content/info info.xsp
Log:
added permissions tab
styled tabs with css classes
Revision Changes Path
1.3 +2 -2 cocoon-lenya/src/webapp/lenya/resources/javascript/tabs.js
Index: tabs.js
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/resources/javascript/tabs.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tabs.js 13 Jun 2003 18:15:22 -0000 1.2
+++ tabs.js 3 Jul 2003 13:29:59 -0000 1.3
@@ -2,7 +2,7 @@
function Tab(i){
// Variables for customisation:
- var numberOfTabs = 5;
+ var numberOfTabs = 6;
var colourOfInactiveTab = "#999966";
var colourOfActiveTab = "#cccc99";
var colourOfInactiveLink = "#333333";
1.5 +31 -21 cocoon-lenya/src/webapp/lenya/xslt/info/info.xsl
Index: info.xsl
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/info.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- info.xsl 16 Jun 2003 09:34:32 -0000 1.4
+++ info.xsl 3 Jul 2003 13:29:59 -0000 1.5
@@ -25,49 +25,55 @@
<body onload="Tab(1)">
<!--
These are the tabs. Make sure that each of them has the correct id,
- target and corresponding number in the domTab() call.
+ target and corresponding number in the Tab() call.
-->
<a href="#" onclick="Tab(1)" id="link1" class="lenya-tablink">Overview</a>
<a href="#" onclick="Tab(2)" id="link2" class="lenya-tablink">Meta</a>
<a href="#" onclick="Tab(3)" id="link3" class="lenya-tablink">Assets</a>
<a href="#" onclick="Tab(4)" id="link4" class="lenya-tablink">Workflow</a>
<a href="#" onclick="Tab(5)" id="link5" class="lenya-tablink">Revisions</a>
+ <a href="#" onclick="Tab(6)" id="link6" class="lenya-tablink">Permissions</a>
<!--
These are the different content blocks of the tabs, each one needs to
- have the id (starting with "opt" and followed by its number) and the
- class "tab" to set the look and feel.
+ have the id (starting with "contentblock" and followed by its number) and the
+ class "lenya-tab" to set the look and feel.
-->
<div id="contentblock1" class="lenya-tab">
- <table>
+ <table class="lenya-table-noborder">
<xsl:apply-templates select="lenya-info:overview"/>
</table>
</div>
<div id="contentblock2" class="lenya-tab">
<form>
- <table>
+ <table class="lenya-table-noborder">
<xsl:apply-templates select="lenya-info:meta"/>
</table>
<input type="submit" value="Update Metadata"/>
</form>
</div>
<div id="contentblock3" class="lenya-tab">
- <table>
+ <table class="lenya-table-noborder">
<xsl:apply-templates select="lenya-info:assets"/>
</table>
<form>
- <input type="file" name="asset" size="40" />
+ <input type="file" name="asset" size="40"/>
<input type="submit" value="Upload Asset"/>
</form>
</div>
<div id="contentblock4" class="lenya-tab">
- <table>
+ <table class="lenya-table-noborder">
<xsl:apply-templates select="wf:version"/>
</table>
</div>
<div id="contentblock5" class="lenya-tab">
- <table>
- <xsl:apply-templates select="rc"/>
+ <table class="lenya-table-noborder">
+ <xsl:apply-templates select="rc:revisions"/>
+ </table>
+ </div>
+ <div id="contentblock6" class="lenya-tab">
+ <table class="lenya-table-noborder">
+ <xsl:apply-templates select="lenya-info:permissions"/>
</table>
</div>
</body>
@@ -86,26 +92,30 @@
</xsl:template>
<xsl:template match="lenya-info:meta">
- <tr><td>Title:</td><td><input type="text" id="dc:title"><xsl:attribute name="value"><xsl:value-of select="dc:title"/></xsl:attribute></input></td></tr>
- <tr><td>Creator:</td><td><input type="text" id="dc:creator"><xsl:attribute name="value"><xsl:value-of select="dc:creator"/></xsl:attribute></input></td></tr>
- <tr><td>Subject:</td><td><input type="text" id="dc:subject"><xsl:attribute name="value"><xsl:value-of select="dc:subject"/></xsl:attribute></input></td></tr>
- <tr><td>Description:</td><td><input type="text" id="dc:description"><xsl:attribute name="value"><xsl:value-of select="dc:description"/></xsl:attribute></input></td></tr>
+ <tr><td>Title:</td><td><input type="text" id="dc:title" class="lenya-form-element"><xsl:attribute name="value"><xsl:value-of select="dc:title"/></xsl:attribute></input></td></tr>
+ <tr><td>Creator:</td><td><input type="text" id="dc:creator" class="lenya-form-element"><xsl:attribute name="value"><xsl:value-of select="dc:creator"/></xsl:attribute></input></td></tr>
+ <tr><td>Subject:</td><td><input type="text" id="dc:subject" class="lenya-form-element"><xsl:attribute name="value"><xsl:value-of select="dc:subject"/></xsl:attribute></input></td></tr>
+ <tr><td>Description:</td><td><input type="text" id="dc:description" class="lenya-form-element"><xsl:attribute name="value"><xsl:value-of select="dc:description"/></xsl:attribute></input></td></tr>
<tr><td>Date:</td><td><xsl:value-of select="dc:date"/></td></tr>
- <tr><td>Rights:</td><td><input type="text" id="dc:rights"><xsl:attribute name="value"><xsl:value-of select="dc:rights"/></xsl:attribute></input></td></tr>
+ <tr><td>Rights:</td><td><input type="text" id="dc:rights" class="lenya-form-element"><xsl:attribute name="value"><xsl:value-of select="dc:rights"/></xsl:attribute></input></td></tr>
</xsl:template>
<xsl:template match="lenya-info:assets">
- <!-- <xsl:for-each select="lenya-info:asset>
- <tr><td><xsl:value-of select="."/></td><td><a href="">delete</a></td></tr>
- </xsl:for-each>-->
+ <!-- <xsl:for-each select="lenya-info:asset>-->
+ <tr><td>asset.gif<xsl:value-of select="."/></td><td><a href="">delete</a></td></tr>
+ <!-- </xsl:for-each>-->
</xsl:template>
-<xsl:template match="rc">
-<tr><td>1.0</td><td>Felix Maeder</td><td>2003-04-01 18:01</td><td>view restore</td></tr>
+<xsl:template match="rc:revisions">
+<tr><td>1.0</td><td>Felix Maeder</td><td>2003-04-01 18:01</td><td><a href="#">view</a></td><td><a href="#">restore</a></td></tr>
</xsl:template>
<xsl:template match="wf:version">
<tr><td><xsl:value-of select="@state"/></td><td><xsl:value-of select="@user"/></td><td><xsl:value-of select="@date"/></td></tr>
+</xsl:template>
+
+<xsl:template match="lenya-info:permissions">
+Permission GUI goes here
</xsl:template>
</xsl:stylesheet>
1.5 +54 -3 cocoon-lenya/src/webapp/lenya/content/info/info.xsp
Index: info.xsp
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/content/info/info.xsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- info.xsp 11 Jun 2003 09:39:55 -0000 1.4
+++ info.xsp 3 Jul 2003 13:29:59 -0000 1.5
@@ -8,8 +8,18 @@
xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
xmlns:rc="http://apache.org/cocoon/lenya/rc/1.0"
xmlns:dc="http://dc.org/2003/"
+ xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
>
+ <xsp:structure>
+ <xsp:include>org.apache.lenya.cms.rc.RevisionController</xsp:include>
+ <xsp:include>java.io.IOException</xsp:include>
+ <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
+ <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
+ <xsp:include>org.apache.lenya.cms.rc.RCEnvironment</xsp:include>
+ </xsp:structure>
+
+
<lenya-info:info>
<lenya-info:overview>
@@ -19,7 +29,7 @@
<dc:language></dc:language>
<lenya-info:lastmodifiedby></lenya-info:lastmodifiedby>
<lenya-info:lastmodified></lenya-info:lastmodified>
- <lenya-info:documentid></lenya-info:documentid>
+ <lenya-info:documentid><input:get-attribute module="page-envelope" as="object" name="document-id"/></lenya-info:documentid>
</lenya-info:overview>
<lenya-info:meta>
<dc:title></dc:title>
@@ -36,8 +46,49 @@
<wf:version date="(?)" state="redaktion" user="michael"/>
<wf:version date="(?)" event="publish" state="review" user="gregor"/>
</lenya-info:workflow>
- <lenya-info:revisions>
- </lenya-info:revisions>
+ <rc:revisions>
+ <!--
+ <xsp:logic>
+ String docId = (String)<input:get-attribute module="page-envelope" as="object" name="document-id"/>;
+ <xsp:content><documentId><xsp:expr>docId</xsp:expr></documentId></xsp:content>
+
+ Publication publication = (Publication)<input:get-attribute module="page-envelope" as="object" name="publication"/>;
+ String filename=publication.getEnvironment().getAuthoringPath() + "/" +docId;
+ <xsp:content><usecase><xsp:expr>request.getParameter("lenya.usecase")</xsp:expr></usecase></xsp:content>
+ <xsp:content><request_uri><xsp:expr>request.getRequestURI()</xsp:expr></request_uri></xsp:content>
+
+
+ String rootDir=publication.getEnvironment().getPublicationPath();
+
+ String servletContextPath = publication.getServletContext().getCanonicalPath();
+
+ RCEnvironment rcEnvironment = new RCEnvironment(servletContextPath);
+ String rcmlDirectory = rcEnvironment.getRCMLDirectory();
+ rcmlDirectory=rootDir+rcmlDirectory;
+ String backupDirectory = rcEnvironment.getBackupDirectory();
+ backupDirectory=rootDir+backupDirectory;
+
+ RevisionController rc = new RevisionController(rcmlDirectory, backupDirectory, rootDir);
+
+ org.w3c.dom.Document rcmlDoc=null;
+ try {
+ rcmlDoc=rc.getRCML(filename).getDOMDocumentClone();
+ } catch (Exception e) {
+ <rc:exception>rollback: Unable to get DOM doc for rcml file, caught exception: <xsp:expr>e.toString()</xsp:expr></rc:exception>
+ }
+ org.w3c.dom.Element rootE= (org.w3c.dom.Element)rcmlDoc.getDocumentElement();
+ org.w3c.dom.NodeList timeElements = rootE.getElementsByTagName("Time");
+
+ for (int i = 0; i < timeElements.getLength(); i++) {
+ org.w3c.dom.Element time = (org.w3c.dom.Element) timeElements.item(i);
+ time.setAttribute("humanreadable", new Date(new Long(time.getFirstChild().getNodeValue()).longValue()).toString());
+ }
+ </xsp:logic>
+ <xsp:expr>rootE</xsp:expr>
+ -->
+ </rc:revisions>
+ <lenya-info:permissions>
+ </lenya-info:permissions>
</lenya-info:info>
</xsp:page>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org