Search in sources :

Example 1 with ContentRecordVO

use of com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO in project entando-core by entando.

the class TestContentDAO method deleteContent.

private void deleteContent(Content content) throws ApsSystemException {
    this._contentDao.deleteEntity(content.getId());
    ContentRecordVO contentRecord = (ContentRecordVO) this._contentDao.loadEntityRecord(content.getId());
    assertNull(contentRecord);
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO)

Example 2 with ContentRecordVO

use of com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO in project entando-core by entando.

the class ContentManager method loadContent.

@Override
public // @CacheableInfo(groups = "T(com.agiletec.plugins.jacms.aps.system.services.cache.CmsCacheWrapperManager).getContentCacheGroupsCsv(#id)")
Content loadContent(String id, boolean onLine, boolean cacheable) throws ApsSystemException {
    Content content = null;
    try {
        ContentRecordVO contentVo = this.loadContentVO(id);
        content = this.createContent(contentVo, onLine);
    } catch (ApsSystemException e) {
        _logger.error("Error while loading content : id {}", id, e);
        throw new ApsSystemException("Error while loading content : id " + id, e);
    }
    return content;
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException)

Example 3 with ContentRecordVO

use of com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO in project entando-core by entando.

the class ContentManager method reloadEntityReferences.

@Override
public void reloadEntityReferences(String entityId) {
    try {
        ContentRecordVO contentVo = this.loadContentVO(entityId);
        Content content = this.createContent(contentVo, true);
        if (content != null) {
            this.getContentDAO().reloadPublicContentReferences(content);
        }
        Content workcontent = this.createContent(contentVo, false);
        if (workcontent != null) {
            this.getContentDAO().reloadWorkContentReferences(workcontent);
        }
        _logger.debug("Reloaded content references for content {}", entityId);
    } catch (Throwable t) {
        _logger.error("Error while reloading content references for content {}", entityId, t);
    }
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO) Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content)

Example 4 with ContentRecordVO

use of com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO in project entando-core by entando.

the class ContentFinderAction method getLastUpdateContentResponse.

@SuppressWarnings("rawtypes")
public List<ContentJO> getLastUpdateContentResponse() {
    List<ContentJO> response = null;
    try {
        EntitySearchFilter modifyOrder = new EntitySearchFilter(IContentManager.CONTENT_MODIFY_DATE_FILTER_KEY, false);
        modifyOrder.setOrder(EntitySearchFilter.DESC_ORDER);
        List<String> ids = this.getContentManager().searchId(new EntitySearchFilter[] { modifyOrder });
        if (null != ids && !ids.isEmpty()) {
            if (this.getLastUpdateResponseSize() > ids.size() - 1)
                this.setLastUpdateResponseSize(ids.size() - 1);
            List<String> subList = ids.subList(0, this.getLastUpdateResponseSize());
            response = new ArrayList<ContentJO>();
            Iterator<String> sublist = subList.iterator();
            while (sublist.hasNext()) {
                String contentId = sublist.next();
                Content content = this.getContentManager().loadContent(contentId, false);
                ContentRecordVO vo = this.getContentManager().loadContentVO(contentId);
                ContentJO contentJO = new ContentJO(content, vo);
                response.add(contentJO);
            }
        }
    } catch (Throwable t) {
        _logger.error("Error loading last updated content response", t);
        throw new RuntimeException("Error loading last updated content response", t);
    }
    return response;
}
Also used : ContentJO(org.entando.entando.plugins.jacms.apsadmin.content.rs.model.ContentJO) Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO) EntitySearchFilter(com.agiletec.aps.system.common.entity.model.EntitySearchFilter)

Example 5 with ContentRecordVO

use of com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO in project entando-core by entando.

the class ContentInspectionAction method getReferencedContents.

/**
 * Return the list of the referenced contents.
 * @return the list of the referenced contents.
 * @deprecated use getReferencedContentsId() method
 */
public List<ContentRecordVO> getReferencedContents() {
    List<ContentRecordVO> referencedContents = new ArrayList<ContentRecordVO>();
    try {
        List<String> referencedContentsId = this.getReferencedContentsId();
        if (null != referencedContentsId) {
            for (int i = 0; i < referencedContentsId.size(); i++) {
                ContentRecordVO currentReferencedContent = this.getContentManager().loadContentVO(referencedContentsId.get(i));
                referencedContents.add(currentReferencedContent);
            }
        }
    } catch (Throwable t) {
        _logger.error("Error getting referenced contents by content {}", this.getContentId(), t);
        String msg = "Error getting referenced contents by content " + this.getContentId();
        throw new RuntimeException(msg, t);
    }
    return referencedContents;
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO) ArrayList(java.util.ArrayList)

Aggregations

ContentRecordVO (com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO)18 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)4 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)3 UserDetails (com.agiletec.aps.system.services.user.UserDetails)2 ArrayList (java.util.ArrayList)2 ApiError (org.entando.entando.aps.system.services.api.model.ApiError)2 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)2 StringApiResponse (org.entando.entando.aps.system.services.api.model.StringApiResponse)2 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)1 ApsProperties (com.agiletec.aps.util.ApsProperties)1 ContentUtilizer (com.agiletec.plugins.jacms.aps.system.services.content.ContentUtilizer)1 IContentManager (com.agiletec.plugins.jacms.aps.system.services.content.IContentManager)1 ResourceUtilizer (com.agiletec.plugins.jacms.aps.system.services.resource.ResourceUtilizer)1 Properties (java.util.Properties)1 JAXBContent (org.entando.entando.plugins.jacms.aps.system.services.api.model.JAXBContent)1 ContentJO (org.entando.entando.plugins.jacms.apsadmin.content.rs.model.ContentJO)1