05-02-2011 10:02 AM
05-09-2011 10:56 PM
what I did is to add this to "processEngineConfiguration" config in spring,
<property name="customSessionFactories">
<list>
<bean class="com.xxxxx.user.ActivitiCustomUserManagerFactory">
<property name="usersDao" ref="usersDAO"/>
</bean>
</list>
</property>
And this factory will return ActivitiCustomUserManager (extends UserManager) in its openSession() method.
Similar thing should be needed for GroupManager and its Factory as well.
<property name="customSessionFactories">
<list>
<bean class="org.grails.activiti.springsecurity.SpringSecurityUserManagerFactory">
<property name="usersDao" ref="usersDAO"/>
</bean>
<bean class="org.grails.activiti.springsecurity.SpringSecurityGroupManagerFactory">
<property name="groupsDao" ref="groupsDAO"/>
</bean>
</list>
</property>
and SpringSecurityUserManagerFactory implementation:
package org.grails.activiti.springsecurity;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
class SpringSecurityUserManagerFactory implements SessionFactory {
public Class<?> getSessionType() {
return UserManager.class;
}
public Session openSession() {
return new UserManager();
}
}
05-10-2011 12:21 PM
public Class<?> getSessionType() {
return UserManager.class;
}
public Session openSession() {
return new MyUserManager();
}
Notice the MyUserManager()05-10-2011 01:43 PM
what I did is to add this to "processEngineConfiguration" config in spring,
<property name="customSessionFactories">
<list>
<bean class="com.xxxxx.user.ActivitiCustomUserManagerFactory">
<property name="usersDao" ref="usersDAO"/>
</bean>
</list>
</property>
And this factory will return ActivitiCustomUserManager (extends UserManager) in its openSession() method.
Similar thing should be needed for GroupManager and its Factory as well.
Thanks for writing.
I tried the following configuration:and SpringSecurityUserManagerFactory implementation:
<property name="customSessionFactories">
<list>
<bean class="org.grails.activiti.springsecurity.SpringSecurityUserManagerFactory">
<property name="usersDao" ref="usersDAO"/>
</bean>
<bean class="org.grails.activiti.springsecurity.SpringSecurityGroupManagerFactory">
<property name="groupsDao" ref="groupsDAO"/>
</bean>
</list>
</property>
package org.grails.activiti.springsecurity;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
class SpringSecurityUserManagerFactory implements SessionFactory {
public Class<?> getSessionType() {
return UserManager.class;
}
public Session openSession() {
return new UserManager();
}
}
What error did you see? In your config, the factory has DAO reference, how come there is not such property in your actual class?
Thanks.
Unluckily, the code above doesn't work, did I overlook anything?
Please advice.
Best regards,
Chee Kin
05-10-2011 08:53 PM
What error did you see? In your config, the factory has DAO reference, how come there is not such property in your actual class?
Thanks.
<property name="customSessionFactories">
<list>
<bean class="org.grails.activiti.springsecurity.SpringSecurityUserManagerFactory" />
<bean class="org.grails.activiti.springsecurity.SpringSecurityGroupManagerFactory" />
</list>
</property>
05-10-2011 10:43 PM
package org.grails.activiti.springsecurity
…
class UserManager extends org.activiti.engine.impl.persistence.entity.UserManager {
…
}
Please see a complete source code here http://code.google.com/p/grails-activiti-spring-security-plugin/source/browse/src/groovy/org/grails/...05-12-2011 08:52 PM
05-12-2011 09:33 PM
05-12-2011 09:45 PM
In this case, I would suggest you to pull out the activiti source code (specifically the engine module and the spring module, or maybe webapp-rest code as well), to debug it and see what's going on. That's what I would do if see something similar.
05-12-2011 09:51 PM
and SpringSecurityUserManagerFactory implementation:
<property name="customSessionFactories">
<list>
<bean class="org.grails.activiti.springsecurity.SpringSecurityUserManagerFactory">
<property name="usersDao" ref="usersDAO"/>
</bean>
<bean class="org.grails.activiti.springsecurity.SpringSecurityGroupManagerFactory">
<property name="groupsDao" ref="groupsDAO"/>
</bean>
</list>
</property>I guess you should return org.activiti.engine.impl.persistence.entity.UserManager instead of the one in package org.grails.activiti.springsecurity. In this way, the custom SessionFactory can override original UserManager settings.
package org.grails.activiti.springsecurity;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
class SpringSecurityUserManagerFactory implements SessionFactory {
public Class<?> getSessionType() {
return UserManager.class;
}
public Session openSession() {
return new UserManager();
}
}
05-12-2011 09:58 PM
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.