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;
}
}
Following new attribute added. Setting it to false omits the need of click on a link to create a file. Default value is true.
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