Mercurial > hg > ismi-richfaces
comparison src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/CodexDynamicPage.java @ 1:2e911857a759
(none)
author | jurzua |
---|---|
date | Wed, 29 Oct 2014 14:00:28 +0000 |
parents | |
children | 0d0a3b757981 |
comparison
equal
deleted
inserted
replaced
0:74df02964906 | 1:2e911857a759 |
---|---|
1 package de.mpiwg.itgroup.ismi.publicView.pages; | |
2 | |
3 import java.util.ArrayList; | |
4 import java.util.Collections; | |
5 import java.util.List; | |
6 | |
7 import org.mpi.openmind.repository.bo.Entity; | |
8 | |
9 import de.mpiwg.itgroup.ismi.utils.templates.WitnessTemplate; | |
10 | |
11 public class CodexDynamicPage extends JSPDynamicPage{ | |
12 | |
13 private List<WitnessTemplate> witnessList; | |
14 private List<WitnessTemplate> unknownList; | |
15 private Integer startPage; | |
16 private Boolean imageFullscreen; | |
17 | |
18 @Override | |
19 public void load(Long codexId){ | |
20 super.load(codexId); | |
21 | |
22 witnessList = new ArrayList<WitnessTemplate>(); | |
23 unknownList = new ArrayList<WitnessTemplate>(); | |
24 | |
25 //loading the digitalization object | |
26 List<Entity> list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_digitalization_of", "DIGITALIZATION", 1); | |
27 this.digi = (list0.size() == 0) ? null : list0.get(0); | |
28 | |
29 //loading the witnesses | |
30 list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_part_of", "WITNESS", -1); | |
31 for(Entity witness : list0){ | |
32 WitnessTemplate tmp = new WitnessTemplate(witness, getWrapper(), true); | |
33 this.witnessList.add(tmp); | |
34 if(tmp.isUnknown()){ | |
35 this.unknownList.add(tmp); | |
36 } | |
37 } | |
38 Collections.sort(this.witnessList); | |
39 Collections.sort(this.unknownList); | |
40 } | |
41 | |
42 public void init(){ | |
43 this.startPage = 0; | |
44 this.imageFullscreen = false; | |
45 try { | |
46 | |
47 this.load(Long.parseLong(getRequest().getParameter("eid"))); | |
48 | |
49 try { | |
50 this.startPage = Integer.parseInt(getRequest().getParameter("startPage")); | |
51 this.imageFullscreen = | |
52 (getRequest().getParameter("imgFullscreen") != null) ? Boolean.parseBoolean(getRequest().getParameter("imgFullscreen")) : false; | |
53 } catch (Exception e) { | |
54 // TODO: handle exception | |
55 } | |
56 | |
57 } catch (Exception e) { | |
58 e.printStackTrace(); | |
59 } | |
60 } | |
61 | |
62 public Integer getStartPage() { | |
63 return startPage; | |
64 } | |
65 | |
66 public Boolean getImageFullscreen() { | |
67 return imageFullscreen; | |
68 } | |
69 | |
70 public List<WitnessTemplate> getWitnessList() { | |
71 return witnessList; | |
72 } | |
73 | |
74 public void setWitnessList(List<WitnessTemplate> witnessList) { | |
75 this.witnessList = witnessList; | |
76 } | |
77 | |
78 public List<WitnessTemplate> getUnknownList() { | |
79 return unknownList; | |
80 } | |
81 | |
82 public void setUnknownList(List<WitnessTemplate> unknownList) { | |
83 this.unknownList = unknownList; | |
84 } | |
85 | |
86 } |