Package com.claymus.site.module.content

Examples of com.claymus.site.module.content.ContentType


    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);
    content = ContentData.createContent(content);
    if(content == null)
      throw new ServerException("Content could not be created. Please try again later.");
View Full Code Here


  }


  protected List<ContentType> getPageContents(String[] tokens, User user) {
    LinkedList<ContentType> contentsData = new LinkedList<ContentType>();
    ContentType contentData = getPageContent(tokens, user);
    if(contentData != null)
      contentsData.add(contentData);
    return contentsData;
  }
View Full Code Here

        return new Error401();
      }

    } else if(tokens.length == 2 && tokens[1].equals("new")) {
      if(accessLevel >= ModuleHelper.ADD)
        return new ContentType() {

          @Override
          public String getName() {
            return "Add Page";
          }

          @Override
          protected String getHTML() {
            return "<div class='claymus-h1'>" + getName() + "</div>" +
                "<div id='claymus-PageEditor'></div>" +
                "<script type='text/javascript' src='/com.claymus.site.module.page.pages.editor.gwt/com.claymus.site.module.page.pages.editor.gwt.nocache.js'></script>";
          }

        };
      else
        return new Error401();

    } else if(tokens.length == 2 && tokens[1].equals("edit")) {
      String encoded = ClaymusMain.getRequest().getParameter("key");
      if(encoded == null)
        return null;

      final Page page = PageData.getPage(KeyFactory.stringToKey(encoded));
      if(page == null)
        return null;

      if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && page.getCreator().equals(user)))
        return new ContentType() {

          @Override
          public String getName() {
            return page.getTitle() != null
                ? "Editing Page: " + page.getTitle()
View Full Code Here

      if(! blockData.hasEditor())
        return null;

      if(accessLevel >= ModuleHelper.ADD)
        return new ContentType() {

          @Override
          public String getName() {
            return "Add Block \u00BB " + blockData.getName();
          }

          @Override
          protected String getHTML() {
            String html = "<div class='claymus-h1'>" + getName() + "</div>";
            html += blockData.getEditor();
            return html;
          }

        };
      else
        return new Error401();

    } else if(tokens.length == 2 && tokens[1].equals("edit")) {
      String encoded = ClaymusMain.getRequest().getParameter("key");
      if(encoded == null)
        return null;

      final Block block = BlockData.getBlock(KeyFactory.stringToKey(encoded));
      if(block == null)
        return null;

      if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && block.getOwner().equals(user)))
        return new ContentType() {

          @Override
          public String getName() {
            return "Edit Block \u00BB " + block.getName();
          }
View Full Code Here

TOP

Related Classes of com.claymus.site.module.content.ContentType

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.