Search in sources :

Example 1 with JAXBUserProfile

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

the class ApiUserProfileInterface method getUserProfile.

public JAXBUserProfile getUserProfile(Properties properties) throws ApiException, Throwable {
    JAXBUserProfile jaxbUserProfile = null;
    try {
        String username = properties.getProperty("username");
        IUserProfile userProfile = this.getUserProfileManager().getProfile(username);
        if (null == userProfile) {
            throw new ApiException(IApiErrorCodes.API_PARAMETER_VALIDATION_ERROR, "Profile of user '" + username + "' does not exist", Response.Status.CONFLICT);
        }
        jaxbUserProfile = new JAXBUserProfile(userProfile, null);
    } catch (ApiException ae) {
        throw ae;
    } catch (Throwable t) {
        _logger.error("Error extracting user profile", t);
        // ApsSystemUtils.logThrowable(t, this, "getUserProfile");
        throw new ApsSystemException("Error extracting user profile", t);
    }
    return jaxbUserProfile;
}
Also used : JAXBUserProfile(org.entando.entando.aps.system.services.userprofile.api.model.JAXBUserProfile) IUserProfile(org.entando.entando.aps.system.services.userprofile.model.IUserProfile) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException) ApiException(org.entando.entando.aps.system.services.api.model.ApiException)

Aggregations

ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)1 JAXBUserProfile (org.entando.entando.aps.system.services.userprofile.api.model.JAXBUserProfile)1 IUserProfile (org.entando.entando.aps.system.services.userprofile.model.IUserProfile)1