Examples of JsGraph


Examples of org.dspace.app.cris.network.dto.JsGraph

            Integer maxlevel, boolean showExternal, Integer modeEntity, boolean showSameDept, String dept) throws Exception {

        if (level <= maxlevel) {

            log.debug(" Building researcher node: " + authority);
            JsGraph rsGraph = plugin.search(authority, fullName, level, showExternal, showSameDept, dept, modeEntity);
           
            graph.add(rsGraph);
            if(authority!=null && !authority.isEmpty()) {
                cacheID.add(authority);
            }
            else {
                cacheID.add(fullName);
            }
            log.debug(" End build researcher node: " + rsGraph.getId());

            for (JsGraphAdjacence adjacence : rsGraph.getAdjacencies()) {

                log.debug(" Prepare to building researcher node from edge: from "
                        + rsGraph.getId());
                       
                String split[] = adjacence.getSrc().split("\\|\\|\\|");
               
                String displayValue = "";
                String authorityValue = null;
               
                if (split.length > 1)
                {
                    displayValue = split[1];
                }
                                    
                if (split.length > 2)
                {
                    authorityValue = split[2];           
                }
               
                if (!cacheID.contains(adjacence.getNodeTo())) {
                    buildGraph(service, authorityValue, displayValue, plugin,
                        graph, level + 1, maxlevel, showExternal, ConstantNetwork.ENTITY_RP, showSameDept, dept);
                }
                else {
                    log.debug(" Skip researcher node: has just build, node with label "
                            + adjacence.getNodeTo());
                }

            }

        } else {
            log.debug(" Build leaf node, researcher " + authority);                    
            JsGraph nodeLeaf = new JsGraph();
            nodeLeaf.setName(fullName);
            JsGraphNodeData dataNodeLeaf = new JsGraphNodeData();
            if(authority==null) {
                nodeLeaf.setId(fullName);  
                dataNodeLeaf.setModeStyle("stroke");
            }
            else {
                nodeLeaf.setId(authority);
                dataNodeLeaf.setModeStyle("fill");
            }                      
            dataNodeLeaf.setColor(plugin.getNodeCustomColor());                       
            dataNodeLeaf.setType(plugin.getType());        
            nodeLeaf.setData(dataNodeLeaf);
            log.debug(" End build leaf node, internal researcher "
                    + authority);
            graph.add(nodeLeaf);
        }
View Full Code Here

Examples of org.dspace.app.cris.network.dto.JsGraph

        if (level <= maxlevel)
        {

            log.debug(" Building researcher node: " + authority);
            JsGraph rsGraph = plugin
                    .search(authority, fullName, level, showExternal,
                            showSameDept, dept, ConstantNetwork.ENTITY_RP);

            graph.add(rsGraph);
            cacheID.add(authority);
            log.debug(" End build researcher node: " + rsGraph.getId());

            for (JsGraphAdjacence adjacence : rsGraph.getAdjacencies())
            {

                log.debug(" Prepare to building researcher node from edge: from "
                        + rsGraph.getId());

                String split[] = adjacence.getSrc().split("\\|\\|\\|");

                String displayValue = "";
                String authorityValue = null;

                if (split.length > 1)
                {
                    String[] splitAuthority = split[1].split(AVisualizationGraph.splitterAuthority);
                   
                    displayValue = splitAuthority[0];
                   
                    if (splitAuthority.length > 1)
                    {
                   
                        authorityValue = splitAuthority[1];
                   
                    }                                                                              
                   
                }      

                if (!cacheID.contains(adjacence.getNodeTo()))
                {
                    buildGraph(service, authorityValue, displayValue, plugin,
                            graph, level + 1, maxlevel, showExternal, showSameDept, dept);
                }
                else
                {
                    log.debug(" Skip researcher node: has just build, node with label "
                            + adjacence.getNodeTo());
                }

            }

        }
        else
        {
            log.debug(" Build leaf node, researcher " + authority);
            JsGraph nodeLeaf = new JsGraph();
            nodeLeaf.setName(fullName);
            JsGraphNodeData dataNodeLeaf = new JsGraphNodeData();
            if (authority == null)
            {
                nodeLeaf.setId(fullName);
                dataNodeLeaf.setModeStyle("stroke");
            }
            else
            {
                nodeLeaf.setId(authority);
                dataNodeLeaf.setModeStyle("fill");
            }
            dataNodeLeaf.setColor(plugin.getNodeCustomColor());           
            dataNodeLeaf.setType(plugin.getType());
            nodeLeaf.setData(dataNodeLeaf);
            log.debug(" End build leaf node, internal researcher " + authority);
            graph.add(nodeLeaf);
        }

    }
View Full Code Here

Examples of org.dspace.app.cris.network.dto.JsGraph

        QueryResponse rsp = service.search(solrQuery);

        FacetField facets = rsp.getFacetField(FACET_SEARCH);

        JsGraph rsGraph = null;
        String src = null;
        if (authority != null && !authority.isEmpty())
        {
            src = authority;
            rsGraph = new JsGraph();
            rsGraph.setId(authority);
            rsGraph.setName(name);
            JsGraphNodeData dataNode = new JsGraphNodeData();
            dataNode.setColor(getNodeCustomColor());
            dataNode.setType(getType());
            dataNode.setModeStyle("fill");
            rsGraph.setData(dataNode);

        }
        else
        {
            src = name;
            rsGraph = new JsGraph();
            rsGraph.setId(name);
            rsGraph.setName(name);
            JsGraphNodeData dataNodeLeaf = new JsGraphNodeData();
            dataNodeLeaf.setColor(getNodeLeafCustomColor());           
            dataNodeLeaf.setType(getType());
            dataNodeLeaf.setModeStyle("stroke");
            rsGraph.setData(dataNodeLeaf);

        }
        if (rsGraph != null)
        {
            if (facets != null && facets.getValueCount() > 0)
            {
                for (Count facet : facets.getValues())
                {
                    if (facet.getCount() > 0)
                    {

                        String node2 = (String) facet.getName();
                        String split[] = node2.split("\\|\\|\\|");

                        String srcnode2 = null;
                        String displayValue = "";
                        String authorityValue = null;
                        boolean isAuthority = false;
                       
                        if (split.length > 1)
                        {
                            String[] splitAuthority = split[1].split(splitterAuthority);
                           
                            displayValue = splitAuthority[0];
                            srcnode2 = displayValue;
                            if (splitAuthority.length > 1)
                            {
                                isAuthority = true;
                                authorityValue = splitAuthority[1];
                                srcnode2 = authorityValue;
                            }                                                                              
                           
                        }              
                        else if (split.length == 1)
                        {
                            displayValue = split[0];
                            srcnode2 = displayValue;
                        }

                        if (!(src.equals(srcnode2)))
                        {
                            JsGraphAdjacence adjacence = new JsGraphAdjacence();
                            JsGraphData data = new JsGraphData();

                            adjacence.setSrc(node2);

                            if (isAuthority)
                            {
                                adjacence.setNodeTo(authorityValue);
                            }
                            else
                            {
                                adjacence.setNodeTo(displayValue);
                            }

                            if (authorityValue != null || showExternal)
                            {
                                data.setColor(getEdgeCustomColor());
                                data.setLineWidth(getCustomLineWidth((int) facet
                                        .getCount()));
                                data.setCount((int) facet.getCount());
                                data.setType(getType());
                                adjacence.setData(data);

                                rsGraph.getAdjacencies().add(adjacence);

                            }
                        }
                    }
                }
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.