Search in sources :

Example 1 with UserProfileRecord

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

the class UserProfileDAO method createEntityRecord.

@Override
protected ApsEntityRecord createEntityRecord(ResultSet res) throws Throwable {
    UserProfileRecord profile = new UserProfileRecord();
    profile.setId(res.getString("username"));
    profile.setTypeCode(res.getString("profiletype"));
    profile.setXml(res.getString("profilexml"));
    profile.setPublicProfile(res.getInt("publicprofile") == 1);
    return profile;
}
Also used : UserProfileRecord(org.entando.entando.aps.system.services.userprofile.model.UserProfileRecord)

Example 2 with UserProfileRecord

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

the class UserProfileManager method getProfile.

@Override
@CachePut(value = ICacheInfoManager.DEFAULT_CACHE_NAME, key = "'UserProfile_'.concat(#username)")
@CacheableInfo(groups = "'UserProfileTypes_cacheGroup'")
public IUserProfile getProfile(String username) throws ApsSystemException {
    IUserProfile profile = null;
    try {
        UserProfileRecord profileVO = (UserProfileRecord) this.getProfileDAO().loadEntityRecord(username);
        if (profileVO != null) {
            profile = (IUserProfile) this.createEntityFromXml(profileVO.getTypeCode(), profileVO.getXml());
            profile.setPublicProfile(profileVO.isPublicProfile());
        }
    } catch (Throwable t) {
        logger.error("Error loading profile. user: {} ", username, t);
        throw new ApsSystemException("Error loading profile", t);
    }
    return profile;
}
Also used : UserProfileRecord(org.entando.entando.aps.system.services.userprofile.model.UserProfileRecord) IUserProfile(org.entando.entando.aps.system.services.userprofile.model.IUserProfile) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException) CacheableInfo(org.entando.entando.aps.system.services.cache.CacheableInfo) CachePut(org.springframework.cache.annotation.CachePut)

Example 3 with UserProfileRecord

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

the class UserProfileSearcherDAO method createRecord.

@Override
protected ApsEntityRecord createRecord(ResultSet result) throws Throwable {
    UserProfileRecord record = new UserProfileRecord();
    record.setId(result.getString("username"));
    record.setXml(result.getString("profilexml"));
    record.setTypeCode(result.getString("profiletype"));
    record.setPublicProfile(result.getInt("publicprofile") == 1);
    return record;
}
Also used : UserProfileRecord(org.entando.entando.aps.system.services.userprofile.model.UserProfileRecord)

Aggregations

UserProfileRecord (org.entando.entando.aps.system.services.userprofile.model.UserProfileRecord)3 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1 CacheableInfo (org.entando.entando.aps.system.services.cache.CacheableInfo)1 IUserProfile (org.entando.entando.aps.system.services.userprofile.model.IUserProfile)1 CachePut (org.springframework.cache.annotation.CachePut)1