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

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


    }
  }
 
  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


  }
 
  public String getBodyPreview(boolean html) {
    String mailBody = null;
    try {
      Content content = this.getContent();
      mailBody = this.getNewsletterManager().buildMailBody(content, html);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getBodyPreview");
    }
    return mailBody;
View Full Code Here

   * @return L'entità valorizzata.
   * @throws ApsSystemException In caso di errore nella lettura dell'entità.
   */
  protected Content createContentFromXml(String entityTypeCode, String xml) throws ApsSystemException {
    try {
      Content entityPrototype = (Content) this.getContentManager().getEntityPrototype(entityTypeCode);
      SAXParserFactory parseFactory = SAXParserFactory.newInstance();     
      SAXParser parser = parseFactory.newSAXParser();
      InputSource is = new InputSource(new StringReader(xml));
      EntityHandler handler = this.getEntityHandler();
      handler.initHandler(entityPrototype, this.getXmlAttributeRootElementName(), this.getCategoryManager());
View Full Code Here

      INewsletterManager newsletterManager = this.getNewsletterManager();
      Set<String> contentIds = this.getContentIds();
      if (contentIds!=null && contentIds.size()>0) {
        List<String> newsletterQueue = newsletterManager.getContentQueue();
        for (String contentId : contentIds) {
          Content content = this.getContentManager().loadContent(contentId, true);
          if (this.checkContent(content)) {
            if (newsletterQueue.contains(contentId)) {
              this.addActionError(this.getText("Errors.newsletter.contentAlreadyAdded", new String[] { content.getDescr() }));
            } else {
              newsletterManager.addContentToQueue(contentId);
              this.addActionMessage(this.getText("Messages.newsletter.addedContent", new String[] { content.getDescr() }));
            }
          }
        }
      }
    } catch (Throwable t) {
View Full Code Here

        String result = super.edit();
    if (!result.equals(SUCCESS)) {
      return result;
    }
    try {
      Content content = this.getContent();
      ContentModel model = this.getContentModel();
      if (null != this.getAttributeName() && null != model) {
        if (!content.getTypeCode().equals(model.getContentType())) {
          ApsSystemUtils.getLogger().error("Invalid model id " + model.getId() +
            " of type " + model.getContentType() + " for content " + this.getContentId());
          //return SUCCESS;
        }
      }
      if (model != null) {
        this.extractAttributesToEdit(model.getContentShape(), content);
      }
      List<AttributeInterface> attributes = content.getAttributeList();
      for (int i = 0; i < attributes.size(); i++) {
        AttributeInterface attribute = attributes.get(i);
        //jpfrontshortcut_${typeCodeKey}_${attributeNameI18nKey}
        String attributeLabelKey = "jpfrontshortcut_" + content.getTypeCode() + "_" + attribute.getName();
        if (null == this.getI18nManager().getLabelGroup(attributeLabelKey)) {
          this.addLabelGroups(attributeLabelKey, attribute.getName());
        }
        attribute.setDisablingCodes(this.createNewCodes(attribute.getDisablingCodes()));
        if (null != this.getAttributeName() && !this.getAttributeName().contains(attribute.getName())) {
View Full Code Here

      List<String> contentIds = this.getContentQueue();
      if (contentIds.size() > 0) {
        List<Content> contents = new ArrayList<Content>(contentIds.size());
        for (int i = 0; i < contentIds.size(); i++) {
          String id = contentIds.get(i);
          Content content = this.getContentManager().loadContent(id, true);
          if (content != null) {
            contents.add(content);
          }
        }
        if (contents.size() > 0) {
View Full Code Here

 
  private Map<String, List<String>> prepareProfileAttributesForContents(List<Content> contents) {
    Map<String, List<String>> profileAttributes = new HashMap<String, List<String>>();
    Properties subscriptions = this.getConfig().getSubscriptions();
    for (int i=0; i<contents.size(); i++) {
      Content content = contents.get(i);
      List<String> contentProfileAttributes = this.extractProfileAttributesForContent(content, subscriptions);
      if (contentProfileAttributes != null && contentProfileAttributes.size() > 0) {
        profileAttributes.put(content.getId(), contentProfileAttributes);
      }
    }
    return profileAttributes;
  }
View Full Code Here

        allContents = value != null && value.booleanValue();
      }
      List<String> groupNames = this.extractUserGroupNames(user);
      boolean isGroupAdmin = groupNames.contains(Group.ADMINS_GROUP_NAME);
      for (int i=0; i<contents.size(); i++) {
        Content content = contents.get(i);
        String contentId = content.getId();
        List<String> contentProfileAttributes = profileAttributes.get(contentId);
        ContentReport contentReport = newsletterReport.getContentReport(contentId);
        if (contentReport != null && (isGroupAdmin || this.checkUserAllowedOnContent(groupNames, content))) {
          if (allContents) {
            userContents.add(content);
View Full Code Here

  }
 
  private void sendNewsletterToSubscribers(List<Content> contents, NewsletterReport newsletterReport) throws ApsSystemException {
    List<Content> contentsToSubscribers = new ArrayList<Content>();
    for (int i = 0; i < contents.size(); i++) {
      Content content = contents.get(i);
      if (this.isContentToSend(content)) {
        contentsToSubscribers.add(content);
      }
    }
    this.sendContentsToSubscribers(contentsToSubscribers, newsletterReport);
View Full Code Here

        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

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.