Package org.vosao.entity

Examples of org.vosao.entity.GroupEntity


  }

  @Override
  public ServiceResponse save(Map<String, String> vo) {
    try {
      GroupEntity group = getDao().getGroupDao().getById(Long.valueOf((
        vo.get("groupId"))));
      if (group == null) {
        throw new ServiceException(Messages.get("group_not_found"));
      }
      String url = vo.get("url");
View Full Code Here


  }

  @Override
  public ServiceResponse save(Map<String, String> vo) {
    try {
      GroupEntity group = getDao().getGroupDao().getById(Long.valueOf((
        vo.get("groupId"))));
      if (group == null) {
        throw new ServiceException(Messages.get("group_not_found"));
      }
      FolderEntity folder = getDao().getFolderDao().getById(
View Full Code Here

  implements GroupBusiness {

  @Override
  public List<String> validateBeforeUpdate(final GroupEntity group) {
    List<String> errors = new ArrayList<String>();
    GroupEntity foundGroup = getDao().getGroupDao().getByName(
        group.getName());
    if (group.getId() == null) {
      if (foundGroup != null) {
        errors.add(Messages.get("group_already_exists"));
      }
    }
    else {
      if (foundGroup != null && !foundGroup.getId().equals(group.getId())) {
        errors.add(Messages.get("group_already_exists"));
      }
    }
    if (StringUtils.isEmpty(group.getName())) {
      errors.add(Messages.get("name_is_empty"));
View Full Code Here

    getDao().getUserDao().save(user);
    return user;
  }
 
  private GroupEntity addGroup(String name) {
    GroupEntity group = new GroupEntity(name);
    getDao().getGroupDao().save(group);
    return group;
  }
View Full Code Here

  public void testGetPermission() {
    UserEntity developer = addUser("alex","kinyelo@gmail.com", UserRole.USER);
    UserEntity admin = addUser("admin","admin@gmail.com", UserRole.ADMIN);
    UserEntity manager = addUser("test1","test1@gmail.com", UserRole.USER);
    UserEntity dev2 = addUser("test2","test2@gmail.com", UserRole.USER);
    GroupEntity guests = addGroup("guests");
    GroupEntity managers = addGroup("managers");
    GroupEntity developers = addGroup("developers");
    addUserGroup(developer, developers);
    addUserGroup(manager, managers);
    addUserGroup(dev2, developers);
    addUserGroup(dev2, managers);
    FolderEntity home = addFolder("home", null);
View Full Code Here

    getDao().getUserDao().save(user);
    return user;
  }
 
  private GroupEntity addGroup(String name) {
    GroupEntity group = new GroupEntity(name);
    getDao().getGroupDao().save(group);
    return group;
  }
View Full Code Here

  public void testGetPermission() {
    UserEntity developer = addUser("alex","kinyelo@gmail.com", UserRole.USER);
    UserEntity admin = addUser("admin","admin@gmail.com", UserRole.ADMIN);
    UserEntity manager = addUser("test1","test1@gmail.com", UserRole.USER);
    UserEntity dev2 = addUser("test2","test2@gmail.com", UserRole.USER);
    GroupEntity guests = addGroup("guests");
    GroupEntity managers = addGroup("managers");
    GroupEntity developers = addGroup("developers");
    addUserGroup(developer, developers);
    addUserGroup(manager, managers);
    addUserGroup(dev2, developers);
    addUserGroup(dev2, managers);
    addPage("home", "/");
View Full Code Here

    getDao().getUserDao().save(user);
    return user;
  }
 
  private GroupEntity addGroup(String name) {
    GroupEntity group = new GroupEntity(name);
    getDao().getGroupDao().save(group);
    return group;
  }
View Full Code Here

  }

  private void addGuestPerission(FolderEntity root) {
    UserEntity tester = addUser("tester","kinyelo@gmail.com", UserRole.ADMIN);
    VosaoContext.getInstance().setUser(tester);
    GroupEntity guests = addGroup("guests");
    GroupEntity developers = addGroup("developers");
    addUserGroup(tester, developers);
    addPermission(root, guests, FolderPermissionType.READ);
  }
View Full Code Here

public class ContentPermissionBusinessImpl extends AbstractBusinessImpl
    implements ContentPermissionBusiness {

  @Override
  public ContentPermissionEntity getGuestPermission(final String url) {
    GroupEntity guests = getDao().getGroupDao().getGuestsGroup();
    ContentPermissionEntity result = getGroupPermission(url, guests.getId());
    result.setUrl(url);
    return result;
  }
View Full Code Here

TOP

Related Classes of org.vosao.entity.GroupEntity

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.