Examples of IEntityGroup


Examples of org.jasig.portal.groups.IEntityGroup

    * @return IEntityGroup
    */
   public static IEntityGroup retrieveGroup (String aKey) {
      Utility.logMessage("DEBUG", "GroupsManagerXML::retrieveGroup(): About to search for Group: "
            + aKey);
      IEntityGroup grp = null;
      try {
         if (aKey != null){
            grp = GroupService.findGroup(aKey);
         }
      } catch (Throwable th) {
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      EntityIdentifier[] results;
      String label = null;
      boolean isGroupSearch;
      // if present, the command arg will be the ancestor
      String ancestorKey = getCommandArg(runtimeData);
      IEntityGroup entGrp = GroupsManagerXML.retrieveGroup(ancestorKey);
      String query = runtimeData.getParameter("grpQuery");
      String method = runtimeData.getParameter("grpMethod");
      int methodInt = Integer.parseInt(method);
      // For an EntityGroup search, the grpType will have the  form of "IEntityGroup::classname"
      // For an Entity search, the grpType will have the  form of "classname"
      String grpType = runtimeData.getParameter("grpType");
      if (grpType.startsWith(grpPrefix)) {
         isGroupSearch = true;
         grpTypeName = grpType.substring(grpPrefix.length());
      }
      else {
         isGroupSearch = false;
         grpTypeName = grpType;
      }
      type = Class.forName(grpTypeName);
      if (isGroupSearch) {
         label = "Group of " + org.jasig.portal.EntityTypes.getDescriptiveName(type) +
               "s";
         if (entGrp != null) {
            results = GroupService.searchForGroups(query, methodInt, type, entGrp);
         }
         else {
            results = GroupService.searchForGroups(query, methodInt, type);
         }
      }
      else {
         label = org.jasig.portal.EntityTypes.getDescriptiveName(type);
         if (entGrp != null) {
            results = GroupService.searchForEntities(query, methodInt, type, entGrp);
         }
         else {
            results = GroupService.searchForEntities(query, methodInt, type);
         }
      }
      Document model = getXmlDoc(sessionData);
      IEntityGroup sr = new SearchResultsGroupImpl(type);
      sr.setName("Search Results");
      sr.setDescription("Search for a " + label + " whose name" + methods[methodInt] + "'" + query + "'");
      sr.setCreatorID("CGroupsManager");
      for (int sub = 0; sub < results.length; sub++) {
         EntityIdentifier entID = results[sub];
         IGroupMember resultGroup = GroupService.getGroupMember(entID);
         sr.addMember(resultGroup);
      }
      Element searchElem = GroupsManagerXML.getGroupMemberXml(sr, true, null, sessionData.getUnrestrictedData());
      searchElem.setAttribute("searchResults", "true");
      model.getDocumentElement().appendChild(searchElem);
      this.setCommandArg(sessionData.runtimeData, searchElem.getAttribute("id"));
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      Document viewDoc = sd.model;
      String id = null;
      Element grpViewKeyElem;
      Iterator grpItr = GroupsManagerXML.getNodesByTagNameAndKey(viewDoc, GROUP_TAGNAME,
            grpKey);
      IEntityGroup gm = GroupsManagerXML.retrieveGroup(grpKey);
      if (gm != null) {
         if (!grpItr.hasNext()) {
            grpViewKeyElem = GroupsManagerXML.getGroupMemberXml(gm, true, null, sd);
            Element rootElem = viewDoc.getDocumentElement();
            rootElem.appendChild(grpViewKeyElem);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    */
   public void execute(CGroupsManagerSessionData sessionData) throws Exception{
      ChannelRuntimeData slaveRD = sessionData.runtimeData;
      String[] tgts = new String[1];
      String[] acts = null;
      IEntityGroup g = (IEntityGroup) GroupsManagerXML.retrieveGroupMemberForElementId(this.getXmlDoc(sessionData), this.getCommandArg(sessionData.runtimeData));
      tgts[0] = g.getKey();
      if (g.isEditable()){
         acts = sessionData.permissible.getActivityTokens();
      }
      else{
        acts = new String[] {VIEW_PERMISSION, SELECT_PERMISSION, ASSIGN_PERMISSION};
      }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

        CGroupsManagerUnrestrictedSessionData ursd = servant.getSessionData().getUnrestrictedData();
        Document viewDoc = servant.getSessionData().model;
        Element rootElem = viewDoc.getDocumentElement();
        try{
          Iterator parents = member.getContainingGroups();
          IEntityGroup parent;
          while (parents.hasNext()){
             parent = (IEntityGroup) parents.next();
             Element parentElem = GroupsManagerXML.getGroupMemberXml(parent,false,null,ursd);
             parentElem.setAttribute("selected","true");
             rootElem.appendChild(parentElem);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

     * @param staticData the master channel's staticData
     * @throws PortalException
     */
     public static IGroupsManagerPermissions getPermissionsPolicy(ChannelStaticData staticData) throws PortalException{
        IGroupsManagerPermissions pp = null;
        IEntityGroup admin = GroupService.getDistinguishedGroup(GroupService.PORTAL_ADMINISTRATORS);
        IGroupMember currUser = org.jasig.portal.services.AuthorizationService.instance().getGroupMember(staticData.getAuthorizationPrincipal());
        boolean isAdminUser = (admin.deepContains(currUser));
        if (isAdminUser)
           pp = GroupsManagerAdminPermissions.getInstance();
        else
           pp = GroupsManagerDefaultPermissions.getInstance();
        return pp;
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      if (Utility.areEqual(delElem.getAttribute("searchResults"), "true")){
        // if it is search results, just delete the node and skip the rest
        delElem.getParentNode().removeChild(delElem);
      }
      else{
         IEntityGroup delGroup = sessionData.lockedGroup;
         if (delGroup == null) {
            retMsg = "Unable to retrieve Group!";
            sessionData.feedback = retMsg;
            return;
         }
         Utility.logMessage("DEBUG", "DeleteGroup::execute(): About to delete group: "
               + elemName);
         // remove permissions associated with group
         deletePermissions(delGroup);
         // delete the group
         delGroup.delete();
         Utility.logMessage("DEBUG", "DeleteGroup::execute(): About to delete xml nodes for group: "
               + elemName);
         // remove all xml nodes for this group
         Iterator deletedNodes = GroupsManagerXML.getNodesByTagNameAndKey(model, GROUP_TAGNAME,
               delKey);
         IEntityGroup parentEntGrp = null;
         String hasMbrs = "duh";
         while (deletedNodes.hasNext()) {
            deletedNode = (Node)deletedNodes.next();
            parentNode = deletedNode.getParentNode();
            String nodeKey = ((Element)parentNode).getAttribute("key");
            if (parentEntGrp == null || !parentEntGrp.getKey().equals(nodeKey)) {
               if (!Utility.areEqual(nodeKey, "")){
                  parentEntGrp = GroupsManagerXML.retrieveGroup(nodeKey);
                  hasMbrs = String.valueOf(parentEntGrp.hasMembers());
                  parentNode.removeChild(deletedNode);
               }
               else{
                  //Search elements have a null "key"
                  parentNode.removeChild(deletedNode);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

         }
      }
      try {
         if (targets == null) {
            targets = new HashMap();
            IEntityGroup everyone = GroupService.getDistinguishedGroup(GroupService.EVERYONE);
            targets.put(everyone.getKey(), everyone.getName());
            Iterator allgroups = everyone.getAllMembers();
            while (allgroups.hasNext()) {
               IGroupMember g = (IGroupMember)allgroups.next();
               if (g.isGroup()) {
                  if (targets.get(g.getKey()) == null) {
                     try {
                        targets.put(g.getKey(), ((IEntityGroup)g).getName());
                     } catch (Exception e) {
                        Utility.logMessage("ERROR", "CGroupsManager.init():: unable to add target"
                              + e, e);
                     }
                  }
               }
            }

            IEntityGroup allChans = GroupService.getDistinguishedGroup(GroupService.CHANNEL_CATEGORIES);
            targets.put(allChans.getKey(), allChans.getName());
            Iterator allcgroups = allChans.getAllMembers();
            while (allcgroups.hasNext()) {
               IGroupMember g = (IGroupMember)allcgroups.next();
               if (g.isGroup()) {
                  if (targets.get(g.getKey()) == null) {
                     try {
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

         CGroupsManagerSessionData sessionData = getSessionData();
         Utility.logMessage("DEBUG", this.getClass().getName() + "::setStaticData(): this = " + this);
         Utility.logMessage("DEBUG", this.getClass().getName() + "::setStaticData(): session Data = " + sessionData);
         Utility.logMessage("DEBUG", this.getClass().getName() + "::setStaticData(): sd = " + sd);
         sessionData.staticData = sd;
         IEntityGroup admin = GroupService.getDistinguishedGroup(GroupService.PORTAL_ADMINISTRATORS);
         IGroupMember currUser = AuthorizationService.instance().getGroupMember(sessionData.staticData.getAuthorizationPrincipal());
         sessionData.isAdminUser = (admin.deepContains(currUser));
         sessionData.user = sessionData.staticData.getPerson();
         sessionData.authPrincipal = sd.getAuthorizationPrincipal();
         sessionData.model = GroupsManagerXML.getGroupsManagerXml(sessionData);
         Utility.logMessage("DEBUG", this.getClass().getName() + "::setStaticData(): staticData Person ID = "
               + sessionData.user.getID());
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      String chanKey = String.valueOf(definition.getId());
      IEntity channelDefEntity = GroupService.getEntity(chanKey, IChannelDefinition.class);
    @SuppressWarnings("unchecked")
      Iterator iter = channelDefEntity.getAllContainingGroups();
      while (iter.hasNext()) {
          IEntityGroup group = (IEntityGroup) iter.next();
          group.removeMember(channelDefEntity);
          group.update();
      }

      // For each category ID, add channel to category
      for (ChannelCategory category : categories) {
        channelRegistryStore.addChannelToCategory(definition, category);
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.