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

Examples of com.agiletec.plugins.jacms.aps.system.services.contentmodel.ContentModel


public class FrontContentAction extends ContentAction {
 
  public String editView() {
    try {
      String modelIdString = this.getRequest().getParameter("modelId");
      ContentModel model = this.getContentModel(modelIdString);
      if (null == model) {
        modelIdString = this.getContentManager().getDefaultModel(this.getContentId());
        model = this.getContentModel(modelIdString);
      }
      this.setContentModel(model);
      if (null == model) {
        return this.edit();
      }
      if (!this.getContentId().startsWith(model.getContentType())) {
        throw new ApsSystemException("Invalid model id " + model.getId() +
            " of type " + model.getContentType() + " for content " + this.getContentId());
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "editView");
      return FAILURE;
    }
View Full Code Here


   
  public ContentModel getContentModel(String modelIdString) {
    if (null == modelIdString) {
      return null;
    }
    ContentModel model = null;
    try {
      long modelId = Long.parseLong(modelIdString);
      model = this.getContentModelManager().getContentModel(modelId);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getContentModel", "Error extracting modelId");
View Full Code Here

    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}
View Full Code Here

      String renderInfoCacheKey = BaseContentDispenser.getRenderizationInfoCacheKey(contentId, modelId, langCode, reqCtx);
      ContentRenderizationInfo outputInfo = this._contentDispenser.getRenderizationInfo(contentId, modelId, langCode, reqCtx);
      assertNotNull(outputInfo);
      assertNotNull(this._cacheInfoManager.getFromCache(renderInfoCacheKey));
      //-----------
      ContentModel contentModel = this._contentModelManager.getContentModel(modelId);
      contentModel.setDescription("Modified model description");
      this._contentModelManager.updateContentModel(contentModel);
      super.waitNotifyingThread();
      assertNull(this._cacheInfoManager.getFromCache(renderInfoCacheKey));
      //-----------
      outputInfo = this._contentDispenser.getRenderizationInfo(contentId, modelId, langCode, reqCtx);
View Full Code Here

      assertNull(this._contentManager.loadContent(contentId, false));
    }
  }
 
  protected long createMockContentModel() throws Throwable {
    ContentModel contentModel = this._contentModelManager.getContentModel(2);
    contentModel.setId(200);
    contentModel.setDescription("Test Content Model");
    this._contentModelManager.addContentModel(contentModel);
    return contentModel.getId();
  }
View Full Code Here

    return contentModel.getId();
  }
 
  protected void deleteMockContentObject(String contentId, long modelId) throws Throwable {
    this.deleteMockContent(contentId);
    ContentModel contentModel = this._contentModelManager.getContentModel(modelId);
    if (null != contentModel) {
      this._contentModelManager.removeContentModel(contentModel);
    }
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jacms.aps.system.services.contentmodel.ContentModel

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.