Hello everybody,
I'd like to use annotations to declare webscripts. I found these 2 projects:
Official Alfresco documentation ( Registering a Java-backed web script | Alfresco Documentation ), says that
all web script bean declarations must have the parent 'webscript'
Looking in the Spring configurations, 'webscript' bean it's only an alias.
Is it only a convention, or are there other logics that risk to be ignored using the projects that I found?
Solved! Go to Solution.
The parent "webscript" is only convention to simply writing your own web scripts without actually knowing how everything is actually wired up at runtime. The two projects you have linked basically just add their specific take on different sets of conventions to follow, and take care of the plumbing for you, just as the parent "webscript" takes care of (some of) the plumbing for you in the default convention.
The parent "webscript" is only convention to simply writing your own web scripts without actually knowing how everything is actually wired up at runtime. The two projects you have linked basically just add their specific take on different sets of conventions to follow, and take care of the plumbing for you, just as the parent "webscript" takes care of (some of) the plumbing for you in the default convention.
The answer of Axel is right, but if you need to use annotations of spring anyway i suggest to you the project:
GitHub - dgradecak/alfresco-mvc: Glue between SpringMVC and Alfresco
of dgradecak like alternative to the other two.
in the docuemntation you can find some example with the webscripts:
@Bean(name = { "webscript.alfresco-mvc.mvc.post", "webscript.alfresco-mvc.mvc.get", "webscript.alfresco-mvc.mvc.delete", "webscript.alfresco-mvc.mvc.put" })
public DispatcherWebscript dispatcherWebscript() {
DispatcherWebscript dispatcherWebscript = new DispatcherWebscript();
dispatcherWebscript.setContextClass(org.springframework.web.context.support.AnnotationConfigWebApplicationContext.class);
dispatcherWebscript.setContextConfigLocation(AlfrescoMvcHateoasConfig.class.getName());
return dispatcherWebscript;
}
Thank you for your suggestion. I will check this project for sure.
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.