rdicroce / jsfexporter Goto Github PK
View Code? Open in Web Editor NEWLapis JSF Exporter
Lapis JSF Exporter
Add possibility to export a full list when custom lazy load is available. We have implemented a custom lazy load. Is it possible to add a new parameter to add the full list as parameter to export.
hello,
at first I would like to thank you for your work, the jsf exporter is great!
It works fine for me, but now I have a datatable with around 65k entries and the creation of the file isn't executed. Is there a limit for data which the exporter can handle?
Probably need to have a configuration option of whether to export only the selected rows or the selected rows with their (possibly unselected) ancestors as well.
It would be handy to have TreeTableExportSource optionally do something to indicate depth for flat formats like PDF/CSV/Excel. Maybe a config option to add an additional depth column to the export, or prepend spaces/tabs to the value of the first cell in each row.
In order to make this exporter works whith RichFaces 4.5.0.Final, I had to exclude RichFaces dependencies. Like this :
<dependency>
<groupId>com.lapis.jsfexporter</groupId>
<artifactId>export-source-richfaces</artifactId>
<version>1.0.2.Final</version>
<exclusions>
<exclusion>
<artifactId>richfaces-components-ui</artifactId>
<groupId>org.richfaces.ui</groupId>
</exclusion>
</exclusions>
</dependency>
It could be a good idea to mark the dependency as provided. I think there is the same problem with primefaces...
Currently these show up as javax.faces.component.UINamingContainer in exported file. Would also appreciate any pointers on how to implement this on my own
Happens after clicking the dataExporter
Loaded JARs:
Stacktrace:
2015-03-18 11:16:09,091 ERROR [io.undertow.request](default task-61) UT005023: Exception handling request to /shelfboard/dashboard/gerencial.xhtml: javax.servlet.ServletException: Index: 1, Size: 1
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72) [primefaces-5.1.jar:5.1]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.2.3.jar:1.2.3]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_05]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_05]
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:638) [rt.jar:1.8.0_05]
at java.util.ArrayList.set(ArrayList.java:429) [rt.jar:1.8.0_05]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportFacet(DataTableExportSource.java:159) [export-source-primefaces-1.0.2.Final.jar:]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportData(DataTableExportSource.java:77) [export-source-primefaces-1.0.2.Final.jar:]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportData(DataTableExportSource.java:45) [export-source-primefaces-1.0.2.Final.jar:]
at com.lapis.jsfexporter.DataExporter.internalProcessAction(DataExporter.java:147) [jsf-exporter-core-1.0.2.Final.jar:]
at com.lapis.jsfexporter.DataExporter.processAction(DataExporter.java:101) [jsf-exporter-core-1.0.2.Final.jar:]
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.8-jbossorg-1.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
... 45 more
Hello ,
i'm succesfully using lapis.jsfexporter, im'using primefaces 6.2 with sping boot.
I have a problem whitih one pages, beside a snipped of code
<p:treeTable id="i" widgetVar="i" value="#{iHV.selectDates)}"
var="node"
rendered="#{iHV.selectIndicator != null}"
paginator="false"
resizableColumns="true"
paginatorPosition="top" >
<f:facet name="header">
<p:commandLink ajax="false">
<p:graphicImage value="/images/excel.png" height="20"/>
<l:dataExporter source="i" fileType="excel" fileName="documents"/>
</p:commandLink>
</f:facet>
<p:column headerText="Description" style="width:300px">
<h:outputText value="#{node[1]}" title="#{node[1]}"/>
</p:column>
<p:columns value="#{iHV.inValDates}" var="c" columnIndexVar="colIndex">
<f:facet name="header">
<h:outputText value="#{c}" />
</f:facet>
<h:outputText value="#{iHV.getValue(node[0],c)}">
<f:convertNumber pattern="#,###,##0.0000" />
</h:outputText>
</p:columns>
</p:treeTable>
The problem is jsfexportewr do not manage p:columns but only p:column!!!!
May you extends implementation?.
Thanks in advance
Need to add a value formatter that iterates over the SelectItems, finds the correct one, and uses the label from that item.
Add configuration option to export a node only if all ancestors are expanded (and thus the row is visible)
Add an option to only export up to a given depth
When:
exporting from a lazy p:dataTable or p:dataList AND
table is paginated AND
exporting entire dataset AND
dataset size is not a multiple of page size
the final page is a "partial" page and is not exported correctly due to missing calls to setFirst() and loadLazyData(). Instead of exporting the data on the last page, the data on the second to last page is repeated.
Error: Could not find an IExportSource implementation for export source javax.faces.component.html.HtmlPanelGrid
What I'm doing wrong?
Has many of the same issues as treeTable, including
Whether the tree is horizontal should probably be ignored. I can't think of any good way to support exporting a tree horizontally.
Should allow configuring name, size, color, style, and background. Facets should be allowed to have a different font configuration.
This could be complicated. It's unclear what it means for some export types, like CSV. Possibly CSV could just add a blank line between component exports, or it could generate a bunch of CSV files and package them all into an archive (but then what format should the archive be in?).
Header columns under columnGroup that have rendered="false" or exportable="false" are still appearing as headers in the exported document (tested with excel export). Headers also become misaligned since the column is skipped when data cells are being populated.
"a4j:" for richfaces 4x
"r:" for richfaces 5.x
Hi
jsfexporter looks very interesting but we didn't get very far.
We use statics to do some formatting. So in the datatable:
<p:column headerText="Start Time" exportable="true>
<h:outputText value="#{uiUtils.formatTimeFromLocalDateTime(slot.startDate,currentLocale)}" />
</p:column>
The static itself is along the lines of:
public static String formatTimeFromLocalDateTime(LocalDateTime dt, Locale locale)
{
// do the formatting
}
But jsfexport gave the following stack trace.
16:56:13,794 ERROR [com.myapp.ui.utils.ExceptionManager] (http-localhost/127.0.0.1:8080-3) An unexpected exception has been thrown: javax.el.PropertyNotFoundException: /webapp/myfile.xhtml @71,106 value="#{uiUtils.formatDateFromLocalDateTime(_booking.startDate,currentLocale)}": The class 'com.myapp.ui.utils.UIUtils' does not have the property 'formatDateFromLocalDateTime'.
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at com.lapis.jsfexporter.impl.value.ValueHolderFormatter.formatValue(ValueHolderFormatter.java:59) [jsf-exporter-core-1.0.3.Final.jar:]
at com.lapis.jsfexporter.impl.value.ValueHolderFormatter.formatValue(ValueHolderFormatter.java:31) [jsf-exporter-core-1.0.3.Final.jar:]
at com.lapis.jsfexporter.util.ExportUtil.transformComponentsToString(ExportUtil.java:41) [jsf-exporter-core-1.0.3.Final.jar:]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportRowCells(DataTableExportSource.java:189) [export-source-primefaces-1.0.3.Final.jar:]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportData(DataTableExportSource.java:79) [export-source-primefaces-1.0.3.Final.jar:]
at com.lapis.jsfexporter.primefaces.datatable.DataTableExportSource.exportData(DataTableExportSource.java:45) [export-source-primefaces-1.0.3.Final.jar:]
at com.lapis.jsfexporter.DataExporter.internalProcessAction(DataExporter.java:147) [jsf-exporter-core-1.0.3.Final.jar:]
at com.lapis.jsfexporter.DataExporter.processAction(DataExporter.java:101) [jsf-exporter-core-1.0.3.Final.jar:]
i'm having this error: Could not find an IExportSource implementation for export source org.primefaces.component.treetable.TreeTable
p :treeTable value="#{estruturaProdutoMB.root}"
var="document"
id="arvore"
selection="#{estruturaProdutoMB.selectedNode}"
emptyMessage="Nenhum registro encontrado"
selectionMode="single">.../p:treeTable>
p:commandButton value="Export"
ajax="false">
<l:dataExporter source="arvore"
fileType="excel" fileName="myfile"/>
/p:commandButton>
What i'm doing wrong ?
When I try to use jsfexporter in a existing Liferay portlet, I get the following error:
javax.faces.component.UIViewRoot cannot be cast to javax.portlet.faces.component.PortletNamingContainerUIViewRoot
I got the error after I added these dependencies to the portlet:
<dependency>
<groupId>com.lapis.jsfexporter</groupId>
<artifactId>jsf-exporter-core</artifactId>
<version>1.0.2.Final</version>
</dependency>
<dependency>
<groupId>com.lapis.jsfexporter</groupId>
<artifactId>export-type-excel</artifactId>
<version>1.0.2.Final</version>
</dependency>
This is useful, to export outputFormat values, which can have a list of f:param values, which also must be exported.
This is complicated.
Row expansions could just be made as additional rows in the export, but this could result in some useless exports. Suppose the export type is CSV and we have a dataTable with a rowExpansion that has another dataTable inside it: the resulting CSV will be completely useless since it will have headers in the data, probably a varying number of columns, and varying meanings of data within the same column. The best solution is probably to add a configuration option that allows the user to decide if they want the rowExpansion organized into additional columns or not. If yes, then instead of having DataTableExportSource produce rows like this:
header1, header2, header3
row1_cell1, row1_cell2, row1_cell3
row_expansion_header1, row_expansion_header2
row_expansion_row1_cell1, row_expansion_row1_cell2
we would instead produce rows like this:
header1, header2, header3, row_expansion_header1, row_expansion_header2
row1_cell1, row1_cell2, row1_cell3, ,
, , , row_expansion_row1_cell1, row_expansion_row1_cell2
We should also provide an option to disable exporting the row expansion entirely.
Should allow configuring name, size, color, style, and background. Facets should be allowed to have a different font configuration.
Hi,
I tried to use your lib for customizing my CSV Export. I need to remove the 'footerText' that is displayed in Primefaces p:dataTable. I could not find any documentation for writing such a Postprocessor.
Can you give me a hint how to realize this task?
P.S: I tried to find any mail address to write to but I did not find anything, sorry for using the Issue tool.
greetz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.