move / migrate files to and from mediadb

Niels Dettenbach <[email protected]> Fri, 12 Jul 2013 10:59:28 +0200
Newsgroups gmane.comp.cms.zms.devel
Organization Syndicat IT&Internet
Message-ID <1653447.6NnqHp6EcC@gongo>
--nextPart1727749.iOusynGVv4
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Hi all,


is there any method or similiar allowing to "move" / migrate blobs (files, 
images) from ZODB into mediadb or vice versa?

It seems that setObjProperty('filefieldname', <FILE>) (or the new aequivalent 
"attr()) did not save any type of blob in the mediadb (when a mediadb is 
activated/there). So i'm looking for a way to push single blobs / files from 
the ZODB into the mediadb or back. 

It would be nice to use the mediadb infrastructure instead of writing another 
own stuff here...

Regarding the ZMS sources there are just methods allowing recursively pushing 
out all - but not single - objects (recurse_addMediaDb() from 
manage_addMediaDb()) or vice versa.

I tried to experiment with uploadBlobField() and createBlobField() but with no 
luck so far, but i'm not understanding all partes of the ZMS sources there.

Or how can i tell attr() or setObjProperty() to store that blob into the 
mediadb and not the ZODB (i.e. with options like "mediadbStorable")? I did not 
understand why files uploaded "by hand" over ZMI got stored in the mediadb 
while set/save it by code not (in the case of images / DT_IMAGE that seems to 
work - for file / DT_FILE not what did not make any sense to me as images are 
just some "special" files / blobs).


Any hint or help is very welcome.

many many thanks for any help,


Niels.
-- 
 ---
 Niels Dettenbach
 Syndicat IT & Internet
 http://www.syndicat.com
 PGP: https://syndicat.com/pub_key.asc
 ---
 




--nextPart1727749.iOusynGVv4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAABCAAGBQJR38VwAAoJEM78prARigUndvYQAJNqJCLYzYBrvSrzsFXSqsGp
QcF6/36ntlmlldElHE2pSES+Sfs+ug8hJsYs80E1cvnlZyXVYciIERKHtbUPMEiH
FpsUZERYULVzQtfHqEKVN8KX2FtEwvstbVPBCSTHz9VYctvA8Mv2IM8PSNIJSap8
aAII6KdbTepM9Snvg9Pza6wV4YHWr052SGl8XLAIuNEmnrCoOTI1hM0zh5D++1B9
m7oytlfyIV9N1s74GH5fMdzxcUAjGm48aNFnuuUphCMhCppXTb0IRvrU3Zvh+o8a
O0INv96vvCM0XmyyKO10wLD/nFpZiKe1+PPkkDvrhZPWWgwZYvDGaPV6m/tMdGlM
+slBh7jLrNC6AcdStSdQtBZRwg3TFhTBbtiJqY99rkoWrHG4PP0Z21tvyGdhXzsD
hoa7zKpLNOCWjIerCVjq4V1mrEsCN017hWVU9Z3NQm9fyIsvmM80ZZ5NZaVJ6XiJ
6CvCtm8MZpYsJqEB1/k9lZsmxaJxm1lrKzN5aRZdXCjv9BPdweeJxTY9kaWK6I4n
C0aB1XmQ9Hk9UOWPDUl3lp7od2E5R+xw79Pn5i6AaKUjvhnLZFkX0RljZK2Ihn1N
nRb1wwyJC2j3bjA37RN7laja2XPJBYcC4XPFpy4SVQivKz5fbR8ouEenMf/LAH70
4VBU/HSYabCrbpoXvaHu
=ZtH2
-----END PGP SIGNATURE-----

--nextPart1727749.iOusynGVv4--