I can successfully write a (e.g. MyWebScript1), which extends from AbstractWebScript.
However, my goal is to define another webscript (e.g. MyWebScript2), which will extend from MyWebScript1 (and MyWebScript1 will extend from AbstractWebScript).
The goal is to define MyWebScript1 as a base web script with some boiler plate/common code inside execute, which MyWebScript2, MyWebScript3 etc. can inherit (by calling super, without having to duplicate them in MyWebScript2, MyWebScript3).
MyWebScript1 will just serve as a superclass.
This is what I am not able to accomplish.
My questions:
1. Do I still need to define a XML for the common/base MyWebScript1? However, MyWebScript1 is not associated with any get, post etc.
2. Do I still need to define MyWebScript1 inside webscripts-context.xml?
I am only seen the examples where a given WebScript extends from AbstractWebScript, but seen a hirerachy like the way I am trying to accomplish.
You do not need any XML for any web script base class that is only used for others to extend from. If the base class defines a few setters for common members, you can define an abstract bean to be used as a "parent" for your specific web scripts.
Tq very much Axel. Could you please provide any examples of code-snippets of parent declaration of parent in the webscript-context xml. Throughout my search, I can only find examples where all the webscripts only extend from AbstractWebScript, but do not find any example of two level of extending.
Really? All Java-backed webscripts typically have to use a parent to inherit key configuration. This pattern can simply be extended to use your base class as a (intermediary) parent.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.