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

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


      String renderInfoCacheKey = BaseContentDispenser.getRenderizationInfoCacheKey(contentId, modelId, langCode, reqCtx);
      ContentRenderizationInfo outputInfo = this._contentDispenser.getRenderizationInfo(contentId, modelId, langCode, reqCtx);
      assertNotNull(outputInfo);
      assertNotNull(this._cacheInfoManager.getFromCache(renderInfoCacheKey));
      //-----------
      Content content = this._contentManager.loadContent(contentId, true);
      content.setDescr("Modified content description");
      this._contentManager.insertOnLineContent(content);
      super.waitNotifyingThread();
      assertNull(this._cacheInfoManager.getFromCache(renderInfoCacheKey));
      //-----------
      outputInfo = this._contentDispenser.getRenderizationInfo(contentId, modelId, langCode, reqCtx);
View Full Code Here


  }
 
  //----------------------------------------------
 
  protected String createMockContent() throws Throwable {
    Content content = this._contentManager.loadContent("ART1", false);
    content.setId(null);
    this._contentManager.insertOnLineContent(content);
    String id = content.getId();
    assertNotNull(id);
    return id;
  }
View Full Code Here

  @Before("execution(* com.agiletec.plugins.jacms.aps.system.services.content.IContentManager.saveContent(..)) && args(content,..)")
  public void listenContentSaving(Object content) {
    try {
      boolean notify = true;
      Content currentContent = (Content) content;
      String contentId = currentContent.getId();
      if (null != contentId) {
        Content previousContent = this.getContentManager().loadContent(contentId, false);
        if (previousContent.getStatus().equals(currentContent.getStatus())) {
          notify = false;
        }
      }
      if (notify) {
        this.saveContentStatusChanged(currentContent);
View Full Code Here

    assertNotNull(id);
    return id;
  }
 
  protected void deleteMockContent(String contentId) throws Throwable {
    Content content = this._contentManager.loadContent(contentId, true);
    if (null != content) {
      this._contentManager.removeOnLineContent(content);
      this._contentManager.deleteContent(content);
      assertNull(this._contentManager.loadContent(contentId, false));
    }
View Full Code Here

public class ContentActionHelper extends com.agiletec.plugins.jacms.apsadmin.content.helper.ContentActionHelper
    implements IContentWorkFlowActionHelper {
 
  @Override
  public void updateEntity(IApsEntity entity, HttpServletRequest request) {
    Content content = (Content) entity;
    try {
            if (null != content) {
              String descr = request.getParameter("descr");
              if (descr != null) content.setDescr(descr.trim());
              // Non consente di modificare lo stato del contenuto
        String status = content.getStatus();
        if (status==null || status.equals(Content.STATUS_NEW)) {
          content.setStatus(Content.STATUS_DRAFT);
        }
              if (null == content.getId()) {
                String mainGroup = request.getParameter("mainGroup");
                if (mainGroup != null) content.setMainGroup(mainGroup);
              }
              super.updateEntity(content, request);
            }
        } catch (Throwable t) {
          ApsSystemUtils.logThrowable(t, this, "updateContent");
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();
    } catch (Throwable t) {
View Full Code Here

        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();
    } catch (Throwable t) {
View Full Code Here

    List<SelectItem> types = new ArrayList<SelectItem>();
    try {
      types.add(new SelectItem(IContentListFilterAction.METADATA_KEY_PREFIX + IContentManager.CONTENT_CREATION_DATE_FILTER_KEY, this.getText("label.creationDate")));
      types.add(new SelectItem(IContentListFilterAction.METADATA_KEY_PREFIX + IContentManager.CONTENT_MODIFY_DATE_FILTER_KEY, this.getText("label.lastModifyDate")));
      //String contentType = this.getShowlet().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
      Content prototype = this.getContentManager().createContentType(this.getContentType());
      List<AttributeInterface> contentAttributes = prototype.getAttributeList();
      for (int i=0; i<contentAttributes.size(); i++) {
        AttributeInterface attribute = contentAttributes.get(i);
        if (attribute.isSearcheable()) {
          types.add(new SelectItem(attribute.getName(), this.getText("label.attribute", new String[]{attribute.getName()})));
        }
View Full Code Here

    super.tearDown();
    List<String> contents = this.getRSSContents();
    Iterator<String> contentIt = contents.iterator();
    while (contentIt.hasNext()) {
      String contentId = contentIt.next();
      Content content = _contentManager.loadContent(contentId, false);
      _contentManager.deleteContent(content);
    }
    List<ApsAggregatorItem> items = _aggregatorManager.getItems();
    Iterator<ApsAggregatorItem> it = items.iterator();
    while (it.hasNext()) {
View Full Code Here

      String contentTypeCode = this.getContentType();
      if (null == this.getContentManager().getSmallContentTypesMap().get(contentTypeCode)) {
        String[] args = {this.getContentType()};
        this.addFieldError("contentType", this.getText("error.calendarConfig.invalidContentType", args));
      } else {
        Content prototype = this.getContentManager().createContentType(contentTypeCode);
        if (null == this.getStartDateAttributeName() || null == prototype.getAttribute(this.getStartDateAttributeName())) {
          String[] args = {this.getStartDateAttributeName()};
          this.addFieldError("startDateAttributeName", this.getText("error.calendarConfig.invalidStartDateAttribute", args));
        }
        if (null == this.getEndDateAttributeName() || null == prototype.getAttribute(this.getEndDateAttributeName())) {
          String[] args = {this.getEndDateAttributeName()};
          this.addFieldError("endDateAttributeName", this.getText("error.calendarConfig.invalidEndDateAttribute", args));
        }
        if (null != this.getStartDateAttributeName() && null != this.getEndDateAttributeName()
            && this.getEndDateAttributeName().equals(this.getStartDateAttributeName())) {
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.