[Yanel-commits] rev 28559 - in public/yanel/contributions/realms/foaf: . data/xslt src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf

michi at wyona.com michi at wyona.com
Wed Nov 7 10:00:56 CET 2007


Author: michi
Date: 2007-11-07 10:00:55 +0100 (Wed, 07 Nov 2007)
New Revision: 28559

Modified:
   public/yanel/contributions/realms/foaf/TODO.txt
   public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
   public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java
Log:
show some more info

Modified: public/yanel/contributions/realms/foaf/TODO.txt
===================================================================
--- public/yanel/contributions/realms/foaf/TODO.txt	2007-11-07 08:25:40 UTC (rev 28558)
+++ public/yanel/contributions/realms/foaf/TODO.txt	2007-11-07 09:00:55 UTC (rev 28559)
@@ -5,3 +5,4 @@
   - Implement a Meguni Implementation of Facebook (http://www.facebook.com/srch.php?nm=Sam+Ruby)
   - Implement a Meguni Implementation of LinkedIn (http://www.linkedin.com/search?search=&sik=1194372540647&keywords=Michael+Wechner&sortCriteria=4)
   - Implement a FOAF Yanel User, such that one can use the E-Mail address to login
+  - Protect RDF data!

Modified: public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
===================================================================
--- public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl	2007-11-07 08:25:40 UTC (rev 28558)
+++ public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl	2007-11-07 09:00:55 UTC (rev 28559)
@@ -9,6 +9,7 @@
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:foaf="http://xmlns.com/foaf/0.1/"
   xmlns:wyona="http://www.wyona.org/foaf/1.0"
+  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 >
 
 <!-- IMPORTANT: Needs to correspond to the mime-type which is sent by the server! -->
@@ -35,15 +36,51 @@
 </head>
 
 <body>
-<a href="?yanel.resource.viewid=source">XML</a>
-<br/>
-<a href="{/wyona:foaf/wyona:source/@href}">FOAF RDF</a>
+<!-- XML Link -->
+<xsl:apply-templates select="/wyona:foaf/wyona:source" mode="source"/>
+<xsl:apply-templates select="/wyona:foaf/wyona:third-party-source" mode="source"/>
+
+<!-- RDF Link -->
+<xsl:apply-templates select="/wyona:foaf/wyona:source" mode="original"/>
+<xsl:apply-templates select="/wyona:foaf/wyona:third-party-source" mode="original"/>
+
 <h2>Profile of <xsl:value-of select="/wyona:foaf/rdf:RDF/foaf:Person/foaf:name"/></h2>
 <p>
-...
+Workplace Homepage: <a href="{/wyona:foaf/rdf:RDF/foaf:Person/foaf:workplaceHomepage/@rdf:resource}"><xsl:value-of select="/wyona:foaf/rdf:RDF/foaf:Person/foaf:workplaceHomepage/@rdf:resource"/></a>
 </p>
+
+<h3>Friends</h3>
+<ul>
+<xsl:apply-templates select="/wyona:foaf/rdf:RDF/foaf:Person/foaf:knows"/>
+</ul>
 </body>
 </html>
 </xsl:template>
 
+<xsl:template match="wyona:source" mode="source">
+<a href="?yanel.resource.viewid=source">XML</a>
+<br/>
+</xsl:template>
+
+<xsl:template match="wyona:third-party-source" mode="source">
+<a href="?href={@href}&amp;yanel.resource.viewid=source">XML</a>
+<br/>
+</xsl:template>
+
+<xsl:template match="wyona:source" mode="original">
+<a href="{$yarep.back2realm}{@href}.rdf">Original RDF</a> (TODO: Protect this data!)
+<br/>
+</xsl:template>
+
+<xsl:template match="wyona:third-party-source" mode="original">
+<a href="{@href}">Original RDF</a>
+<br/>
+</xsl:template>
+
+<xsl:template match="foaf:knows">
+<xsl:for-each select="foaf:Person">
+  <li><a href="{rdfs:seeAlso/@rdf:resource}"><xsl:value-of select="foaf:name"/></a></li>
+</xsl:for-each>
+</xsl:template>
+
 </xsl:stylesheet>

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-07 08:25:40 UTC (rev 28558)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java	2007-11-07 09:00:55 UTC (rev 28559)
@@ -72,9 +72,10 @@
             StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"?>");
             sb.append("<wyona:foaf xmlns:wyona=\"http://www.wyona.org/foaf/1.0\">");
             if (getRequest().getParameter("href") != null) {
-                sb.append("<wyona:source href=\"" + getRequest().getParameter("href") + "\"/>");
+                sb.append("<wyona:third-party-source href=\"" + getRequest().getParameter("href") + "\"/>");
             } else {
-                sb.append("<wyona:source href=\"" + getPath() + "\"/>");
+                String path = getPath();
+                sb.append("<wyona:source href=\"" + path.substring(0, path.lastIndexOf(".html")) + "\"/>");
             }
             // TODO: The following leads to errors if the RDF contains special characters!
             BufferedReader br = new BufferedReader(new InputStreamReader(getRDFAsInputStream()));



More information about the Yanel-commits mailing list