Package com.agiletec.plugins.jacms.aps.system.services.content.model

Examples of com.agiletec.plugins.jacms.aps.system.services.content.model.Content


  public void validate() {
    super.validate();
    if (this.getFieldErrors().size()==0) {
      try {
        if (this.getContentId()!=null){
          Content publishingContent = this.getContentManager().loadContent(this.getContentId(), true);
          if (null == publishingContent) {
            this.addFieldError("contentId", this.getText("Page.specialShowlet.viewer.nullContent"));
          } else {
            IPage currentPage = this.getCurrentPage();
            String mainGroup = currentPage.getGroup();
            if (!publishingContent.getMainGroup().equals(Group.FREE_GROUP_NAME) && !publishingContent.getGroups().contains(Group.FREE_GROUP_NAME) &&
                !publishingContent.getMainGroup().equals(mainGroup) && !publishingContent.getGroups().contains(mainGroup) &&
                !Group.ADMINS_GROUP_NAME.equals(mainGroup)) {
              this.addFieldError("contentId", this.getText("Page.specialShowlet.viewer.invalidContent"));
            }
          }
        }
View Full Code Here


  }

  public void testAddRatingToContent() throws Throwable{
    IRating rating = null;
    try {
      Content content = _contentManager.loadContent(CONTENT_ID, true);
      if (content==null){
        fail();
      }
      this._retingManager.addRatingToContent(CONTENT_ID, 1);
      rating = this._retingManager.getContentRating(CONTENT_ID);
View Full Code Here

  public void testAddGetComment() throws Throwable{
    Comment comment = null;
    try {

      IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
      Content content = contentManager.loadContent("ART1", true);
      if (content==null){
        fail();
      }
      List<String> listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(0,listaIds.size());
      comment = createNewComment();
      comment.setContentId(content.getId());
      this._commentManager.addComment(comment);
      assertNotNull(comment.getId());
      IComment commentRead = this._commentManager.getComment(comment.getId());
      assertEquals(comment.getComment(), commentRead.getComment());
      assertEquals(comment.getStatus(), commentRead.getStatus());
View Full Code Here

  public void testAddUpdateDeleteComment() throws Throwable{
    Comment comment = null;
    try {
      IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
      Content content = contentManager.loadContent("ART1", true);
      if (content==null){
        fail();
      }
      List<String> listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(0,listaIds.size());
      comment = createNewComment();
      comment.setContentId(content.getId());
      this._commentManager.addComment(comment);
      assertNotNull(comment.getId());
      IComment commentRead = this._commentManager.getComment(comment.getId());
      assertEquals(comment.getComment(), commentRead.getComment());
      assertEquals(comment.getStatus(), commentRead.getStatus());
View Full Code Here

    }

  public void testAddDeleteCommentByWidgetConfig()throws Throwable{
    String contentId = "ART1";
    try{
      Content content = this._contentManager.loadContent(contentId, true);
      ICacheManager cacheManager = (ICacheManager) ApsWebApplicationUtils.getBean(SystemConstants.CACHE_MANAGER, this.getRequest());
      PublicContentAuthorizationInfo authInfo = new PublicContentAuthorizationInfo(content);
      cacheManager.putInCache(JacmsSystemConstants.CONTENT_AUTH_INFO_CACHE_PREFIX + contentId, authInfo);
      this.setUserOnSession("admin");
      Widget widget = new Widget();
View Full Code Here

  }

  public void testAddContentRatingByShowletConfig()throws Throwable {
    String contentId = "ART1";
    try {
      Content content = this._contentManager.loadContent(contentId, true);
      ICacheManager cacheManager = (ICacheManager) ApsWebApplicationUtils.getBean(SystemConstants.CACHE_MANAGER, this.getRequest());
      PublicContentAuthorizationInfo authInfo = new PublicContentAuthorizationInfo(content);
      cacheManager.putInCache(JacmsSystemConstants.CONTENT_AUTH_INFO_CACHE_PREFIX + contentId, authInfo);
      this.setUserOnSession("admin");
      Widget showlet = new Widget();
View Full Code Here

  }

  public void testViewContentAndAddCommentByRequest()throws Throwable{
    String contentId = "ART1";
    try {
      Content content = this._contentManager.loadContent(contentId, true);
      ICacheManager cacheManager = (ICacheManager) ApsWebApplicationUtils.getBean(SystemConstants.CACHE_MANAGER, this.getRequest());
      PublicContentAuthorizationInfo authInfo = new PublicContentAuthorizationInfo(content);
      cacheManager.putInCache(JacmsSystemConstants.CONTENT_AUTH_INFO_CACHE_PREFIX + contentId, authInfo);
      this.setUserOnSession("admin");
      this._contentManager.loadContent(contentId, true);
View Full Code Here

 
  @Override
  public String preview() {
    try {
      ContentVersion contentVersion = this.getContentVersion();
      Content currentContent = this.getVersioningManager().getContent(contentVersion);
      this.setContent(currentContent);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "preview");
      return FAILURE;
    }
View Full Code Here

    return SUCCESS;
  }
 
  @Override
  public String recover() {
    Content content = null;
    try {
      ContentVersion contentVersion = this.getContentVersion();
      if (null == contentVersion) {
        throw new RuntimeException("Null content version : versionid " + this.getVersionId());
      }
View Full Code Here

public class NewsletterAction extends BaseAction implements INewsletterAction {
 
  @Override
  public String entry() {
    try {
      Content content = this.getContent();
      if (!this.checkContent(content)) {
        return "userNotAllowed";
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "entry");
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jacms.aps.system.services.content.model.Content

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.