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! 

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 14:41:12
Script start
Timing: Jan 29 2025 14:41:12
Module start 'layout'
Timing: Jan 29 2025 14:41:12
Module start 'content'
Timing: Jan 29 2025 14:41:12
Module end 'content'
Timing: Jan 29 2025 14:41:12
Script end

Main resources:

Total runtime0.0155 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2656151.2266
Module start 'layout' 0.00450.0030 739.492236.7031
Module start 'content' 0.00760.0068 776.195394.3281
Module end 'content' 0.01440.0011 870.523437.9766
Script end 0.0155  908.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002214.1916140.0002
Check MTime0.00106.3115140.0001
Mysql Total
Database connection0.00074.504710.0007
Mysqli_queries0.002616.838730.0009
Looping result0.00000.122910.0000
Template Total0.00085.310.0008
Template load0.00064.163610.0006
Template processing0.00021.063210.0002
Override
Cache load0.00052.937610.0005
General
dbfile0.002817.946580.0003
String conversion0.00000.056840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs