08-27-2009 06:59 PM
Result: ${total} found
<#list nodes as document>
<#if document.isDocument>
{"name": "${document.name}"
<#if document.properties.author??>, "author":"${document.properties.author}"</#if>
<#if document.properties.creator??>, "creator":"${document.properties.creator}"</#if>
<#if document.properties.modified??>, "modified":"${document.properties.modified?datetime}"</#if>
<#if document.properties.created??>, "created":"${document.properties.created?datetime}"</#if>
<#if document.properties.description??>, "description":"${document.properties.description}"</#if>
</#if>
</#list>
08-28-2009 05:57 PM
<!– Default Formats –>s
<bean id="webscripts.formats" parent="webscripts.formatmap">
<property name="formats">
<props>
<prop key="html">text/html</prop>
<prop key="text">text/plain</prop>
<prop key="xml">text/xml</prop>
<prop key="atom">application/atom+xml</prop>
<prop key="atomentry">application/atom+xml;type=entry</prop>
<prop key="atomfeed">application/atom+xml;type=feed</prop>
<prop key="rss">application/rss+xml</prop>
<prop key="json">application/json</prop>
<prop key="opensearchdescription">application/opensearchdescription+xml</prop>
<prop key="mediawiki">text/plain</prop>
<prop key="portlet">text/html</prop>
<prop key="fbml">text/html</prop>
<prop key="php">text/html</prop>
<prop key="js">text/javascript</prop>
<prop key="calendar">text/calendar</prop>
<prop key="xls">application/vnd.ms-excel</prop>
<prop key="txt">application/txt+text</prop>
<prop key="csv">application/cv+text</prop>
</props>
</property>
<property name="mimetypes">
<props>
<prop key="text/html">html</prop>
<prop key="text/plain">text</prop>
<prop key="text/xml">xml</prop>
<prop key="text/calendar">calendar</prop>
<prop key="application/atom+xml">atom</prop>
<prop key="application/atom+xml;type=entry">atomentry</prop>
<prop key="application/atom+xml;type=feed">atomfeed</prop>
<prop key="application/rss+xml">rss</prop>
<prop key="application/json">json</prop>
<prop key="application/opensearchdescription+xml">opensearchdescription</prop>
</props>
</property>
</bean>
09-15-2009 01:49 PM
<!– IE Specific set of API Formats –>
<bean id="webscripts.formats.IE" parent="webscripts.formatmap">
<property name="agent"><value>MSIE</value></property>
<property name="formats">
<props>
<prop key="text">text/plain</prop>
<prop key="atom">text/xml</prop>
<prop key="atomentry">text/xml</prop>
<prop key="atomfeed">text/xml</prop>
<prop key="rss">text/xml</prop>
<prop key="json">application/json</prop>
<prop key="opensearchdescription">text/xml</prop>
<prop key="xls">application/vnd.ms-excel</prop>
<prop key="csv">application/vnd.csv+text</prop>
<prop key="txt">application/octetstream.txt+text</prop
[color=#FFBF00] <!– blow are other combinations I found on the web to work in PHP, ASP, etc but not through Alfresco –>[/color]
<prop key="txt">application/download.txt+text</prop>
<prop key="txt">application/vnd.txt+text</prop>
<prop key="txt">application/vnd.txt/text</prop>
<prop key="txt">application/vnd.txt</prop>
</props>
</property>
</bean>
02-02-2015 10:47 PM
public class ForceDownloadWebScript extends DeclarativeWebScript {
private WebScriptResponse res;
@Override
protected void executeFinallyImpl(WebScriptRequest req, Status status,
Cache cache, Map<String, Object> model) {
super.executeFinallyImpl(req, status, cache, model);
String filename = req.getParameter("filename");
res.addHeader("Content-Type", "application/octet-stream");
res.addHeader("Content-Disposition", "attachment; filename=" + filename);
}
@Override
protected Map<String, Object> createScriptParameters(WebScriptRequest req,
WebScriptResponse res, ScriptDetails script,
Map<String, Object> customParams) {
this.res = res;
return super.createScriptParameters(req, res, script, customParams);
}
}
<bean id="webscript.download.service.get" class="com.my.ForceDownloadWebScript"
parent="webscript">
</bean>
<webscript>
<shortname>Download Test Service</shortname>
<description>To Test if this had a force download header</description>
<url>/force/download/service?filename={filename}</url>
<authentication>user</authentication>
<format default="xml">extension</format>
</webscript>
model.animals= [
{kind: 'dog', name: 'pluto'},
{kind: 'cat', name: 'tommy'}
];
<?xml version="1.0"?>
<animals>
<#list animals as anim>
<animal kind="${anim.kind}">${anim.name}</animal>
</#list>
</animals>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.