use of org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModel in project entando-core by entando.
the class DataObjectModelCacheWrapper method initCache.
@Override
public void initCache(IDataObjectModelDAO dataObjectModelDAO) throws ApsSystemException {
try {
Cache cache = this.getCache();
this.releaseCachedObjects(cache);
Map<String, DataObjectModel> modelsMap = this.getModelsMap(dataObjectModelDAO);
super.insertObjectsOnCache(cache, modelsMap);
} catch (Throwable t) {
logger.error("Error bootstrapping data object models map cache", t);
throw new ApsSystemException("Error bootstrapping data object models map cache", t);
}
}
use of org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModel in project entando-core by entando.
the class TestDataObjectDispenser method testGetRenderedContent_4.
public void testGetRenderedContent_4() throws Throwable {
String dataobjectId = "ART120";
String dataobjectShapeModel = "title (Text): testo=$data.Titolo.getText()";
int modelId = 1972;
try {
this.addNewDataObjectModel(modelId, dataobjectShapeModel, "ART");
RequestContext reqCtx = this.getRequestContext();
this.setUserOnSession("admin");
DataObjectRenderizationInfo outputInfo = this._dataObjectDispenser.getRenderizationInfo(dataobjectId, modelId, "en", reqCtx);
assertEquals("title (Text): testo=Title of Administrator's Content", outputInfo.getRenderedDataobject());
DataObjectModel model = this._dataObjectModelManager.getDataObjectModel(modelId);
String newContentShapeModel = "title: testo=$data.Titolo.getText()";
model.setShape(newContentShapeModel);
this._dataObjectModelManager.updateDataObjectModel(model);
this.waitNotifyingThread();
outputInfo = this._dataObjectDispenser.getRenderizationInfo(dataobjectId, modelId, "en", reqCtx);
assertEquals("title: testo=Title of Administrator's Content", outputInfo.getRenderedDataobject());
} catch (Throwable t) {
throw t;
} finally {
DataObjectModel model = this._dataObjectModelManager.getDataObjectModel(modelId);
if (null != model) {
this._dataObjectModelManager.removeDataObjectModel(model);
}
}
}
use of org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModel in project entando-core by entando.
the class TestDataObjectDispenser method addNewDataObjectModel.
public void addNewDataObjectModel(int id, String shape, String dataTypeCode) throws Throwable {
DataObjectModel model = new DataObjectModel();
model.setDataType(dataTypeCode);
model.setDescription("test");
model.setId(id);
model.setShape(shape);
this._dataObjectModelManager.addDataObjectModel(model);
}
use of org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModel in project entando-core by entando.
the class DataObjectModelAction method checkModelId.
private void checkModelId() {
if (null == this.getModelId()) {
return;
}
DataObjectModel dummyModel = this.getDataObjectModelManager().getDataObjectModel(this.getModelId());
if (dummyModel != null) {
this.addFieldError("modelId", this.getText("error.dataObjectModel.modelId.alreadyPresent"));
}
SmallDataType utilizer = this.getDataObjectModelManager().getDefaultUtilizer(this.getModelId());
if (null != utilizer && !utilizer.getCode().equals(this.getDataType())) {
String[] args = { this.getModelId().toString(), utilizer.getDescr() };
this.addFieldError("modelId", this.getText("error.dataObjectModel.modelId.wrongUtilizer", args));
}
}
use of org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModel in project entando-core by entando.
the class DataObjectModelAction method edit.
public String edit() {
this.setStrutsAction(ApsAdminSystemConstants.EDIT);
try {
long modelId = this.getModelId().longValue();
DataObjectModel model = this.getDataObjectModelManager().getDataObjectModel(modelId);
this.setFormValues(model);
} catch (Throwable t) {
_logger.error("error in edit", t);
// ApsSystemUtils.logThrowable(t, this, "edit");
return FAILURE;
}
return SUCCESS;
}
Aggregations