Wednesday 16 August 2006 4:31:25 pm
We are looking into this too. Xavier, did you manage to use the <i>insertRegularFile</i> method? I wonder how it can be called effectively. We tried something like inside an import script:
// enumerate attributes of the new object to set them
$contentObjectAttributes =& $contentObjectVersion->contentObjectAttributes(); foreach ($contentObjectAttributes as $attribute)
{
if ($data_type_string=='ezimage')
{
$attribute->insertRegularFile($contentObject, $contentObject->attribute( 'current_version' ), $contentObject->CurrentLanguage, $attribute, $parsedItems[$i][$TagName]);
}
Where:
$parsedItems[$i][$TagName] = image file name
But this doesn't seem to do anything. Can anyone confirm if this looks right?
On the other hand, we have had success doing massive image object imports with the Image Batch Upload Script http://ez.no/community/contribs/import_export/image_batch_uploadscript_from_local_harddrive It requires a little tweaking to work with current versions of eZ. The tricky part is knowing how to relate the image, or publish it under the appropriate object. Eg. if the object has a text attribute called "12345.gif", then when importing the image "12345.gif", one should fetch the object whose image attribute is "12345.gif", get it's node id and publish the image using that node_id as parent_node_id. The problem seems to be that fetching a tree with attribute filter is straightforward in template code, but not that clear how to properly code that function in the extension. Felipe
Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia
|