Search in sources :

Example 16 with ContentRecordVO

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

the class RowContentListViewerWidgetAction method joinContent.

public String joinContent() {
    try {
        this.createValuedShowlet();
        ApsProperties config = this.getWidget().getConfig();
        this.extractContentProperties(config);
        ContentRecordVO contentVo = this.getContentVo(this.getContentId());
        if (null == contentVo || !contentVo.isOnLine()) {
            return INPUT;
        }
        List<Properties> contentProperties = this.getContentsProperties();
        Properties properties = new Properties();
        properties.put("contentId", this.getContentId());
        if (!StringUtils.isEmpty(this.getModelId())) {
            properties.put("modelId", this.getModelId());
        }
        contentProperties.add(properties);
        String newWidgetParam = RowContentListHelper.fromContentsToParameter(contentProperties);
        this.getWidget().getConfig().setProperty("contents", newWidgetParam);
    } catch (Throwable t) {
        _logger.error("Error joining content", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO) Properties(java.util.Properties) ApsProperties(com.agiletec.aps.util.ApsProperties) ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 17 with ContentRecordVO

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

the class AbstractContentSearcherDAO method createRecord.

@Override
protected ApsEntityRecord createRecord(ResultSet result) throws Throwable {
    ContentRecordVO contentVo = new ContentRecordVO();
    contentVo.setId(result.getString("contentid"));
    contentVo.setTypeCode(result.getString("contenttype"));
    contentVo.setDescr(result.getString("descr"));
    contentVo.setStatus(result.getString("status"));
    String xmlWork = result.getString("workxml");
    contentVo.setCreate(DateConverter.parseDate(result.getString("created"), this.DATE_FORMAT));
    contentVo.setModify(DateConverter.parseDate(result.getString("lastmodified"), this.DATE_FORMAT));
    String xmlOnLine = result.getString("onlinexml");
    contentVo.setOnLine(null != xmlOnLine && xmlOnLine.length() > 0);
    contentVo.setSync(xmlWork.equals(xmlOnLine));
    String mainGroupCode = result.getString("maingroup");
    contentVo.setMainGroupCode(mainGroupCode);
    contentVo.setXmlWork(xmlWork);
    contentVo.setXmlOnLine(xmlOnLine);
    contentVo.setVersion(result.getString("currentversion"));
    contentVo.setLastEditor(result.getString("lasteditor"));
    return contentVo;
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO)

Example 18 with ContentRecordVO

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

the class ContentDAO method createEntityRecord.

@Override
protected ApsEntityRecord createEntityRecord(ResultSet res) throws Throwable {
    ContentRecordVO contentVo = new ContentRecordVO();
    contentVo.setId(res.getString(1));
    contentVo.setTypeCode(res.getString(2));
    contentVo.setDescription(res.getString(3));
    contentVo.setStatus(res.getString(4));
    String xmlWork = res.getString(5);
    contentVo.setCreate(DateConverter.parseDate(res.getString(6), JacmsSystemConstants.CONTENT_METADATA_DATE_FORMAT));
    contentVo.setModify(DateConverter.parseDate(res.getString(7), JacmsSystemConstants.CONTENT_METADATA_DATE_FORMAT));
    String xmlOnLine = res.getString(8);
    contentVo.setOnLine(null != xmlOnLine && xmlOnLine.length() > 0);
    contentVo.setSync(xmlWork.equals(xmlOnLine));
    String mainGroupCode = res.getString(9);
    contentVo.setMainGroupCode(mainGroupCode);
    contentVo.setXmlWork(xmlWork);
    contentVo.setXmlOnLine(xmlOnLine);
    contentVo.setVersion(res.getString(10));
    contentVo.setFirstEditor(res.getString(11));
    contentVo.setLastEditor(res.getString(12));
    return contentVo;
}
Also used : ContentRecordVO(com.agiletec.plugins.jacms.aps.system.services.content.model.ContentRecordVO)

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