[opencms-dev] copy a Resource and its siblings as a new Resource

Peter korn peterkorn at gmx.net
Thu Sep 28 17:06:17 CEST 2006


Hi,
thanks for your reply. 

Yes you understand this correctly. I think i will do it like you suggested  i just hoped there where an easyer way to do it, like changing the uuidresource in the manifest of an OpenCms Export.

regards 

Peter



> > Hi,
> >
> > i have a problem (OpenCms 6.0.4). I want to copy a complete site. The siblings in the site should be siblings in the copy too. But they should not be a sibling from the resource in the source site.
> >
> > So i need a function to copy a Resource with its siblings to a  new Resource with it siblings.
> >
> > In the copy dialog there are only the options to create siblings (then all siblings in the source and in the destination Site points to one file) or to copy the files as a new Resource (then the new Site contains no siblings any more, the en and de folders are no longer linked)
> >
> > Did i miss this feature in the workplace dialogs, or is it not possible?
> > Is there a way to copy it with the api? Or is this feature implemented or planned in the new OpenCms version?
> >
> >
> > thanks 
> >
> > Peter
> >   
If i understand this correctly then you have someting like

/x/foo.html
/x/bar.html
with foo.html and bar.html being siblings.


Then you want to copy /x/ to /y/ and get

/x/foo.html
/x/bar.html

/y/foo.html
/y/bar.html


with /x/foo.html and /x/bar.html being siblings,  /y/foo.html and
/y/bar.html being siblings, but the /x/ folder having no siblings in
common with the /y/ folder.

Such a copy feature does not exist. You would have to write this
yourself by doing sth like
- going through the source folder tree and for each file
  - check, if this file has siblings
  - check if a copy of one of the siblings has been created in the
target folder
    - if none of the original siblings has been created, then the file
must be created as a separate copy
    - if one of the original siblings has been copied then the current
file must be made into a sibling of the existing file

CmsObject should give you the ability to get all files in a complete
folder hierarchy, to create copies, to create siblings, to check if a
file exists already and to request the existing siblings of a given
resource.

hth
christian




_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the opencms-dev mailing list