Export search results into Excel file

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2009 01:10 AM
Hi,
Is it possible to export the search results into excel file?
Thanks in Advance.
Is it possible to export the search results into excel file?
Thanks in Advance.
Labels:
- Labels:
-
Archive
8 REPLIES 8

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 04:29 AM
Did u get this, how to export search results into Excel. If yes, please respond to this.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2009 09:19 AM
Please take a look to the ContentTransformers Section.
At a glance please open tomcat\webapps\alfresco\WEB-INF\classes\alfresco\content-services-context.xml and have a look to following snippet:
One transformer, responsible to change excel input into a string.
See therefore: org.alfresco.repo.content.transform.PoiHssfContentTransformer.transformInternal.
Now you get a first expierence on how an excel format can be read.
But in which way we can achieve your aim? If you do a search, nodes will be stored in the backend as an attribute "contentNodes" member of BrowseBean.
Your only thing you have to make is, to create an excel download button what delegates the "download request" to a downdload servlet. This Servlet obtains the BrowseBean via BeanFactory as the browsbean is managed within the whole session. Now you can query getNodes() on that class and you retrieve your last search results.
A more better solution can be achieved on querieng alfresco within the servlet as well.
Happy Coding!
Best Regards!
At a glance please open tomcat\webapps\alfresco\WEB-INF\classes\alfresco\content-services-context.xml and have a look to following snippet:
<bean id="transformer.Poi" class="org.alfresco.repo.content.transform.PoiHssfContentTransformer" parent="baseContentTransformer" />
One transformer, responsible to change excel input into a string.
See therefore: org.alfresco.repo.content.transform.PoiHssfContentTransformer.transformInternal.
Now you get a first expierence on how an excel format can be read.
But in which way we can achieve your aim? If you do a search, nodes will be stored in the backend as an attribute "contentNodes" member of BrowseBean.
Your only thing you have to make is, to create an excel download button what delegates the "download request" to a downdload servlet. This Servlet obtains the BrowseBean via BeanFactory as the browsbean is managed within the whole session. Now you can query getNodes() on that class and you retrieve your last search results.
A more better solution can be achieved on querieng alfresco within the servlet as well.
Happy Coding!
Best Regards!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 01:12 AM
Thanks Cheffilet.
I am new to Alfresco coding.
Can you please tell me how to add download button in search results screen?
and how to invoke download servlet when I click on download button?
Thanks in Advance!
I am new to Alfresco coding.
Can you please tell me how to add download button in search results screen?
and how to invoke download servlet when I click on download button?
Thanks in Advance!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2009 05:07 AM
you should add some link for "download" at browse.jsp Page.
( Becasue in "AdvanceSearchDialog.java will return result to browse.jsp" )
and this like will call servlet "reportServlet" and you have to add this on web.xml
Then you have to some coding about getting data from browseBean.
But My idea is so hard way, But i have not idea to use WEBDev too.
Cheer
( Becasue in "AdvanceSearchDialog.java will return result to browse.jsp" )
and this like will call servlet "reportServlet" and you have to add this on web.xml
Then you have to some coding about getting data from browseBean.
But My idea is so hard way, But i have not idea to use WEBDev too.
Cheer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2010 10:57 AM
thank you for your posts. They have been very helpful!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2011 07:12 AM
Hi,
I want to export the search result into excel file or .csv file.
I added a link, for "download", to "browse.jsp" but I don't know some coding about getting data from browseBean.
Code for add actionLink to browse.jsp
Bean code to identify the action with their sources. I added the following code to the file: faces-config-custom.xml
Code Java Class export search results into Excel file
Error System of link in actionLink for export search result
How I can get browseBean in my java class?
How I can pass browseBean for actionLink to browse.jsp?
Thanks
I want to export the search result into excel file or .csv file.
I added a link, for "download", to "browse.jsp" but I don't know some coding about getting data from browseBean.
Code for add actionLink to browse.jsp
<td style="padding-left:4px" width=90><nobr><a:actionLink id="link22" style="white-space:nowrap" value="Exportar CSV" actionListener="#{CSVExportAction.csvExport}" image="/images/icons/export.gif"></a:actionLink></nobr></td>
Bean code to identify the action with their sources. I added the following code to the file: faces-config-custom.xml
<faces-config> <managed-bean> <description> Exporta a un fichero CSV, los metadatos de los documentos obtenidos en la búsqueda </description> <managed-bean-name> CSVExportAction </managed-bean-name> <managed-bean-class> ants.alfrescoexportcsv.csvexportaction.CSVExportAction </managed-bean-class> <managed-bean-scope> session </managed-bean-scope> <managed-property> <property-name>nodeService</property-name> <value>#{NodeService}</value> </managed-property> <managed-property> <property-name>browseBean</property-name> <value>#{BrowseBean}</value> </managed-property> </managed-bean></faces-config>
Code Java Class export search results into Excel file
public class CSVExportAction extends ActionExecuterAbstractBase{ private static Logger logger; public CSVExportAction (){ super(); } private NodeService nodeService; private BrowseBean browseBean; public BrowseBean getBrowseBean() { return browseBean; } public void setBrowseBean(BrowseBean browseBean) { this.browseBean = browseBean; } public NodeService getNodeService() { return nodeService; } public void setNodeService(NodeService nodeService) { this.nodeService = nodeService; } …. public void csvExport(ActionEvent e) throws Exception{ // Start the session this.initLog(); logger.info("init exportCSV"); logger.debug("BroseBean: "+browseBean); logger.debug("NodeService: "+nodeService); List<Node> nodos = browseBean.getNodes(); logger.info("Size List "+nodos.size()); for(int i = 0 ; i<nodos.size();i++) logger.debug("NODO: "+nodos.get(i)); …. }…. protected void executeImpl(Action arg0, NodeRef arg1) { } protected void addParameterDefinitions(List arg0) { }}
Error System of link in actionLink for export search result
javax.faces.FacesException: net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationTokencaused by:org.apache.jasper.JasperException: net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationTokencaused by:net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
How I can get browseBean in my java class?
How I can pass browseBean for actionLink to browse.jsp?
Thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2013 11:16 AM
To avoid that error add this line of code at the end of csvExport metod
browseBean.closeSearch(e);
browseBean.closeSearch(e);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2012 02:36 AM
hi all.
did any one get how to export search result in to excel sheet?
did any one get how to export search result in to excel sheet?
