Package com.appspot.gaeforum309.pathing

Examples of com.appspot.gaeforum309.pathing.Path


    {
      // TODO: Catch this error
      return;
    }
   
    DBUser user = ForumAPI.userLogin();
    if(user == null)
    {
      // TODO: Catch this error
      return;
    }
View Full Code Here


   
    response.append("<H1>Forum " + ForumAPI.Config.getForumName() + "</H1>");
   
    if(ForumAPI.loggedUser())
    {
      DBUser dbuser = ForumAPI.userLogin();
      response.append("<p>Welcome Mr " + dbuser.getEmail() + "</p>");
      if(ForumAPI.loggedUserAsAdmin())
      {
        response.append("<p>You are an administrator.</p>");
      }
    }
View Full Code Here

    if(!userServ.isUserLoggedIn())
      return null;
   
    User user =userServ.getCurrentUser();
   
    DBUser dbuser = DBUser.createOrUpdateUser(user);
   
    return dbuser;
  }
View Full Code Here

      public void foot(StringBuilder response, Path path, IPathable object) {
        response.append("</div>");
       
        if(Action.actionAuthorized(object, Action.ActionType.createChild))
        {
          Action action = Action.buildAction(object, Action.ActionType.createChild);
         
          TemplatePunBB.writeActionAsForm(action, response);
        }
      }

      // TODO: Add a method on IPathable to count childs objects instead of getChilds().size()
      @Override
      public void body(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic)object;
       
        response.append("<div id=\"forum48\" class=\"main-item odd main-first-item\">" +
            "<span class=\"icon \"><!-- --></span>" +
            "<div class=\"item-subject\">" +
            "<h3 class=\"hn\"><a href=\""+ ForumPages.Page.getUrl(topic) +"\"><span>"+ topic.getTitle() +"</span></a></h3>" +
            "<p>"+topic.getDescription()+"</p>" +
            "</div>" +
            "<ul class=\"item-info\">" +
            "<li class=\"info-topics\"><strong>"+ topic.getChilds().size() +"</strong> <span class=\"label\">topics</span></li>"+
            "<li class=\"info-posts\"><strong>X</strong> <span class=\"label\">posts</span></li>" +
            "<li class=\"info-lastpost\"><span class=\"label\">Last post:</span> <strong><a href=\"http://punbb.informer.com/forums/post/145563/#p145563\">2012-06-28 07:06</a></strong> <cite>by CReatiVe4w3</cite></li>" +
            "</ul>" +
            "</div>");
      }
    });
    addSection(DBConversation.tagName, new Template.ITemplateSection() {

      @Override
      public void head(StringBuilder response, Path path, IPathable object) {
        DBConversation conversation = (DBConversation) object;
       
        // TODO: Ajouter paging
        response.append("<div id=\"brd-pagepost-top\" class=\"main-pagepost gen-content\">"+
            "<p class=\"paging\"><span class=\"pages\">Pages</span> <strong class=\"first-item\">1</strong></p>"+
            "<p class=\"posting\">You must <a href=\"http://punbb.informer.com/forums/login/\">login</a> or <a href=\"http://punbb.informer.com/forums/register/\">register</a> to post a reply</p>"+
            "</div>");
       
        response.append("<div class=\"main-head\">"+
            "<p class=\"options\"><span class=\"feed first-item\"><a class=\"feed\" href=\"/\">RSS topic feed</a></span></p>"+
            "<h2 class=\"hn\"><span><span class=\"item-info\">Posts: "+ conversation.getChilds().size() +"</span></span></h2>"+
            "</div>");
       
        response.append("<div id=\"forum68\" class=\"main-content main-topic\">");
       
      }

      @Override
      public void foot(StringBuilder response, Path path, IPathable object) {
        response.append("</div>");
       
        if(Action.actionAuthorized(object, Action.ActionType.createChild))
        {
          Action action = Action.buildAction(object, Action.ActionType.createChild);
         
          TemplatePunBB.writeActionAsForm(action, response);
        }
      }
View Full Code Here

      // TODO: Catch this error
      return;
    }
   
    // Rebuild action object with value from form.
    Action action = Action.buildAction(ip, actionType);
    if(action == null)
    {
      // TODO: Catch this error, operation not permit
      return;
    }
   
    for(Field field:action.getFieldsList())
    {
      String value = req.getParameter(field.name);
      if(value != null)
      {
        field.defaultValue = value;
View Full Code Here

    String pageNumStr = req.getParameter("pn");
    int pageNum = 0;
    if(pageNumStr != null) pageNum = Integer.valueOf(pageNumStr);
    if(pageNum < 0) pageNum = 0;
   
    Path path = null;
    if(req.getParameter("tagName") != null && req.getParameter("tagKey") != null)
    {
      String tagName = req.getParameter("tagName");
      String tagKey = req.getParameter("tagKey");
     
View Full Code Here

    {
      // TODO: Catch this error
      return;
    }
   
    IPathable ip = pc.getObject(tagKey);
    if(ip == null)
    {
      // TODO: Catch this error
      return;
    }
   
    // Rebuild action object with value from form.
    Action action = Action.buildAction(ip, actionType);
    if(action == null)
    {
      // TODO: Catch this error, operation not permit
      return;
    }
   
    for(Field field:action.getFieldsList())
    {
      String value = req.getParameter(field.name);
      if(value != null)
      {
        field.defaultValue = value;
      }
    }
   
    if(!ip.applyAction(action))
    {
      // TODO: Found a solution to send failure return to the remplate, in the redirection
    }
   
    resp.sendRedirect(redirect);
View Full Code Here

      // TODO: Catch this problem
     
      return;
    }
   
    IPathable ip = path.object();
   
    beginPage(buildContent, path);
   
    if(!generatePageSection(buildContent, path, ip, tagShowLevel))
    {
View Full Code Here

  public List<IPathable> getPath() {
    return path;
  }

  public String objectTagName() {
    IPathable iobject = path.get(0);
    if (iobject == null)
      return null;

    return iobject.getPathable().getTagName();
  }
View Full Code Here

      // TODO: Catch this error
      return;
    }
   
    // Rebuild action
    PathableClass pc = PathBuilder.getPathableClass(tagName);
    if(pc == null)
    {
      // TODO: Catch this error
      return;
    }
   
    IPathable ip = pc.getObject(tagKey);
    if(ip == null)
    {
      // TODO: Catch this error
      return;
    }
View Full Code Here

TOP

Related Classes of com.appspot.gaeforum309.pathing.Path

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.