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);
}
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;
}
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);
}
}
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;
}
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;
}
Aggregations