Package com.sparc.knappsack.models.reports

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


        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);
View Full Code Here


        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);
View Full Code Here

        return data;
    }

    private void addOrganizationNodes(Node rootNode, List<Node> nodes, List<Link> links, List<Organization> organizations) {
        for (Organization organization : organizations) {
            Node node = new Node();
            node.setType("organization");
            node.setId(Long.toString(organization.getId()));
            node.setUuid(organization.getUuid());
            node.setMatch(Float.toString(generator.nextFloat() * 1.0f));
            node.setName(organization.getName());
            node.setPopularity(Long.toString(organization.getGroups().size()));
            nodes.add(node);

            addGroupNodes(nodes, links, organization);

            Link link = new Link();
View Full Code Here

    }

    private void addGroupNodes(List<Node> nodes, List<Link> links, Organization organization) {
        List<Group> groups = organization.getGroups();
        for (Group group : groups) {
            Node groupNode = new Node();
            groupNode.setType("group");
            groupNode.setId(Long.toString(group.getId()));
            groupNode.setUuid(group.getUuid());
            groupNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
            groupNode.setName(group.getName());
            groupNode.setPopularity(Long.toString(group.getOwnedApplications().size()));
            nodes.add(groupNode);

            addApplicationNodes(nodes, links, group);

            Link link = new Link();
View Full Code Here

    }

    private void addApplicationNodes(List<Node> nodes, List<Link> links, Group group) {
        List<Application> applications = group.getOwnedApplications();
        for (Application application : applications) {
            Node appNode = new Node();
            appNode.setType("application");
            appNode.setId(Long.toString(application.getId()));
            appNode.setUuid(application.getUuid());
            appNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
            appNode.setName(application.getName());
            appNode.setPopularity(Long.toString(application.getApplicationVersions().size()));
            nodes.add(appNode);

            addApplicationVersionNodes(nodes, links, application);

            Link link = new Link();
View Full Code Here

    }

    private void addApplicationVersionNodes(List<Node> nodes, List<Link> links, Application application) {
        List<ApplicationVersion> appVersions = application.getApplicationVersions();
        for (ApplicationVersion appVersion : appVersions) {
            Node appVersionNode = new Node();
            appVersionNode.setType("applicationVersion");
            appVersionNode.setId(Long.toString(appVersion.getId()));
            appVersionNode.setUuid(appVersion.getUuid());
            appVersionNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
            appVersionNode.setName(appVersion.getVersionName());
            appVersionNode.setPopularity(Integer.toString(generator.nextInt() * 10));
            nodes.add(appVersionNode);

            Link link = new Link();
            link.setSource(appVersion.getUuid());
            link.setTarget(application.getUuid());
View Full Code Here

TOP

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

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.