cancel
Showing results for 
Search instead for 
Did you mean: 

How alfresco javascript api is integrated in repository?

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

While going thru http://wiki.alfresco.com/wiki/4.0_JavaScript_API, i was curious that how alfresco javascript apis are integrated in repository so that these can leverage underlying java based services framework. E.g. javascript search api

var results = search.query({query: "TEXT:alfresco"});


Internally it calls alfresco repo searchservice so how it happens exactly & how can i extend it for custom javascript apis.

Regards.
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
There are parts to the puzzle.   

The first is that there are a number of so called "root" scoped objects that are placed into the java script context.   One of which is "search".    You can add your own root scoped objests - take a look at how one of the existing ones is defined to see the pattern.

The second part of the puzzle is the machinery ro run Java script and map java objects to jave script.   You shouldn't need to know the ins and outs of that process.

Hmm..but i should get an overview of the machinery you just mentioned.

mrogers
Star Contributor
Star Contributor
O.K.  Read up on Rhino.  

In alfresco
Have a look at the ScriptService in particular ScriptServiceImpl that's the entry point.
And the various ScriptProcessors.

dynamolalit
Champ on-the-rise
Champ on-the-rise
Thanks a lot!