-
Notifications
You must be signed in to change notification settings - Fork 10
Alfresco retrying transaction or runAs features tend to introduce quite a lot of boilerplate code, this library allows to avoid that.
used on a service method to indicate what type of authentication is allowed, same usage as in the webscript decriptor user. Four possibilities are NONE, GUEST, USER, ADMIN as defined in the AuthenticationType enum. Defaults to USER
allows with a simple annotation to use the runas mechanism of alfresco. The value has to be a static string with the username.
this one uses the RetryingTansaction in order to avoid to write all lines for a RetryingTransactionCallback, Params: readOnly defaults to true and propagation defaults to org.springframework.transaction.annotation.Propagation.REQUIRED
Configuration:
@ComponentScan(basePackageClasses = { "com.gradecak.alfresco.mvc.sample.service" })
@EnableAlfrescoMvcProxy(basePackageClasses = { "com.gradecak.alfresco.mvc.sample.service" })
EnableAlfrescoMvcProxy or PackageAutoProxyCreator will auto create spring's proxies for all the classes in the specified package in order to apply the advices
<context:component-scan base-package="com.gradecak.alfresco.mvc.sample.service">
<context:include-filter expression="org.springframework.stereotype.Service" type="annotation" />
</context:component-scan>
<bean class="com.gradecak.alfresco.mvc.aop.PackageAutoProxyCreator">
<property name="basePackage" value="com.gradecak.alfresco.mvc.sample.service" />
</bean>
Some issues while using CMIS were spotted if the services are registered via @ComponentScan and used in Alfresco behaviors, therefore for now it is recommended to use the xml or java (@Bean) config for service scanning only. This is due to the lifecycle of spring's loading of beans (not reproduced on Alfresco 6 for now).
There is a spring proxy limitation (spring 3.2.x) in order to use @Autowired on constructors, therefore @Autowired for now should be used on fields. This is due to how CGLIB creates the proxies (a default constructor is needed)