cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Webscript and ActionExecuter.

mbel
Star Contributor
Star Contributor

Hello,

I want to override the alfresco ExporterActionExecuter java class.

In general I see that it is some kind of webscript, however not sure how to call that method using java.

How to register this specific 'webscript' ?

Whats the difference between Webscript and ActionExecuter?

I will be happy if someone provide some documentation and refer me what I have to read or answer to me.

Thank you in advance,

Mariya

1 ACCEPTED ANSWER

jpotts
World-Class Innovator
World-Class Innovator

The ExporterActionExecuter class is not a web script, it is an action executer. You can tell that by the package name and by the class that it extends, which is ActionExecuterAbstractBase.

An Action is a self-contained unit of operations that can be executed against zero or more nodes in the repository. Actions are executed by the action service. The code that triggers the action service to execute an action might come from something in the UI or a folder rule or any other place where Java code might be running.

For more help with actions, you might take a look at my tutorial on the subject.

A web script is a collection of files which is used to implement a RESTful endpoint. A web script follows the Model View Controller pattern. The controller can be implemented as JavaScript or Java. Some people in the community have done some work to support additional languages as well, but those two are, by far, the most common you will encounter.

Web scripts are meant to be invoked by clients making HTTP calls. So if you had some logic you wanted to run, and you wanted to invoke that logic from some process remote to the Alfresco process, you could put it in a web script controller. Without a web script controller, there is really no convenient way to make that invocation.

If you want to know more about web scripts, I have also written a tutorial that will give you a brief intro.

Finally, web scripts and actions can work together. For example, you might have an action called "ApproveDocument". Maybe it needs to set a flag on a document as well as a handful of other properties. You might call that action from a UI action in Share to start out. Later, someone says, "I'd like to be able to approve documents from the XYZ System." So you'd write a web script that would simply read some arguments from the request and then invoke the ApproveDocument action.

I hope this helps you understand the difference between Web Scripts and Actions and when you'd use them.

View answer in original post

3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator

The ExporterActionExecuter class is not a web script, it is an action executer. You can tell that by the package name and by the class that it extends, which is ActionExecuterAbstractBase.

An Action is a self-contained unit of operations that can be executed against zero or more nodes in the repository. Actions are executed by the action service. The code that triggers the action service to execute an action might come from something in the UI or a folder rule or any other place where Java code might be running.

For more help with actions, you might take a look at my tutorial on the subject.

A web script is a collection of files which is used to implement a RESTful endpoint. A web script follows the Model View Controller pattern. The controller can be implemented as JavaScript or Java. Some people in the community have done some work to support additional languages as well, but those two are, by far, the most common you will encounter.

Web scripts are meant to be invoked by clients making HTTP calls. So if you had some logic you wanted to run, and you wanted to invoke that logic from some process remote to the Alfresco process, you could put it in a web script controller. Without a web script controller, there is really no convenient way to make that invocation.

If you want to know more about web scripts, I have also written a tutorial that will give you a brief intro.

Finally, web scripts and actions can work together. For example, you might have an action called "ApproveDocument". Maybe it needs to set a flag on a document as well as a handful of other properties. You might call that action from a UI action in Share to start out. Later, someone says, "I'd like to be able to approve documents from the XYZ System." So you'd write a web script that would simply read some arguments from the request and then invoke the ApproveDocument action.

I hope this helps you understand the difference between Web Scripts and Actions and when you'd use them.

romschn
Star Collaborator
Star Collaborator

Very nicely explained Jeff. Really helpful.

mbel
Star Contributor
Star Contributor

Thank you, Jeff.

It was very helpful.