[opencms-dev] manual backup of resources
M Butcher
mbutcher at grcomputing.net
Mon Apr 19 21:09:01 CEST 2004
What do you want to back it up to? Disk? Some other database?
OpenCms uses a version control mechanism, so there is a built-in backup
mechanism in the database already (for instance, look at the
CMS_BACKUP_* tables in the DB). Skim through the CmsResourceBroker class
for your database (e.g. com.opencms.file.myslq.CmsResourceBroker) --
I'm pretty sure the code is in there.
Matt
Florian Kleedorfer wrote:
> hi all!
>
> Does anyone know how you can "manually" backup a single CmsResource
> without publishing it and without having to backup the whole project?
>
> Here's a sketch of the lifecycle that I would like to implement:
>
> [creation]
>
> public void CreateFile(CmsObject cms, String filename, byte[]
> myModifiedByteContent) {
> ...
> CmsResource newResource = cms.createResource( folder, name ,
> "plain", null, myNewByteContent);
> ...
> }
>
> [manipulation]
> public void manipulateFile(CmsObject cms, String filename, byte[]
> myModifiedByteContent) {
> ...
> CmsFile file = cms.readFile(filename);
> <backup the CmsResource (i.e. the CmsFile), need help here!>
> file.setContents(myModifiedByteContent);
> cms.writeFile(file);
> ...
> }
>
> [restoring]
> public void restoreVersion(CmsObject cms, String filename, int
> versionId) {
> <need help here!>
> }
>
>
> thx for your help!
> flo
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list