use of com.agiletec.aps.system.common.entity.IEntityManager in project entando-core by entando.
the class TestEntityManagersAction method executeEditAttribute.
private String executeEditAttribute(String username, String attributeName, String entityTypeCode, String entityManagerName) throws Throwable {
this.setUserOnSession(username);
this.initAction("/do/Entity/Attribute", "editAttribute");
this.addParameter("attributeName", attributeName);
IEntityManager entityManager = (IEntityManager) this.getApplicationContext().getBean(entityManagerName);
IApsEntity entityType = entityManager.getEntityPrototype(entityTypeCode);
this.getRequest().getSession().setAttribute(IEntityTypeConfigAction.ENTITY_TYPE_ON_EDIT_SESSION_PARAM, entityType);
return this.executeAction();
}
use of com.agiletec.aps.system.common.entity.IEntityManager in project entando-core by entando.
the class AbstractApsEntityFinderAction method getSearchResult.
@Override
public List<String> getSearchResult() {
List<String> result = null;
try {
IEntityManager entityManager = this.getEntityManager();
result = entityManager.searchId(this.getFilters());
} catch (Throwable t) {
_logger.error("Error while searching entity Ids", t);
throw new RuntimeException("Error while searching entity Ids", t);
}
return result;
}
use of com.agiletec.aps.system.common.entity.IEntityManager in project entando-core by entando.
the class AbstractApsEntityFinderAction method getEntity.
protected IApsEntity getEntity(String entityId) {
IApsEntity entity = null;
try {
IEntityManager entityManager = this.getEntityManager();
entity = entityManager.getEntity(entityId);
} catch (Throwable t) {
_logger.error("Error while extracting entity", t);
throw new RuntimeException("Error while extracting entity", t);
}
return entity;
}
use of com.agiletec.aps.system.common.entity.IEntityManager in project entando-core by entando.
the class EntityTypeConfigAction method getAttributeTypes.
public List<AttributeInterface> getAttributeTypes() {
List<AttributeInterface> attributes = null;
try {
IEntityManager entityManager = this.getEntityManager();
Map<String, AttributeInterface> attributeTypes = entityManager.getEntityAttributePrototypes();
attributes = new ArrayList<AttributeInterface>(attributeTypes.values());
Collections.sort(attributes, new BeanComparator("type"));
} catch (Throwable t) {
_logger.error("Error while extracting attribute Types", t);
// ApsSystemUtils.logThrowable(t, this, "getAttributeTypes");
throw new RuntimeException("Error while extracting attribute Types", t);
}
return attributes;
}
use of com.agiletec.aps.system.common.entity.IEntityManager in project entando-core by entando.
the class EntityInfoTag method getMasterObject.
@Override
protected Object getMasterObject(String keyValue) throws Throwable {
String managerNameValue = (String) super.findValue(this.getEntityManagerName(), String.class);
try {
IEntityManager entityManager = (IEntityManager) ApsWebApplicationUtils.getBean(managerNameValue, this.pageContext);
if (null != entityManager) {
return entityManager.getEntity(keyValue);
}
} catch (Throwable t) {
String message = "Error extracting entity : key '" + keyValue + "' - entity manager '" + managerNameValue + "'";
_logger.error("Error extracting entity : key '{}' - entity manager '{}'", keyValue, managerNameValue, t);
// ApsSystemUtils.logThrowable(t, this, "getMasterObject", message);
throw new ApsSystemException(message, t);
}
_logger.debug("Null entity manager : service name '{}'", managerNameValue);
return null;
}
Aggregations