cancel
Showing results for 
Search instead for 
Did you mean: 

Using BehaviorFilter

rhinmass
Champ in-the-making
Champ in-the-making
I'm trying to use BehaviorFilter to disable the auditable aspect while I update a property. 

The reason is that this particular webscript needs to run as Administrator, but when it updates a property on the file, alfresco is changing the last modifier to Administrator.  So I am trying to use BehaviourFilter to disable this aspect while I update the property.


public class PublishWebscript extends PublishingWebScriptSupport {
   
   private BehaviourFilter behaviourFilter;
   public void setBehaviourFilter(BehaviourFilter policyBehaviourFilter)
   {
      this.behaviourFilter = policyBehaviourFilter;
   }
   
   
   public void execute(WebScriptRequest req, WebScriptResponse res) throws WebScriptException {   


And the associated bean:

   <bean id="webscript.com.czen.publish.post" class="com.czen.alfresco.web.webscripts.PublishWebscript" parent="webscript">
      <property name="username" value="administrator" />
      <property name="password" value="123456" />
      <property name="BehaviourFilter">
               <ref bean="policyBehaviourFilter" />
           </property>
   </bean>

When I try to start up the container I get:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'policyBehaviourFilter' is defined


Where do I need to define policyBehaviourFilter.



1 REPLY 1

mlagneaux
Champ on-the-rise
Champ on-the-rise
Hi,

I've defined an action executer bean that uses policyBehaviourFilter bean in 4.2 and the property of the bean is exactly the same than yours :

<property name="behaviourFilter">
          <ref bean="policyBehaviourFilter" />
</property>


Pay attention to the upper case at the beginning of "BehaviourFilter" in the property name of the bean. I don't think that causes your problem but it could be a problem later.

I see that admin credentials are used in the property of your bean. I think that you should use runAs parameter in your webscript description instead of that. You can run your webscript as admin or system for example.
Getting started

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.