Package com.claymus.gwt

Examples of com.claymus.gwt.ServerException


    BlockType blockData = BlockData.getBlockType(blockDTO.getClass().getSimpleName().replace("DTO", ""));
    Block block = new Block(blockData, blockDTO.getLocation());
    block.update(blockDTO);
    block = BlockData.createBlock(block);
    if(block == null)
      throw new ServerException("Block could not be created. Please try again later.");
  }
View Full Code Here


    Block block = BlockData.getBlock(key);

    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

      for(int j = 0; j < blocks.size(); j++) {
        Block block = blocks.get(j);
        block = BlockData.updateBlockOrder(block.getKey(), weights.get(j), locations.get(i));
        if(block == null)
          throw new ServerException("Operation failed partially or fully. <a href=''>Refresh</a> the page to see the changes.");
      }
    }
  }
View Full Code Here

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

    module = ModuleData.getModule(moduleId);
    if(module == null)
      throw new ServerException();

    module.setAccessLevel(UserData.getUserRole(KeyFactory.stringToKey(encoded)), accessLevel);
    if(! ModuleData.saveModule(module))
      throw new ServerException();
  }
View Full Code Here

    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

    User user = UserData.getUser();
    Page page = PageData.getPage(KeyFactory.stringToKey(pageEncoded));
    Content content = ContentData.getContent(KeyFactory.stringToKey(encoded));

    if(page.getId() != content.getPageId())
      throw new ServerException();

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && content.getOwner().equals(user))) {
      ContentDTO contentDTO = content.getDTO();
      contentDTO.setLocations(page.getLayout().getLocations());
View Full Code Here

    ContentType contentData = ContentData.getContentType(contentDTO.getClass().getSimpleName().replace("DTO", ""));
    Content content = new Content(contentData, page.getId(), contentDTO.getLocation());
    content.update(contentDTO);
    content = ContentData.createContent(content);
    if(content == null)
      throw new ServerException("Content could not be created. Please try again later.");
  }
View Full Code Here

    Content content = ContentData.getContent(key);

    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

      for(int j = 0; j < contentList.size(); j++) {
        Content content = contentList.get(j);
        content = ContentData.updateContentOrder(content.getKey(), weights.get(j), locations.get(i));
        if(content == null)
          throw new ServerException("Operation failed partially or fully. <a href=''>Refresh</a> page to see the changes.");
      }
    }
  }
View Full Code Here

    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    Page page = PageData.getPage(pageDTO.getUri());
    if(page != null)
      throw new ServerException("Page with uri " + "<a href='" + page.getUri() + "'>" + page.getUri() + "</a> already exists. Please enter a different uri.");

    page = new Page(pageDTO);
    if(PageData.createPage(page) == null)
      throw new ServerException("Page could not be created. Please try again later.");

    return KeyFactory.keyToString(page.getKey());
  }
View Full Code Here

TOP

Related Classes of com.claymus.gwt.ServerException

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.