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

Examples of com.agiletec.plugins.jacms.aps.system.services.content.IContentManager


  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());
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());
View Full Code Here

      this._helper.resetConfig();
    }
  }
 
  public void testBuildMailBody() throws Throwable {
    IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
    Content content = contentManager.loadContent("ART180", true);
    String textBody = this._newsletterManager.buildMailBody(content, false);
    assertNotNull(textBody);
    String htmlBody = this._newsletterManager.buildMailBody(content, true);
    assertNotNull(htmlBody);
  }
View Full Code Here

    String modelId = (null != showletConfig) ? (String) showletConfig.get("modelId") : null;
    if (null == modelId) {
      modelId = reqCtx.getRequest().getParameter("modelId");
    }
    if (null == modelId && null != this.getContentId()) {
      IContentManager contentManager = (IContentManager) ApsWebApplicationUtils.getBean(JacmsSystemConstants.CONTENT_MANAGER, this.pageContext);
      modelId = contentManager.getDefaultModel(this.getContentId());
    }
    return modelId;
  }
View Full Code Here

    Widget currentShowlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
    if (null == currentShowlet.getConfig()) return contentTypes;
    String paramName = JpFacetNavSystemConstants.CONTENT_TYPES_FILTER_SHOWLET_PARAM_NAME;
    String contentTypesParamValue = currentShowlet.getConfig().getProperty(paramName);
    if (null != contentTypesParamValue) {
      IContentManager contentManager = (IContentManager) ApsWebApplicationUtils.getBean(JacmsSystemConstants.CONTENT_MANAGER, reqCtx.getRequest());
      String[] contentTypesArray = contentTypesParamValue.split(",");
      for (int i=0; i<contentTypesArray.length; i++) {
        String contentTypeCode = contentTypesArray[i].trim();
        if (null != contentManager.getSmallContentTypesMap().get(contentTypeCode)) {
          contentTypes.add(contentTypeCode);
        }
      }
    }
    return contentTypes;
View Full Code Here

   * @param contentManager
   * @return a map (content_descr:hits) used to render the chart
   */
  @Override
  public Map<String, Integer> getTopContents(Calendar start, Calendar end) {
    IContentManager contentManager = this.getContentManager();
    Connection conn = null;
    PreparedStatement stat = null;
    ResultSet res = null;
    Map<String, Integer> topContents = new TreeMap<String, Integer>();
    String startString = new Timestamp(start.getTimeInMillis()).toString();
    String endString = new Timestamp(end.getTimeInMillis()).toString();
    try {
      conn = this.getConnection();
      String queryName = this.GetGET_TOP_CONTENTS(this.getDriverName());
      stat = conn.prepareStatement(queryName);
      stat.setString(1,  startString);
      stat.setString(2,  endString);
      res = stat.executeQuery();
      while (res.next()) {
        String contentId = res.getString("content");
        String contentDescr = null;
        ContentRecordVO content = contentManager.loadContentVO(contentId);
        if (null == content) {
          contentDescr = "[DELETED]";
        } else {
          contentDescr = content.getDescr();
        }
View Full Code Here

      List<GeorefInfoBean> geoPoints = new ArrayList<GeorefInfoBean>();
      Collection object = (Collection) this.pageContext.getAttribute(this.getMaster());
      if (object == null) {
        ApsSystemUtils.getLogger().error("There is no list in the request.");
      } else {
        IContentManager contentManager = (IContentManager) ApsWebApplicationUtils.getBean(JacmsSystemConstants.CONTENT_MANAGER, pageContext);
        Iterator<String> iter = object.iterator();
        double sumx = 0;
        double sumy = 0;
        double westX = MAX_EAST;
        double eastX = MIN_WEST;
        double northY = MIN_SOUTH;
        double southY = MAX_NORTH;
        while (iter.hasNext()) {
          String contentId = (String) iter.next();
          Content content = (Content) contentManager.loadContent(contentId, true);
          if (null != content) {
            CoordsAttribute coords = this.extractCoordAttribute(content);
            if (coords != null && coords.getX() != 0 && coords.getY() != 0) {
              GeorefInfoBean geoInfoBean = new GeorefInfoBean();
              geoInfoBean.setContentId(contentId);
View Full Code Here

      if (null == this.getContentIds()) {
        return SUCCESS;
      }
      Iterator<String> iter = this.getContentIds().iterator();
      List<Content> publishedContents = new ArrayList<Content>();
      IContentManager contentManager = (IContentManager) this.getContentManager();
      while (iter.hasNext()) {
        String contentId = (String) iter.next();
        Content contentToPublish = contentManager.loadContent(contentId, false);
        String[] msgArg = new String[1];
        if (null == contentToPublish) {
          msgArg[0] = contentId;
          this.addActionError(this.getText("error.content.contentToPublishNull", msgArg));
          continue;
        }
        msgArg[0] = contentToPublish.getDescr();
        if (!Content.STATUS_READY.equals(contentToPublish.getStatus())) {
          String nextStep = this.getNextStep(contentToPublish);
          if (null != nextStep && !Content.STATUS_READY.equals(nextStep)) {
            String[] args = {contentToPublish.getId(), contentToPublish.getDescr(), contentToPublish.getStatus()};
            this.addActionError(this.getText("error.content.publish.statusNotAllowed", args));
            continue;
          }
        }
        if (!this.isUserAllowed(contentToPublish)) {
          this.addActionError(this.getText("error.content.userNotAllowedToPublishContent", msgArg));
          continue;
        }
        this.getContentActionHelper().scanEntity(contentToPublish, this);
        if (this.getFieldErrors().size()>0) {
          this.addActionError(this.getText("error.content.publishingContentWithErrors", msgArg));
          continue;
        }
        contentManager.insertOnLineContent(contentToPublish);
        ApsSystemUtils.getLogger().info("Content '" + contentToPublish.getId()
            + "' published by user '" + this.getCurrentUser().getUsername() + "'");
        publishedContents.add(contentToPublish);
      }
      //RIVISITARE LOGICA DI COSTRUZIONE LABEL
View Full Code Here

  }
 
  private void init() throws Exception {
    try {
      this._rssManager = (IRssManager) this.getService(JpRssSystemConstants.RSS_MANAGER);
      IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
      Content contentType = contentManager.createContentType("ART");
      AttributeInterface titolo = (AttributeInterface) contentType.getAttribute("Titolo");
      String[] roles = {JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_TITLE};
      titolo.setRoles(roles);
      ((IEntityTypesConfigurer) contentManager).updateEntityPrototype(contentType);
      this.waitNotifyingThread();
View Full Code Here

        int id = current.getId();
        this.getRssManager().deleteChannel(id);
      }
      fullList = this.getRssManager().getChannels(Channel.STATUS_ALL);
      assertTrue(fullList.isEmpty());
      IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
      Content contentType = contentManager.createContentType("ART");
      AttributeInterface titolo = (AttributeInterface) contentType.getAttribute("Titolo");
      String[] roles = {JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_TITLE};
      titolo.setRoles(roles);
      ((IEntityTypesConfigurer) contentManager).updateEntityPrototype(contentType);
      this.waitNotifyingThread();
View Full Code Here

TOP

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

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.