[Yanel-commits] rev 26648 -
public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources
michi at wyona.com
michi at wyona.com
Thu Aug 9 15:23:02 CEST 2007
Author: michi
Date: 2007-08-09 15:23:02 +0200 (Thu, 09 Aug 2007)
New Revision: 26648
Modified:
public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
Log:
log warning re get last modified for the case of yanel-path parameter
Modified: public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
===================================================================
--- public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 2007-08-09 13:21:46 UTC (rev 26647)
+++ public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 2007-08-09 13:23:02 UTC (rev 26648)
@@ -111,20 +111,18 @@
InputStream xmlInputStream = getContentXML(repo, yanelPath, revisionName);
return getXMLView(viewId, xmlInputStream);
}
-
/**
* Get initial content as XML
*/
private InputStream getContentXML(Repository repo, String yanelPath, String revisionName) throws Exception {
if (yanelPath != null) {
- log.debug("Yanel Path: " + yanelPath);
- Resource res = yanel.getResourceManager().getResource(getEnvironment(),
- getRealm(), yanelPath);
+ if (log.isDebugEnabled()) log.debug("Yanel Path: " + yanelPath);
+ Resource res = yanel.getResourceManager().getResource(getEnvironment(), getRealm(), yanelPath);
if (ResourceAttributeHelper.hasAttributeImplemented(res, "Viewable", "1")) {
// TODO: Pass the request ...
String viewV1path = getRealm().getMountPoint() + yanelPath.substring(1);
- log.debug("including document: " + viewV1path);
+ log.warn("Path of view: " + viewV1path);
View view = ((ViewableV1) res).getView(new Path(viewV1path), null);
if (view.getMimeType().indexOf("xml") >= 0) {
// TODO: Shall the mime-type be transfered?
@@ -222,12 +220,18 @@
*
*/
public long getLastModified() throws Exception {
- Node node = getRealm().getRepository().getNode(getPath());
long lastModified;
- if (node.isResource()) {
- lastModified = node.getLastModified();
+ String yanelPath = getResourceConfigProperty("yanel-path");
+ if (yanelPath != null) {
+ log.warn("Get last modified for parameter yanel-path not implemented yet!");
+ lastModified = -1;
} else {
- lastModified = 0;
+ Node node = getRealm().getRepository().getNode(getPath());
+ if (node.isResource()) {
+ lastModified = node.getLastModified();
+ } else {
+ lastModified = 0;
+ }
}
return lastModified;
More information about the Yanel-commits
mailing list