Package com.claymus.site

Examples of com.claymus.site.Module


  }


  @Override
  public void saveOrder(String pageEncoded, LinkedList<String> locations, LinkedList<String> encodedList) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    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>();
View Full Code Here


  }


  @Override
  public PageDTO get(String encoded) throws UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    User user = UserData.getUser();
    Page page = PageData.getPage(KeyFactory.stringToKey(encoded));

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && page.getCreator().equals(user))) {
      PageDTO pageDTO = page.getDTO();
      pageDTO.setLayouts(getLayouts());
      return pageDTO;
    } else {
View Full Code Here

  }


  @Override
  public String add(PageDTO pageDTO) throws ServerException, UserException {
    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(pageDTO.getUri());
    if(page != null)
View Full Code Here

    return KeyFactory.keyToString(page.getKey());
  }

  @Override
  public void update(PageDTO pageDTO) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    User user = UserData.getUser();
    Page page = PageData.getPage(pageDTO.getUri());

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && page.getCreator().equals(user))) {
      if(PageData.updatePage(pageDTO) == null)
        throw new ServerException("Page could not be saved. Please try again.");
    } else {
      throw new UserException();
View Full Code Here

TOP

Related Classes of com.claymus.site.Module

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.