Package org.wso2.carbon.user.core.claim

Examples of org.wso2.carbon.user.core.claim.Claim


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


        try {
            claimManager = IdentityClaimManager.getInstance();
            claims = claimManager.getAllSupportedClaims(IdentityConstants.INFOCARD_DIALECT,IdentityTenantUtil
                            .getRealm(null, userIdentifier));
            for (int i = 0; i < claims.length; i++) {
                Claim temp = claims[i];
                supportedClaims.put(temp.getClaimUri(), temp);
            }           
            Claim tenant = new Claim();
            tenant.setClaimUri(IdentityConstants.CLAIM_TENANT_DOMAIN);
            tenant.setDescription("Tenant");
            tenant.setDisplayTag("Tenant");
            tenant.setSupportedByDefault(true);
            tenant.setDialectURI("http://wso2.org");
            supportedClaims.put(tenant.getClaimUri(), tenant);
        } catch (IdentityException e) {
            log.error("Error while loading claims", e);
            throw new IdentityProviderException("Error while loading claims", e);
        }
    }
View Full Code Here

        try {
            claimManager = IdentityClaimManager.getInstance();
            claims = claimManager.getAllSupportedClaims(IdentityConstants.OPENID_AX_DIALECT,
                    IdentityTenantUtil.getRealm(null,getUserIdentifier()));
            for (int i = 0; i < claims.length; i++) {
                Claim temp = claims[i];
                supportedClaims.put(temp.getClaimUri(), temp);
            }

            Claim openid = new Claim();
            openid.setClaimUri(IdentityConstants.CLAIM_OPENID);
            openid.setDisplayTag("OpenID");
            openid.setDescription("OpenID");
            supportedClaims.put(IdentityConstants.CLAIM_OPENID, openid);

        } catch (IdentityException e) {
            log.error("Error while loading claims", e);
            throw new IdentityProviderException("Error while loading claims", e);
View Full Code Here

                String profile = profileNames[i];
                Map<String, String> valueMap = ur.getUserClaimValues(username, claimUris, profile);
                ArrayList<UserFieldDTO> userFields = new ArrayList<UserFieldDTO>();
                for (int j = 0; j < claims.length; j++) {
                    UserFieldDTO data = new UserFieldDTO();
                    Claim claim = claims[j];
                    String claimUri = claim.getClaimUri();
                    if (!UserCoreConstants.PROFILE_CONFIGURATION.equals(claimUri)) {
                        data.setClaimUri(claimUri);
                        data.setFieldValue(valueMap.get(claimUri));
                        data.setDisplayName(claim.getDisplayTag());
                        data.setRegEx(claim.getRegEx());
                        data.setRequired(claim.isRequired());
                        data.setDisplayOrder(claim.getDisplayOrder());
                        userFields.add(data);
                    }
                }

                UserProfileDTO temp = new UserProfileDTO();
View Full Code Here

                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());
                datas[j] = data;
            }

        } catch (Exception e) {
            // Not logging. Already logged.
View Full Code Here

            Map<String, String> valueMap = ur.getUserClaimValues(username, claimUris, profileName);
            ArrayList<UserFieldDTO> userFields = new ArrayList<UserFieldDTO>();

            for (int j = 0; j < claims.length; j++) {
                UserFieldDTO data = new UserFieldDTO();
                Claim claim = claims[j];
                String claimUri = claim.getClaimUri();
                if (!UserCoreConstants.PROFILE_CONFIGURATION.equals(claimUri)) {
                    data.setClaimUri(claimUri);
                    data.setFieldValue(valueMap.get(claimUri));
                    data.setDisplayName(claim.getDisplayTag());
                    data.setRegEx(claim.getRegEx());
                    data.setRequired(claim.isRequired());
                    data.setDisplayOrder(claim.getDisplayOrder());
                    userFields.add(data);
                }
            }

            profile.setProfileName(profileName);
View Full Code Here

        try {
            claimManager = IdentityClaimManager.getInstance();
            claims = claimManager.getAllSupportedClaims(UserCoreConstants.DEFAULT_CARBON_DIALECT,
                    IdentityTenantUtil.getRealm(null, userIdentifier));
            for (int i = 0; i < claims.length; i++) {
                Claim temp = claims[i];
                supportedClaims.put(temp.getClaimUri(), temp);
            }
        } catch (IdentityException e) {
            log.error("Error while loading claims", e);
            throw new IdentityProviderException("Error while loading claims", e);
        }
View Full Code Here

     *
     * @param URI
     * @return
     */
    public String getDisplayName(String URI) {
        Claim claim = null;

        if (log.isDebugEnabled()) {
            log.debug("");
        }

        claim = supportedClaims.get(URI);
        if (claim != null) {
            if (IdentityConstants.CLAIM_PPID.equals(claim.getClaimUri())) {
                return IdentityConstants.PPID_DISPLAY_VALUE;
            }
            return claim.getDisplayTag();
        }
        return null;
    }
View Full Code Here

        Map<String, String> values = this.getUserClaimValues(userName, claims, profileName);
        Claim[] finalValues = new Claim[values.size()];
        int i = 0;
        for (Iterator<Map.Entry<String, String>> ite = values.entrySet().iterator(); ite.hasNext();) {
            Map.Entry<String, String> entry = ite.next();
            Claim claim = new Claim();
            claim.setValue(entry.getValue());
            claim.setClaimUri(entry.getKey());
            String displayTag;
            try {
                displayTag = claimManager.getClaim(entry.getKey()).getDisplayTag();
            } catch (org.wso2.carbon.user.api.UserStoreException e) {
                throw new UserStoreException(e);
            }
            claim.setDisplayTag(displayTag);
            finalValues[i] = claim;
            i++;
        }
        return finalValues;
    }
View Full Code Here

    // "
    protected void addClaimMapping(Connection dbConnection, ClaimMapping claimMapping)
            throws UserStoreException {
        PreparedStatement prepStmt = null;
        try {
            Claim claim = claimMapping.getClaim();
            int dialectId = getDialect(dbConnection, claim.getDialectURI());
            if (dialectId == -1) {
                dialectId = addDialect(dbConnection, claim.getDialectURI());
            }
            short isSupported = 0;
            if (claim.isSupportedByDefault()) {
                isSupported = 1;
            }
            ;
            short isRequired = 0;
            if (claim.isRequired()) {
                isRequired = 1;
            }
            ;
            prepStmt = dbConnection.prepareStatement(ClaimDBConstants.ADD_CLAIM_SQL);
            prepStmt.setInt(1, dialectId);
            prepStmt.setString(2, claim.getClaimUri());
            prepStmt.setString(3, claim.getDisplayTag());
            prepStmt.setString(4, claim.getDescription());
            prepStmt.setString(5, claimMapping.getMappedAttribute());
            prepStmt.setString(6, claim.getRegEx());
            prepStmt.setShort(7, isSupported);
            prepStmt.setShort(8, isRequired);
            prepStmt.setInt(9, claim.getDisplayOrder());
            prepStmt.setInt(10, tenantId);
            prepStmt.executeUpdate();
            prepStmt.close();
        } catch (SQLException e) {
            log.error("Database Error - " + e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.wso2.carbon.user.core.claim.Claim

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.