[Yanel-commits] rev 25025 - in
public/yanel/trunk/src/contributions/resources: .
data-repo-sitetree data-repo-sitetree/src
data-repo-sitetree/src/build data-repo-sitetree/src/java
data-repo-sitetree/src/java/org
data-repo-sitetree/src/java/org/wyona
data-repo-sitetree/src/java/org/wyona/yanel
data-repo-sitetree/src/java/org/wyona/yanel/impl
data-repo-sitetree/src/java/org/wyona/yanel/impl/resources
michi at wyona.com
michi at wyona.com
Mon Jun 11 12:10:11 CEST 2007
Author: michi
Date: 2007-06-11 12:10:10 +0200 (Mon, 11 Jun 2007)
New Revision: 25025
Added:
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/build.xml
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/resource.xml
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/build.properties
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/dependencies.xml
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/test/
Log:
sitetree resource started
Added: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/build.xml
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/build.xml (rev 0)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/build.xml 2007-06-11 10:10:10 UTC (rev 25025)
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+
+<project name="yanel-resource" default="compile">
+
+ <import file="src/build/dependencies.xml"/>
+
+ <target name="init" description="Initialize build" depends="dependencies">
+ <echo>Initialize build</echo>
+
+ <dirname property="resource.home.dir" file="${ant.file}"/>
+ <echo>Resource Home Directory: ${resource.home.dir}</echo>
+
+ <property file="${resource.home.dir}/src/build/local.build.properties"/>
+ <property file="${resource.home.dir}/src/build/build.properties"/>
+
+ <path id="classpath">
+ <pathelement path="${maven2.cp}"/>
+ </path>
+ <property name="resource.build.dir" value="${resource.home.dir}/build"/>
+ <property name="resource.classes.dir" value="${resource.build.dir}/classes"/>
+ <property name="resource.lib.dir" value="${resource.build.dir}/lib"/>
+ <property name="resource.java.dir" value="${resource.home.dir}/src/java"/>
+ </target>
+
+ <target name="compile" description="Compile Java classes" depends="init">
+
+ <mkdir dir="${resource.classes.dir}"/>
+ <javac srcdir="${resource.java.dir}" destdir="${resource.classes.dir}"
+ classpathref="classpath"
+ debug="true"
+ />
+ <mkdir dir="${resource.lib.dir}"/>
+ <jar destfile="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar"
+ basedir="${resource.classes.dir}"
+ />
+ </target>
+
+ <target name="clean" depends="init">
+ <delete dir="${resource.build.dir}"/>
+ </target>
+
+ <target name="copy-dependencies" depends="init">
+ <copy todir="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/lib">
+ <fileset refid="maven2.resource.fileset"/>
+ <mapper type="flatten"/>
+ </copy>
+ </target>
+</project>
Added: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/resource.xml
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/resource.xml (rev 0)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/resource.xml 2007-06-11 10:10:10 UTC (rev 25025)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<resource xmlns="http://www.wyona.org/yanel/1.0"
+ name="data-repo-sitetree"
+ namespace="http://www.wyona.org/yanel/resource/1.0"
+ class="org.wyona.yanel.impl.resources.DataRepoSitetreeResource"
+ >
+<description>
+Allows browsing the sitetree of the data repository
+</description>
+
+<rtd>
+<!--
+ <property name="foo" default-value="bar"/>
+-->
+</rtd>
+</resource>
Added: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/build.properties
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/build.properties (rev 0)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/build.properties 2007-06-11 10:10:10 UTC (rev 25025)
@@ -0,0 +1,2 @@
+resource.name=data-repo-sitetree
+resource.version=0.0.1-dev-rXXX
Added: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/dependencies.xml
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/dependencies.xml (rev 0)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/build/dependencies.xml 2007-06-11 10:10:10 UTC (rev 25025)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<project name="wiki-dependencies" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+
+ <target name="dependencies" description="Dependencies">
+ <artifact:remoteRepository id="wyona.remote.repository" url="http://www.wyona.org/maven2/"/>
+
+ <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}"/>
+ </artifact:dependencies>
+
+ <artifact:dependencies pathId="maven2.resource.classpath" filesetId="maven2.resource.fileset">
+ <remoteRepository refid="wyona.remote.repository"/>
+ <!-- No resource specific libs yet -->
+ </artifact:dependencies>
+
+ <property name="maven2.cp" refid="maven2.classpath"/>
+ <!--<echo>Maven2 classpath: ${maven2.cp}</echo>-->
+ </target>
+
+</project>
Added: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java (rev 0)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java 2007-06-11 10:10:10 UTC (rev 25025)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2006 Wyona
+ */
+
+package org.wyona.yanel.impl.resources;
+
+import org.wyona.yanel.core.Resource;
+import org.wyona.yanel.core.api.attributes.ViewableV2;
+import org.wyona.yanel.core.attributes.viewable.View;
+import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;
+
+/**
+ *
+ */
+public class DataRepoSitetreeResource extends Resource implements ViewableV2 {
+
+ /**
+ *
+ */
+ public DataRepoSitetreeResource() {
+ }
+
+ /**
+ *
+ */
+ public String getMimeType(String viewId) throws Exception {
+ return "application/xhtml+xml";
+ }
+
+ /**
+ *
+ */
+ public long getSize() throws Exception {
+ return -1;
+ }
+
+ /**
+ *
+ */
+ public boolean exists() throws Exception {
+ return true;
+ }
+
+ /**
+ *
+ */
+ public View getView(String viewId) throws Exception {
+ StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"?>");
+ sb.append("<sitetree/>");
+
+ View view = new View();
+ view.setMimeType("application/xml");
+ view.setInputStream(new java.io.StringBufferInputStream(sb.toString()));
+ return view;
+ }
+
+ /**
+ *
+ */
+ public ViewDescriptor[] getViewDescriptors() {
+ return null;
+ }
+}
More information about the Yanel-commits
mailing list