Projekt

Obecné

Profil

« Předchozí | Další » 

Revize bf76f726

Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)

use standard Maven directory structure for resources

Zobrazit rozdíly:

config/config_návrh.json
1
{
2
  //defaultn? filter
3
  "defaultFilter": {
4

  
5
    //filter podle archetyp? vrchol?
6
    "vertexArchetypeFilter": {
7
      "archetypes": [ "archetypeName1", "archetypeName2", ... ], //seznam n?zv? archetyp?
8
      "matchType": "match_type" //match type: "matching" / "non_matching"
9
    },
10

  
11
    //filter podle archetyp? hran
12
    "edgeArchetypeFilter": {
13
      //seznam trojic archetyp? (archetyp v?choz?ho vrcholu, archetyp hrany, archetype c?lov?ho vrcholu)
14
      "archetypes": [
15
        {
16
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
17
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
18
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
19
          //filtr je v?dy pro ka?dou trojici fromArchetype-edgeArchetpye-toArchetype, kter? spl?uje libovolnou z uveden?ch kombinac?
20
        },
21
        {
22
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
23
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
24
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
25
        },
26
        {
27
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
28
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
29
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
30
        },
31
        ...
32
      ],
33
      "matchType": "matchType" //match type: "matching" / "non_matching"
34
    },
35

  
36
    //filter podle atribut? vrchol?
37
    "vertexAttributeFilters": [
38
      //filter pro typ ENUM
39
      {
40
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
41
        "attributeName": "attributeName", //n?zev atributu
42
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
43
        "filter": {
44
          "values": [ "value1", "value2", ... ], //hodnoty jako string
45
          "matchType": "matchType" //match type: "any" / "none" / "exact_match"
46
        }
47
      },
48
      //filter pro typ STRING
49
      {
50
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
51
        "attributeName": "attributeName", //n?zev atributu
52
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
53
        "filter": {
54
          "value": "value", //hodnota typu string
55
          "matchType": "matchType" //match type: "exact_match" / "exact_mismatch" / "containing" / "non_containing" / "regular_expression"
56
        }
57
      },
58
      //filter pro typ NUMBER
59
      {
60
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
61
        "attributeName": "attributeName", //n?zev atributu
62
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
63
        "filter": {
64
          "min": cislo, //minim?ln? hodnota jako ??slo
65
          "max": cislo, //maxim?n? hodnota jako ??slo
66
          "minInclusive": inclusive, //info, zda min je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
67
          "maxInclusive": inclusive, //info, zda max je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
68
          "matchType": "matchType" //match type: "matching" / "non_matching"
69
        }
70
      },
71
      //filter pro typ DATE
72
      {
73
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
74
        "attributeName": "attributeName", //n?zev atributu
75
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
76
        "filter": {
77
          "min": "datum", //minim?ln? hodnota jako datum reprezentovan? ?et?zcem ve form?tu ve form?tu yyyy-MM-dd HH:mm:ss
78
          "max": "datum", //maxim?n? hodnota jako datum reprezentovan? ?et?zcem ve form?tu ve form?tu yyyy-MM-dd HH:mm:ss
79
          "minInclusive": inclusive, //info, zda min je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
80
          "maxInclusive": inclusive, //info, zda max je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
81
          "matchType": "matchType" //match type: "matching" / "non_matching"
82
        }
83
      },
84
      ...
85
    ],
86

  
87
    //filter podle atribut? hran
88
    "edgeAttributeFilters": [
89
      //stejn? jako u "vertexAttributeFilters"
90
    ]
91
  },
92
  
93
  "defaultGroupArchetypes": [ "archetypeName1", "archetypeName2", ... ], //Pole n?zv? archetyp?, kter? budou p?esunuty do skupin v postrann? li?t?
94

  
95
  //Definice archetypov?ch ikon
96
  "archetypeIcons": {
97
    //ikony identifikov?ny pomoc? jm?n
98
    "archetypeName1": 'archetype 1 svg', //hodnotou v t?to struktu?e je pot? svg k?d
99
    "archetypeName2": 'archetype 2 svg'
100
  }
101
}
config/empty_filter.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      
17
    ],
18

  
19
    "edgeAttributeFilters": [
20
      
21
    ]
22
  },
23
  
24
  "defaultGroupArchetypes": [ "File", "Commit", "RepoFile"],
25
  
26
  "archetypeIcons": [
27
    {
28
      "name" : "Person",
29
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
30
    },
31
    {
32
      "name" : "Wiki",
33
      "value" : "<text x=\"6\" y=\"7\" font-weight=\"bold\" style=\"font-family: serif !important; text-anchor: middle\">W<\/text>"
34
    },
35
    {
36
      "name" : "Commit",
37
      "value" : "<circle r=\"4\" cx=\"6\" cy=\"7.5\" fill-opacity=\"0\" stroke=\"black\" stroke-width=\"2\"\/><line x1=\"6\" y1=\"1\" x2=\"6\" y2=\"3.5\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/><line x1=\"6\" y1=\"11.5\" x2=\"6\" y2=\"14\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/>"
38
    },
39
    {
40
      "name" : "File",
41
      "value" : "<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/>"
42
    },
43
    {
44
      "name" : "RepoFile",
45
      "value" :"<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/><ellipse cx=\"5\" cy=\"7\" rx=\"3\" ry=\"1\" stroke=\"black\" fill=\"transparent\" stroke-width=\"0.5\"\/><path d=\"M 2 7 L 2 12 A 3 1 0 0 0 8 12 L 8 7\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 8.66 A 3 1 0 0 0 8 8.66\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 10.33 A 3 1 0 0 0 8 10.33\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/>"
46
    },
47
    {
48
      "name" : "Ticket",
49
      "value" : "<path d=\"M 1 0 L 3 0 A 2 1 0 0 0 9 0 L 11 0, 11 15, 9 15 A 2 1 0 0 0 3 15 L 1 15 Z\" stroke=\"black\" fill=\"none\" stroke-linejoin=\"round\"\/><line x1=\"1\" y1=\"6\" x2=\"11\" y2=\"6\" stroke=\"black\" stroke-width=\"0.5\" stroke-dasharray=\"1,1\" stroke-linecap=\"round\"\/>"
50
    },
51
    {
52
      "name" : "Change",
53
      "value" : "<polygon points=\"1,4 5,4 3,1\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"3\" y1=\"2\" x2=\"3\" y2=\"13\" stroke=\"black\"\/><polygon points=\"7,11 11,11 9,14\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"9\" y1=\"2\" x2=\"9\" y2=\"13\" stroke=\"black\"\/>"
54
    }
55
  ]
56
}
config/historical_data_config.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      
17
    ],
18

  
19
    "edgeAttributeFilters": [
20
      
21
    ]
22
  },
23
  
24
  "defaultGroupArchetypes": [],
25
  
26
  "archetypeIcons": [
27
    {
28
      "name" : "person",
29
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
30
    },
31
    {
32
      "name" : "device",
33
      "value" : "<g transform=\"scale(0.6,0.6)\"><g transform=\"translate(-2,1)\"><path id=\"gear\" fill=\"black\" stroke=\"black\" style=\"fill-rule:evenodd;clip-rule:evenodd;\" d=\"M20.869,13.476C20.948,12.994,21,12.504,21,12s-0.052-0.994-0.131-1.476l-2.463-0.259c-0.149-0.556-0.367-1.082-0.648-1.57l1.558-1.924c-0.576-0.806-1.281-1.511-2.087-2.087 l-1.924,1.558c-0.488-0.281-1.015-0.499-1.57-0.648l-0.259-2.463C12.994,3.052,12.504,3,12,3s-0.994,0.052-1.476,0.131 l-0.259,2.463C9.71,5.743,9.184,5.961,8.695,6.242L6.771,4.685C5.966,5.261,5.261,5.966,4.685,6.771l1.558,1.924 c-0.281,0.488-0.499,1.015-0.648,1.57l-2.463,0.259C3.052,11.006,3,11.496,3,12s0.052,0.994,0.131,1.476l2.463,0.259 c0.149,0.556,0.367,1.082,0.648,1.57l-1.558,1.924c0.576,0.806,1.281,1.511,2.087,2.087l1.924-1.558 c0.488,0.281,1.015,0.499,1.57,0.648l0.259,2.463C11.006,20.948,11.496,21,12,21s0.994-0.052,1.476-0.131l0.259-2.463 c0.556-0.149,1.082-0.367,1.57-0.648l1.924,1.558c0.806-0.576,1.511-1.281,2.087-2.087l-1.558-1.924 c0.281-0.488,0.499-1.015,0.648-1.57L20.869,13.476z M12,15.998c-2.209,0-3.998-1.789-3.998-3.998S9.791,8.002,12,8.002 S15.998,9.791,15.998,12S14.209,15.998,12,15.998z\"/></g></g>"
34
    },
35
    {
36
      "name" : "theory",
37
      "value" : "<g transform=\"scale(0.03,0.03)\"><g transform=\"translate(-35,0)\"><path id=\"gear\" fill=\"black\" stroke=\"black\" d=\"M394.235,151.628c0,82.449-49.695,92.044-59.021,181.956c0,8.382-6.785,15.163-15.168,15.163H165.161 c-8.379,0-15.161-6.781-15.161-15.163h-0.028c-9.299-89.912-58.994-99.507-58.994-181.956C90.978,67.878,158.855,0,242.606,0 S394.235,67.878,394.235,151.628z M318.423,363.906H166.794c-8.384,0-15.166,6.786-15.166,15.168 c0,8.378,6.782,15.163,15.166,15.163h151.628c8.378,0,15.163-6.785,15.163-15.163C333.586,370.692,326.801,363.906,318.423,363.906 z M318.423,409.396H166.794c-8.384,0-15.166,6.786-15.166,15.163c0,8.383,6.782,15.168,15.166,15.168h151.628 c8.378,0,15.163-6.785,15.163-15.168C333.586,416.182,326.801,409.396,318.423,409.396z M212.282,485.212h60.65 c16.76,0,30.322-13.562,30.322-30.326h-121.3C181.955,471.65,195.518,485.212,212.282,485.212z\"/></g></g>"
38
    }
39
  ]
40
}
config/spade_config.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ "Ticket", "Person", "Wiki", "File"],
5
      "matchType": "matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Person" ],
12
          "edgeArchetypes": [ "Authorship" ],
13
          "toArchetypes": [ "Ticket", "File" ]
14
        },
15
        {
16
          "fromArchetypes": [ "Person" ],
17
          "edgeArchetypes": [ "Assignment" ],
18
          "toArchetypes": [ "Ticket" ]
19
        },
20
        {
21
          "fromArchetypes": [ "File", "Ticket", "Wiki" ],
22
          "edgeArchetypes": [ "ItemRelation" ],
23
          "toArchetypes": [ "File", "Ticket", "Wiki" ]
24
        },
25
        {
26
          "fromArchetypes": [ "Person" ],
27
          "edgeArchetypes": [ "Modification" ],
28
          "toArchetypes": [ "Wiki" ]
29
        }
30
      ],
31
      "matchType": "matching"
32
    },
33

  
34
    "vertexAttributeFilters": [
35
      {
36
        "archetype": "Ticket",
37
        "attributeName": "Status super class",
38
        "filter": {
39
          "values": [ "OPEN" ],
40
          "matchType": "any"
41
        }
42
      },
43
      {
44
        "archetype": "Person",
45
        "attributeName": "Role super classes",
46
        "filter": {
47
          "values": [ "TEAMMEMBER" ],
48
          "matchType": "any"
49
        }
50
      }
51
    ],
52

  
53
    "edgeAttributeFilters": [
54
      {
55
        "archetype": "Modification",
56
        "attributeName": "Relation",
57
        "filter": {
58
          "values": [ "last modified by", "last modified" ],
59
          "matchType": "any"
60
        }
61
      }
62
    ]
63
  },
64
  
65
  "defaultGroupArchetypes": [ "File", "Commit", "RepoFile"],
66
  
67
  "archetypeIcons": [
68
    {
69
      "name" : "Person",
70
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
71
    },
72
    {
73
      "name" : "Wiki",
74
      "value" : "<text x=\"6\" y=\"7\" font-weight=\"bold\" style=\"font-family: serif !important; text-anchor: middle\">W<\/text>"
75
    },
76
    {
77
      "name" : "Commit",
78
      "value" : "<circle r=\"4\" cx=\"6\" cy=\"7.5\" fill-opacity=\"0\" stroke=\"black\" stroke-width=\"2\"\/><line x1=\"6\" y1=\"1\" x2=\"6\" y2=\"3.5\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/><line x1=\"6\" y1=\"11.5\" x2=\"6\" y2=\"14\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/>"
79
    },
80
    {
81
      "name" : "File",
82
      "value" : "<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/>"
83
    },
84
    {
85
      "name" : "RepoFile",
86
      "value" :"<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/><ellipse cx=\"5\" cy=\"7\" rx=\"3\" ry=\"1\" stroke=\"black\" fill=\"transparent\" stroke-width=\"0.5\"\/><path d=\"M 2 7 L 2 12 A 3 1 0 0 0 8 12 L 8 7\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 8.66 A 3 1 0 0 0 8 8.66\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 10.33 A 3 1 0 0 0 8 10.33\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/>"
87
    },
88
    {
89
      "name" : "Ticket",
90
      "value" : "<path d=\"M 1 0 L 3 0 A 2 1 0 0 0 9 0 L 11 0, 11 15, 9 15 A 2 1 0 0 0 3 15 L 1 15 Z\" stroke=\"black\" fill=\"none\" stroke-linejoin=\"round\"\/><line x1=\"1\" y1=\"6\" x2=\"11\" y2=\"6\" stroke=\"black\" stroke-width=\"0.5\" stroke-dasharray=\"1,1\" stroke-linecap=\"round\"\/>"
91
    },
92
    {
93
      "name" : "Change",
94
      "value" : "<polygon points=\"1,4 5,4 3,1\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"3\" y1=\"2\" x2=\"3\" y2=\"13\" stroke=\"black\"\/><polygon points=\"7,11 11,11 9,14\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"9\" y1=\"2\" x2=\"9\" y2=\"13\" stroke=\"black\"\/>"
95
    }
96
  ]
97
}
sources/src/main/java/cz/zcu/kiv/offscreen/configuration/ConfigurationLoader.java
1
package cz.zcu.kiv.offscreen.configuration;
2

  
3
import javax.servlet.ServletContext;
4

  
5
/**
6
 * 
7
 * @author Jindra Pavlíková <jindra.pav2@seznam.cz>
8
 */
9
public class ConfigurationLoader {
10

  
11
	private static final String PROP_CONFIG_LOCATION = "configLocation";
12

  
13
	/**
14
	 * Get configuration location property from web.xml.
15
	 *
16
	 * @param context App context.
17
	 * @return Storage location path.
18
	 */
19
	public static String getConfigLocation(ServletContext context) {
20
		return context.getInitParameter(PROP_CONFIG_LOCATION);
21
	}
22
}
sources/src/main/java/cz/zcu/kiv/offscreen/graph/loader/GraphJSONDataLoader.java
9 9
import cz.zcu.kiv.offscreen.api.AttributeDataType;
10 10
import cz.zcu.kiv.offscreen.graph.EdgeArchetypeInfo;
11 11
import cz.zcu.kiv.offscreen.graph.GraphManager;
12
import org.apache.commons.io.FileUtils;
12
import org.apache.commons.io.IOUtils;
13 13

  
14 14
import java.io.File;
15 15
import java.io.IOException;
......
26 26

  
27 27
    static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
28 28

  
29
    private File file;
30 29
    private String loadedJSON;
31 30
    private GraphManager graphManager;
32 31

  
......
37 36

  
38 37

  
39 38
    public GraphJSONDataLoader(File file) {
40
        this.file = file;
41
        loadJSON();
42
    }
43

  
44
    public GraphJSONDataLoader(String json){
45
        loadedJSON = json;
46
    }
47

  
48
    private void loadJSON() {
49 39
        try {
50
            loadedJSON = FileUtils.readFileToString(file, "UTF-8");
40
            loadedJSON = IOUtils.toString(getClass().getClassLoader().getResourceAsStream(file.getPath()), "UTF-8");
51 41
        } catch (IOException e) {
52 42
            e.printStackTrace();
53 43
        }
54 44
    }
55 45

  
46
    public GraphJSONDataLoader(String json){
47
        loadedJSON = json;
48
    }
49

  
56 50
    /**
57 51
     * Method load graph from parameters from constructor or null when data are invalid.
58 52
     *
sources/src/main/java/cz/zcu/kiv/offscreen/graph/loader/JSONConfigLoader.java
7 7
import cz.zcu.kiv.offscreen.graph.filter.*;
8 8
import net.sf.json.JSONArray;
9 9
import net.sf.json.JSONObject;
10
import org.apache.commons.io.FileUtils;
10
import org.apache.commons.io.IOUtils;
11 11

  
12 12
import java.io.File;
13 13
import java.io.IOException;
......
27 27

  
28 28
    private GraphManager graphManager;
29 29
    private JSONObject json;
30
    private File configFile;
30 31

  
31
    /**
32
     * Path to the directory with configuration file.
33
     */
34
    private String pathToConfig;
35

  
36
    public static String configFilename = "config.json";
32
    public JSONConfigLoader(GraphManager graphManager) {
33
        this(graphManager, new File("config.json"));
34
    }
37 35

  
38
    public JSONConfigLoader(GraphManager graphManager, String pathToConfig) {
36
    public JSONConfigLoader(GraphManager graphManager, File configFile) {
39 37
        this.graphManager = graphManager;
40
        this.pathToConfig = pathToConfig;
38
        this.configFile = configFile;
41 39
    }
42 40

  
43 41
    /**
......
48 46
        GraphFilter filter = new GraphFilter();
49 47

  
50 48
        try {
51
            //String filterJson = FileUtils.readFileToString(new File("D:\\aswi-git\\aswi\\config\\empty_filter.json"), "UTF-8");
52
            String filterJson = FileUtils.readFileToString(new File(pathToConfig + File.separator + configFilename), "UTF-8");
49
            String filterJson = IOUtils.toString(getClass().getClassLoader().getResourceAsStream(configFile.getPath()), "UTF-8");
53 50

  
54 51
            json = JSONObject.fromObject(filterJson);
55 52

  
sources/src/main/java/cz/zcu/kiv/offscreen/servlets/api/LoadGraphData.java
6 6
import cz.zcu.kiv.offscreen.graph.loader.DemoDiagramLoader;
7 7
import cz.zcu.kiv.offscreen.graph.loader.GraphJSONDataLoader;
8 8
import cz.zcu.kiv.offscreen.graph.loader.JSONConfigLoader;
9
import cz.zcu.kiv.offscreen.configuration.ConfigurationLoader;
10 9
import cz.zcu.kiv.offscreen.servlets.BaseServlet;
11 10
import cz.zcu.kiv.offscreen.user.DB;
12 11
import cz.zcu.kiv.offscreen.user.Diagram;
......
58 57

  
59 58
            switch (jsonType) {
60 59
                case "spade":
61
                    String configLocation = ConfigurationLoader.getConfigLocation(request.getServletContext());
62
                    rawJson = convertSpadeToRawJson(jsonToDisplay, configLocation);
60
                    rawJson = convertSpadeToRawJson(jsonToDisplay);
63 61
                    break;
64 62
                default:
65 63
                    rawJson = jsonToDisplay;
......
77 75
    /**
78 76
     * Convert input spade JSON to frontend backend JSON and return it.
79 77
     */
80
    private String convertSpadeToRawJson(String spadeJson, String configLocation){
78
    private String convertSpadeToRawJson(String spadeJson) {
81 79
        GraphManager graphManager = new GraphJSONDataLoader(spadeJson).LoadData();
82

  
83
        JSONConfigLoader configLoader = new JSONConfigLoader(graphManager, configLocation);
80
        JSONConfigLoader configLoader = new JSONConfigLoader(graphManager);
84 81

  
85 82
        Graph graph = graphManager.createGraph(configLoader);
86 83
        JSONObject json = JSONObject.fromObject(graph);
sources/src/main/resources/config/config_návrh.json
1
{
2
  //defaultn? filter
3
  "defaultFilter": {
4

  
5
    //filter podle archetyp? vrchol?
6
    "vertexArchetypeFilter": {
7
      "archetypes": [ "archetypeName1", "archetypeName2", ... ], //seznam n?zv? archetyp?
8
      "matchType": "match_type" //match type: "matching" / "non_matching"
9
    },
10

  
11
    //filter podle archetyp? hran
12
    "edgeArchetypeFilter": {
13
      //seznam trojic archetyp? (archetyp v?choz?ho vrcholu, archetyp hrany, archetype c?lov?ho vrcholu)
14
      "archetypes": [
15
        {
16
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
17
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
18
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
19
          //filtr je v?dy pro ka?dou trojici fromArchetype-edgeArchetpye-toArchetype, kter? spl?uje libovolnou z uveden?ch kombinac?
20
        },
21
        {
22
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
23
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
24
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
25
        },
26
        {
27
          "fromArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ], //seznam n?zv? archetyp? v?choz?ho vrcholu
28
          "edgeArchetypes": [ "edgeArchetypeName1", "edgeArchetypeName2", ... ], //seznam n?zv? archetyp? hrany
29
          "toArchetypes": [ "vertexArchetypeName1", "vertexArchetypeName2", ... ] //seznam n?zv? archetyp? c?lov?ho vrcholu
30
        },
31
        ...
32
      ],
33
      "matchType": "matchType" //match type: "matching" / "non_matching"
34
    },
35

  
36
    //filter podle atribut? vrchol?
37
    "vertexAttributeFilters": [
38
      //filter pro typ ENUM
39
      {
40
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
41
        "attributeName": "attributeName", //n?zev atributu
42
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
43
        "filter": {
44
          "values": [ "value1", "value2", ... ], //hodnoty jako string
45
          "matchType": "matchType" //match type: "any" / "none" / "exact_match"
46
        }
47
      },
48
      //filter pro typ STRING
49
      {
50
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
51
        "attributeName": "attributeName", //n?zev atributu
52
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
53
        "filter": {
54
          "value": "value", //hodnota typu string
55
          "matchType": "matchType" //match type: "exact_match" / "exact_mismatch" / "containing" / "non_containing" / "regular_expression"
56
        }
57
      },
58
      //filter pro typ NUMBER
59
      {
60
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
61
        "attributeName": "attributeName", //n?zev atributu
62
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
63
        "filter": {
64
          "min": cislo, //minim?ln? hodnota jako ??slo
65
          "max": cislo, //maxim?n? hodnota jako ??slo
66
          "minInclusive": inclusive, //info, zda min je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
67
          "maxInclusive": inclusive, //info, zda max je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
68
          "matchType": "matchType" //match type: "matching" / "non_matching"
69
        }
70
      },
71
      //filter pro typ DATE
72
      {
73
        "archetype": "archetypeName", //n?zev archetypu, pro kter? filtr plat?
74
        "attributeName": "attributeName", //n?zev atributu
75
        //"filter" obsahuje info o samotn?m filtru, jeho struktura z?vis? na datov?m typu dan?ho atributu, ten lze zjistit v aplikaci z na?ten?ho grafu v GraphManageru
76
        "filter": {
77
          "min": "datum", //minim?ln? hodnota jako datum reprezentovan? ?et?zcem ve form?tu ve form?tu yyyy-MM-dd HH:mm:ss
78
          "max": "datum", //maxim?n? hodnota jako datum reprezentovan? ?et?zcem ve form?tu ve form?tu yyyy-MM-dd HH:mm:ss
79
          "minInclusive": inclusive, //info, zda min je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
80
          "maxInclusive": inclusive, //info, zda max je sou??st intervalu ?i nikoliv, jako hodnota typu bool (true/false)
81
          "matchType": "matchType" //match type: "matching" / "non_matching"
82
        }
83
      },
84
      ...
85
    ],
86

  
87
    //filter podle atribut? hran
88
    "edgeAttributeFilters": [
89
      //stejn? jako u "vertexAttributeFilters"
90
    ]
91
  },
92
  
93
  "defaultGroupArchetypes": [ "archetypeName1", "archetypeName2", ... ], //Pole n?zv? archetyp?, kter? budou p?esunuty do skupin v postrann? li?t?
94

  
95
  //Definice archetypov?ch ikon
96
  "archetypeIcons": {
97
    //ikony identifikov?ny pomoc? jm?n
98
    "archetypeName1": 'archetype 1 svg', //hodnotou v t?to struktu?e je pot? svg k?d
99
    "archetypeName2": 'archetype 2 svg'
100
  }
101
}
sources/src/main/resources/config/empty_filter.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      
17
    ],
18

  
19
    "edgeAttributeFilters": [
20
      
21
    ]
22
  },
23
  
24
  "defaultGroupArchetypes": [ "File", "Commit", "RepoFile"],
25
  
26
  "archetypeIcons": [
27
    {
28
      "name" : "Person",
29
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
30
    },
31
    {
32
      "name" : "Wiki",
33
      "value" : "<text x=\"6\" y=\"7\" font-weight=\"bold\" style=\"font-family: serif !important; text-anchor: middle\">W<\/text>"
34
    },
35
    {
36
      "name" : "Commit",
37
      "value" : "<circle r=\"4\" cx=\"6\" cy=\"7.5\" fill-opacity=\"0\" stroke=\"black\" stroke-width=\"2\"\/><line x1=\"6\" y1=\"1\" x2=\"6\" y2=\"3.5\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/><line x1=\"6\" y1=\"11.5\" x2=\"6\" y2=\"14\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/>"
38
    },
39
    {
40
      "name" : "File",
41
      "value" : "<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/>"
42
    },
43
    {
44
      "name" : "RepoFile",
45
      "value" :"<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/><ellipse cx=\"5\" cy=\"7\" rx=\"3\" ry=\"1\" stroke=\"black\" fill=\"transparent\" stroke-width=\"0.5\"\/><path d=\"M 2 7 L 2 12 A 3 1 0 0 0 8 12 L 8 7\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 8.66 A 3 1 0 0 0 8 8.66\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 10.33 A 3 1 0 0 0 8 10.33\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/>"
46
    },
47
    {
48
      "name" : "Ticket",
49
      "value" : "<path d=\"M 1 0 L 3 0 A 2 1 0 0 0 9 0 L 11 0, 11 15, 9 15 A 2 1 0 0 0 3 15 L 1 15 Z\" stroke=\"black\" fill=\"none\" stroke-linejoin=\"round\"\/><line x1=\"1\" y1=\"6\" x2=\"11\" y2=\"6\" stroke=\"black\" stroke-width=\"0.5\" stroke-dasharray=\"1,1\" stroke-linecap=\"round\"\/>"
50
    },
51
    {
52
      "name" : "Change",
53
      "value" : "<polygon points=\"1,4 5,4 3,1\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"3\" y1=\"2\" x2=\"3\" y2=\"13\" stroke=\"black\"\/><polygon points=\"7,11 11,11 9,14\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"9\" y1=\"2\" x2=\"9\" y2=\"13\" stroke=\"black\"\/>"
54
    }
55
  ]
56
}
sources/src/main/resources/config/historical_data_config.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      
17
    ],
18

  
19
    "edgeAttributeFilters": [
20
      
21
    ]
22
  },
23
  
24
  "defaultGroupArchetypes": [],
25
  
26
  "archetypeIcons": [
27
    {
28
      "name" : "person",
29
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
30
    },
31
    {
32
      "name" : "device",
33
      "value" : "<g transform=\"scale(0.6,0.6)\"><g transform=\"translate(-2,1)\"><path id=\"gear\" fill=\"black\" stroke=\"black\" style=\"fill-rule:evenodd;clip-rule:evenodd;\" d=\"M20.869,13.476C20.948,12.994,21,12.504,21,12s-0.052-0.994-0.131-1.476l-2.463-0.259c-0.149-0.556-0.367-1.082-0.648-1.57l1.558-1.924c-0.576-0.806-1.281-1.511-2.087-2.087 l-1.924,1.558c-0.488-0.281-1.015-0.499-1.57-0.648l-0.259-2.463C12.994,3.052,12.504,3,12,3s-0.994,0.052-1.476,0.131 l-0.259,2.463C9.71,5.743,9.184,5.961,8.695,6.242L6.771,4.685C5.966,5.261,5.261,5.966,4.685,6.771l1.558,1.924 c-0.281,0.488-0.499,1.015-0.648,1.57l-2.463,0.259C3.052,11.006,3,11.496,3,12s0.052,0.994,0.131,1.476l2.463,0.259 c0.149,0.556,0.367,1.082,0.648,1.57l-1.558,1.924c0.576,0.806,1.281,1.511,2.087,2.087l1.924-1.558 c0.488,0.281,1.015,0.499,1.57,0.648l0.259,2.463C11.006,20.948,11.496,21,12,21s0.994-0.052,1.476-0.131l0.259-2.463 c0.556-0.149,1.082-0.367,1.57-0.648l1.924,1.558c0.806-0.576,1.511-1.281,2.087-2.087l-1.558-1.924 c0.281-0.488,0.499-1.015,0.648-1.57L20.869,13.476z M12,15.998c-2.209,0-3.998-1.789-3.998-3.998S9.791,8.002,12,8.002 S15.998,9.791,15.998,12S14.209,15.998,12,15.998z\"/></g></g>"
34
    },
35
    {
36
      "name" : "theory",
37
      "value" : "<g transform=\"scale(0.03,0.03)\"><g transform=\"translate(-35,0)\"><path id=\"gear\" fill=\"black\" stroke=\"black\" d=\"M394.235,151.628c0,82.449-49.695,92.044-59.021,181.956c0,8.382-6.785,15.163-15.168,15.163H165.161 c-8.379,0-15.161-6.781-15.161-15.163h-0.028c-9.299-89.912-58.994-99.507-58.994-181.956C90.978,67.878,158.855,0,242.606,0 S394.235,67.878,394.235,151.628z M318.423,363.906H166.794c-8.384,0-15.166,6.786-15.166,15.168 c0,8.378,6.782,15.163,15.166,15.163h151.628c8.378,0,15.163-6.785,15.163-15.163C333.586,370.692,326.801,363.906,318.423,363.906 z M318.423,409.396H166.794c-8.384,0-15.166,6.786-15.166,15.163c0,8.383,6.782,15.168,15.166,15.168h151.628 c8.378,0,15.163-6.785,15.163-15.168C333.586,416.182,326.801,409.396,318.423,409.396z M212.282,485.212h60.65 c16.76,0,30.322-13.562,30.322-30.326h-121.3C181.955,471.65,195.518,485.212,212.282,485.212z\"/></g></g>"
38
    }
39
  ]
40
}
sources/src/main/resources/config/spade_config.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ "Ticket", "Person", "Wiki", "File"],
5
      "matchType": "matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Person" ],
12
          "edgeArchetypes": [ "Authorship" ],
13
          "toArchetypes": [ "Ticket", "File" ]
14
        },
15
        {
16
          "fromArchetypes": [ "Person" ],
17
          "edgeArchetypes": [ "Assignment" ],
18
          "toArchetypes": [ "Ticket" ]
19
        },
20
        {
21
          "fromArchetypes": [ "File", "Ticket", "Wiki" ],
22
          "edgeArchetypes": [ "ItemRelation" ],
23
          "toArchetypes": [ "File", "Ticket", "Wiki" ]
24
        },
25
        {
26
          "fromArchetypes": [ "Person" ],
27
          "edgeArchetypes": [ "Modification" ],
28
          "toArchetypes": [ "Wiki" ]
29
        }
30
      ],
31
      "matchType": "matching"
32
    },
33

  
34
    "vertexAttributeFilters": [
35
      {
36
        "archetype": "Ticket",
37
        "attributeName": "Status super class",
38
        "filter": {
39
          "values": [ "OPEN" ],
40
          "matchType": "any"
41
        }
42
      },
43
      {
44
        "archetype": "Person",
45
        "attributeName": "Role super classes",
46
        "filter": {
47
          "values": [ "TEAMMEMBER" ],
48
          "matchType": "any"
49
        }
50
      }
51
    ],
52

  
53
    "edgeAttributeFilters": [
54
      {
55
        "archetype": "Modification",
56
        "attributeName": "Relation",
57
        "filter": {
58
          "values": [ "last modified by", "last modified" ],
59
          "matchType": "any"
60
        }
61
      }
62
    ]
63
  },
64
  
65
  "defaultGroupArchetypes": [ "File", "Commit", "RepoFile"],
66
  
67
  "archetypeIcons": [
68
    {
69
      "name" : "Person",
70
      "value" : "<circle r=\"3\" cx=\"6\" cy=\"3\" fill=\"black\" stroke-width=\"0\"\/><path d=\"M 1 10 A 6 4 0 0 1 11 10 L 11 15 L 1 15\" fill=\"black\" stroke-width=\"0\"\/>"
71
    },
72
    {
73
      "name" : "Wiki",
74
      "value" : "<text x=\"6\" y=\"7\" font-weight=\"bold\" style=\"font-family: serif !important; text-anchor: middle\">W<\/text>"
75
    },
76
    {
77
      "name" : "Commit",
78
      "value" : "<circle r=\"4\" cx=\"6\" cy=\"7.5\" fill-opacity=\"0\" stroke=\"black\" stroke-width=\"2\"\/><line x1=\"6\" y1=\"1\" x2=\"6\" y2=\"3.5\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/><line x1=\"6\" y1=\"11.5\" x2=\"6\" y2=\"14\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\"\/>"
79
    },
80
    {
81
      "name" : "File",
82
      "value" : "<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/>"
83
    },
84
    {
85
      "name" : "RepoFile",
86
      "value" :"<polygon points=\"0.5,0.5 7.5,0.5 11.5,4.5 11.5,14.5 0.5,14.5\" fill=\"white\" stroke=\"black\" stroke-linejoin=\"round\" \/><polygon points=\"7.5,0.5 11.5,4.5 7.5,4.5\" fill=\"gray\" stroke=\"black\" stroke-linejoin=\"round\" \/><ellipse cx=\"5\" cy=\"7\" rx=\"3\" ry=\"1\" stroke=\"black\" fill=\"transparent\" stroke-width=\"0.5\"\/><path d=\"M 2 7 L 2 12 A 3 1 0 0 0 8 12 L 8 7\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 8.66 A 3 1 0 0 0 8 8.66\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/><path d=\"M 2 10.33 A 3 1 0 0 0 8 10.33\" stroke-width=\"0.5\" stroke=\"black\" fill=\"transparent\"\/>"
87
    },
88
    {
89
      "name" : "Ticket",
90
      "value" : "<path d=\"M 1 0 L 3 0 A 2 1 0 0 0 9 0 L 11 0, 11 15, 9 15 A 2 1 0 0 0 3 15 L 1 15 Z\" stroke=\"black\" fill=\"none\" stroke-linejoin=\"round\"\/><line x1=\"1\" y1=\"6\" x2=\"11\" y2=\"6\" stroke=\"black\" stroke-width=\"0.5\" stroke-dasharray=\"1,1\" stroke-linecap=\"round\"\/>"
91
    },
92
    {
93
      "name" : "Change",
94
      "value" : "<polygon points=\"1,4 5,4 3,1\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"3\" y1=\"2\" x2=\"3\" y2=\"13\" stroke=\"black\"\/><polygon points=\"7,11 11,11 9,14\" fill=\"black\" stroke=\"black\" stroke-linejoin=\"round\" \/><line x1=\"9\" y1=\"2\" x2=\"9\" y2=\"13\" stroke=\"black\"\/>"
95
    }
96
  ]
97
}
sources/src/test/java/cz/zcu/kiv/imiger/tests/backend/GraphFilterTest.java
17 17

  
18 18
public class GraphFilterTest {
19 19

  
20
    private static String testDirectory;
21

  
22 20
    private static GraphManager graphManager;
23 21

  
24 22
    @BeforeAll
25 23
    static void initTest() {
26
        testDirectory = System.getProperty("user.dir") + "\\..\\test";
27

  
28
        File graphFile = new File(testDirectory + "\\data\\test1.json");
29

  
30
        graphManager = new GraphJSONDataLoader(graphFile).LoadData();
24
        graphManager = new GraphJSONDataLoader(new File("data/test1.json")).LoadData();
31 25
    }
32 26

  
33 27
    @Test
34 28
    void testFilter1a() {
35
        Graph graph = createGraph("test1a.json");
29
        Graph graph = createGraph("config/test1a.json");
36 30

  
37 31
        List<Integer> vertexIds = new ArrayList<>();
38 32
        vertexIds.add(32);
......
59 53

  
60 54
    @Test
61 55
    void testFilter1b() {
62
        Graph graph = createGraph("test1b.json");
56
        Graph graph = createGraph("config/test1b.json");
63 57

  
64 58
        List<Integer> vertexIds = new ArrayList<>();
65 59
        vertexIds.add(2);
......
81 75

  
82 76
    @Test
83 77
    void testFilter1c() {
84
        Graph graph = createGraph("test1c.json");
78
        Graph graph = createGraph("config/test1c.json");
85 79

  
86 80
        List<Integer> vertexIds = new ArrayList<>();
87 81
        vertexIds.add(2);
......
103 97

  
104 98
    @Test
105 99
    void testFilter1d() {
106
        Graph graph = createGraph("test1d.json");
100
        Graph graph = createGraph("config/test1d.json");
107 101

  
108 102
        List<Integer> vertexIds = new ArrayList<>();
109 103
        vertexIds.add(1);
......
125 119

  
126 120
    @Test
127 121
    void testFilter1e() {
128
        Graph graph = createGraph("test1e.json");
122
        Graph graph = createGraph("config/test1e.json");
129 123

  
130 124
        List<Integer> vertexIds = new ArrayList<>();
131 125
        vertexIds.add(1);
......
147 141

  
148 142
    @Test
149 143
    void testFilter1f() {
150
        Graph graph = createGraph("test1f.json");
144
        Graph graph = createGraph("config/test1f.json");
151 145

  
152 146
        List<Integer> vertexIds = new ArrayList<>();
153 147
        vertexIds.add(1);
......
164 158
    }
165 159

  
166 160
    private Graph createGraph(String configFilename) {
167
        String configLocation = testDirectory + "\\config";
168
        JSONConfigLoader configLoader = new JSONConfigLoader(graphManager, configLocation);
169
        JSONConfigLoader.configFilename = configFilename;
170
        return graphManager.createGraph(configLoader);
161
        return graphManager.createGraph(new JSONConfigLoader(graphManager, new File(configFilename)));
171 162
    }
172 163

  
173 164
    private SubedgeInfo createTestSubEdge(int id) {
sources/src/test/java/cz/zcu/kiv/imiger/tests/frontend/SeleniumUtil.java
14 14

  
15 15
class SeleniumUtil {
16 16

  
17
    private static final String TEST_DIRECTORY = System.getProperty("user.dir") + "\\..\\test";
17
    private static final String TEST_DIRECTORY = System.getProperty("user.dir") + "\\src\\test\\resources";
18 18

  
19 19
    /**
20 20
     * Path to the config location folder
......
71 71
     * Turn on exclude mode for vertex exclude
72 72
     */
73 73
    static void switchToExcludeMode(){
74
        browser.findElement(By.id("remove")).click();
74
        browser.findElement(By.id("exclude")).click();
75 75

  
76 76
        try {
77 77
            Thread.sleep(1000);
sources/src/test/resources/config/archetypeIconConfigTest.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [],
16

  
17
    "edgeAttributeFilters": []
18
  },
19
  
20
  "defaultGroupArchetypes": [],
21
  
22
  "archetypeIcons": [
23
	{
24
		name: "SpecifiedIcon",
25
		value: "<rect class=\"testingArchetypeIcon\" width=\"12\" height=\"15\" x=\"0\" y =\"0\" stroke=\"none\" fill=\"green\"/>"
26
	}
27
  ]
28
}
sources/src/test/resources/config/automaticGroupingConfigTest.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [],
16

  
17
    "edgeAttributeFilters": []
18
  },
19
  
20
  "defaultGroupArchetypes": ["FirstGroupArchetype"],
21
  
22
  "archetypeIcons": []
23
}
sources/src/test/resources/config/emptyConfig.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [],
16

  
17
    "edgeAttributeFilters": []
18
  },
19
  
20
  "defaultGroupArchetypes": [],
21
  
22
  "archetypeIcons": []
23
}
sources/src/test/resources/config/test1a expected result.txt
1
Vertices - ids: 32, 9, 1, 2
2
Edges 	- from: 1, to: 32, ids: 117
3
	- from: 1, to: 9, ids: 10
4
	- from: 2, to: 9, ids: 8
5
	
sources/src/test/resources/config/test1a.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [  ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Ticket" ],
12
          "edgeArchetypes": [ "Assignment" ],
13
          "toArchetypes": [ "Person" ]
14
        }
15
      ],
16
      "matchType": "non_matching"
17
    },
18

  
19
    "vertexAttributeFilters": [
20
      {
21
        "archetype": "Ticket",
22
        "attributeName": "Created",
23
        "filter": {
24
          "min": "2017-04-05 00:00:00",
25
          "max": "2017-04-12 12:00:00",
26
          "minInclusive": true,
27
          "maxInclusive": true,
28
          "matchType": "matching"
29
        }
30
      },
31
      {
32
        "archetype": "Ticket",
33
        "attributeName": "Estimate",
34
        "filter": {
35
          "min": 1.0,
36
          "max": 3.0,
37
          "minInclusive": true,
38
          "maxInclusive": false,
39
          "matchType": "non_matching"
40
        }
41
      },
42
      {
43
        "archetype": "Person",
44
        "attributeName": "Roles",
45
        "filter": {
46
          "values": [ "Team leader", "Developer" ],
47
          "matchType": "any"
48
        }
49
      }
50
    ],
51

  
52
    "edgeAttributeFilters": [
53
      {
54
        "archetype": "Authorship",
55
        "attributeName": "Relation",
56
        "filter": {
57
          "values": [ "created by" ],
58
          "matchType": "none"
59
        }
60
      }
61
    ]
62
  },
63
  
64
  "defaultGroupArchetypes": [],
65
  
66
  "archetypeIcons": []
67
}
sources/src/test/resources/config/test1b expected result.txt
1
Vertices - ids: 2, 9, 18
2
Edges 	- from: 9, to: 2, ids: 9
3
	- from: 18, to: 2, ids: 86
4
	
sources/src/test/resources/config/test1b.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ "Person", "Ticket" ],
5
      "matchType": "matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Ticket" ],
12
          "edgeArchetypes": [ "Authorship", "Modification" ],
13
          "toArchetypes": [ "Person" ]
14
        }
15
      ],
16
      "matchType": "matching"
17
    },
18

  
19
    "vertexAttributeFilters": [
20
      {
21
        "archetype": "Person",
22
        "attributeName": "Role classes",
23
        "filter": {
24
          "values": [ "DEVELOPER", "PROJECTMANAGER" ],
25
          "matchType": "exact_match"
26
        }
27
      }
28
    ],
29

  
30
    "edgeAttributeFilters": [
31
      
32
    ]
33
  },
34
  
35
  "defaultGroupArchetypes": [],
36
  
37
  "archetypeIcons": []
38
}
sources/src/test/resources/config/test1c expected result.txt
1
Vertices - ids: 2, 18, 32
2
Edges 	- from: 2, to: 18, ids: 79
3
	- from: 18, to: 2, ids: 86
4
	
sources/src/test/resources/config/test1c.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      {
17
        "archetype": "Ticket",
18
        "attributeName": "Start",
19
        "filter": {
20
          "min": "2017-04-12 00:00:00",
21
          "max": "2017-04-19 00:00:00",
22
          "minInclusive": true,
23
          "maxInclusive": false,
24
          "matchType": "non_matching"
25
        }
26
      },
27
      {
28
        "archetype": "Person",
29
        "attributeName": "Name",
30
        "filter": {
31
          "value": "Petr Mayr",
32
          "matchType": "exact_match"
33
        }
34
      }
35
    ],
36

  
37
    "edgeAttributeFilters": [
38
      
39
    ]
40
  },
41
  
42
  "defaultGroupArchetypes": [],
43
  
44
  "archetypeIcons": []
45
}
sources/src/test/resources/config/test1d expected result.txt
1
Vertices - ids: 1, 9, 32
2
Edges 	- from: 1, to: 9, ids: 10
3
	- from: 1, to: 32, ids: 117
4
	
sources/src/test/resources/config/test1d.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ "Person", "Ticket", "Change" ],
5
      "matchType": "matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Person" ],
12
          "edgeArchetypes": [ "Authorship" ],
13
          "toArchetypes": [ "Change" ]
14
        },
15
        {
16
          "fromArchetypes": [ "Person" ],
17
          "edgeArchetypes": [ "Assignment" ],
18
          "toArchetypes": [ "Ticket" ]
19
        }
20
      ],
21
      "matchType": "matching"
22
    },
23

  
24
    "vertexAttributeFilters": [
25
      {
26
        "archetype": "Ticket",
27
        "attributeName": "Spent",
28
        "filter": {
29
          "min": 1.0,
30
          "max": 2.0,
31
          "minInclusive": false,
32
          "maxInclusive": true,
33
          "matchType": "matching"
34
        }
35
      },
36
      {
37
        "archetype": "Person",
38
        "attributeName": "Name",
39
        "filter": {
40
          "value": "Petr Mayr",
41
          "matchType": "exact_mismatch"
42
        }
43
      }
44
    ],
45

  
46
    "edgeAttributeFilters": [
47
      
48
    ]
49
  },
50
  
51
  "defaultGroupArchetypes": [],
52
  
53
  "archetypeIcons": []
54
}
sources/src/test/resources/config/test1e expected result.txt
1
Vertices - ids: 1, 32, 9
2
Edges 	- from: 9, to: 1, ids: 11
3
	- from: 1, to: 32, ids: 117
4
	
sources/src/test/resources/config/test1e.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ ],
5
      "matchType": "non_matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        
11
      ],
12
      "matchType": "non_matching"
13
    },
14

  
15
    "vertexAttributeFilters": [
16
      {
17
        "archetype": "Person",
18
        "attributeName": "Name",
19
        "filter": {
20
          "value": "Jan",
21
          "matchType": "containing"
22
        }
23
      },
24
      {
25
        "archetype": "Ticket",
26
        "attributeName": "Description",
27
        "filter": {
28
          "value": "css",
29
          "matchType": "non_containing"
30
        }
31
      }
32
    ],
33

  
34
    "edgeAttributeFilters": [
35
      {
36
        "archetype": "Assignment",
37
        "attributeName": "Relation",
38
        "filter": {
39
          "values": [ "is assigned to" ],
40
          "matchType": "any"
41
        }
42
      }
43
    ]
44
  },
45
  
46
  "defaultGroupArchetypes": [],
47
  
48
  "archetypeIcons": []
49
}
sources/src/test/resources/config/test1f expected result.txt
1
Vertices - ids: 1, 2, 18
2
Edges 	- from: 18, to: 2, ids: 86
3
	
sources/src/test/resources/config/test1f.json
1
{
2
  "defaultFilter": {
3
    "vertexArchetypeFilter": {
4
      "archetypes": [ "Person", "Ticket" ],
5
      "matchType": "matching"
6
    },
7

  
8
    "edgeArchetypeFilter": {
9
      "archetypes": [
10
        {
11
          "fromArchetypes": [ "Person" ],
12
          "edgeArchetypes": [ "Modification" ],
13
          "toArchetypes": [ "Ticket" ]
14
        },
15
        {
16
          "fromArchetypes": [ "Person" ],
17
          "edgeArchetypes": [ "Modification" ],
18
          "toArchetypes": [ "Change" ]
19
        },
20
        {
21
          "fromArchetypes": [ "Change" ],
22
          "edgeArchetypes": [ "Modification" ],
23
          "toArchetypes": [ "Person" ]
24
        }
25
      ],
26
      "matchType": "non_matching"
27
    },
28

  
29
    "vertexAttributeFilters": [
30
      {
31
        "archetype": "Ticket",
32
        "attributeName": "Description",
33
        "filter": {
34
          "value": ".*css.*",
35
          "matchType": "regular_expression"
36
        }
37
      }
38
    ],
39

  
40
    "edgeAttributeFilters": [
41
      
42
    ]
43
  },
44
  
45
  "defaultGroupArchetypes": [],
46
  
47
  "archetypeIcons": []
48
}
sources/src/test/resources/data/RawArchetypeIconTest.json
1
{"attributeTypes":[],"edgeArchetypes":[{"name":"edge","text":""}],"vertexArchetypes":[{"icon":"<rect class=\"testingArchetypeIcon\" width=\"12\" height=\"15\" x=\"0\" y =\"0\" stroke=\"none\" fill=\"green\"/>","name":"SpecifiedIcon","text":""},{"icon":"","name":"UnspecifiedIcon","text":""},{"icon":"","name":"☺Smiley","text":""}],"vertices":[{"archetype":0,"attributes":[],"id":1,"text":"","name":"Vertex with specified icon","position":{"x":640.5,"y":408.25}},{"archetype":1,"attributes":[],"id":2,"text":"","name":"Vertex with unspecified icon","position":{"x":826.25,"y":536.75}},{"archetype":2,"attributes":[],"id":3,"text":"","name":"Vertex with smiley as archetype icon","position":{"x":438,"y":537.75}}],"edges":[{"subedgeInfo":[{"archetype":0,"attributes":[],"id":1}],"from":1,"to":3,"text":"","id":1},{"subedgeInfo":[{"archetype":0,"attributes":[],"id":0}],"from":1,"to":2,"text":"","id":2}],"possibleEnumValues":{},"groups":[],"sideBar":[],"highlightedVertex":"","highlightedEdge":""}
sources/src/test/resources/data/RawAssociatedArchetypeTest.json
1
{"attributeTypes":[],"edgeArchetypes":[{"name":"edge","text":""}],"vertexArchetypes":[{"icon":"","name":"1","text":""},{"icon":"","name":"2","text":""},{"icon":"","name":"3","text":""},{"icon":"","name":"4","text":""}],"vertices":[{"archetype":0,"attributes":[],"id":1,"text":"","name":"V1","position":{"x":989.5,"y":684}},{"archetype":1,"attributes":[],"id":2,"text":"","name":"V2","position":{"x":985.75,"y":871.5}},{"archetype":1,"attributes":[],"id":3,"text":"","name":"V3","position":{"x":988,"y":540}},{"archetype":3,"attributes":[],"id":4,"text":"","name":"V4","position":{"x":694,"y":678.25}},{"archetype":2,"attributes":[],"id":5,"text":"","name":"V5","position":{"x":702.75,"y":755}}],"edges":[{"subedgeInfo":[{"archetype":0,"attributes":[],"id":0}],"from":1,"to":2,"text":"","id":1},{"subedgeInfo":[{"archetype":0,"attributes":[],"id":4}],"from":4,"to":5,"text":"","id":2},{"subedgeInfo":[{"archetype":0,"attributes":[],"id":2}],"from":1,"to":4,"text":"","id":3},{"subedgeInfo":[{"archetype":0,"attributes":[],"id":1}],"from":3,"to":1,"text":"","id":4},{"subedgeInfo":[{"archetype":0,"attributes":[],"id":3}],"from":4,"to":1,"text":"","id":5}],"possibleEnumValues":{},"groups":[],"sideBar":[],"highlightedVertex":"","highlightedEdge":""}
sources/src/test/resources/data/RawDetailTest.json
1
{"attributeTypes":[{"dataType":"STRING","name":"D","text":"0"},{"dataType":"STRING","name":"C","text":"1"},{"dataType":"STRING","name":"B","text":"2"},{"dataType":"STRING","name":"A","text":"3"}],"edgeArchetypes":[{"name":"edgeArchetype1","text":""},{"name":"edgeArchetype2","text":""}],"vertexArchetypes":[{"icon":"","name":"1","text":""},{"icon":"","name":"2","text":""},{"icon":"","name":"3","text":""}],"vertices":[{"archetype":2,"attributes":[["D","E"],["B","W"],["A","Q"]],"id":1,"text":"","name":"V1","position":{"x":753.25,"y":693.75}},{"archetype":1,"attributes":[["D","E"],["C","Q"],["B","W"]],"id":2,"text":"","name":"V2","position":{"x":534.25,"y":897.5}},{"archetype":0,"attributes":[["D","Q"],["C","W"],["A","E"]],"id":3,"text":"","name":"V3","position":{"x":961.25,"y":899.75}}],"edges":[{"subedgeInfo":[{"archetype":0,"attributes":[["D","E"],["C","W"]],"id":3}],"from":1,"to":3,"text":"","id":1},{"subedgeInfo":[{"archetype":0,"attributes":[["D","E"],["B","W"],["A","Q"]],"id":1},{"archetype":1,"attributes":[["D","D"],["B","S"],["A","A"]],"id":2}],"from":1,"to":2,"text":"","id":2},{"subedgeInfo":[{"archetype":1,"attributes":[["C","T"],["B","R"]],"id":4}],"from":3,"to":1,"text":"","id":3}],"possibleEnumValues":{},"groups":[],"sideBar":[],"highlightedVertex":"","highlightedEdge":""}
sources/src/test/resources/data/automaticGroupingTest.json
1
{
2
 "attributeTypes": [
3

  
4
 ],
5
 "vertexArchetypes": [
6
  {
7
   "name": "FirstGroupArchetype",
8
   "text": ""
9
  },
10
  {
11
   "name": "NonGroupArchetype",
12
   "text": ""
13
  }
14
 ],
15
 "edgeArchetypes": [
16
	{
17
		"name": "edge",
18
		"text": ""
19
	}
20
 ],
21
 "vertices": [
22
  {
23
   "archetype": 0,
24
   "attributes": {},
25
   "id": 1,
26
   "text": "",
27
   "title": "First vertex from first group"
28
  },
29
  {
30
   "archetype": 1,
31
   "attributes": {},
32
   "id": 2,
33
   "text": "",
34
   "title": "Non group vertex"
35
  },
36
  {
37
   "archetype": 0,
38
   "attributes": {},
39
   "id": 3,
40
   "text": "",
41
   "title": "Second vertex from first group"
42
  },  
43
   {
44
   "archetype": 1,
45
   "attributes": {},
46
   "id": 4,
47
   "text": "",
48
   "title": "Non group vertex"
49
  },
50
  {
51
   "archetype": 1,
52
   "attributes": {},
53
   "id": 5,
54
   "text": "",
55
   "title": "Non group vertex"
56
  }
57
 ],
58
 "edges": [
59
	{
60
	   "archetype": 0,
61
	   "from": 1,
62
	   "attributes": {},
63
	   "id": 0,
64
	   "to": 2,
65
	   "text": ""
66
	},
67
	{
68
	   "archetype": 0,
... Rozdílový soubor je zkrácen, protože jeho délka přesahuje max. limit.

Také k dispozici: Unified diff