title: Alfresco - How to create a Share web script that uses a Repository web script?
body: <p>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?</p>
  
  <p>This what I have compiled from various sources in the interwebs ;)</p>
  
  <p>Desc:</p>
  
  <pre><code>&lt;webscript&gt;
     &lt;shortname&gt;Some name&lt;/shortname&gt;
     &lt;description&gt;Some description&lt;/description&gt;
     &lt;family&gt;dashlet&lt;/family&gt;
     &lt;url&gt;/components/dashlets/upload/fileupload&lt;/url&gt;
  &lt;/webscript&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>HTML.ftl result:</p>
  
  <pre><code>&lt;#if resultaat??&gt;
      ${resultaat}
  &lt;#else&gt;
      Oh no, the folder name is empty!
  &lt;/#if&gt;
  </code></pre>
  
  <p>What I'm actually trying to do is call a Repo webscript that generates and put a report in the Repository. This works (see <a href="https://stackoverflow.com/questions/30304918/how-to-add-a-document-to-the-alfresco-repository-with-java-code">How to add a document to the Alfresco Repository with Java code?</a>), but I want to call this from Share. So any suggestions?</p>
  
  <p>EDIT: Updated the files.</p>