Package org.infoglue.cms.entities.management

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


        return getAllVOObjects(RoleImpl.class, "roleName", db);
    }

    public RoleVO create(RoleVO roleVO) throws ConstraintException, SystemException
    {
        Role role = new RoleImpl();
        role.setValueObject(roleVO);
        role = (Role) createEntity(role);
        return role.getValueObject();
    }    
View Full Code Here


        return role.getValueObject();
    }    

    public Role create(RoleVO roleVO, Database db) throws ConstraintException, SystemException, Exception
    {
        Role role = new RoleImpl();
        role.setValueObject(roleVO);
        role = (Role) createEntity(role, db);
        return role;
    }    
View Full Code Here

        removeUsers(roleVO.getRoleName());

      Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        Role role = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
      role = update(roleVO, userNamesSet, db);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }

        return role.getValueObject();
    }       
View Full Code Here

        return role.getValueObject();
    }       

    public Role update(RoleVO roleVO, Set<String> userNamesSet, Database db) throws ConstraintException, SystemException, Exception
    {
        Role role = getRoleWithName(roleVO.getRoleName(), db);
       
        if(userNamesSet != null)
      {
          for (String userName : userNamesSet)
          {
        addUser(roleVO.getRoleName(), userName, db);
          }
      }
       
        role.setValueObject(roleVO);

        return role;
    }       
View Full Code Here

         
          QueryResults results = oql.execute(Database.READONLY);
     
      while(results.hasMore())
            {
              Role role = (Role)results.next();
              roleVOList.add(role.getValueObject());
            }
     
      results.close();
      oql.close();
        }
View Full Code Here

TOP

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

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.