[Yanel-commits] rev 20677 - in public/yanel/trunk/src:
contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources
contributions/resources/davcollection/src/java/org/wyona/yanel/impl/resources
core/java/org/wyona/yanel/core/api/attributes
core/java/org/wyona/yanel/servlet
resources/file/src/java/org/wyona/yanel/impl/resources
resources/xml/src/java/org/wyona/yanel/impl/resources
josias at wyona.com
josias at wyona.com
Fri Dec 8 12:22:04 CET 2006
Author: josias
Date: 2006-12-08 12:22:02 +0100 (Fri, 08 Dec 2006)
New Revision: 20677
Modified:
public/yanel/trunk/src/contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources/AtomEntryResource.java
public/yanel/trunk/src/contributions/resources/davcollection/src/java/org/wyona/yanel/impl/resources/DavCollection.java
public/yanel/trunk/src/core/java/org/wyona/yanel/core/api/attributes/ViewableV2.java
public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java
public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/FileResource.java
public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
Log:
applied patch for bug #5071: implement size attribute for meta data (patch was adapted to some changes in yanel). thanks to Paloma.
Modified: public/yanel/trunk/src/contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources/AtomEntryResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources/AtomEntryResource.java 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources/AtomEntryResource.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -287,5 +287,11 @@
return true;
}
+ public long getSize() throws Exception {
+ // TODO not implemented yet
+ log.error("Method is not implemented yet");
+ return -1;
+ }
+
}
Modified: public/yanel/trunk/src/contributions/resources/davcollection/src/java/org/wyona/yanel/impl/resources/DavCollection.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/davcollection/src/java/org/wyona/yanel/impl/resources/DavCollection.java 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/contributions/resources/davcollection/src/java/org/wyona/yanel/impl/resources/DavCollection.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -18,13 +18,6 @@
public class DavCollection extends XmlViewResource implements ViewableV2 {
- public boolean exists() throws Exception {
- // TODO Auto-generated method stub
- log.warn("Not implemented yet!");
- return false;
- }
-
-
private static Category log = Category.getInstance(DavCollection.class);
// WebDAV namespace definition
@@ -180,9 +173,16 @@
endElement(WEBDAV_NS_URI, WEBDAV_EL_RESPONSE, WEBDAV_PREFIX + WEBDAV_EL_RESPONSE);
}
- public boolean exists(Path path) {
- //TODO not implemented yet
- log.error("Method is not implemented yet");
+ public boolean exists() throws Exception {
+ // TODO Auto-generated method stub
+ log.warn("Not implemented yet!");
return false;
}
+
+ public long getSize() throws Exception {
+ // TODO not implemented yet
+ log.error("Method is not implemented yet");
+ return -1;
+ }
+
}
Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/api/attributes/ViewableV2.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/api/attributes/ViewableV2.java 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/api/attributes/ViewableV2.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -42,4 +42,9 @@
*
*/
public boolean exists() throws Exception;
+
+ /**
+ *
+ */
+ public long getSize() throws Exception;
}
Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/servlet/YanelServlet.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -231,6 +231,7 @@
//String rti = map.getResourceTypeIdentifier(new Path(request.getServletPath()));
Resource res = null;
long lastModified = -1;
+ long size = -1;
if (rti != null) {
ResourceTypeDefinition rtd = rtr.getResourceTypeDefinition(rti.getUniversalName());
if (rtd == null) {
@@ -286,6 +287,11 @@
} else if (ResourceAttributeHelper.hasAttributeImplemented(res, "Viewable", "2")) {
log.error("DEBUG: Resource is viewable V2");
String viewId = request.getParameter("yanel.resource.viewid");
+ Element viewElement = (Element) resourceElement.appendChild(doc.createElement("view"));
+ viewElement.appendChild(doc.createTextNode("View Descriptors: " + ((ViewableV2) res).getViewDescriptors()));
+ size = ((ViewableV2) res).getSize();
+ Element sizeElement = (Element) resourceElement.appendChild(doc.createElement("size"));
+ sizeElement.appendChild(doc.createTextNode(String.valueOf(size)));
view = ((ViewableV2) res).getView(viewId);
} else {
Element noViewElement = (Element) resourceElement.appendChild(doc.createElement("no-view"));
Modified: public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/FileResource.java
===================================================================
--- public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/FileResource.java 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/FileResource.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -195,5 +195,11 @@
return true;
}
+ public long getSize() throws Exception {
+ // TODO not implemented yet
+ log.error("Method is not implemented yet");
+ return -1;
+ }
+
}
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 2006-12-08 10:34:39 UTC (rev 20676)
+++ public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 2006-12-08 11:22:02 UTC (rev 20677)
@@ -292,4 +292,9 @@
return true;
}
+ public long getSize() throws Exception {
+ // TODO not implemented yet
+ log.error("Method is not implemented yet");
+ return -1;
+ }
}
More information about the Yanel-commits
mailing list