How to send webscript response as file (file download box)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2012 05:45 AM
Hi,
In alfresco 4 share enterprise, When I perform advance search, I place one more button called "Export Search", when search result gives me nodes (searched results).
e.g. Let say I got 5 results. Following are the steps I performed.
1) Get 5 nodeRefs from client side search.js
2) Calling repo side webscript from the same search.js (custom repo side webscript)
3) My repo side webscript will process those nodes and write data to one file (export as csv)
4) Now question is what output should I give in desc/or response file so, it will directly ask user to save/open that csv file ????
Let me know if anybody resolved same kind of thing.
In alfresco 4 share enterprise, When I perform advance search, I place one more button called "Export Search", when search result gives me nodes (searched results).
e.g. Let say I got 5 results. Following are the steps I performed.
1) Get 5 nodeRefs from client side search.js
2) Calling repo side webscript from the same search.js (custom repo side webscript)
3) My repo side webscript will process those nodes and write data to one file (export as csv)
4) Now question is what output should I give in desc/or response file so, it will directly ask user to save/open that csv file ????
Let me know if anybody resolved same kind of thing.
Labels:
- Labels:
-
Archive
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2012 06:28 AM
Hi Ghanshyam,
I have similar kind of issue, did you resolved that?
I am storing file in tomcat/temp but streamContent would not expose file to share side as download prompt.
I have similar kind of issue, did you resolved that?
I am storing file in tomcat/temp but streamContent would not expose file to share side as download prompt.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2013 08:21 AM
Hi All,
were you able to resolve this, coz i am doing the same thing to export file from Share. I tried with declarative webscript and Content Stream but i am not getting content pop-up to save/save-as file.
please provide your inputs, that will be really help full.
Thanks.
were you able to resolve this, coz i am doing the same thing to export file from Share. I tried with declarative webscript and Content Stream but i am not getting content pop-up to save/save-as file.
please provide your inputs, that will be really help full.
Thanks.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2013 12:31 AM
hi, we're trying to the same as well. Has anyone got this down yet? we're using alfresco share 4.0.e.
Cheers.
Cheers.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2013 12:43 PM
Hello,
Can you tell me how did you put a button to export advanced search results on the results screen
Can you tell me how did you put a button to export advanced search results on the results screen
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 12:44 PM
Check this one out: https://wiki.alfresco.com/wiki/3.0_Web_Scripts_Kinds
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 12:55 PM
in case anyone still needs a response to this, here's how i did it…. all you need is a name.get.js and name.get.desc.xml and place them into your webScripts directory in Alfresco Share
name.get.desc.xml
three things to pay attention to: 1. "kind" attribute on the <webscript> tag, 2. empty "default" attribute on the <format> tag, 3. "required" content for the <transaction> tag
name.get.js
I search for my file first by name, but, you can search on other things as well, tags, internal columns, categories, text, etc. Just take a look into luceneSearch
and that's it
name.get.desc.xml
three things to pay attention to: 1. "kind" attribute on the <webscript> tag, 2. empty "default" attribute on the <format> tag, 3. "required" content for the <transaction> tag
<webscript kind="org.alfresco.repository.content.stream"> <shortname>return file</shortname> <description>return a file</description> <url>/name/return/{name}url> <format default="">extension</format> <authentication>guest</authentication> <transaction>required</transaction></webscript>
name.get.js
I search for my file first by name, but, you can search on other things as well, tags, internal columns, categories, text, etc. Just take a look into luceneSearch
// perform searchvar nodes = search.luceneSearch("@cm\\:name:\""+url.extension+".xml\"");//stream the first documentmodel.contentNode = nodes[0];
and that's it