Package org.wso2.carbon.user.core.profile

Examples of org.wso2.carbon.user.core.profile.ProfileConfiguration


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        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

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        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

            String profileConfigName = null;
            Iterator<OMElement> profileIter = null;
            List<String> hidden = null;
            List<String> overridden = null;
            List<String> inherited = null;
            ProfileConfiguration profileConfiguration = null;

            profileConfigName = profileElem.getAttribute(
                    new QName(ATTR_PROFILE_CONFIG_NAME)).getAttributeValue();
            dialectName = profileElem.getAttribute(new QName(ATTR_DIALECT_URI))
                    .getAttributeValue();
            profileIter = profileElem.getChildrenWithLocalName(LOCAL_NAME_CLAIM);

            hidden = new ArrayList<String>();
            overridden = new ArrayList<String>();
            inherited = new ArrayList<String>();

            while (profileIter.hasNext()) {
                OMElement claimElem = null;
                String claimURI = null;
                String behavior = null;

                claimElem = profileIter.next();
                claimURI = claimElem.getFirstChildWithName(
                        new QName(LOCAL_NAME_CLAIM_URI)).getText();
                behavior = claimElem.getFirstChildWithName(
                        new QName(LOCAL_NAME_CLAIM_BEHAVIOR)).getText();
                if (behavior.equals(UserCoreConstants.CLAIM_HIDDEN)) {
                    hidden.add(claimURI);
                } else if (behavior.equals(UserCoreConstants.CLAIM_OVERRIDEN)) {
                    overridden.add(claimURI);
                } else {
                    inherited.add(claimURI);
                }
            }
            profileConfiguration = new ProfileConfiguration(profileConfigName, hidden, overridden,
                    inherited);
            profileConfiguration.setDialectName(dialectName);
            profileConfigs.put(profileConfigName, profileConfiguration);

        }
       
        try {
View Full Code Here

            while (rs.next()) {
                String claimUri = rs.getString(1);
                String profileName = rs.getString(2);
                short behavior = rs.getShort(3);
                String dialectUri = rs.getString(4);
                ProfileConfiguration profConfig = map.get(profileName);
                if (profConfig == null) {
                    profConfig = new ProfileConfiguration();
                    map.put(profileName, profConfig);
                }
                profConfig.setDialectName(dialectUri);
                profConfig.setProfileName(profileName);
                if (behavior == UserCoreConstants.BEHAVIOUR_HIDDEN) {
                    profConfig.addHiddenClaim(claimUri);
                } else if (behavior == UserCoreConstants.BEHAVIOUR_INHERITED) {
                    profConfig.addInheritedClaim(claimUri);
                } else if (behavior == UserCoreConstants.BEHAVIOUR_OVERRIDDEN) {
                    profConfig.addOverriddenClaim(claimUri);
                } else {
                    assert (false);
                }
            }
        } catch (SQLException e) {
View Full Code Here

            property = claimManager.getAttributeName(claim);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            throw new UserStoreException(e);
        }

        ProfileConfiguration profileConfig;
        try {
            profileConfig =
                    (ProfileConfiguration) profileManager.getProfileConfig(profileConfiguration);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            throw new UserStoreException(e);
        }
        if (profileConfig != null) {
            List<String> hidden = getMappingAttributeList(profileConfig.getHiddenClaims());
            if (hidden.contains(property)) {
                return null;
            }
        }

        String value = this.getUserPropertyValues(userName, new String[] { property }, profileName)
                .get(property);
        if ((value == null || value.trim().length() == 0)
                && !UserCoreConstants.DEFAULT_PROFILE.equals(profileName) && profileConfig != null) {
            List<String> overridden = getMappingAttributeList(profileConfig.getOverriddenClaims());
            if (!overridden.contains(property)) {
                value = this.getUserPropertyValues(userName, new String[] { property },
                        UserCoreConstants.DEFAULT_PROFILE).get(property);
            }
        }
View Full Code Here

        profileConfigurationName = uerProperties.get(UserCoreConstants.PROFILE_CONFIGURATION);
        if (profileConfigurationName == null) {
            profileConfigurationName = UserCoreConstants.DEFAULT_PROFILE_CONFIGURATION;
        }

        ProfileConfiguration profileConfig;
        try {
            profileConfig = (ProfileConfiguration) profileManager.getProfileConfig(profileConfigurationName);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            throw new UserStoreException(e);
        }

        List<String> hidden = null;
        if (profileConfig != null) {
            hidden = getMappingAttributeList(profileConfig.getHiddenClaims());
        }

        List<String> overridden = null;
        if (profileConfig != null) {
            overridden = getMappingAttributeList(profileConfig.getOverriddenClaims());
        }

        List<String> getAgain = new ArrayList<String>();
        Map<String, String> finalValues = new HashMap<String, String>();
View Full Code Here

    }

    public static Map<String, ProfileConfiguration> getProfileTestData() {
        Map<String, ProfileConfiguration> map = new HashMap<String, ProfileConfiguration>();
        ProfileConfiguration profConfig = new ProfileConfiguration();
        profConfig.setProfileName(HOME_PROFILE_NAME);
        profConfig.addHiddenClaim(CLAIM_URI1);
        profConfig.addInheritedClaim(CLAIM_URI2);
        profConfig.setDialectName("http://wso2.org/claims");
        map.put(HOME_PROFILE_NAME, profConfig);
        return map;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.user.core.profile.ProfileConfiguration

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.