Package com.claymus.gwt

Examples of com.claymus.gwt.UserException


      BlockDTO blockDTO = block.getDTO();
      blockDTO.setLocations(getLocations());
      blockDTO.setRoles(getRoles());
      return blockDTO;
    } else {
      throw new UserException();
    }
  }
View Full Code Here


    Module module = ModuleData.getModule(ModuleHelper.class);
    User user = UserData.getUser();

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    BlockType blockData = BlockData.getBlockType(blockDTO.getClass().getSimpleName().replace("DTO", ""));
    Block block = new Block(blockData, blockDTO.getLocation());
    block.update(blockDTO);
    block = BlockData.createBlock(block);
View Full Code Here

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && block.getOwner().equals(user))) {
      if(BlockData.updateBlock(key, blockDTO) == null)
        throw new ServerException("Block could not be saved. Please try again later.");
    } else {
      throw new UserException();
    }
  }
View Full Code Here

    Module module = ModuleData.getModule(ModuleHelper.class);
    User user = UserData.getUser();

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    for(int i = 0; i < locations.size(); i++) {
      LinkedList<Block> blocks = new LinkedList<Block>();
      LinkedList<Long> weights = new LinkedList<Long>();
View Full Code Here

  public void setModuleAccessLevel(String moduleId, String encoded, int accessLevel) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    UserRole userRole = UserData.getUser().getRole();

    if(module.getAccessLevel(userRole) < ModuleHelper.VIEW_N_EDIT)
      throw new UserException();

    module = ModuleData.getModule(moduleId);
    if(module == null)
      throw new ServerException();
View Full Code Here

  public void setActive(String className) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    UserRole userRole = UserData.getUser().getRole();

    if(module.getAccessLevel(userRole) != ModuleHelper.VIEW_N_CHANGE)
      throw new UserException();

    if(! ThemeData.setTheme(ThemeData.getTheme(className)))
      throw new ServerException("Theme could not be saved. Please try again.");
  }
View Full Code Here

      ContentDTO contentDTO = content.getDTO();
      contentDTO.setLocations(page.getLayout().getLocations());
      contentDTO.setRoles(getRoles());
      return contentDTO;
    } else {
      throw new UserException();
    }

  }
View Full Code Here

    Module module = ModuleData.getModule(ModuleHelper.class);
    User user = UserData.getUser();

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    Page page = PageData.getPage(KeyFactory.stringToKey(pageEncoded));
    ContentType contentData = ContentData.getContentType(contentDTO.getClass().getSimpleName().replace("DTO", ""));
    Content content = new Content(contentData, page.getId(), contentDTO.getLocation());
    content.update(contentDTO);
View Full Code Here

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && content.getOwner().equals(user))) {
      if(ContentData.updateContent(key, contentDTO) == null)
        throw new ServerException("Content could not be saved. Please try again later.");
    } else {
      throw new UserException();
    }
  }
View Full Code Here

    User user = UserData.getUser();
    Page page = PageData.getPage(KeyFactory.stringToKey(pageEncoded));

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    for(int i = 0; i < locations.size(); i++) {
      LinkedList<Content> contentList = new LinkedList<Content>();
      LinkedList<Long> weights = new LinkedList<Long>();
View Full Code Here

TOP

Related Classes of com.claymus.gwt.UserException

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.