Package gwtappcontainer.shared.apps.content

Examples of gwtappcontainer.shared.apps.content.ContentProp


   
    //ensure content can be retrieved
    resp = api.getContent(tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    ContentProp prop = (ContentProp) resp.object;
   
    assertTrue(prop.html.equals(content));
    assertTrue(prop.publish == true);
    assertTrue(prop.tag == tag);         
  }
View Full Code Here


   
    //ensure content can be retrieved
    resp = api.getContent(tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    ContentProp prop = (ContentProp) resp.object;
   
    assertTrue(prop.html.equals(content));
    assertTrue(prop.publish == false);
    assertTrue(prop.tag == tag);       
  }
View Full Code Here

        helper.loginAsPortalAdmin());       
   
    //ensure content can be retrieved
    resp = api.getContent(tag, user);
   
    ContentProp prop = (ContentProp) resp.object;
    String expected = content.toString() + content.toString()
        + content.toString() + "1111";
    assertTrue(prop.html.equals(expected));
    assertTrue(prop.publish == true);
    assertTrue(prop.tag == tag);       
View Full Code Here

   
    //ensure content can be retrieved even without login
    resp = api.getContent(tag, null);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    ContentProp prop = (ContentProp) resp.object;
   
    assertTrue(prop.html.equals(content));
    assertTrue(prop.publish == true);
    assertTrue(prop.tag == tag)
  }
View Full Code Here

  String html;
  @Index String tag;
  boolean publish;
 
  ContentProp toProp() {
    ContentProp prop = new ContentProp();
    prop.id = id;
    prop.html = html;
    prop.tag = tag;
    prop.publish = publish;
   
View Full Code Here

        throw new APIException(Status.ERROR_RESOURCE_DOES_NOT_EXIST,
            "[" + tag + "] is not valid");
           
      ContentRepository repository = new ContentRepository();
     
      ContentProp prop = repository.setContent(html, tag, publish);               
     
      return new APIResponse(Status.SUCCESS, prop);
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
View Full Code Here

      String contentAdminRole = getContentAdminRoleForTag(tag);
      gateKeeper.ensureRole(user, contentAdminRole,
          Role.PORTAL_ADMIN.toString());       
           
      ContentRepository repository = new ContentRepository();   
      ContentProp prop = repository.setPublishStatus(tag, publish);
     
      return new APIResponse(Status.SUCCESS, prop);
    } catch (Exception ex) {
      return new APIResponse(ex);
    }
View Full Code Here

  @ApiMethod(path="getcontent", httpMethod = HttpMethod.GET)
  public APIResponse getContent(@Named("tag") String tag, User user) {
   
    try {
      ContentRepository repository = new ContentRepository();
      ContentProp prop = repository.getContent(tag);
           
      logger.info("received getContent for tag - " + tag);
     
      if (null == prop)
        throw new APIException(Status.ERROR_RESOURCE_DOES_NOT_EXIST,
View Full Code Here

      return;
    }
           
    String htmlContent;
   
    ContentProp prop = (ContentProp) response.object;
    htmlContent = prop.html;                     
    resp.getWriter().println(htmlContent);       
  }
View Full Code Here

TOP

Related Classes of gwtappcontainer.shared.apps.content.ContentProp

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.