Examples of AssociationTreeBean


Examples of org.wso2.carbon.registry.relations.beans.AssociationTreeBean

    private static final Log log = LogFactory.getLog(AssociationTreeBeanPopulator.class);
    private static List paths;

    public static AssociationTreeBean populate(UserRegistry userRegistry, String resourcePath, String associationType) {
        paths = new ArrayList();
        AssociationTreeBean associationTreeBean = new AssociationTreeBean();
        associationTreeBean.setResourcePath(resourcePath);
        associationTreeBean.setAssoType(associationType);
        associationTreeBean.setAssoIndex(0);

        try {
            List fatherAsso = provideChildAssociations(resourcePath, associationType, userRegistry);
            if (fatherAsso != null) {
                Iterator ifatherAssofaterAsso = fatherAsso.iterator();

                while (ifatherAssofaterAsso.hasNext()) {
                    Association asso = (Association) ifatherAssofaterAsso.next();
                    associationTreeBean.setAssociationTree(associationTreeBean.getAssociationTree() +
                            createAssociationTree(
                                    asso, associationTreeBean, userRegistry));

                }
            }

            String [] pathArray = new String [paths.size()];
            for(int i=0; i<paths.size(); i++) {
                pathArray[i] = (String) paths.get(i);
            }
            associationTreeBean.setTreeCache(pathArray);
        } catch (RegistryException e) {
            String msg = "Failed to generate association tree of the resource " +
                    resourcePath + ". " + e.getMessage();
            log.error(msg, e);
            associationTreeBean.setErrorMessage(msg);
        }

        return associationTreeBean;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.relations.stub.beans.xsd.AssociationTreeBean

    }

    public AssociationTreeBean getAssociationTree(HttpServletRequest request) throws Exception {
        String path = request.getParameter("path");
        String type = request.getParameter("type");
        AssociationTreeBean bean = null;

        try{
             bean = stub.getAssociationTree(path, type);
        } catch(Exception e) {
            String msg = "Failed to get association tree. " +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.