[Yanel-commits] rev 28472 - in
public/yanel/contributions/realms/foaf: data data/xslt
data/xslt/foaf2xhtml.xsl.yarep res-configs
src/resources/foaf/src/build
src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf
michi at wyona.com
michi at wyona.com
Mon Nov 5 10:04:24 CET 2007
Author: michi
Date: 2007-11-05 10:04:23 +0100 (Mon, 05 Nov 2007)
New Revision: 28472
Added:
public/yanel/contributions/realms/foaf/data/xslt/
public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl.yarep/
public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl.yarep/meta
Modified:
public/yanel/contributions/realms/foaf/res-configs/print.html.yanel-rc
public/yanel/contributions/realms/foaf/src/resources/foaf/src/build/dependencies.xml
public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java
Log:
XSLT started to display profiles
Added: public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
===================================================================
--- public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl (rev 0)
+++ public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl 2007-11-05 09:04:23 UTC (rev 28472)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:i18n="http://www.wyona.org/yanel/i18n/1.0"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+>
+
+<!-- IMPORTANT: Needs to correspond to the mime-type which is sent by the server! -->
+<xsl:output method="xhtml" encoding="UTF-8"/>
+<!--
+<xsl:output method="html"/>
+-->
+
+<xsl:param name="yanel.path.name" select="'NAME_IS_NULL'"/>
+<xsl:param name="yanel.path" select="'PATH_IS_NULL'"/>
+<xsl:param name="yanel.back2context" select="'BACK2CONTEXT_IS_NULL'"/>
+<xsl:param name="yarep.back2realm" select="'BACK2REALM_IS_NULL'"/>
+<xsl:param name="language" select="'LANGUAGE_IS_NULL'"/>
+<xsl:param name="content-language" select="'CONTENT_LANGUAGE_IS_NULL'"/>
+
+<xsl:param name="yanel.meta.language" select="'en'"/>
+
+<xsl:variable name="name-without-suffix" select="substring-before($yanel.path.name, '.')"/>
+
+<xsl:template match="/">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title><xsl:value-of select="/rdf:RDF/foaf:Person/foaf:name"/></title>
+</head>
+
+<body>
+<h2>Profile of <xsl:value-of select="/rdf:RDF/foaf:Person/foaf:name"/></h2>
+<p>
+...
+</p>
+</body>
+</html>
+</xsl:template>
+
+</xsl:stylesheet>
Added: public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl.yarep/meta
===================================================================
--- public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl.yarep/meta (rev 0)
+++ public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl.yarep/meta 2007-11-05 09:04:23 UTC (rev 28472)
@@ -0,0 +1 @@
+yarep_type<string>:resource
Modified: public/yanel/contributions/realms/foaf/res-configs/print.html.yanel-rc
===================================================================
--- public/yanel/contributions/realms/foaf/res-configs/print.html.yanel-rc 2007-11-05 08:41:21 UTC (rev 28471)
+++ public/yanel/contributions/realms/foaf/res-configs/print.html.yanel-rc 2007-11-05 09:04:23 UTC (rev 28472)
@@ -2,4 +2,6 @@
<yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
<yanel:rti name="foaf" namespace="http://www.wyona.org/yanel/resource/1.0"/>
+
+ <yanel:property name="xslt" value="/xslt/foaf2xhtml.xsl"/>
</yanel:resource-config>
Modified: public/yanel/contributions/realms/foaf/src/resources/foaf/src/build/dependencies.xml
===================================================================
--- public/yanel/contributions/realms/foaf/src/resources/foaf/src/build/dependencies.xml 2007-11-05 08:41:21 UTC (rev 28471)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/src/build/dependencies.xml 2007-11-05 09:04:23 UTC (rev 28472)
@@ -7,11 +7,15 @@
<artifact:dependencies pathId="maven2.classpath" filesetId="maven2.fileset">
<remoteRepository refid="wyona.remote.repository"/>
-<!--
+
<dependency groupId="wyona-org-yanel" artifactId="yanel-core" version="${yanel.source.version}"/>
--->
+ <dependency groupId="wyona-org-yanel" artifactId="yanel-impl" version="${yanel.source.version}"/>
<!-- Hardcoded Yanel dependency in order to be able to compile standalone -->
+<!--
<dependency groupId="wyona-org-yanel" artifactId="yanel-core" version="1.0-dev-rREVISION"/>
+ <dependency groupId="wyona-org-yanel" artifactId="yanel-impl" version="1.0-dev-rREVISION"/>
+-->
+
<dependency groupId="javax.servlet" artifactId="servlet-api" version="2.3"/>
</artifact:dependencies>
Modified: public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java
===================================================================
--- public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java 2007-11-05 08:41:21 UTC (rev 28471)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java 2007-11-05 09:04:23 UTC (rev 28472)
@@ -8,6 +8,7 @@
import org.wyona.yanel.core.api.attributes.ViewableV2;
import org.wyona.yanel.core.attributes.viewable.View;
import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;
+import org.wyona.yanel.impl.resources.BasicXMLResource;
import org.apache.log4j.Category;
@@ -16,7 +17,8 @@
/**
*
*/
-public class FOAFResource extends Resource implements ViewableV2 {
+public class FOAFResource extends BasicXMLResource implements ViewableV2 {
+//public class FOAFResource extends Resource implements ViewableV2 {
private static Category log = Category.getInstance(FOAFResource.class);
@@ -56,8 +58,11 @@
View view = new View();
try {
URL url = new URL(getRequest().getParameter("href"));
+/*
view.setInputStream(url.openConnection().getInputStream());
view.setMimeType(getMimeType(viewId));
+*/
+ return getXMLView(viewId, url.openConnection().getInputStream());
} catch (java.io.FileNotFoundException e) {
log.error(e);
view.setInputStream(new java.io.StringBufferInputStream(new StringBuffer("No such file: " + e.getMessage()).toString()));
More information about the Yanel-commits
mailing list