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

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


    return super.isAuthToEdit(user, content);
  }
 
  @Override
  public boolean isAuthToEdit(UserDetails user, String contentId, boolean publicVersion) throws ApsSystemException {
    Content content = this.getContentManager().loadContent(contentId, publicVersion);
    return super.isAuthToEdit(user, content);
  }
View Full Code Here


    return eventsForMonth;
  }
 
  @Override
  public void updateFromPublicContentChanged(PublicContentChangedEvent event) {
    Content content = (Content) event.getContent();
    if (content.getTypeCode().equals(this.getManagedContentType())) {
      this._map.clear();
    }
  }
View Full Code Here

 
  @Override
  public int doStartTag() throws JspException {
    IContentWorkFlowActionHelper helper = (IContentWorkFlowActionHelper) ApsWebApplicationUtils.getBean("jpcontentworkflowContentActionHelper", pageContext);
    try {
      Content content = this.getContent();
      String stepCode = null;
      if (this.isNextStep()) {
        stepCode = helper.getNextStep(content.getStatus(), content.getTypeCode());
      } else {
        stepCode = helper.getPreviousStep(content.getStatus(), content.getTypeCode());
      }
      if (null != this.getVar()) {
        ValueStack stack = this.getStack();
        stack.getContext().put(this.getVar(), stepCode);
              stack.setValue("#attr['" + this.getVar() + "']", stepCode, false);
View Full Code Here

    try {
      List<SmallContentType> smallContentTypes = super.getContentTypes();
      if (null != smallContentTypes && !smallContentTypes.isEmpty()) {
        for (int i = 0; i < smallContentTypes.size(); i++) {
          SmallContentType smallContentType = smallContentTypes.get(i);
          Content prototype = (Content) this.getContentManager().getEntityPrototype(smallContentType.getCode());
          if (null != prototype.getAttributeByRole(GeoRefSystemConstants.ATTRIBUTE_ROLE_COORD)) {
            list.add(smallContentType);
          }
        }
      }
    } catch (Throwable t) {
View Full Code Here

    List<SelectItem> types = new ArrayList<SelectItem>();
    try {
      types.add(new SelectItem(UserFilterOptionBean.KEY_FULLTEXT, this.getText("label.fulltext")));
      types.add(new SelectItem(UserFilterOptionBean.KEY_CATEGORY, this.getText("label.category")));
      String contentType = this.getWidget().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
      Content prototype = this.getContentManager().createContentType(contentType);
      List<AttributeInterface> contentAttributes = prototype.getAttributeList();
      for (int i=0; i<contentAttributes.size(); i++) {
        AttributeInterface attribute = contentAttributes.get(i);
        if (attribute.isSearcheable()) {
                                    // Escludo filtro per tipo Coordinate
                                    if(!ContentListViewerWidgetAction.ATTRIBUTE_TYPE_COORD.equals(attribute.getType()))
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.getWidget().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
      Content prototype = this.getContentManager().createContentType(contentType);
      List<AttributeInterface> contentAttributes = prototype.getAttributeList();
      for (int i=0; i<contentAttributes.size(); i++) {
        AttributeInterface attribute = contentAttributes.get(i);
        if (attribute.isSearcheable()) {
                                    // Escludo filtro per tipo Coordinate
                                    if(!ContentListViewerWidgetAction.ATTRIBUTE_TYPE_COORD.equals(attribute.getType()))
View Full Code Here

    List<SyndEntryImpl> entries = _rssConverterManager.getRssEntries(IRssConverterManager.RSS_2_0, url);
    assertNotNull(entries);
    List<Content> contents = _rssConverterManager.getContents(item);
    assertNotNull(contents);
    assertEquals(entries.size(), contents.size());
    Content content = contents.get(0);
    assertEquals("Burnout", content.getDescr());
    TextAttribute titleAttr = (TextAttribute) content.getAttribute("Title");
    LinkAttribute  linkAttr = (LinkAttribute) content.getAttribute("Link");
    HypertextAttribute corpoAttr = (HypertextAttribute) content.getAttribute("TextBody");
    assertEquals("Burnout", titleAttr.getText());
    assertEquals("http://www.alistapart.com/articles/burnout/", linkAttr.getSymbolicLink().getUrlDest());
    assertTrue(corpoAttr.getText().startsWith("Does every day feel like a bad day"));

    Content content1 = contents.get(2);
    assertEquals("Descrizione non disponibile", content1.getDescr());
    TextAttribute titleAttr1 = (TextAttribute) content1.getAttribute("Title");
    LinkAttribute  linkAttr1 = (LinkAttribute) content1.getAttribute("Link");
    HypertextAttribute corpoAttr1 = (HypertextAttribute) content1.getAttribute("TextBody");
    assertEquals("Titolo non disponibile", titleAttr1.getText());
    assertEquals("http://www.alistapart.com/articles/taking-the-guesswork-out-of-design/", linkAttr1.getSymbolicLink().getUrlDest());
    assertEquals("Corpo testo non disponibile", corpoAttr1.getText());
  }
View Full Code Here

  // Portare a protected in Action padre di jacms
  protected void addConfirmMessage(String key, List<Content> deletedContents) {
    if (deletedContents.size() > 0) {
      String confirm = this.getText(key);
      for (int i=0; i<deletedContents.size(); i++) {
        Content content = deletedContents.get(i);
        if (i>0) {
          confirm += " - ";
        }
        confirm += " '" + content.getDescr() + "'";
      }
      this.addActionMessage(confirm);
    }
  }
View Full Code Here

    String contentId = null;
    try {
      contentId = this.createMockContent();
      String cacheKey = JacmsSystemConstants.CONTENT_CACHE_PREFIX + contentId;
      assertNull(this._cacheInfoManager.getFromCache(cacheKey));
      Content extractedContent = this._contentManager.loadContent(contentId, true);
      assertNotNull(extractedContent);
      Content cachedContent = (Content) this._cacheInfoManager.getFromCache(cacheKey);
      assertNotNull(cachedContent);
      assertEquals(cachedContent.hashCode(), extractedContent.hashCode());
      assertEquals(cachedContent.getStatus(), extractedContent.getStatus());
      assertEquals(cachedContent.getDescr(), extractedContent.getDescr());
      assertEquals(cachedContent.getLastModified(), extractedContent.getLastModified());
      assertEquals(cachedContent.getLastEditor(), extractedContent.getLastEditor());
      assertEquals(cachedContent.getAttributeList().size(), extractedContent.getAttributeList().size());
      this._contentManager.insertOnLineContent(extractedContent);
      cachedContent = (Content) this._cacheInfoManager.getFromCache(cacheKey);
      assertNull(cachedContent);
      Content extractedWorkContent = this._contentManager.loadContent(contentId, false);
      assertNotNull(extractedWorkContent);
      cachedContent = (Content) this._cacheInfoManager.getFromCache(cacheKey);
      assertNull(cachedContent);
    } catch (Throwable t) {
      throw t;
View Full Code Here

    String contentId = null;
    try {
      contentId = this.createMockContent();
      String cacheKey = JacmsSystemConstants.CONTENT_CACHE_PREFIX + contentId;
      assertNull(this._cacheInfoManager.getFromCache(cacheKey));
      Content extractedContent = this._contentManager.loadContent(contentId, true);
      assertNotNull(extractedContent);
      assertNotNull(this._cacheInfoManager.getFromCache(cacheKey));
      String group1 = JacmsSystemConstants.CONTENT_CACHE_GROUP_PREFIX + contentId;
      this._cacheInfoManager.flushGroup(group1);
      assertNull(this._cacheInfoManager.getFromCache(cacheKey));
      extractedContent = this._contentManager.loadContent(contentId, true);
      assertNotNull(extractedContent);
      assertNotNull(this._cacheInfoManager.getFromCache(cacheKey));
      String group2 = JacmsSystemConstants.CONTENT_TYPE_CACHE_GROUP_PREFIX + extractedContent.getTypeCode();
      this._cacheInfoManager.flushGroup(group2);
      assertNull(this._cacheInfoManager.getFromCache(cacheKey));
    } catch (Throwable t) {
      throw t;
    } finally {
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.