我使用钩子为每个创建的用户组创建一个团队。 (最终会有一个LDAP导入一次完成所有这些)
当我创建用户组时,我的TeamServiceWrapperImpl正在从组创建中调用,但我没有看到正在创建的新团队。
这是我的AddUserGroupImpl方法:
@Override
public UserGroup addUserGroup(String name, String description, ServiceContext serviceContext) throws PortalException, SystemException{
super.addUserGroup(name, description, serviceContext);
id = this.getUserGroup(name).getGroupId();
name = this.getUserGroup(name).getName();
System.out.println("You've created User Group: " + name);
System.out.println("The user group name is " + name);
TeamServiceUtil.addTeam(id, name, teamDescription);
return null;
}
和我的TeamServiceWrapperImpl:
public Team addTeam(long groupId, String name, String description) throws PortalException, SystemException{
System.out.println("Adding a Team from inside the TeamService Class");
return super.addTeam(groupId, name, description);
}
最后,我的liferay-hook.xml:
<hook>
<portal-properties>portal.properties</portal-properties>
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
<service>
<service-type>com.liferay.portal.service.UserGroupService</service-type>
<service-impl>com.bofa.AddUserGroupToTeamImpl</service-impl>
</service>
<service>
<service-type>com.liferay.portal.service.TeamService</service-type>
<service-impl>com.bofa.TeamServiceWrapperImpl</service-impl>
</service>
</hook>
关于为什么我的团队没有被创建的任何想法,即使正在调用addTeam方法?