Search in sources :

Example 1 with DataObjectRecordVO

use of org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO in project entando-core by entando.

the class DataObjectManager method loadDataObject.

@Override
public DataObject loadDataObject(String id, boolean onLine, boolean cacheable) throws ApsSystemException {
    DataObject dataobject = null;
    try {
        DataObjectRecordVO dataobjectVo = this.loadDataObjectVO(id);
        dataobject = this.createDataObject(dataobjectVo, onLine);
    } catch (ApsSystemException e) {
        logger.error("Error while loading dataobject : id {}", id, e);
        throw new ApsSystemException("Error while loading dataobject : id " + id, e);
    }
    return dataobject;
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) DataObjectRecordVO(org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException)

Example 2 with DataObjectRecordVO

use of org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO in project entando-core by entando.

the class TestDataObjectDAO method addDataObject.

private void addDataObject(DataObject mockDataObject) throws ApsSystemException {
    _dataObjectDao.addEntity(mockDataObject);
    DataObjectRecordVO dataObjectRecord = (DataObjectRecordVO) this._dataObjectDao.loadEntityRecord(mockDataObject.getId());
    assertEquals(mockDataObject.getDescription(), dataObjectRecord.getDescription());
    assertEquals(mockDataObject.getStatus(), dataObjectRecord.getStatus());
    assertTrue(dataObjectRecord.isOnLine());
}
Also used : DataObjectRecordVO(org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO)

Example 3 with DataObjectRecordVO

use of org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO in project entando-core by entando.

the class TestDataObjectDAO method insertOnLineDataObject.

private void insertOnLineDataObject(DataObject mockDataObject) throws ApsSystemException {
    this._dataObjectDao.insertDataObject(mockDataObject);
    DataObjectRecordVO dataObjectRecord = (DataObjectRecordVO) this._dataObjectDao.loadEntityRecord(mockDataObject.getId());
    assertTrue(dataObjectRecord.isOnLine());
}
Also used : DataObjectRecordVO(org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO)

Example 4 with DataObjectRecordVO

use of org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO in project entando-core by entando.

the class TestDataObjectEntityManager method verifyOrder.

private void verifyOrder(List<ApsEntityRecord> dataObjects, String[] order) {
    for (int i = 0; i < dataObjects.size(); i++) {
        DataObjectRecordVO vo = (DataObjectRecordVO) dataObjects.get(i);
        assertEquals(order[i], vo.getId());
    }
}
Also used : DataObjectRecordVO(org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO)

Example 5 with DataObjectRecordVO

use of org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO in project entando-core by entando.

the class AbstractDataObjectSearcherDAO method createRecord.

@Override
protected ApsEntityRecord createRecord(ResultSet result) throws Throwable {
    DataObjectRecordVO contentVo = new DataObjectRecordVO();
    contentVo.setId(result.getString("dataid"));
    contentVo.setTypeCode(result.getString("datatype"));
    contentVo.setDescription(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 : DataObjectRecordVO(org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO)

Aggregations

DataObjectRecordVO (org.entando.entando.aps.system.services.dataobject.model.DataObjectRecordVO)10 DataObject (org.entando.entando.aps.system.services.dataobject.model.DataObject)2 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1