Mercurial > hg > ismi-richfaces
comparison src/main/java/de/mpiwg/itgroup/ismi/utils/templates/CodexTemplate.java @ 1:2e911857a759
(none)
author | jurzua |
---|---|
date | Wed, 29 Oct 2014 14:00:28 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:74df02964906 | 1:2e911857a759 |
---|---|
1 package de.mpiwg.itgroup.ismi.utils.templates; | |
2 | |
3 import java.util.List; | |
4 | |
5 import org.mpi.openmind.cache.WrapperService; | |
6 import org.mpi.openmind.repository.bo.Attribute; | |
7 import org.mpi.openmind.repository.bo.Entity; | |
8 | |
9 public class CodexTemplate { | |
10 | |
11 public Long id; | |
12 public String ov; | |
13 public String identifier; | |
14 public String mpiwgId; | |
15 public String indexmetaFolder; | |
16 public String collection; | |
17 public String repository; | |
18 public String city; | |
19 public String country; | |
20 | |
21 public CodexTemplate(Entity entity, WrapperService om) { | |
22 this.id = entity.getId(); | |
23 this.ov = entity.getOwnValue(); | |
24 | |
25 Attribute tmp = om.getAttributeByName(entity.getId(), "identifier"); | |
26 this.identifier = (tmp != null) ? tmp.getValue() : null; | |
27 | |
28 tmp = om.getAttributeByName(entity.getId(), "mpiwg_id"); | |
29 this.mpiwgId = (tmp != null) ? tmp.getValue() : null; | |
30 | |
31 tmp = om.getAttributeByName(entity.getId(), "indexmeta_folder"); | |
32 this.indexmetaFolder = (tmp != null) ? tmp.getValue() : null; | |
33 | |
34 List<Entity> list = om.getTargetsForSourceRelation(entity.getId(), "is_part_of", "COLLECTION", 1); | |
35 if(list.size() > 0){ | |
36 this.collection = list.get(0).getOwnValue(); | |
37 list = om.getTargetsForSourceRelation(list.get(0).getId(), "is_part_of", "REPOSITORY", 1); | |
38 if(list.size() > 0){ | |
39 this.repository = list.get(0).getOwnValue(); | |
40 list = om.getTargetsForSourceRelation(list.get(0).getId(), "is_in", "PLACE", 1); | |
41 if(list.size() > 0){ | |
42 this.city = list.get(0).getOwnValue(); | |
43 list = om.getTargetsForSourceRelation(list.get(0).getId(), "is_part_of", "PLACE", 1); | |
44 if(list.size() > 0){ | |
45 this.country = list.get(0).getOwnValue(); | |
46 } | |
47 } | |
48 } | |
49 } | |
50 } | |
51 | |
52 public Long getId(){ | |
53 return this.id; | |
54 } | |
55 | |
56 public String getOv(){ | |
57 return this.ov; | |
58 } | |
59 | |
60 public String getIdentifier() { | |
61 return identifier; | |
62 } | |
63 | |
64 public String getCollection() { | |
65 return collection; | |
66 } | |
67 | |
68 public String getRepository() { | |
69 return repository; | |
70 } | |
71 | |
72 public String getCity() { | |
73 return city; | |
74 } | |
75 | |
76 public String getCountry() { | |
77 return country; | |
78 } | |
79 | |
80 | |
81 } |