コード例 #1
0
ファイル: OwnershipAction.java プロジェクト: NCIP/caarray
  /**
   * @return SUCCESS.
   * @throws CSException is unable to change owner.
   */
  public String reassign() throws CSException {
    if (owner == null) {
      addActionError("Select a new Owner");
      users = ServiceLocatorFactory.getPermissionsManagementService().getUsers(targetUser);
      users.remove(targetUser);
      return "newOwner";
    }

    for (long gId : groupIds) {
      ServiceLocatorFactory.getPermissionsManagementService()
          .changeOwner(gId, owner.getLoginName());
      ActionHelper.saveMessage(
          "Collaboration Group " + gId + " assigned to " + owner.getLoginName());
    }
    for (long pId : projectIds) {
      ServiceLocatorFactory.getProjectManagementService().changeOwner(pId, owner.getLoginName());
      ActionHelper.saveMessage("Experiment " + pId + " assigned to " + owner.getLoginName());
    }

    return "listOwners";
  }
コード例 #2
0
ファイル: OwnershipAction.java プロジェクト: NCIP/caarray
  /** @return SUCCESS. */
  public String assets() {
    if (owner == null) {
      ActionHelper.saveMessage("Select a user");
      return "listOwners";
    }
    long id = owner.getUserId().longValue();
    groups =
        ServiceLocatorFactory.getPermissionsManagementService().getCollaboratorGroupsForOwner(id);
    projects = ServiceLocatorFactory.getProjectManagementService().getProjectsForOwner(owner);

    return SUCCESS;
  }