A simplification of file creation
---------------------------------

         Key: DISPL-325
         URL: http://jira.codehaus.org/browse/DISPL-325
     Project: DisplayTag
        Type: New Feature

  Components: Export  
    Versions: 1.1    
    Reporter: Howard Rafal
 Attachments: useExtension.diff

We currently have about 30 different tables in our application which each can 
export to csv, xml, excel, and pdf. We want to have each one export as a unique 
name. This requires that each table set the four filename properties and if we 
decide to add to the export, we need to change all 30 tables to add the new 
filename. I have implemented and tested the following solution for this. Not 
sure if it is the cleanest way to do this but essentially it boils down to:

2 export parameters: 
   export.use_extension=true
   export.filename=  <default generic filename>

If using extension, then this filename parameter is used for any export media 
type and a specified extension is used for each media type by using, if 
use_extension if false, then it behaves the original way:

   export.<mediatype>.extension

So, I just had to add the following to my properties file:

   export.excel.extension=xls
   export.xml.extension=xml
   export.pdf.extension=pdf
   export.csv.extension=csv

This is nice (for our use) because our JSPs just defines export.filename once 
and it works for all four of our media types and if we add more, we don't have 
to touch our JSPs.

To implement this I just updated TableProperties.java. I attached the diff (I 
added two constants and replaced the getExportFileName with my version).

Thanks for considering this.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to