Search in sources :

Example 41 with DataObject

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

the class ApiDataObjectTypeInterface method checkNewEntityType.

@Override
protected void checkNewEntityType(JAXBEntityType jaxbEntityType, IApsEntity newEntityType, StringApiResponse response) throws ApiException, Throwable {
    JAXBDataObjectType jaxbDataObjectType = (JAXBDataObjectType) jaxbEntityType;
    DataObject dataType = (DataObject) newEntityType;
    boolean defaultModelCheck = this.checkDataObjectModel(jaxbDataObjectType.getDefaultModelId(), dataType, response);
    if (defaultModelCheck) {
        dataType.setDefaultModel(String.valueOf(jaxbDataObjectType.getDefaultModelId()));
    }
    boolean listModelCheck = this.checkDataObjectModel(jaxbDataObjectType.getListModelId(), dataType, response);
    if (listModelCheck) {
        dataType.setListModel(String.valueOf(jaxbDataObjectType.getListModelId()));
    }
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) JAXBDataObjectType(org.entando.entando.aps.system.services.dataobject.api.model.JAXBDataObjectType)

Example 42 with DataObject

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

the class BaseDataListHelper method getFilter.

@Override
public EntitySearchFilter getFilter(String dataTypeType, IEntityFilterBean bean, String langCode) {
    BaseFilterUtils dom = new BaseFilterUtils();
    DataObject contentPrototype = this.getDataObjectManager().createDataObject(dataTypeType);
    if (null == contentPrototype) {
        return null;
    }
    return dom.getFilter(contentPrototype, bean, langCode);
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) BaseFilterUtils(com.agiletec.aps.system.common.entity.helper.BaseFilterUtils)

Example 43 with DataObject

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

the class DataObjectHandler method endCreated.

private void endCreated() {
    StringBuffer textBuffer = this.getTextBuffer();
    if (null != textBuffer) {
        Date date = DateConverter.parseDate(textBuffer.toString(), SystemConstants.DATA_TYPE_METADATA_DATE_FORMAT);
        ((DataObject) this.getCurrentEntity()).setCreated(date);
    }
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) Date(java.util.Date)

Example 44 with DataObject

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

the class DataTypeDOM method createEntityType.

@Override
protected IApsEntity createEntityType(Element contentElem, Class entityClass) throws ApsSystemException {
    DataObject dataObject = (DataObject) super.createEntityType(contentElem, entityClass);
    dataObject.setId(null);
    String viewPage = this.extractXmlAttribute(contentElem, "viewpage", true);
    if (!viewPage.equals(NULL_VALUE)) {
        dataObject.setViewPage(viewPage);
    }
    String listModel = this.extractXmlAttribute(contentElem, "listmodel", true);
    if (!listModel.equals(NULL_VALUE)) {
        dataObject.setListModel(listModel);
    }
    String defaultModel = this.extractXmlAttribute(contentElem, "defaultmodel", true);
    if (!defaultModel.equals(NULL_VALUE)) {
        dataObject.setDefaultModel(defaultModel);
    }
    dataObject.setStatus(DataObject.STATUS_NEW);
    return dataObject;
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject)

Example 45 with DataObject

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

the class DataTypeDOM method createRootTypeElement.

@Override
protected Element createRootTypeElement(IApsEntity currentEntityType) {
    Element typeElement = super.createRootTypeElement(currentEntityType);
    DataObject dataObject = (DataObject) currentEntityType;
    this.setXmlAttribute(typeElement, "viewpage", dataObject.getViewPage());
    this.setXmlAttribute(typeElement, "listmodel", dataObject.getListModel());
    this.setXmlAttribute(typeElement, "defaultmodel", dataObject.getDefaultModel());
    return typeElement;
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) Element(org.jdom.Element)

Aggregations

DataObject (org.entando.entando.aps.system.services.dataobject.model.DataObject)72 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)10 UserDetails (com.agiletec.aps.system.services.user.UserDetails)9 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)7 JAXBDataObject (org.entando.entando.aps.system.services.dataobject.api.model.JAXBDataObject)7 Test (org.junit.Test)7 TextAttribute (com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)6 ArrayList (java.util.ArrayList)5 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)4 ITextAttribute (com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute)4 MonoTextAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoTextAttribute)4 Category (com.agiletec.aps.system.services.category.Category)4 Date (java.util.Date)4 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)3 FieldError (com.agiletec.aps.system.common.entity.model.FieldError)3 DateAttribute (com.agiletec.aps.system.common.entity.model.attribute.DateAttribute)3 MonoListAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute)3 Group (com.agiletec.aps.system.services.group.Group)3 StringApiResponse (org.entando.entando.aps.system.services.api.model.StringApiResponse)3 IDataObjectManager (org.entando.entando.aps.system.services.dataobject.IDataObjectManager)3