Examples of ILockableEntityGroup


Examples of org.jasig.portal.groups.ILockableEntityGroup

      Document model = getXmlDoc(sessionData);
      String parentID = getCommandArg(runtimeData);
      String newGrpName = runtimeData.getParameter("grpNewName");
      Utility.logMessage("DEBUG", "CreateGroup::execute(): New grp: " + newGrpName +
            " will be added to parent element = " + parentID);
      ILockableEntityGroup parentGroup = null;
      Class parentEntityType;
      Element parentElem = GroupsManagerXML.getElementByTagNameAndId(model, GROUP_TAGNAME, parentID);
      String parentKey = parentElem.getAttribute("key");
      String retMsg;
      Iterator parentNodes;
      if (parentElem == null) {
         retMsg = "Unable to find Parent element!";
         sessionData.feedback = retMsg;
         Utility.logMessage("ERROR", "CreateGroup::execute(): " + retMsg);
         return;
      }
      Utility.logMessage("DEBUG", "CreateGroup::execute(): Parent element was found!");

      //parentGroup = GroupsManagerXML.retrieveGroup(parentKey);
      parentGroup = sessionData.lockedGroup;
      if (parentGroup == null) {
         retMsg = "Unable to retrieve Parent Entity Group!";
         sessionData.feedback = retMsg;
         return;
      }
      parentEntityType = parentGroup.getLeafType();
      //parentEntityType = (Class) GroupsManagerXML.getEntityTypes().get("Person");
      Utility.logMessage("DEBUG", "CreateGroup::execute(): About to create new group: "
            + newGrpName + " Type: " + parentEntityType.getName());
      String userID = sessionData.user.getEntityIdentifier().getKey();
      Utility.logMessage("DEBUG", "CreateGroup::execute(): userID = " + userID);
      IEntityGroup childEntGrp = GroupService.newGroup(parentEntityType);
      childEntGrp.setName(newGrpName);
      childEntGrp.setCreatorID(userID);
      childEntGrp.update();
      Utility.logMessage("DEBUG", "CreateGroup::execute(): About to add new group: "
         + newGrpName);
      parentGroup.addMember((IGroupMember)childEntGrp);
      parentGroup.updateMembersAndRenewLock();
      parentNodes = GroupsManagerXML.getNodesByTagNameAndKey(model, GROUP_TAGNAME, parentKey);
      // add new group to all parent group xml nodes
      while (parentNodes.hasNext()) {
         Element parentNode = (Element)parentNodes.next();
         GroupsManagerXML.getGroupMemberXml((IGroupMember)parentGroup, true, parentNode,
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

         retMsg = "Update was not applied. No changes were entered.";
         sessionData.feedback = retMsg;
         return;
      }
      //IEntityGroup updGroup = GroupsManagerXML.retrieveGroup(updKey);
      ILockableEntityGroup updGroup = sessionData.lockedGroup;
      if (updGroup == null) {
         retMsg = "Unable to retrieve Group!";
         sessionData.feedback = retMsg;
         return;
      }
      Utility.logMessage("DEBUG", "UpdateGroup::execute(): About to update group: " +
            curName);
      updGroup.setName(newName);
      updGroup.setDescription(newDescription);
      updGroup.updateAndRenewLock();
      Utility.logMessage("DEBUG", "UpdateGroup::execute(): About to update xml nodes for group: "
            + curName);
      // update all xml nodes for this group
      GroupsManagerXML.refreshAllNodes(sessionData.getUnrestrictedData(), updGroup);
      Utility.logMessage("DEBUG", "UpdateGroup::execute(): Finished");
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

    */
   private void addChildrenToGroup (Vector gmCollection, CGroupsManagerSessionData sessionData,
      Element parentElem, Document model) throws Exception {
      //ChannelRuntimeData runtimeData = sessionData.runtimeData;
      Element parent;
      ILockableEntityGroup parentGroup = null;
      IGroupMember childGm = null;
      Element childElem;
      parentGroup = sessionData.lockedGroup;
      Iterator gmItr = gmCollection.iterator();
      while (gmItr.hasNext()) {
         childGm = (IGroupMember) gmItr.next();
         Utility.logMessage("DEBUG", "DoneWithSelection::execute: About to add child");
         // add to parent group
         parentGroup.addMember(childGm);
         // remove property elements for child gm and clear the Entity Properties cache.
         GroupsManagerXML.removePropertyElements (model, childGm, true);
         // update parent group
         parentGroup.updateMembersAndRenewLock();
         // get parent element(s) and add element for child group member
         Iterator parentNodes = GroupsManagerXML.getNodesByTagNameAndKey(model, GROUP_TAGNAME,
               parentElem.getAttribute("key"));
         while (parentNodes.hasNext()) {
            parent = (Element)parentNodes.next();
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

    */
    public static IServant getGroupsServantforAddRemove(ChannelStaticData staticData, String groupKey) throws PortalException{
        long time1 = Calendar.getInstance().getTime().getTime();
      CGroupsManagerServant servant;
      try {
        ILockableEntityGroup lockedGroup = GroupService.findLockableGroup(groupKey,staticData.getAuthorizationPrincipal().getPrincipalString());
        lockedGroup.getClass();
        servant = getGroupsServant();
        ChannelStaticData slaveSD = cloneStaticData(staticData);

        ((IChannel)servant).setStaticData(slaveSD);
        servant.getSessionData().mode = MEMBERS_ONLY_MODE;
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

      String userKey = sessionData.user.getEntityIdentifier().getKey();
      String lockKey = userID + "::" + userKey;
      Utility.logMessage("DEBUG", "EditGroup::execute(): lockKey = " + lockKey);
      Element parentElem = GroupsManagerXML.getElementById(model, parentElemId);
      String parentKey = parentElem.getAttribute("key");
      ILockableEntityGroup lockedGroup = GroupService.findLockableGroup(parentKey, lockKey);
      // if lockedGroup is null, an exception has probably already been thrown
      if (lockedGroup != null){
         GroupsManagerXML.refreshAllNodesRecursivelyIfRequired(sessionData.getUnrestrictedData(), parentElem);
         // store in sessionData
         sessionData.lockedGroup=lockedGroup;
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

     * @param category the channel category to delete
     * @throws org.jasig.portal.groups.GroupsException
     */
    public void deleteChannelCategory(ChannelCategory category) throws GroupsException {
        String key = String.valueOf(category.getId());
        ILockableEntityGroup categoryGroup = GroupService.findLockableGroup(key,"UP_FRAMEWORK");
        categoryGroup.delete();
    }
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

  private ILockableEntityGroup getSafeLockableGroup(IEntityGroup eg, IGroupMember gm) {
      if (log.isTraceEnabled()) {
          log.trace("Creating lockable group for group/member: " + eg + "/" + gm);
      }
     
      ILockableEntityGroup leg = null;
     
      try {
          if (eg.isEditable()) {
            leg = GroupService.findLockableGroup(eg.getKey(), gm.getKey());
          }
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

      // Remove my existing group memberships
      IGroupMember me = GroupService.getGroupMember(person.getEntityIdentifier());
      Iterator myExistingGroups = me.getContainingGroups();
      while (myExistingGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)myExistingGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              removePersonFromGroup(person, me, leg);
          }
      }

      // Copy template user's groups memberships
      IGroupMember template = GroupService.getEntity(templateUser.getUserName(), Class.forName("org.jasig.portal.security.IPerson"));
      Iterator templateGroups = template.getContainingGroups();
      while (templateGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)templateGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              addPersonToGroup(person, me, leg);
          }
      }
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

      IGroupMember me = GroupService.getGroupMember(person.getEntityIdentifier());
      IGroupMember template = GroupService.getEntity(templateUser.getUserName(), Class.forName("org.jasig.portal.security.IPerson"));
      Iterator templateGroups = template.getContainingGroups();
      while (templateGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)templateGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              addPersonToGroup(person, me, leg);
          }
      }
View Full Code Here

Examples of org.jasig.portal.groups.ILockableEntityGroup

   * @param category the channel category to delete
   * @throws org.jasig.portal.groups.GroupsException
   */
  public void deleteChannelCategory(ChannelCategory category) throws GroupsException {
    String key = String.valueOf(category.getId());
    ILockableEntityGroup categoryGroup = GroupService.findLockableGroup(key,"UP_FRAMEWORK");
    categoryGroup.delete();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.