[Yanel-commits] rev 25323 -
public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources
josias at wyona.com
josias at wyona.com
Fri Jun 22 12:05:16 CEST 2007
Author: josias
Date: 2007-06-22 12:05:15 +0200 (Fri, 22 Jun 2007)
New Revision: 25323
Modified:
public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/DirectoryResource.java
Log:
make directoryresource creatable. fixes bug #5392, thanks to Simon
Modified: public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/DirectoryResource.java
===================================================================
--- public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/DirectoryResource.java 2007-06-22 09:40:05 UTC (rev 25322)
+++ public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/DirectoryResource.java 2007-06-22 10:05:15 UTC (rev 25323)
@@ -19,6 +19,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.CreatableV2;
import org.wyona.yanel.core.api.attributes.ViewableV2;
import org.wyona.yanel.core.attributes.viewable.View;
import org.wyona.yanel.core.attributes.viewable.ViewDescriptor;
@@ -54,7 +55,7 @@
/**
*
*/
-public class DirectoryResource extends Resource implements ViewableV2 {
+public class DirectoryResource extends Resource implements ViewableV2, CreatableV2 {
private static Category log = Category.getInstance(DirectoryResource.class);
@@ -270,4 +271,57 @@
}
return parentPath;
}
+
+ /**
+ *
+ */
+ public void create(HttpServletRequest request) {
+ try {
+ Repository repo = getRealm().getRepository();
+ org.wyona.yanel.core.util.YarepUtil.addNodes(repo, getPath().toString(), org.wyona.yarep.core.NodeType.COLLECTION);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ /**
+ *
+ */
+ public java.util.HashMap createRTIProperties(HttpServletRequest request) {
+ java.util.HashMap map = new java.util.HashMap();
+ map.put("xslt", request.getParameter("rp.xslt"));
+ map.put("mime-type", request.getParameter("rp.mime-type"));
+ return map;
+ }
+
+ /**
+ *
+ */
+ public String getPropertyType(String name) {
+ log.warn("Not implemented yet!");
+ return null;
+ }
+
+ /**
+ *
+ */
+ public Object getProperty(String name) {
+ log.warn("Not implemented yet!");
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String[] getPropertyNames() {
+ log.warn("Not implemented yet!");
+ return null;
+ }
+
+ /**
+ *
+ */
+ public void setProperty(String name, Object value) {
+ log.warn("Not implemented yet!");
+ }
}
More information about the Yanel-commits
mailing list