I'm trying to make a webscript on Alfresco Share (and potentially a dashlet) that uses/calls a webscript on the Repository tier. I know I need a description XML file, a javascript and a result page being HTML or JSON. My question is what should be in those files?
This what I have compiled from various sources in the interwebs ;)
Desc:
<webscript>
<shortname>Some name</shortname>
<description>Some description</description>
<family>dashlet</family>
<url>/components/dashlets/upload/fileupload</url>
</webscript>
Javascript:
var connector = remote.connect("alfresco");
var data = connector.get("/upload/fileupload");//URL of Repository webscript
// create json object from data
var result = eval('(' + data + ')');//This will parse json data
model.resultaat = result["resultaat"];//For adding data to model.
HTML.ftl result:
<#if resultaat??>
${resultaat}
<#else>
Oh no, the folder name is empty!
</#if>
What I'm actually trying to do is call a Repo webscript that generates and put a report in the Repository. This works (see How to add a document to the Alfresco Repository with Java code?), but I want to call this from Share. So any suggestions?
EDIT: Updated the files.