ICEfaces
  1. ICEfaces
  2. ICE-4390

Make it so the dataExporter component will create the export file and initiate the download with a single click

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      dataExporter + generate file

      Description

      Make it so the dataExporter component would not require a click to create a file

        Issue Links

          Activity

          Adnan Durrani created issue -
          Adnan Durrani made changes -
          Field Original Value New Value
          Assignee Adnan Durrani [ adnan.durrani ]
          Adnan Durrani made changes -
          ICEfaces Forum Reference http://www.icefaces.org/JForum/posts/list/12499.page#49527
          Salesforce Case []
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 1.8.1 [ 10170 ]
          Assignee Priority P3
          Ken Fyten made changes -
          Salesforce Case []
          Assignee Priority P3 P2
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18802 Fri Apr 24 11:30:00 MDT 2009 adnan.durrani Fix for ICE-4390 (Make it configurable so the dataExporter component would not require a click to create a file)
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/dataexporter/DataExporterRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-dataExporter-props.xml
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/dataexporter/DataExporter.java
          Adnan Durrani made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Adnan Durrani added a comment -

          Following new attribute added. Setting it to false omits the need of click on a link to create a file. Default value is true.

          • clickToCreateFile

          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
          Completed: At revision: 18802

          Show
          Adnan Durrani added a comment - Following new attribute added. Setting it to false omits the need of click on a link to create a file. Default value is true. clickToCreateFile Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Completed: At revision: 18802
          Adnan Durrani made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Ken Fyten added a comment - - edited

          I think we need to reconsider how this component works. I don't understand the use-case for having to click twice to download an export file? If possible, we should both generate the export file and initiate the download with a single click to the "label" on this component. This makes the component nicer to user from a user's perspective and makes the component more efficient as it doesn't generate the file until a user actually requests it.

          We could then deprecate the "clickToCreateFileText" attribute altogether that was in the original 1.8 release for this component (make it a no-op attribute and mark it as deprecated in the TLD docs). We would no longer require the new "clickToCreateFile" attribute added as part of the original commit on this JIRA. As it hasn't released yet, we can simply remove it altogether.

          Show
          Ken Fyten added a comment - - edited I think we need to reconsider how this component works. I don't understand the use-case for having to click twice to download an export file? If possible, we should both generate the export file and initiate the download with a single click to the "label" on this component. This makes the component nicer to user from a user's perspective and makes the component more efficient as it doesn't generate the file until a user actually requests it. We could then deprecate the "clickToCreateFileText" attribute altogether that was in the original 1.8 release for this component (make it a no-op attribute and mark it as deprecated in the TLD docs). We would no longer require the new "clickToCreateFile" attribute added as part of the original commit on this JIRA. As it hasn't released yet, we can simply remove it altogether.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Affects [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration]
          Ken Fyten made changes -
          Link This issue blocks ICE-4389 [ ICE-4389 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18901 Tue May 19 18:03:19 MDT 2009 adnan.durrani Fix for ICE-4390 (Make it so the dataExporter component would not require a click to create a file )
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputresource/OutputResource.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/dataexporter/DataExporterRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-dataExporter-props.xml
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/dataexporter/DataExporter.java
          Adnan Durrani made changes -
          Summary Make it configurable so the dataExporter component would not require a click to create a file Make it so the dataExporter component would not require a click to create a file
          Salesforce Case []
          Adnan Durrani made changes -
          Salesforce Case []
          Description Make it configurable so the dataExporter component would not require a click to create a file Make it so the dataExporter component would not require a click to create a file
          Hide
          Adnan Durrani added a comment -

          Following changes made:

          • "clickToCreateFileImage" attribute removed.
          • "clickToCreateFileattribute" attribute removed.
          • "clickToCreateFileText" still exist but no-op marked as deprecated.
          • The render is now response writer based.
          • Only one click is required to create and download the file.
          • File will only be created if clicked to download.

          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
          Completed: At revision: 18901

          Show
          Adnan Durrani added a comment - Following changes made: "clickToCreateFileImage" attribute removed. "clickToCreateFileattribute" attribute removed. "clickToCreateFileText" still exist but no-op marked as deprecated. The render is now response writer based. Only one click is required to create and download the file. File will only be created if clicked to download. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporterRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-dataExporter-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Completed: At revision: 18901
          Adnan Durrani made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Summary Make it so the dataExporter component would not require a click to create a file Make it so the dataExporter component will create the export file and initiate the download with a single click
          Salesforce Case []
          Hide
          Adnan Durrani added a comment -

          Tld Docs updated revision 18905

          Show
          Adnan Durrani added a comment - Tld Docs updated revision 18905
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #20024 Fri Dec 18 11:36:35 MST 2009 adnan.durrani 1.8.2EE DataExporter changes moved to Compat DataExporter towards ICE-4481. The changes include the fix of following JIRAs ICE-4484, ICE-4390, ICE-4660, ICE-4223, ICE-4823, ICE-4836, ICE-4837, ICE-4764, ICE-4730, ICE-4844, ICE-4289, ICE-4826, ICE-4863, ICE-4934, ICE-4955
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/component-metadata/src/main/resources/conf/ice_cust_properties/cust-dataExporter-props.xml
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/resources/META-INF/resources/ice-extras.js
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/samples/component-showcase/web/WEB-INF/includes/examples/custom/dataTable-dataExporter.xhtml
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/dataexporter/DataExporter.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/dataexporter/DataExporterRenderer.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/faces/util/CoreUtils.java
          Hide
          John Carlson added a comment - - edited

          Can you provide an example of a single click to create, download and delete a file? Are you sure you can do this in the context of JSF? So far we're using our own Servlets for downloads (non data exporter downloads). Here's my example. I also use Maps when the dataExporter is in the context of a repeated structure (loop of tables). An example of that would be useful too. I'm really clogging up my faces-config.xml with stuff.

          <ice:dataExporter for="configAndCalib"
          binding="#

          {dataExporterNoHashCheckExcel}

          "
          image="images/Excel-16x16.png" type="excel"
          style="text-decoration:underline"
          clickToCreateFileText="Click to create excel file" />
          <ice:dataExporter for="configAndCalib"
          binding="#

          {dataExporterNoHashCheckCsv}

          "
          image="images/Excel-16x16.png" type="csv"
          style="text-decoration:underline"
          clickToCreateFileText="Click to create csv file" />

          <managed-bean>
          <managed-bean-name>dataExporterNoHashCheckExcel</managed-bean-name>
          <managed-bean-class>gov.llnl.nif.datavis.sdavis.view.DataExporterNoHashCheck</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          </managed-bean>

          <managed-bean>
          <managed-bean-name>dataExporterNoHashCheckCsv</managed-bean-name>
          <managed-bean-class>gov.llnl.nif.datavis.sdavis.view.DataExporterNoHashCheck</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          </managed-bean>

          package gov.llnl.nif.datavis.sdavis.view;

          import javax.faces.component.UIData;

          import com.icesoft.faces.application.D2DViewHandler;
          import com.icesoft.faces.component.dataexporter.DataExporter;

          public class DataExporterNoHashCheck extends DataExporter {
          public UIData getUIData() {
          String forStr = getFor();
          UIData forComp = (UIData)D2DViewHandler.findComponent(forStr, this);

          if (forComp == null)

          { throw new IllegalArgumentException( "could not find UIData referenced by attribute @for = '" + forStr + "'"); }

          else if (!(forComp instanceof UIData))

          { throw new IllegalArgumentException( "uiComponent referenced by attribute @for = '" + forStr + "' must be of type " + UIData.class.getName() + ", not type " + forComp.getClass().getName()); }

          return forComp;
          }

          }

          Show
          John Carlson added a comment - - edited Can you provide an example of a single click to create, download and delete a file? Are you sure you can do this in the context of JSF? So far we're using our own Servlets for downloads (non data exporter downloads). Here's my example. I also use Maps when the dataExporter is in the context of a repeated structure (loop of tables). An example of that would be useful too. I'm really clogging up my faces-config.xml with stuff. <ice:dataExporter for="configAndCalib" binding="# {dataExporterNoHashCheckExcel} " image="images/Excel-16x16.png" type="excel" style="text-decoration:underline" clickToCreateFileText="Click to create excel file" /> <ice:dataExporter for="configAndCalib" binding="# {dataExporterNoHashCheckCsv} " image="images/Excel-16x16.png" type="csv" style="text-decoration:underline" clickToCreateFileText="Click to create csv file" /> <managed-bean> <managed-bean-name>dataExporterNoHashCheckExcel</managed-bean-name> <managed-bean-class>gov.llnl.nif.datavis.sdavis.view.DataExporterNoHashCheck</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>dataExporterNoHashCheckCsv</managed-bean-name> <managed-bean-class>gov.llnl.nif.datavis.sdavis.view.DataExporterNoHashCheck</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> package gov.llnl.nif.datavis.sdavis.view; import javax.faces.component.UIData; import com.icesoft.faces.application.D2DViewHandler; import com.icesoft.faces.component.dataexporter.DataExporter; public class DataExporterNoHashCheck extends DataExporter { public UIData getUIData() { String forStr = getFor(); UIData forComp = (UIData)D2DViewHandler.findComponent(forStr, this); if (forComp == null) { throw new IllegalArgumentException( "could not find UIData referenced by attribute @for = '" + forStr + "'"); } else if (!(forComp instanceof UIData)) { throw new IllegalArgumentException( "uiComponent referenced by attribute @for = '" + forStr + "' must be of type " + UIData.class.getName() + ", not type " + forComp.getClass().getName()); } return forComp; } }
          Hide
          John Carlson added a comment -

          Is there a regression problem with this? It requires two clicks in 1.8.2, unless my example above is wrong.

          Show
          John Carlson added a comment - Is there a regression problem with this? It requires two clicks in 1.8.2, unless my example above is wrong.
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2

            People

            • Assignee:
              Adnan Durrani
              Reporter:
              Adnan Durrani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: