You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ro...@apache.org on 2004/10/30 19:54:00 UTC
svn commit: rev 56053 - in incubator/lenya/trunk/src/webapp/lenya: content/info xslt/bxe
Author: roku
Date: Sat Oct 30 10:54:00 2004
New Revision: 56053
Modified:
incubator/lenya/trunk/src/webapp/lenya/content/info/assets.xsp
incubator/lenya/trunk/src/webapp/lenya/xslt/bxe/image.xsl
Log:
Fixed meta data access.
Modified: incubator/lenya/trunk/src/webapp/lenya/content/info/assets.xsp
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/content/info/assets.xsp (original)
+++ incubator/lenya/trunk/src/webapp/lenya/content/info/assets.xsp Sat Oct 30 10:54:00 2004
@@ -66,17 +66,21 @@
But this would be to heavy for 1.2.1, so I do this hack here, sorry :) /roku
-->
File metaFile;
- String title;
+ String title = "";
+ String format = "";
org.w3c.dom.Document metaDoc;
try {
metaDoc = DocumentHelper.readDocument(resourceMgr.getMetaFile(resources[i]));
title = metaDoc.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/", "title").item(0).getChildNodes().item(0).getNodeValue();
+ format = metaDoc.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/", "format").item(0).getChildNodes().item(0).getNodeValue();
} catch(Exception e) { continue; }
+
<xsp:content>
<lenya-info:asset>
<dc:source><xsp:expr>resources[i].getName()</xsp:expr></dc:source>
<dc:title><xsp:expr>title</xsp:expr></dc:title>
<dc:date><xsp:expr>SimpleDateFormat.getDateInstance().format(new Date(resources[i].lastModified()))</xsp:expr></dc:date>
+ <dc:format><xsp:expr>format</xsp:expr></dc:format>
<dc:extent><xsp:expr>resources[i].length()/1024</xsp:expr></dc:extent>
</lenya-info:asset>
</xsp:content>
Modified: incubator/lenya/trunk/src/webapp/lenya/xslt/bxe/image.xsl
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/xslt/bxe/image.xsl (original)
+++ incubator/lenya/trunk/src/webapp/lenya/xslt/bxe/image.xsl Sat Oct 30 10:54:00 2004
@@ -15,7 +15,7 @@
limitations under the License.
-->
-<!-- $Id: image.xsl,v 1.10 2004/05/23 20:34:29 roku Exp $ -->
+<!-- $Id$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lenya-info="http://apache.org/cocoon/lenya/info/1.0"
@@ -163,7 +163,7 @@
<xsl:for-each select="lenya-info:asset">
<xsl:choose>
<xsl:when
- test="contains(dc:title, 'jpg') or contains(dc:title, 'gif')">
+ test="dc:format = 'image/jpeg' or dc:format = 'image/gif'">
<tr>
<td
colspan="2">
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org