cancel
Showing results for 
Search instead for 
Did you mean: 

repository access?

noah
Champ in-the-making
Champ in-the-making
Hello community,

i will change .ftl file of a webscript. I read following text in Web Scripts Extensions folder.

Documentation on how to develop a Web Script may be found here.

Any part of a Web Script (i.e. its description, "execute" javascript, or "response" template) may be overridden. This is achieved by copying the original part to this extension folder. The folder within which the part lives must be replicated in this extension area too.

e.g. to override the html output of the "Keyword search" script…

copy

/Data Dictionary/Web Scripts/org/alfresco/repository/keywordsearch.get.html.ftl

to

/Data Dictionary/Web Scripts Extensions/org/alfresco/repository/keywordsearch.get.html.ftl

Once copied, you can make your changes to the copy.

To ensure your override is registered, go to /alfresco/service/ and click on the "Refresh List of Web Scripts" button. The next invocation of the web script will include your override.

My problem: i dont see /Data Dictionary/Web Scripts/org/alfresco/repository/ folder. it exists only …org/alfresco/sample What can i do to get access to repository path?

thanks
Noah
1 REPLY 1

steventux
Champ in-the-making
Champ in-the-making
You can create a folder called 'repository' under the Data Dictionary/Web Script Extensions/org/alfresco/ repository path. Alternatively you can create whatever folder structure you like e.g. Data Dictionary/Web Script Extensions/com/mycompany/search/
Then place your 2 or 3 associated Web Script files in a folder, so keywordsearch.get.html.ftl, keywordsearch.get.js, keywordsearch.get.desc.xml.
The edit the *.desc.xml file, important to take note of the value you set for the url as this is how you call the script. So say you configure the url
/com/mycompany/keywordsearch
The next thing is to call http://<host>:<port>/alfresco/service/ and hit the refresh scripts button - this will load your new script (you should see the total script count change to verify it was picked up).
Now you can call this via http://<host>:<port>/alfresco/service/com/mycompany/keywordsearch
You could also pass parameters to the script - these are accessible in the *.get.js file via the args associative array.
So http://<host>:<port>/alfresco/service/com/mycompany/keywordsearch?keyword=alfresco
you'd find the value of the keyword param in args["keyword"].

You'll find more info here http://wiki.alfresco.com/wiki/Web_Scripts