You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Pe...@softwareag.com on 2004/10/01 16:44:09 UTC

Initializing files at startup

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




Re: Initializing files at startup

Posted by Unico Hommes <un...@hippo.nl>.
Peter.Nevermann@softwareag.com wrote:

>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)
>  
>

Awsome feature. It's been on my wishlist for a long time :-). As far as 
I am concerned, yes, please also add it to the 2.1 branch.

--
Unico

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: Initializing files at startup

Posted by Jim Myers <ji...@verizon.net>.
I think this is VERY useful functionality. We have similar use cases and 
developed similar capabilities (combined with some other modifications that 
has slowed us in getting it in shape to send back to Slide). Users have 
asked for two types of things:

Bulk import of files when starting a fresh server: for example, we 
distribute an electronic notebook that runs on top of our modified Slide 
server and we want to upload all the images and other files it uses the 
first time the server runs.

Synch of files from a local dir into the repository at each startup or on 
demand: we have people using our server as a store for a portal and they 
drop configuration files and other resources in. Whenever they change their 
configuration, they'd like to redeploy their portal related files and have 
the Slide repository suck in the new files.

To support these, we first added a content node in Domain.xml for single 
files (or expanded - I think Slide 1 had some limited content mechanism 
didn't it?) and then decided to create a second recursive bulk directory 
upload mechanism (for any top level children of the specified dir, upload 
from the recursively if the corresponding node doesn't exist in the 
repository - that is - upload when the db is created and whenever the admins 
delete the node in the repository). We also experimented with an overwrite 
flag for things in Domain.xml - overwrite="yes" implies the node or property 
is reset to the value in Domain.xml at each server start.

So - I think your mechanisms 2) and 3) below are the most relevant for us 
and some "uploadAt" flag that can be set to "DBinitialization" or 
"serverStartup" (default is at DBinitialization and the flag can be applied 
to properties and/or content... :-) would cover a lot of ground.

Daniel's comment about an archive mechanism sounds like a separate useful 
feature. We have lots of people who put content in and worry that if useful 
information is put in the properties, they'll lose it all if they decide to 
go back to a file system instead of webDAV. A nice XML export format that 
could gather one or more resources and their properties would solve this, as 
well as allowing for bulk transfer between repositories.

  Jim




----- Original Message ----- 
From: "Stefan Lützkendorf" <lu...@apache.org>
To: "Slide Developers Mailing List" <sl...@jakarta.apache.org>
Sent: Friday, October 01, 2004 11:16 AM
Subject: Re: Initializing files at startup


> Hallo Peter,
> installing a webdav server with some inital template data would be
> intresting in some of our projects too.
>
> One query I have is, what happens if the server starts up a second
> time and the content of the file or the referenced collection is
> changed? Is it updated, are new subdirectories added or how do you
> handle this?
>
> Regards, Stefan
>
>
>
> Peter.Nevermann@softwareag.com wrote:
>
>> 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: slide-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>
> -- 
> Stefan Lützkendorf  -- luetzkendorf@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: Initializing files at startup

Posted by Stefan Lützkendorf <lu...@apache.org>.
Hallo Peter,
installing a webdav server with some inital template data would be
intresting in some of our projects too.

One query I have is, what happens if the server starts up a second
time and the content of the file or the referenced collection is
changed? Is it updated, are new subdirectories added or how do you
handle this?

Regards, Stefan



Peter.Nevermann@softwareag.com wrote:

> 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: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org

-- 
Stefan Lützkendorf  -- luetzkendorf@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: Initializing files at startup

Posted by James Mason <ma...@apache.org>.
My preference would be to wait until 2.2. Since we're already into beta 
I get a funny feeling about adding new features. I'm not really picky 
about it, though, so -.5 :).

-James

Oliver Zeigermann wrote:
> 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
> 
> Peter.Nevermann@softwareag.com 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: slide-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: Initializing files at startup

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
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

Peter.Nevermann@softwareag.com 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: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: AW: Initializing files at startup

Posted by James Mason <ma...@apache.org>.
How about using a .zipped copy of what the Tx* Stores use?

The process for export could be 1) create a temporary Tx store somewhere 
on disk 2) copy data to the temp store 3) zip the store 4) stream the 
zip to the client 5) delete the temporary store. Importing would be more 
or less an inverse of that process.

I'm just thinking this might be easier than defining a new format.

-James

Daniel Florey wrote:
> Hi Peter,
> I'd like to have a general mechanism to export/import data into Slide. 
> What we need is some kind of archive format reflecting the content of any
> webdav-repository. This is often needed if you want for example copy the
> content of a webdav-based repository from one server to another one
> including properties, acl and so on. 
> So it would be nice to have an application that can be invoked with some
> parameters (uri, depth, included features (acl,versioning,properties...) to
> create an archive. This archive can be created using the standard set of
> webdav-commands. The same application could be used to import an archive to
> a given url.
> If such an archive would exists (we should consider an as simple as can be
> format so that it can easily created by hand), we could add some required
> archives in domain.xml. At startup Slide could import these archives if they
> do not already exist.
> Don't get me wrong: I like your patches to enable the import of content, but
> I think if you really want to import a larger amount of data, the archive
> way would have some benefits.
> Regards,
> Daniel
> 
>  
> -----Ursprüngliche Nachricht-----
> Von: slide-dev-return-13673-daniel.florey=web.de@jakarta.apache.org
> [mailto:slide-dev-return-13673-daniel.florey=web.de@jakarta.apache.org] Im
> Auftrag von Peter.Nevermann@softwareag.com
> Gesendet: Freitag, 1. Oktober 2004 15:44
> An: slide-dev@jakarta.apache.org
> Betreff: Initializing files at startup
> 
> 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: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


AW: Initializing files at startup

Posted by Daniel Florey <da...@web.de>.
Hi Peter,
I'd like to have a general mechanism to export/import data into Slide. 
What we need is some kind of archive format reflecting the content of any
webdav-repository. This is often needed if you want for example copy the
content of a webdav-based repository from one server to another one
including properties, acl and so on. 
So it would be nice to have an application that can be invoked with some
parameters (uri, depth, included features (acl,versioning,properties...) to
create an archive. This archive can be created using the standard set of
webdav-commands. The same application could be used to import an archive to
a given url.
If such an archive would exists (we should consider an as simple as can be
format so that it can easily created by hand), we could add some required
archives in domain.xml. At startup Slide could import these archives if they
do not already exist.
Don't get me wrong: I like your patches to enable the import of content, but
I think if you really want to import a larger amount of data, the archive
way would have some benefits.
Regards,
Daniel

 
-----Ursprüngliche Nachricht-----
Von: slide-dev-return-13673-daniel.florey=web.de@jakarta.apache.org
[mailto:slide-dev-return-13673-daniel.florey=web.de@jakarta.apache.org] Im
Auftrag von Peter.Nevermann@softwareag.com
Gesendet: Freitag, 1. Oktober 2004 15:44
An: slide-dev@jakarta.apache.org
Betreff: Initializing files at startup

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: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org