Package com.sparc.knappsack.models.reports

Examples of com.sparc.knappsack.models.reports.DirectedGraph


    @Autowired(required = true)
    private OrganizationService organizationService;

    public DirectedGraph createGraphForOrganization(Long organizationId) {
        DirectedGraph data = new DirectedGraph();

        List<Node> nodes = new ArrayList<Node>();
        List<Link> links = new ArrayList<Link>();
        Organization organization = organizationService.get(organizationId);

        Node rootNode = new Node();
        rootNode.setType("organization");
        rootNode.setId(Long.toString(organizationId));
        rootNode.setUuid(organization.getUuid());
        rootNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
        rootNode.setName(organization.getName());
        rootNode.setPopularity(Long.toString(organization.getUserDomains().size()));
        nodes.add(rootNode);

        addGroupNodes(nodes, links, organization);

        data.setNodes(nodes);
        data.setLinks(links);

        return data;
    }
View Full Code Here


        return data;
    }

    public DirectedGraph createGraphForAllAdministeredOrganizations() {
        DirectedGraph data = new DirectedGraph();

        List<Node> nodes = new ArrayList<Node>();
        List<Link> links = new ArrayList<Link>();
        List<Organization> organizations = userService.getAdministeredOrganizations(userService.getUserFromSecurityContext(), SortOrder.ASCENDING);

        Node rootNode = new Node();
        rootNode.setType("root");
        rootNode.setId("0");
        rootNode.setUuid(UUID.randomUUID().toString());
        rootNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
        rootNode.setName("Root Node");
        rootNode.setPopularity(Long.toString(organizations.size()));
        nodes.add(rootNode);

        addOrganizationNodes(rootNode, nodes, links, organizations);

        data.setNodes(nodes);
        data.setLinks(links);

        return data;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.reports.DirectedGraph

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.