[Yanel-commits] rev 37103 -
public/yanel/trunk/src/contributions/resources/pdf/src/java/org/wyona/yanel/impl/resources
michi at wyona.com
michi at wyona.com
Sun Jun 15 11:12:22 CEST 2008
Author: michi
Date: 2008-06-15 11:12:21 +0200 (Sun, 15 Jun 2008)
New Revision: 37103
Modified:
public/yanel/trunk/src/contributions/resources/pdf/src/java/org/wyona/yanel/impl/resources/PDFResource.java
Log:
exists implemented
Modified: public/yanel/trunk/src/contributions/resources/pdf/src/java/org/wyona/yanel/impl/resources/PDFResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/pdf/src/java/org/wyona/yanel/impl/resources/PDFResource.java 2008-06-15 09:00:09 UTC (rev 37102)
+++ public/yanel/trunk/src/contributions/resources/pdf/src/java/org/wyona/yanel/impl/resources/PDFResource.java 2008-06-15 09:12:21 UTC (rev 37103)
@@ -71,7 +71,12 @@
/**
*
*/
- public View getView(String viewId) {
+ public View getView(String viewId) throws Exception {
+ if (!exists()) {
+ log.warn("No such XML '" + getDataPath() + "' in order to generate PDF!");
+ throw new org.wyona.yanel.core.ResourceNotFoundException("No such XML '" + getDataPath() + "' in order to generate PDF!");
+ }
+
View defaultView = new View();
defaultView.setMimeType(getMimeType(viewId));
defaultView.setResponse(false); // This resource writes directly into the response output stream
@@ -140,8 +145,14 @@
*
*/
public boolean exists() throws Exception {
- log.warn("Not implemented yet!");
- return true;
+ String yanelPath = getDataPath();
+ Repository repo = getRealm().getRepository();
+ if (yanelPath.startsWith("yanelrepo:") || yanelPath.startsWith("yanelresource:")) {
+ log.warn("Not implemented yet!");
+ return true;
+ } else {
+ return repo.existsNode(yanelPath);
+ }
}
/**
More information about the Yanel-commits
mailing list