Forums / Developer / all2einfoexport with enhancedezbinaryfile datatype

all2einfoexport with enhancedezbinaryfile datatype

Author Message

Albert Balagueró

Friday 10 June 2011 6:38:53 am

Hello,
I have installed the extensions enhancedezbinaryfile (to send images with collection forms) and all2einfoexport (to export to a XML file the information collections). All is ok but the datataype collected in enhancedezbinaryfiles input from the form, is not showed in XML file. I added a "case" in /classes/all2einfoexportclass.php for date datatype (there were a bug) and I added too a "case" for the enhancedezbinaryfile, but I am not able to write the right code to show the FilePath uploaded with theenhancedbezbinaryfile datataype of the form.

<code>

case 'ezdate':
$content[$collection->attribute('id')][$key] = date( "d.m.Y", $attribute->attribute('data_int') ); break;

/////////////////// Afegit per bug a Datatype ENHANCEDEZBINARYFILE ////////////////

case 'enhancedezbinaryfile':
$content[$collection->attribute('id')][$key] = $attribute->content();

//$content[$collection->attribute('id')][$key] = '<a href=http://{ezini( "SiteSettings", "SiteURL" )}{$attribute.data_text|parsexml("Filename")|wash|ezroot(no)}>{$attribute.data_text|parsexml("OriginalFilename")}</a>'; break;

</code>

Some idea of what I must do?
Thanks! 

Steven E. Bailey

Friday 10 June 2011 9:12:34 am

Hi,

What version of ezpublish are you using and what version of the enhancedbinaryfiletype are you using?  Do you see the path in the collectedinfo page?

There is a problem that I haven't been able to reproduce: http://projects.ez.no/enhancedezbinaryfile/forum/general/upload_works_no_information_collected

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Albert Balagueró

Friday 10 June 2011 9:30:55 am

Hi Steven,
thank you for your fast response.

I'm using eZpublish 4.2.0 and enhancedbinaryfiletype release 4.0.0.
Yes, I see all the information of the image and image path in collectedinfo page, and in sendmail also.
The problem is that when I export the collected form with all2einfoexport extension, the XML file I get, there is no path or name of the image uploaded with enhancedezbinaryfile datatype.
 

Steven E. Bailey

Friday 10 June 2011 2:21:39 pm

O.k. then you'll want to do something like this for the enhancedbinaryfile case in all2einfoexportclass.php 

 case 'enhancedezbinaryfile':
        $dom = new DOMDocument( '1.0', 'utf-8' );
        if ($dom->loadXML( $attribute->attribute( 'data_text' )))
        {
                $content[$collection->attribute('id')][$key] = $dom->getElementsByTagName( "Filename" )->item(0)->textContent;
        }
        break;

Change the element in the getElementsByTagName to whatever you want to store and add multiple fields if you want multiple fields to be stored.  What is returned by the attribute( 'data_text') is the binaryfile_info xml with the elements: OriginalFilename, Type, MimeCategory, MimePart, Filename, Size

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Albert Balagueró

Friday 17 June 2011 11:06:15 am

Hi Steven,I apologise for not to respond earlier...
I've been working on the export of all de data from the website. Sorry...

It works perfectly, I'm really glad to be able to export all the information collection in the forms with enhancedezbinaryfile.
I really apreciate your help. Thanks a lot.

Cheers!