[Yanel-commits] rev 28598 - in
public/yanel/contributions/realms/foaf: . config data/xslt
res-configs src/resources/foaf src/resources/foaf/src/build
src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf
michi at wyona.com
michi at wyona.com
Wed Nov 7 22:56:05 CET 2007
Author: michi
Date: 2007-11-07 22:56:05 +0100 (Wed, 07 Nov 2007)
New Revision: 28598
Modified:
public/yanel/contributions/realms/foaf/TODO.txt
public/yanel/contributions/realms/foaf/config/ac-identities-repository.xml
public/yanel/contributions/realms/foaf/config/ac-policies-repository.xml
public/yanel/contributions/realms/foaf/config/data-repository.xml
public/yanel/contributions/realms/foaf/config/rti-repository.xml
public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
public/yanel/contributions/realms/foaf/res-configs/profile.yanel-rc
public/yanel/contributions/realms/foaf/src/resources/foaf/resource.xml
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:
make profiles repository switchable
Modified: public/yanel/contributions/realms/foaf/TODO.txt
===================================================================
--- public/yanel/contributions/realms/foaf/TODO.txt 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/TODO.txt 2007-11-07 21:56:05 UTC (rev 28598)
@@ -6,3 +6,4 @@
- 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!
+ - Implement Friend opener: http://www.google.com/calendar/ical/k6i6o2dkb1sclkovo263ipucsg%40group.calendar.google.com/private-a519d57358ce1794c2f9da52b77d1ae8/basic.ics
Modified: public/yanel/contributions/realms/foaf/config/ac-identities-repository.xml
===================================================================
--- public/yanel/contributions/realms/foaf/config/ac-identities-repository.xml 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/config/ac-identities-repository.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<repository>
- <name>Yanel from Scratch Access Control Identities</name>
+ <name>FOAF Access Control Identities</name>
<paths class="org.wyona.yarep.impl.VFileSystemMapImpl" src="../ac-identities"/>
Modified: public/yanel/contributions/realms/foaf/config/ac-policies-repository.xml
===================================================================
--- public/yanel/contributions/realms/foaf/config/ac-policies-repository.xml 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/config/ac-policies-repository.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<repository>
- <name>Yanel From Scratch Access Control Policies</name>
+ <name>FOAF Access Control Policies</name>
<paths class="org.wyona.yarep.impl.VFileSystemMapImpl" src="../ac-policies"/>
Modified: public/yanel/contributions/realms/foaf/config/data-repository.xml
===================================================================
--- public/yanel/contributions/realms/foaf/config/data-repository.xml 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/config/data-repository.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -1,22 +1,10 @@
<?xml version="1.0"?>
<repository class="org.wyona.yarep.impl.repo.fs.FileSystemRepository">
- <name>Yanel From Scratch Data Repository</name>
+ <name>FOAF Data Repository</name>
<paths class="org.wyona.yarep.impl.DefaultMapImpl" src="../data-paths" fallback="true">
<ignore pattern=".*\.svn"/>
<ignore pattern=".*\.yarep"/>
</paths>
<content src="../data"/>
</repository>
-
-<!--
-<repository>
- <name>Yanel From Scratch Data Repository</name>
-
- <paths class="org.wyona.yarep.impl.DefaultMapImpl" src="../data-paths" fallback="true"/>
-
- <storage class="org.wyona.yarep.core.impl.fs.FileSystemStorage">
- <content src="../data"/>
- </storage>
-</repository>
--->
Modified: public/yanel/contributions/realms/foaf/config/rti-repository.xml
===================================================================
--- public/yanel/contributions/realms/foaf/config/rti-repository.xml 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/config/rti-repository.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -2,7 +2,7 @@
<!--
<repository class="org.wyona.yarep.impl.repo.fs.FileSystemRepository">
- <name>Yanel From Scratch Resource Configurations Repository</name>
+ <name>FOAF Resource Configurations Repository</name>
<paths class="org.wyona.yarep.impl.VFileSystemMapImpl" src="../res-configs">
<ignore pattern=".*\.svn"/>
</paths>
@@ -11,7 +11,7 @@
-->
<repository>
- <name>Yanel From Scratch Resource Configurations Repository</name>
+ <name>FOAF Resource Configurations Repository</name>
<paths class="org.wyona.yarep.impl.VFileSystemMapImpl" src="../res-configs"/>
Modified: public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl
===================================================================
--- public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/data/xslt/foaf2xhtml.xsl 2007-11-07 21:56:05 UTC (rev 28598)
@@ -68,7 +68,7 @@
</xsl:template>
<xsl:template match="wyona:source" mode="original">
-<a href="{$yarep.back2realm}{@href}.rdf">Original RDF</a> (TODO: Protect this data!)
+<a href="{$yarep.back2realm}{@href}">Original RDF</a> (TODO: Protect this data!)
<br/>
</xsl:template>
Modified: public/yanel/contributions/realms/foaf/res-configs/profile.yanel-rc
===================================================================
--- public/yanel/contributions/realms/foaf/res-configs/profile.yanel-rc 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/res-configs/profile.yanel-rc 2007-11-07 21:56:05 UTC (rev 28598)
@@ -4,5 +4,8 @@
<yanel:rti name="foaf" namespace="http://www.wyona.org/yanel/resource/1.0"/>
<yanel:property name="xslt" value="/xslt/foaf2xhtml.xsl"/>
- <yanel:property name="repo-config" value="/home/michi/src/wyona/wyona/misc/foaf/repository.xml"/>
+ <!--
+ <yanel:property name="repo-config" value="/home/michi/src/wyona/wyona/misc/foaf/data-repository.xml"/>
+ -->
+ <yanel:property name="repo-config" value="/home/michi/src/wyona-svn/wyona/misc/foaf/data-repository.xml"/>
</yanel:resource-config>
Modified: public/yanel/contributions/realms/foaf/src/resources/foaf/resource.xml
===================================================================
--- public/yanel/contributions/realms/foaf/src/resources/foaf/resource.xml 2007-11-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/resource.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -11,5 +11,6 @@
<rtd>
<property name="href"/>
+ <property name="repo-config"/>
</rtd>
</resource>
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-07 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/src/build/dependencies.xml 2007-11-07 21:56:05 UTC (rev 28598)
@@ -17,6 +17,7 @@
-->
<dependency groupId="javax.servlet" artifactId="servlet-api" version="2.3"/>
+ <dependency groupId="yarep" artifactId="yarep-core" version="0.0.1-dev-r28127"/>
</artifact:dependencies>
<artifact:dependencies pathId="maven2.resource.classpath" filesetId="maven2.resource.fileset">
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 21:55:20 UTC (rev 28597)
+++ public/yanel/contributions/realms/foaf/src/resources/foaf/src/java/org/wyona/yanel/impl/resources/foaf/FOAFResource.java 2007-11-07 21:56:05 UTC (rev 28598)
@@ -13,11 +13,15 @@
import org.apache.log4j.Category;
import java.io.BufferedReader;
+import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringBufferInputStream;
import java.net.URL;
+import org.wyona.yarep.core.Repository;
+import org.wyona.yarep.core.RepositoryFactory;
+
/**
*
*/
@@ -75,7 +79,7 @@
sb.append("<wyona:third-party-source href=\"" + getRequest().getParameter("href") + "\"/>");
} else {
String path = getPath();
- sb.append("<wyona:source href=\"" + path.substring(0, path.lastIndexOf(".html")) + "\"/>");
+ sb.append("<wyona:source href=\"" + path.substring(0, path.lastIndexOf(".html")) + ".rdf\"/>");
}
// TODO: The following leads to errors if the RDF contains special characters!
BufferedReader br = new BufferedReader(new InputStreamReader(getRDFAsInputStream()));
@@ -146,7 +150,20 @@
URL url = new URL(getRequest().getParameter("href"));
return url.openConnection().getInputStream();
} else {
- return getRealm().getRepository().getNode("/profiles/foo-bar.rdf").getInputStream();
+ String path = getPath();
+ return getProfilesRepository().getNode(path.substring(0, path.lastIndexOf(".html")) + ".rdf").getInputStream();
}
}
+
+ /**
+ *
+ */
+ private Repository getProfilesRepository() throws Exception {
+ Repository repo = getRealm().getRepository();
+ String repoConfig = getResourceConfigProperty("repo-config");
+ if (repoConfig != null) {
+ repo = new RepositoryFactory().newRepository("profiles", new File(repoConfig));
+ }
+ return repo;
+ }
}
More information about the Yanel-commits
mailing list