This patch allow to sp�cify the content of a revision created in domain.xml or via an import.

You just need to add a *content* tag into the revision tag. A NodeRevisionContent is created and filled with the value inside the tag (without "<![CDATA[" and "]]>").

just something like that:
<objectnode classname="org.apache.slide.structure.SubjectNode" uri="/files/nodewithcontent">
<permission action="all" subject="all" inheritable="true"/>
<revision>
<property name="getcontenttype" namespace="DAV:">text/plain</property>
<content><![CDATA[the content of the revision comes here]]></content>
</revision>
</objectnode>


if there is no content tag, there is no content set (like now).
if revision allready exists... content is ignored like 'propery' tags.

I hope this will be usefull to someone else and be added into next release.

David, Have a nice day.

PS: to test, just apply the patch and add the code frangment into your domain.xml... and start slide.

NOTE: usability is limited by XML, <![CDATA]]>, and java's bytes array size limitations. but it will be nice to setup some small text file into the store (scripts, configurations files, ... etc)






Index: XMLUnmarshaller.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v
retrieving revision 1.33
diff -u -r1.33 XMLUnmarshaller.java
--- XMLUnmarshaller.java 18 Aug 2004 11:46:19 -0000 1.33
+++ XMLUnmarshaller.java 18 Feb 2005 09:53:23 -0000
@@ -404,6 +404,15 @@
}
} else {
+ try {
+ revisionContent = new NodeRevisionContent();
+ byte[] content = revisionDefinition.getConfiguration("content").getValue().getBytes();
+ revisionContent.setContent(content);
+ revisionDescriptor.setContentLength(content.length);
+ } catch (Exception e) {
+ //ignore and reset
+ revisionContent = null;
+ }
try {
accessToken.getContentHelper().create





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to