Oliver,

how does the problem with the content always being created shows up? ...
I cannot reproduce it with objectnodes being initialized in Domain.xml
(at least not with Slide_2.0). With my modest changes to
XMLUnmarshaller.java, content is only created if the <objectnode>
element contains a <revision> element containing a <content> element.

> As at least Domain.xml would have to changed 
> this is could only go into the CVS head.

I dont see that Domain.xml would have to be changed (at least not the
version included in the Slide distribution). It's only a small change to
common/XMLUnmarshaller.java which allows specifying <content> elements
inside <revision> elements.

Regards,
Peter


> -----Original Message-----
> From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] 
> Sent: Freitag, 1. Oktober 2004 17:31
> To: Slide Developers Mailing List
> Subject: Re: Initializing files at startup
> 
> Hi Peter,
> 
> this sounds interesting. I'd say this should at least go into 
> the CVS HEAD, for the release branch of 2.1 I am +0.
> 
> I noticed upon importan of objectnodes Slide always tries to 
> create content along with a node. In my current work I would 
> need something that tells me if a node is a collection or a 
> content resource. I added a property that says it is a 
> collection, but content is created before the property is 
> read. Thus the information required is not available at creation time.
> 
> So, what if Slide stopped to create content when there is 
> none specified? As at least Domain.xml would have to changed 
> this is could only go into the CVS head.
> 
> Any other ideas how I could solve my problem?
> 
> Oliver
> 
> [EMAIL PROTECTED] schrieb:
> > Hi,
> > 
> > to initialize data in a repository during server start-up, 
> I can add 
> > <objectnode> elements in Domain.xml. For instance, I could add an 
> > element <objectnode classname="..." uri=/files/foo"/> inside 
> > <objectnode classname="..." uri=/files"/> to have a folder 
> "/files/foo" initialized.
> > Also, to an <objectnode> element, I could add a <revision> element 
> > containing  <property> elements in order to initialize 
> properties. All 
> > this is *not* new.
> > 
> > But, what I *cannot* do, so far, is to initialize content of files. 
> > And that is precisely what one of my customers using Tamino WebDAV 
> > Server
> > (TWS) would like to do. He wants to install a WebDAV 
> repository with 
> > certain initial content, but he doesn't want the installation 
> > procedure to require a running server for doing the initialization. 
> > Also, doing the initialization in the underlying database is not a 
> > good idea (because must know schema of the metadata).
> > 
> > So, yesterday, I invented a new <content> element which I 
> can add to 
> > <revision> elements in order to initialize content. This 
> can be done 
> > in
> > 3 ways, as shown in the following examples: 
> > 
> > 1) The initial content of /files/sample.xml is specified directly in
> > Domain.xml:
> > 
> >         <objectnode 
> classname="org.apache.slide.structure.SubjectNode"
> > uri="/files">
> >           <objectnode 
> classname="org.apache.slide.structure.SubjectNode"
> > uri="/files/sample.xml">
> >             <revision>
> >  
> > <content><![CDATA[<sequence>tralala</sequence>]]></content>
> >             </revision>
> >           </objectnode>
> >         </objectnode>
> > 
> > 2) The initial content of /files/sample.xml is taken from the file 
> > referenced to by the 'file' attribute of the <content> element:
> > 
> >         <objectnode 
> classname="org.apache.slide.structure.SubjectNode"
> > uri="/files">
> >           <objectnode 
> classname="org.apache.slide.structure.SubjectNode"
> > uri="/files/sample.xml">
> >             <revision>
> >               <content file="../etc/init_data/sample.xml"/>
> >             </revision>
> >           </objectnode>
> >         </objectnode>
> > 
> > 3) The initial content of the /files directory is taken from the 
> > folder referenced to by the 'dir' attribute of the 
> <content> element 
> > (and it can be a whole structure of folders and files):
> > 
> >         <objectnode 
> classname="org.apache.slide.structure.SubjectNode"
> > uri="/files">
> >           <revision>
> >             <content dir="../etc/init_data"/>
> >           </revision>
> >         </objectnode>
> > 
> > As my customer's TWS is based on Slide 2.0, I coded this 
> feature into 
> > my local copy of the SLIDE_2_0_RELEASE_BRANCH and it works 
> quite good 
> > so far (see attached .diff file).
> > 
> > My questions:
> > - what do you think about this feature?
> > - ideas how to improve it?
> > - shall I check-in and also merge into SLIDE_2_1_RELEASE_BRANCH? (I 
> > think it is a low impact add-on)
> > 
> > Thanks in advance!
> > 
> > Regards,
> > Peter
> > 
> > 
> > 
> > 
> > 
> > 
> ----------------------------------------------------------------------
> > --
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to