Package eu.scape_project.planning.model.kbrowser

Examples of eu.scape_project.planning.model.kbrowser.CriteriaHierarchy


        rootNode.setName("rootNode");
        rootNode.addChild(subNode);
        rootNode.addChild(leaf3);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);

        CriteriaHierarchyExporter criteriaHierarchyExporter = new CriteriaHierarchyExporter();
        String exportedXml = criteriaHierarchyExporter.exportToFreemindXml(cHierarchy);

        String expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
View Full Code Here


        rootNode.setName("rootNode");
        rootNode.addChild(subNode);
        rootNode.addChild(leaf3);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);

        CriteriaHierarchyExporter criteriaHierarchyExporter = new CriteriaHierarchyExporter();
        String exportedXml = criteriaHierarchyExporter.exportToFreemindXml(cHierarchy);

        String expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
View Full Code Here

        CriteriaNode rootNode = new CriteriaNode();
        rootNode.setName("rootNode");
        rootNode.addChild(leaf1);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);

        CriteriaHierarchyExporter criteriaHierarchyExporter = new CriteriaHierarchyExporter();
        String exportedXml = criteriaHierarchyExporter.exportToFreemindXml(cHierarchy);

        String expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
View Full Code Here

    /**
     * Delete the user selected hierarchy.
     */
    public void deleteCriteriaHierarchy(int hierarchyId) throws PlanningException {
        CriteriaHierarchy criteriaHierarchy = em.find(CriteriaHierarchy.class, hierarchyId);

        if (criteriaHierarchy == null) {
            log.error("Could not find criteria hiearachy [{}].", hierarchyId);
            throw new PlanningException("Could not find criteria hiearachy [" + hierarchyId + "]");
        }
View Full Code Here

     *            the name of the new criteria hierarchy
     * @return the new criteria hierarchy
     */
    public CriteriaHierarchy createCriteriaHierarchy(String name) {
        // Create a new hierarchy with a new root tree node and persist it.
        CriteriaHierarchy hierarchy = new CriteriaHierarchy();
        hierarchy.setName(name);

        // Assign relevant data to criteria root node.
        CriteriaNode rootNode = new CriteriaNode(planSelection.getSelectedPlans().size());
        rootNode.setName(name);
        rootNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());

        hierarchy.setCriteriaTreeRoot(rootNode);
        em.persist(hierarchy);

        log.debug("Created CriteriaHierarchy with name [{}].", name);

        init();
View Full Code Here

     * @param file
     *            FreeMind file to import the criteria hierarchy from.
     * @return true if the import was successful. False otherwise.
     */
    public boolean importCriteriaHierarchyFromFreemind(DigitalObject file) {
        CriteriaHierarchy criteriaHierarchy = null;

        try {
            InputStream is = new ByteArrayInputStream(file.getData().getData());
            criteriaHierarchy = treeLoader.loadFreeMindCriteriaHierarchy(is, criteriaManager);
        } catch (Exception e) {
View Full Code Here

     *
     * @param criteriaManager Class used to map CriteriaLeaves to correct criterion.
     * @return CriteriaHierarchy represented by this MindMap
     */
    public CriteriaHierarchy getRepresentingCriteriaHierarchy(CriteriaManager criteriaManager) {
      CriteriaHierarchy criteriaHierarchy = new CriteriaHierarchy();
      criteriaHierarchy.setName(root.getTEXT());
      criteriaHierarchy.setCriteriaTreeRoot((CriteriaNode) root.createCriteriaTreeNode(criteriaManager));

      return criteriaHierarchy;
    }
View Full Code Here

     * @return
     */
    public CriteriaHierarchy loadFreeMindCriteriaHierarchy(InputStream in, CriteriaManager criteriaManager) {
        MindMap map = loadFreeMindMap(in);
        if (map != null) {
            CriteriaHierarchy criteriaHierarchy = map.getRepresentingCriteriaHierarchy(criteriaManager);
            return criteriaHierarchy;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.kbrowser.CriteriaHierarchy

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.