06-04-2012 03:18 AM
06-04-2012 03:29 AM
String currentUsername = authenticationService.getCurrentUserName();
Hope this helps :wink:
06-04-2012 05:06 AM
var currentUsername = person.properties.userName;
06-06-2012 06:14 AM
<property name="authenticationService">
<ref bean="authenticationService"/>
</property>
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'authenticationService' of bean class [org.alfresco.repo.jscript.ScriptBehaviour]: Bean property 'authenticationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
… 40 more
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'authenticationService' of bean class [org.alfresco.repo.jscript.ScriptBehaviour]: Bean property 'authenticationService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1024)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:900)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)
… 44 more
06-06-2012 06:36 AM
06-06-2012 09:20 AM
06-06-2012 12:23 PM
<bean id="onBeforeDeleteMyFolder" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration">
<property name="policyName">
<value>{http://www.alfresco.org}beforeDeleteNode</value>
</property>
<property name="className">
<value>{my.test.com}MyDocument</value>
</property>
<property name="behaviour">
<bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
<property name="location">
<bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
<constructor-arg>
<value>alfresco/extension/scripts/onBeforeDeleteNode.js</value>
</constructor-arg>
</bean>
</property>
</bean>
</property>
</bean>
try {
var currentUsername = person.properties.userName;
}
catch (e)
{
logger.log ("error: " + e.message);
}
logger.log("currentUsername: " + currentUsername);
DEBUG [repo.jscript.ScriptLogger] error: "person" is not defined.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.