[Yanel-commits] rev 23737 - in
public/yanel/trunk/src/resources/testing-control/src: build
java/org/wyona/yanel/impl/resources
josias at wyona.com
josias at wyona.com
Fri Apr 13 17:38:57 CEST 2007
Author: josias
Date: 2007-04-13 17:38:56 +0200 (Fri, 13 Apr 2007)
New Revision: 23737
Modified:
public/yanel/trunk/src/resources/testing-control/src/build/dependencies.xml
public/yanel/trunk/src/resources/testing-control/src/java/org/wyona/yanel/impl/resources/TestingControlResource.java
Log:
updated to ant 1.7.0 because of a bugfix in the ZipFileSet. also added ability to use rc instead of rti. fixes bug #5122, thanks to Simon and Jonathan.
Modified: public/yanel/trunk/src/resources/testing-control/src/build/dependencies.xml
===================================================================
--- public/yanel/trunk/src/resources/testing-control/src/build/dependencies.xml 2007-04-13 15:36:38 UTC (rev 23736)
+++ public/yanel/trunk/src/resources/testing-control/src/build/dependencies.xml 2007-04-13 15:38:56 UTC (rev 23737)
@@ -28,9 +28,9 @@
<dependency groupId="nekohtml" artifactId="nekohtml" version="0.9.5"/>
<dependency groupId="avalon-framework" artifactId="avalon-framework-impl" version="4.3"/>
<dependency groupId="avalon-framework" artifactId="avalon-framework-api" version="4.3"/>
- <dependency groupId="ant" artifactId="ant" version="1.6.5"/>
- <dependency groupId="ant" artifactId="ant-launcher" version="1.6.5"/>
- <dependency groupId="ant" artifactId="ant-junit" version="1.6.5"/>
+ <dependency groupId="ant" artifactId="ant" version="1.7.0"/>
+ <dependency groupId="ant" artifactId="ant-launcher" version="1.7.0"/>
+ <dependency groupId="ant" artifactId="ant-junit" version="1.7.0"/>
</artifact:dependencies>
<property name="maven2.cp" refid="maven2.classpath"/>
Modified: public/yanel/trunk/src/resources/testing-control/src/java/org/wyona/yanel/impl/resources/TestingControlResource.java
===================================================================
--- public/yanel/trunk/src/resources/testing-control/src/java/org/wyona/yanel/impl/resources/TestingControlResource.java 2007-04-13 15:36:38 UTC (rev 23736)
+++ public/yanel/trunk/src/resources/testing-control/src/java/org/wyona/yanel/impl/resources/TestingControlResource.java 2007-04-13 15:38:56 UTC (rev 23737)
@@ -47,6 +47,7 @@
import org.wyona.yanel.core.Path;
import org.wyona.yanel.core.Resource;
+import org.wyona.yanel.core.ResourceConfiguration;
import org.wyona.yanel.core.api.attributes.ViewableV1;
import org.wyona.yanel.core.attributes.viewable.View;
import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;
@@ -75,7 +76,11 @@
}
public ViewDescriptor[] getViewDescriptors() {
- return null;
+ ViewDescriptor[] vd = new ViewDescriptor[1];
+ vd[0] = new ViewDescriptor("default");
+ // NOTE: depends on XSLT ...
+ vd[0].setMimeType(null);
+ return vd;
}
public View getView(Path path, String viewId) {
@@ -200,7 +205,7 @@
// prepare tmpResultDir
if (request.getSession().getAttribute("tmpResultDir") == null) {
- String uuid = new java.rmi.server.UID().toString();
+ String uuid = new java.rmi.server.UID().toString().replaceAll(":","");
tmpResultDir = new File(request.getSession().getServletContext().getRealPath("tmp"
+ File.separator + "test-results-" + uuid));
request.getSession().setAttribute("tmpResultDir", tmpResultDir);
@@ -395,16 +400,38 @@
}
/**
- * Get XSLT path
+ * Get XSLTPath returns the path to the configured xslt or null
+ * @param path
+ * @return Path
*/
private Path getXSLTPath(Path path) {
- String xsltPath = getRTI().getProperty("xslt");
- if (xsltPath != null)
- return new Path(xsltPath);
- log.info("No XSLT Path within: " + path);
- return null;
+ try {
+ return new Path(getResourceConfigProperty("xslt"));
+ } catch (Exception e) {
+ log.info("No XSLT Path within: " + path);
+ return null;
+ }
}
+
+ /**
+ * Get property value from resource configuration
+ */
+ private String getResourceConfigProperty(String name) throws Exception {
+ ResourceConfiguration rc = getConfiguration();
+ if (rc != null) return rc.getProperty(name);
+ return getRTI().getProperty(name);
+ }
+
+ /**
+ * Get property value from resource configuration
+ */
+ private String[] getResourceConfigProperties(String name) throws Exception {
+ ResourceConfiguration rc = getConfiguration();
+ if (rc != null) return rc.getProperties(name);
+ return getRTI().getProperties(name);
+ }
+
protected RepositoryFactory getRepositoryFactory() {
return yanel.getRepositoryFactory("DefaultRepositoryFactory");
}
More information about the Yanel-commits
mailing list