02-11-2019 04:53 AM
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?
02-11-2019 04:32 PM
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.
02-11-2019 04:32 PM
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.
02-12-2019 04:26 AM
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;
}
02-14-2019 07:53 AM
Thank you for your suggestion. I will check this project for sure.
Explore our Alfresco products with the links below. Use labels to filter content by product module.