Lets walk through an example, I am going to show you, how you can access Alfresco data repository into Alfresco Share.
Just take a scenario, Alfresco Share doesn’t provide you workflow history list which is available in Alfresco explorer or web client. Now, you might get requirement to get this history in Share by dashlet.

Here, I am going to show you just simple example – Document Property Web Script.

As, you might know, to In Share, you cant directly access Alfresco repository, it can be done either by RESTful API Reference or third party data fetched from XML or JSON sources based on the standard mechanisms provided by the Surf Platform.

Here, Document Property Web Script will simple output some document’s property like name, date of creation etc. in JSON format in Alfresco and I would retrieve this text in Alfresco Share.

PART 1
So first lets create a web script in alfresco for that you need following files.docprop.get.desc.xml
docprop.get.json.ftl

Here, we don’t need .js file, as we are not going to have any specific behavior for our web script.