cancel
Showing results for 
Search instead for 
Did you mean: 

Lock/Unlock File Webscript

tomoconnell
Champ in-the-making
Champ in-the-making
I need to create a java backed webscript that has the functionality to lock or unlock a node. I don't need any GUI changes, just a webscript that I can call from workflow javascript to lock or unlock.

This is my first dealing with java and webscripts in alfresco.

The descriptor file and Spring bean declaration seem straightforward, I just don't know where to begin with the actual scripts method(s).
If anyone has had any experience with this requirement any help is appreciated.

Thanks.
1 REPLY 1

kavilash23
Champ on-the-rise
Champ on-the-rise
Hi Tom,

To get you started you need to do the following;

1. Your java class must implement the Java interface org.alfresco.web.scripts.Webscripts by extending either AbstractWebScript (allows web script to have full control of request) or DeclarativeWebscript (allows webscript to mix java, javascript and templates)
2. You need to implement the execute() method (method to initiate the webscript)
3. You need to implement getDescription() method ( returns a WebscripDescription object which is a java representation of the webscript description xml file)
4. Check the Java Api for locking or unlocking node

Check the http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples for examples.

Hope this helps.

Kind Regards,

Kavi