Search in sources :

Example 1 with JAXBUserProfileType

use of org.entando.entando.aps.system.services.userprofile.api.model.JAXBUserProfileType in project entando-core by entando.

the class ApiUserProfileTypeInterface method getUserProfileType.

public JAXBUserProfileType getUserProfileType(Properties properties) throws ApiException, Throwable {
    JAXBUserProfileType jaxbProfileType = null;
    try {
        String typeCode = properties.getProperty("typeCode");
        IApsEntity masterProfileType = this.getUserProfileManager().getEntityPrototype(typeCode);
        if (null == masterProfileType) {
            throw new ApiException(IApiErrorCodes.API_VALIDATION_ERROR, "User Profile type with code '" + typeCode + "' does not exist");
        }
        jaxbProfileType = new JAXBUserProfileType(masterProfileType);
    } catch (ApiException ae) {
        throw ae;
    } catch (Throwable t) {
        _logger.error("Error extracting user profile type", t);
        // ApsSystemUtils.logThrowable(t, this, "getProfileType");
        throw new ApsSystemException("Error extracting user profile type", t);
    }
    return jaxbProfileType;
}
Also used : JAXBUserProfileType(org.entando.entando.aps.system.services.userprofile.api.model.JAXBUserProfileType) IApsEntity(com.agiletec.aps.system.common.entity.model.IApsEntity) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException) ApiException(org.entando.entando.aps.system.services.api.model.ApiException)

Aggregations

IApsEntity (com.agiletec.aps.system.common.entity.model.IApsEntity)1 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)1 JAXBUserProfileType (org.entando.entando.aps.system.services.userprofile.api.model.JAXBUserProfileType)1