Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.AccessRight


                  accessRightVO.setParameters("" + parameters);
                 
                  if(clearOldAccessRights != null && clearOldAccessRights.equalsIgnoreCase("true"))
                    AccessRightController.getController().delete(interceptionPoint.getId(), parameters, true, db);
                 
                  AccessRight accessRight = AccessRightController.getController().create(accessRightVO, interceptionPoint, db);
                 
                  List accessRightRoles = (List)accessRightMap.get("accessRightRoles");
                  if(accessRightRoles != null)
                  {
                    Iterator accessRightRolesIterator = accessRightRoles.iterator();
                    while(accessRightRolesIterator.hasNext())
                    {
                        String roleName = (String)accessRightRolesIterator.next();
                       
                  AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
                  accessRightRoleVO.setRoleName(roleName);
                  AccessRightRole accessRightRole = AccessRightController.getController().createAccessRightRole(db, accessRightRoleVO, accessRight);
                  accessRight.getRoles().add(accessRightRole);
                    }
                  }
                 
                  List accessRightGroups = (List)accessRightMap.get("accessRightGroups");
                  if(accessRightGroups != null)
                  {
                    Iterator accessRightGroupsIterator = accessRightGroups.iterator();
                    while(accessRightGroupsIterator.hasNext())
                    {
                        String groupName = (String)accessRightGroupsIterator.next();
                       
                  AccessRightGroupVO accessRightGroupVO = new AccessRightGroupVO();
                  accessRightGroupVO.setGroupName(groupName);
                  AccessRightGroup accessRightGroup = AccessRightController.getController().createAccessRightGroup(db, accessRightGroupVO, accessRight);
                  accessRight.getGroups().add(accessRightGroup);
                    }
                  }

                  List accessRightUsers = (List)accessRightMap.get("accessRightUsers");
                  if(accessRightUsers != null)
                  {
                    Iterator accessRightUsersIterator = accessRightUsers.iterator();
                    while(accessRightUsersIterator.hasNext())
                    {
                        String userName = (String)accessRightUsersIterator.next();
                       
                  AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
                  accessRightUserVO.setUserName(userName);
                  AccessRightUser accessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
                  accessRight.getUsers().add(accessRightUser);
                    }
                  }

            commitTransaction(db);
            }
View Full Code Here


    logger.info("accessRightList:" + accessRightList.size());
    Iterator accessRightListIterator = accessRightList.iterator();
    while(accessRightListIterator.hasNext())
    {
      AccessRight accessRight = (AccessRight)accessRightListIterator.next();
      logger.info("accessRight:" + accessRight.getId());
     
      AccessRightVO copiedAccessRight = accessRight.getValueObject().createCopy();
      copiedAccessRight.setParameters(newSiteNodeVersionId.toString());
     
      InterceptionPoint icp = null;
      for(InterceptionPoint currentICP : interceptionPointList)
      {
        if(currentICP.getId().equals(copiedAccessRight.getInterceptionPointId()))
          icp = currentICP;
      }
      if(icp != null)
      {
        AccessRight newAccessRight = AccessRightController.getController().create(copiedAccessRight, icp, db);
       
        Iterator groupsIterator = accessRight.getGroups().iterator();
        while(groupsIterator.hasNext())
        {
            AccessRightGroup accessRightGroup = (AccessRightGroup)groupsIterator.next();
            AccessRightGroupVO newAccessRightGroupVO = new AccessRightGroupVO();
            newAccessRightGroupVO.setGroupName(accessRightGroup.getGroupName());
            AccessRightGroup newAccessRightGroup = AccessRightController.getController().createAccessRightGroup(db, newAccessRightGroupVO, newAccessRight);
            newAccessRight.getGroups().add(newAccessRightGroup);
        }

        Iterator rolesIterator = accessRight.getRoles().iterator();
        while(rolesIterator.hasNext())
        {
            AccessRightRole accessRightRole = (AccessRightRole)rolesIterator.next();
            AccessRightRoleVO newAccessRightRoleVO = new AccessRightRoleVO();
            newAccessRightRoleVO.setRoleName(accessRightRole.getRoleName());
            AccessRightRole newAccessRightRole = AccessRightController.getController().createAccessRightRole(db, newAccessRightRoleVO, newAccessRight);
            newAccessRight.getRoles().add(newAccessRightRole);
        }

        Iterator usersIterator = accessRight.getUsers().iterator();
        while(usersIterator.hasNext())
        {
            AccessRightUser accessRightUser = (AccessRightUser)usersIterator.next();
            AccessRightUserVO newAccessRightUserVO = new AccessRightUserVO();
            newAccessRightUserVO.setUserName(accessRightUser.getUserName());
            AccessRightUser newAccessRightUser = AccessRightController.getController().createAccessRightUser(db, newAccessRightUserVO, newAccessRight);
            newAccessRight.getUsers().add(newAccessRightUser);
        }
      }
    }
  } 
View Full Code Here

    //System.out.println("accessRightList:" + accessRightList.size());
    Iterator accessRightListIterator = accessRightList.iterator();
    while(accessRightListIterator.hasNext())
    {
      AccessRight accessRight = (AccessRight)accessRightListIterator.next();
      //System.out.println("accessRight:" + accessRight.getId());
     
      AccessRightController.getController().delete(accessRight, db);
    }
  } 
View Full Code Here

      dbAccessRight.begin();
      Collection<AccessRight> accessRights = master.getAccessRights();
      Iterator<AccessRight> accessRightsIterator = accessRights.iterator();
      while(accessRightsIterator.hasNext())
      {
        AccessRight accessRight = accessRightsIterator.next();
 
        InterceptionPoint interceptionPoint = InterceptionPointController.getController().getInterceptionPointWithName(accessRight.getInterceptionPointName(), dbAccessRight);
        accessRight.setInterceptionPoint(interceptionPoint);
        if(interceptionPoint.getName().indexOf("Content") > -1)
          accessRight.setParameters((String)contentIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("SiteNodeVersion") > -1)
          accessRight.setParameters((String)siteNodeVersionIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("SiteNode") > -1)
          accessRight.setParameters((String)siteNodeIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("Repository") > -1)
          accessRight.setParameters(""+repositoryIdMap.get(accessRight.getParameters()));
 
        dbAccessRight.create(accessRight);
 
        Iterator accessRightRoleIterator = accessRight.getRoles().iterator();
        while(accessRightRoleIterator.hasNext())
        {
          AccessRightRole accessRightRole = (AccessRightRole)accessRightRoleIterator.next();
          accessRightRole.setAccessRight(accessRight);
          dbAccessRight.create(accessRightRole);
        }
 
        Iterator accessRightGroupIterator = accessRight.getGroups().iterator();
        while(accessRightGroupIterator.hasNext())
        {
          AccessRightGroup accessRightGroup = (AccessRightGroup)accessRightGroupIterator.next();
          accessRightGroup.setAccessRight(accessRight);
          dbAccessRight.create(accessRightGroup);
View Full Code Here

     
      List accessRights = AccessRightController.getController().getAccessRightList(interceptionPoint.getInterceptionPointId(), db);
      Iterator accessRightsIterator = accessRights.iterator();
      while(accessRightsIterator.hasNext())
      {
        AccessRight accessRight = (AccessRight)accessRightsIterator.next();
       
        Iterator groupIterator = accessRight.getGroups().iterator();
        while(groupIterator.hasNext())
        {
          AccessRightGroup group = (AccessRightGroup)groupIterator.next();
          groupIterator.remove();
          db.remove(group);
        }
       
        Iterator roleIterator = accessRight.getRoles().iterator();
        while(roleIterator.hasNext())
        {
          AccessRightRole role = (AccessRightRole)roleIterator.next();
          roleIterator.remove();
          db.remove(role);
        }

        Iterator userIterator = accessRight.getUsers().iterator();
        while(userIterator.hasNext())
        {
          AccessRightUser user = (AccessRightUser)userIterator.next();
          userIterator.remove();
          db.remove(user);
View Full Code Here

      List accessRightList = AccessRightController.getController().getAccessRightListForEntity(interceptionPoint.getId(), originalContentVersionId.toString(), db);
      logger.info("accessRightList:" + accessRightList.size());
      Iterator accessRightListIterator = accessRightList.iterator();
      while(accessRightListIterator.hasNext())
      {
        AccessRight accessRight = (AccessRight)accessRightListIterator.next();
        logger.info("accessRight:" + accessRight.getId());
       
        AccessRightVO copiedAccessRight = accessRight.getValueObject().createCopy(); //.getValueObject();
        copiedAccessRight.setParameters(newContentVersionId.toString());
        AccessRightController.getController().create(copiedAccessRight, interceptionPoint, db);
      }
    }
  } 
View Full Code Here

          Iterator<AccessRightUser> i = accessRightUserList.iterator();
        while(i.hasNext())
          {
              AccessRightUser accessRightUser = i.next();
              //accessRightUser.setUserName(newUserName);
              AccessRight accessRight = accessRightUser.getAccessRight();

          AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
          accessRightUserVO.setUserName(newSystemUser.getUserName());
          AccessRightUser newAccessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
          accessRight.getUsers().add(newAccessRightUser);

          deleteEntity(AccessRightUserImpl.class, accessRightUser.getAccessRightUserId(), db);
          }

        // Update String references on entities
View Full Code Here

    List accessRightList = this.getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), parameters, db);
   
    Iterator accessRightListIterator = accessRightList.iterator();
    while(accessRightListIterator.hasNext())
    {
        AccessRight accessRight = (AccessRight)accessRightListIterator.next();
       
        Collection approvedRoles = accessRight.getRoles();
        Collection approvedGroups = accessRight.getGroups();
        Collection approvedUsers = accessRight.getUsers();
   
        AccessRightVO vo = accessRight.getValueObject();
        vo.getRoles().addAll(toVOList(approvedRoles));
        vo.getGroups().addAll(toVOList(approvedGroups));
        vo.getUsers().addAll(toVOList(approvedUsers));
       
        accessRightVOList.add(vo);
View Full Code Here

      QueryResults results = oql.execute();
      this.logger.info("Fetching entity in read/write mode" + interceptionPointId);

      while (results.hasMore())
      {
        AccessRight accessRight = (AccessRight)results.next();
        accessRightList.add(accessRight);
      }
     
      results.close();
      oql.close();
View Full Code Here

      QueryResults results = oql.execute();
      this.logger.info("Fetching entity in read/write mode");

      while (results.hasMore())
      {
        AccessRight accessRight = (AccessRight)results.next();
        accessRightList.add(accessRight);
      }
     
      results.close();
      oql.close();
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.AccessRight

Copyright © 2018 www.massapicom. 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.