[CPS-devel] How to migrate a file using CPSRemoteController

Michael Schulz mschulz at webgis.de
Thu May 24 10:39:35 CEST 2007


Hi,

yeah, that's the way we use it, for loads of documents... The actual
files come from the fs.
I'm not sure if you could use the data method on the fileobject to get
the data stream and pass that the remotecontroller...

maybe create a external method, that justs does the Binary from
xml-rpc package and feed it back? So you wouldn't have to put the
files in the fs.

Cheers, Michael



2007/5/24, Miguel Sánchez Beato <miguel.sanchez at iavante.es>:
> Hello!
> I'm using CPSRemoteController to "migrate" a file from a CPS 3.4.0
> instance (A) to a CPS 3.4.4 instance (B). What I'm trying to do is take
> a File document from A and put it in B. I've developed a new method for
> the RemoteControllerTool class called getAttachedFile that takes the
> attached file from the File document. The problem comes when I create
> the new File document (using the RemoteController method
> "createDocument"). this method use a binary  file as attached file, and
> that binary file is read using a file system path, as a example:
>
> f.open(file_path)
> binary = Binary(f.read())
> f.close()
>
> doc_def = {'Title': doc_title,
>                    'Description': doc_desc,
>                    'file' : binary,
>                    'file_name' : "file_title",
>                    'file_type' : 'File',
>                    }
>
> doc_type = 'File'
> doc_folder_path = 'workspaces/files'
> proxy.createDocument(doc_type, doc_def,  doc_folder_path, 0)
>
> So, I need to download the file to the file system in order to
> upload/read it using a "file_path".
>
> Anyboby knows how to do it?
> Could be a new mehtod of RemoteControllerTool?
> Is there other way to migrate the whole structure of a folder tree (with
> all documents inside) from an instance to another?
>
> Thank you!!
> _______________________________________________
> cps-devel mailing list
> http://lists.nuxeo.com/mailman/listinfo/cps-devel
>


-- 
-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

In den Weihermatten 66
79108 Freiburg

Tel  +49 (0)761 556959-5
Fax +49 (0)761 556959-6

http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------



This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.