Java Code Examples for org.wso2.carbon.user.core.UserRealm#getProfileConfigurationManager()

The following examples show how to use org.wso2.carbon.user.core.UserRealm#getProfileConfigurationManager() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfileConfigurationManagerService.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
private ProfileConfigurationManager getProfileConfigurationManager() throws UserStoreException {
    try {
        UserRealm realm = super.getUserRealm();
        if (realm == null) {
            throw new UserStoreException(NULL_REALM_MESSAGE);
        }
        return realm.getProfileConfigurationManager();
    } catch (Exception e) {
        throw new UserStoreException(e);
    }
}
 
Example 2
Source File: UserProfileAdmin.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
public UserProfileDTO getProfileFieldsForInternalStore() throws UserProfileException {
    UserFieldDTO[] datas;
    UserProfileDTO profile = new UserProfileDTO();
    String[] availableProfileConfigurations = new String[0];
    try {
        UserRealm realm = getUserRealm();
        Claim[] claims = getClaimsToEnterData(realm);

        ProfileConfigurationManager profileAdmin = realm
                .getProfileConfigurationManager();
        if (profileAdmin != null) {
            availableProfileConfigurations = getAvailableProfileConfiguration(profileAdmin);
        }

        String[] claimUris = new String[claims.length];
        for (int i = 0; i < claims.length; i++) {
            claimUris[i] = claims[i].getClaimUri();
        }
        datas = new UserFieldDTO[claims.length];
        for (int j = 0; j < claims.length; j++) {
            UserFieldDTO data = new UserFieldDTO();
            Claim claim = claims[j];
            String claimUri = claim.getClaimUri();
            data.setClaimUri(claimUri);
            data.setDisplayName(claim.getDisplayTag());
            data.setRegEx(claim.getRegEx());
            data.setRequired(claim.isRequired());
            data.setDisplayOrder(claim.getDisplayOrder());
            data.setRegEx(claim.getRegEx());
            data.setCheckedAttribute(claim.isCheckedAttribute());
            data.setReadOnly(claim.isReadOnly());
            datas[j] = data;
        }

    } catch (Exception e) {
        // Not logging. Already logged.
        throw new UserProfileException(e.getMessage(), e);
    }

    profile.setFieldValues(datas);
    profile.setProfileConfigurations(availableProfileConfigurations);

    return profile;
}
 
Example 3
Source File: UserProfileAdmin.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
public UserProfileDTO getProfileFieldsForInternalStore() throws UserProfileException {
    UserFieldDTO[] datas;
    UserProfileDTO profile = new UserProfileDTO();
    String[] availableProfileConfigurations = new String[0];
    try {
        UserRealm realm = getUserRealm();
        Claim[] claims = getClaimsToEnterData(realm);

        ProfileConfigurationManager profileAdmin = realm
                .getProfileConfigurationManager();
        if (profileAdmin != null) {
            availableProfileConfigurations = getAvailableProfileConfiguration(profileAdmin);
        }

        String[] claimUris = new String[claims.length];
        for (int i = 0; i < claims.length; i++) {
            claimUris[i] = claims[i].getClaimUri();
        }
        datas = new UserFieldDTO[claims.length];
        for (int j = 0; j < claims.length; j++) {
            UserFieldDTO data = new UserFieldDTO();
            Claim claim = claims[j];
            String claimUri = claim.getClaimUri();
            data.setClaimUri(claimUri);
            data.setDisplayName(claim.getDisplayTag());
            data.setRegEx(claim.getRegEx());
            data.setRequired(claim.isRequired());
            data.setDisplayOrder(claim.getDisplayOrder());
            data.setRegEx(claim.getRegEx());
            data.setCheckedAttribute(claim.isCheckedAttribute());
            data.setReadOnly(claim.isReadOnly());
            datas[j] = data;
        }

    } catch (Exception e) {
        // Not logging. Already logged.
        throw new UserProfileException(e.getMessage(), e);
    }

    profile.setFieldValues(datas);
    profile.setProfileConfigurations(availableProfileConfigurations);

    return profile;
}