This commit is contained in:
Massimiliano Assante 2016-04-26 12:47:04 +00:00
parent 0fadebec81
commit 29aa569009
3 changed files with 21 additions and 3 deletions

View File

@ -31,7 +31,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>

View File

@ -155,6 +155,16 @@ public interface RoleManager {
/**
* @param userId the username of who is creating the team
* @param groupId the site group id where the team exists
* @param teamName the name you want to assign to this team
* @param teamDescription
* @return the GCubeTeam if the team is created succesfully, null otherwise
* @throws UserManagementSystemException
*/
GCubeTeam createTeam(long creatorUserId, long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException;
/**
* it will crate the Team as Administrator, use the other method to pass the userId
* @param groupId the site group id where the team exists
* @param teamName the name you want to assign to this team
* @param teamDescription
@ -162,6 +172,7 @@ public interface RoleManager {
* @throws UserManagementSystemException
*/
GCubeTeam createTeam(long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException;
/**
*
* @param groupId

View File

@ -330,8 +330,7 @@ public class LiferayRoleManager implements RoleManager {
* {@inheritDoc}
*/
@Override
public GCubeTeam createTeam(long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException {
long userId = LiferayUserManager.getAdmin().getUserId();
public GCubeTeam createTeam(long userId, long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException {
try {
return mapLRTeam(TeamLocalServiceUtil.addTeam(userId, groupId, teamName, teamDescription));
}
@ -349,6 +348,14 @@ public class LiferayRoleManager implements RoleManager {
* {@inheritDoc}
*/
@Override
public GCubeTeam createTeam(long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException {
long userId = LiferayUserManager.getAdmin().getUserId();
return createTeam(userId, groupId, teamName, teamDescription);
}
/**
* {@inheritDoc}
*/
@Override
public GCubeTeam deleteTeam(long teamId) throws UserManagementSystemException, TeamRetrievalFault {
try {
Team deleted = TeamLocalServiceUtil.deleteTeam(teamId);