* @throws AlfrescoException
* @throws APIException
*/
public UserProfile fetchUserProfile(Alfresco alfresco)
{
UserProfileBuilder userProfile = new UserProfileBuilder();
try
{
Person currentUser = alfresco.getCurrentUser();
userProfile.setEmail(currentUser.getEmail()).setFirstName(currentUser.getFirstName()).setLastName(currentUser.getLastName()).setUsername(currentUser.getId());
}
catch (JsonParseException e)
{
throw new AlfrescoException(e.getMessage(), e);
}
catch (JsonMappingException e)
{
throw new AlfrescoException(e.getMessage(), e);
}
catch (IOException e)
{
throw new AlfrescoException(e.getMessage(), e);
}
return userProfile.build();
}