Mercurial > hg > ismi-richfaces
annotate src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java @ 176:c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 08 Jun 2018 15:32:27 +0200 |
parents | 3d8b31508128 |
children | af1018d06443 |
rev | line source |
---|---|
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 package de.mpiwg.itgroup.ismi.merge; |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
4 import java.util.ArrayList; |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
5 import java.util.HashMap; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
6 import java.util.List; |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
7 import java.util.Map; |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 import javax.faces.event.ActionEvent; |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 import org.apache.log4j.Logger; |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
12 import org.mpi.openmind.repository.bo.Attribute; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
13 import org.mpi.openmind.repository.bo.Entity; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
14 import org.mpi.openmind.repository.bo.Relation; |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 |
168
e9ab943ec528
new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
165
diff
changeset
|
16 import de.mpiwg.itgroup.ismi.browse.EntityRepositoryBean; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
17 import de.mpiwg.itgroup.ismi.browse.FullEntityRepositoryBean; |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; |
175
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
19 import de.mpiwg.itgroup.ismi.entry.utils.PrivacityUtils; |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 public class PublicByAuthorBean extends AbstractISMIBean implements Serializable{ |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
22 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 private static Logger logger = Logger.getLogger(PublicByAuthorBean.class); |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
24 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 private static final long serialVersionUID = 1L; |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
27 protected String findAuthorName = ""; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
28 protected Long selectedPersonId = 0l; |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
29 protected Integer maxMamsNr = 0; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
30 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
31 protected Entity selectedPerson; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
32 protected List<Entity> selectedPersonTexts; |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
33 protected List<String> selectedPersonSubjects; |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
34 protected Map<String,List<Entity>> selectedPersonSubjectMap; |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
35 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
36 protected List<String> subjectList; |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
37 protected Map<String,List<String>> subjectParents; |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
38 protected Map<String,List<Entity>> subjectTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
39 protected Map<String,List<Entity>> subjectPublicTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
40 protected Map<String,List<Entity>> subjectPrivateTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
41 protected Map<String,Entity> subjectEntity; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
42 |
173
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
43 private FullEntityRepositoryBean browseBean; |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
45 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
46 public PublicByAuthorBean(){ |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 //logger.info("AdvancedSearchBean"); |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
48 this.reset(); |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 public void reset(){ |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
52 logger.info("PublicByAuthorBean.reset()"); |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
53 browseBean = new FullEntityRepositoryBean(); |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
54 browseBean.setObjectClass(PERSON); |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
55 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
56 selectedPersonTexts = new ArrayList<Entity>(); |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
57 selectedPersonSubjectMap = new HashMap<String,List<Entity>>(); |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
58 |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
59 makeSubjectTree(); |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
60 logger.info("PublicByAuthorBean.reset() Done."); |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
63 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
64 * Creates the subjectParents Map with all subject names as keys and |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
65 * a List with their parents as values. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
66 * |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
67 * Also creates the subjectList List of subject names. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
68 */ |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
69 protected void makeSubjectTree() { |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
70 subjectList = new ArrayList<String>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
71 subjectEntity = new HashMap<String,Entity>(); |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
72 subjectParents = new HashMap<String,List<String>>(); |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
73 subjectTexts = new HashMap<String,List<Entity>>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
74 subjectPublicTexts = new HashMap<String,List<Entity>>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
75 subjectPrivateTexts = new HashMap<String,List<Entity>>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
76 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
77 * get all subjects |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
78 */ |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
79 List<Entity> subjects = getWrapper().getEntitiesByDef(SUBJECT); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
80 for (Entity subject : subjects) { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
81 if (subject.isLightweight()) { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
82 subject = getWrapper().getEntityContent(subject); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
83 } |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
84 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
85 * add subject |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
86 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
87 String subjectName = subject.getOwnValue(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
88 subjectList.add(subjectName); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
89 subjectEntity.put(subjectName, subject); |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
90 ArrayList<String> parents = new ArrayList<String>(); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
91 Entity parent = subject; |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
92 int cnt = 0; |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
93 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
94 * find subject's parents |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
95 */ |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
96 do { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
97 if (parent.isLightweight()) { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
98 parent = getWrapper().getEntityContent(parent); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
99 } |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
100 List<Relation> parRels = parent.getSourceRelations(is_part_of, SUBJECT); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
101 if (!parRels.isEmpty()) { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
102 Long parentId = parRels.get(0).getTargetId(); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
103 parent = getWrapper().getEntityById(parentId); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
104 parents.add(parent.getOwnValue()); |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
105 } else { |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
106 break; |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
107 } |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
108 } while (++cnt < 5); |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
109 subjectParents.put(subjectName, parents); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
110 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
111 * find subject's texts |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
112 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
113 ArrayList<Entity> textList = new ArrayList<Entity>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
114 ArrayList<Entity> pubTextList = new ArrayList<Entity>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
115 ArrayList<Entity> privTextList = new ArrayList<Entity>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
116 for (Relation textRel : subject.getTargetRelations(has_subject, TEXT)) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
117 Long textId = textRel.getSourceId(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
118 Entity text = getWrapper().getEntityByIdWithContent(textId); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
119 textList.add(text); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
120 if (text.getIsPublic()) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
121 pubTextList.add(text); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
122 } else { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
123 privTextList.add(text); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
124 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
125 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
126 subjectTexts.put(subjectName, textList); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
127 subjectPublicTexts.put(subjectName, pubTextList); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
128 subjectPrivateTexts.put(subjectName, privTextList); |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
129 } |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
130 } |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
131 |
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
132 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
133 public void actionReset() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
134 reset(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
135 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
136 |
171
50b8103ec85c
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
170
diff
changeset
|
137 public void listenerAuthorIdSearch(ActionEvent event) { |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
138 setSelectedPersonById(); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
139 } |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
140 |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
141 protected void setSelectedPersonById() { |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
142 Entity ent = getWrapper().getEntityById(selectedPersonId); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
143 if (ent != null) { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
144 ent = getWrapper().getEntityContent(ent); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
145 selectedPerson = ent; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
146 updateSelectedPerson(); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
147 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
148 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
149 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
150 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
151 * Updates the information in selectedPersonTexts, selectedPersonSubjects |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
152 * and selectedPersonSubjectMap. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
153 */ |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
154 public void updateSelectedPerson() { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
155 // load all texts by this author |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
156 selectedPersonTexts = new ArrayList<Entity>(); |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
157 selectedPersonSubjectMap = new HashMap<String,List<Entity>>(); |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
158 List<Relation> textRels = selectedPerson.getTargetRelations("was_created_by", "TEXT"); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
159 for (Relation rel : textRels) { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
160 Long textID = rel.getSourceId(); |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
161 // get text |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
162 Entity text = getWrapper().getEntityByIdWithContent(textID); |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
163 selectedPersonTexts.add(text); |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
164 // get subject |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
165 List<Relation> subjectRels = text.getSourceRelations("has_subject", "SUBJECT"); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
166 if (subjectRels.isEmpty()) { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
167 String subject = "NO SUBJECT"; |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
168 List<Entity> texts = selectedPersonSubjectMap.get(subject); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
169 if (texts == null) { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
170 texts = new ArrayList<Entity>(); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
171 } |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
172 // add text to list |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
173 texts.add(text); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
174 // add list to subject map |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
175 selectedPersonSubjectMap.put(subject, texts); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
176 |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
177 } else { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
178 for (Relation subjectRel : subjectRels) { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
179 Long subjectId = subjectRel.getTargetId(); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
180 Entity subject = getWrapper().getEntityByIdWithContent(subjectId); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
181 List<Entity> texts = selectedPersonSubjectMap.get(subject.getOwnValue()); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
182 if (texts == null) { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
183 texts = new ArrayList<Entity>(); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
184 } |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
185 // add text to list |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
186 texts.add(text); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
187 // add list to subject map |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
188 selectedPersonSubjectMap.put(subject.getOwnValue(), texts); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
189 } |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
190 } |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
191 } |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
192 // update list of subjects |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
193 selectedPersonSubjects = new ArrayList<String>(); |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
194 for (String sub : selectedPersonSubjectMap.keySet()) { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
195 selectedPersonSubjects.add(sub); |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
196 } |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
197 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
198 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
199 |
173
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
200 public void actionAllAuthors() { |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
201 browseBean.setObjectClass(PERSON); |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
202 browseBean.setSortAttributeName("mams_number"); |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
203 browseBean.setSortAttributeNumerically(true); |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
204 try { |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
205 browseBean.sortByAttributes(); |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
206 } catch (Exception e) { |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
207 logger.error(e); |
aa564b1b5e1f
publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
171
diff
changeset
|
208 } |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
209 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
210 |
175
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
211 public String actionSelectPerson() { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
212 Entity entity = (Entity) getRequestBean("entity"); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
213 selectedPersonId = entity.getId(); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
214 setSelectedPersonById(); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
215 // switch tab |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
216 getSessionBean().setSelectedPublicByAuthorTab("autsub"); |
175
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
217 return null; |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
218 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
219 |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
220 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
221 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
222 * Makes the selected text and its related objects public. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
223 * Uses PrivacityUtils.setTextAndMorePrivacity(). |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
224 * @return |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
225 */ |
175
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
226 public String actionMakeTextAndRelatedPublic() { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
227 Entity text = (Entity) getRequestBean("text"); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
228 List<String> textMsg = new ArrayList<String>(); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
229 try { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
230 List<Entity> entities = PrivacityUtils.setTextAndMorePrivacity(text, true, textMsg, getWrapper()); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
231 // save only public state |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
232 getWrapper().saveEntityListAsNodeWithoutContent(entities, null); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
233 } catch (Exception e) { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
234 logger.error(e); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
235 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
236 logger.debug("MAKE TEXT PUBLIC"); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
237 for (String msg : textMsg) { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
238 this.addGeneralMsg(msg); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
239 logger.debug(msg); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
240 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
241 return null; |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
242 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
243 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
244 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
245 * Makes the selected subject and its texts and related objects public. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
246 * Uses PrivacityUtils.setTextAndMorePrivacity(). |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
247 * @return |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
248 */ |
175
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
249 public String actionMakePersonSubjectAndRelatedPublic() { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
250 String subject = (String) getRequestBean("subject"); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
251 logger.debug("MAKE SUBJECT PUBLIC"); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
252 List<Entity> texts = selectedPersonSubjectMap.get(subject); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
253 for (Entity text : texts) { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
254 List<String> textMsg = new ArrayList<String>(); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
255 try { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
256 List<Entity> entities = PrivacityUtils.setTextAndMorePrivacity(text, true, textMsg, getWrapper()); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
257 // save only public state |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
258 getWrapper().saveEntityListAsNodeWithoutContent(entities, null); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
259 } catch (Exception e) { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
260 logger.error(e); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
261 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
262 for (String msg : textMsg) { |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
263 this.addGeneralMsg(msg); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
264 logger.debug(msg); |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
265 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
266 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
267 return null; |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
268 } |
3d8b31508128
PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
173
diff
changeset
|
269 |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
270 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
271 * Makes the selected subject and its texts and related objects public. |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
272 * Uses PrivacityUtils.setTextAndMorePrivacity(). |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
273 * @return |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
274 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
275 public String actionMakeMamsSubjectAndRelatedPublic() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
276 String subject = (String) getRequestBean("subject"); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
277 logger.debug("MAKE PUBLIC BY MAMS AND SUBJECT"); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
278 if (maxMamsNr < 1) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
279 addErrorMsg("MAMS number too small!"); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
280 return null; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
281 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
282 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
283 * go through all texts for the subject |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
284 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
285 List<Entity> texts = subjectTexts.get(subject); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
286 for (Entity text : texts) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
287 if (text.isLightweight()) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
288 text = getWrapper().getEntityContent(text); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
289 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
290 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
291 * check author's MAMS number |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
292 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
293 List<Relation> authorRels = text.getSourceRelations(rel_was_created_by, PERSON); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
294 if (authorRels.isEmpty()) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
295 // skip text with no author |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
296 continue; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
297 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
298 long authorId = authorRels.get(0).getTargetId(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
299 Entity author = getWrapper().getEntityByIdWithContent(authorId); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
300 try { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
301 Attribute mamsAtt = author.getAttributeByName("mams_number"); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
302 int mamsNr = Integer.parseInt(mamsAtt.getValue()); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
303 if (mamsNr > maxMamsNr) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
304 // skip if MAMS number too big |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
305 continue; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
306 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
307 } catch (Exception e) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
308 // attribute missing or wrong |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
309 continue; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
310 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
311 /* |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
312 * make text and related objects public |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
313 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
314 List<String> textMsg = new ArrayList<String>(); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
315 try { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
316 List<Entity> entities = PrivacityUtils.setTextAndMorePrivacity(text, true, textMsg, getWrapper()); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
317 // save only public state |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
318 getWrapper().saveEntityListAsNodeWithoutContent(entities, null); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
319 } catch (Exception e) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
320 logger.error(e); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
321 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
322 for (String msg : textMsg) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
323 this.addGeneralMsg(msg); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
324 logger.debug(msg); |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
325 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
326 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
327 return null; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
328 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
329 |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
330 /** |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
331 * @return the findAuthorName |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
332 */ |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
333 public String getFindAuthorName() { |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
334 return findAuthorName; |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
335 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
336 |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
337 /** |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
338 * @param findAuthorName the findAuthorName to set |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
339 */ |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
340 public void setFindAuthorName(String findAuthorName) { |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
341 this.findAuthorName = findAuthorName; |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
342 } |
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
343 |
165
85fdcca37a0d
working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
153
diff
changeset
|
344 /** |
168
e9ab943ec528
new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
165
diff
changeset
|
345 * @return the browseBean |
165
85fdcca37a0d
working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
153
diff
changeset
|
346 */ |
168
e9ab943ec528
new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
165
diff
changeset
|
347 public EntityRepositoryBean getBrowseBean() { |
e9ab943ec528
new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
165
diff
changeset
|
348 return browseBean; |
165
85fdcca37a0d
working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
153
diff
changeset
|
349 } |
85fdcca37a0d
working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
153
diff
changeset
|
350 |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
351 /** |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
352 * @return the selectedPersonId |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
353 */ |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
354 public long getSelectedPersonId() { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
355 return selectedPersonId; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
356 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
357 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
358 /** |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
359 * @return the selectedPerson |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
360 */ |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
361 public Entity getSelectedPerson() { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
362 return selectedPerson; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
363 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
364 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
365 /** |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
366 * @return the selectedPersonTexts |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
367 */ |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
368 public List<Entity> getSelectedPersonTexts() { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
369 return selectedPersonTexts; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
370 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
371 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
372 /** |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
373 * @return the selectedPersonSubjects |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
374 */ |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
375 public Map<String, List<Entity>> getSelectedPersonSubjectMap() { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
376 return selectedPersonSubjectMap; |
169
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
377 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
378 |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
379 /** |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
380 * @param selectedPersonId the selectedPersonId to set |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
381 */ |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
382 public void setSelectedPersonId(Long selectedPersonId) { |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
383 this.selectedPersonId = selectedPersonId; |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
384 } |
0b5d02012299
more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
168
diff
changeset
|
385 |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
386 /** |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
387 * @return the selectedPersonSubjects |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
388 */ |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
389 public List<String> getSelectedPersonSubjects() { |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
390 return selectedPersonSubjects; |
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
391 } |
176
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
392 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
393 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
394 * @return the subjectParents |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
395 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
396 public Map<String, List<String>> getSubjectParents() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
397 return subjectParents; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
398 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
399 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
400 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
401 * @return the subjectList |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
402 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
403 public List<String> getSubjectList() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
404 return subjectList; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
405 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
406 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
407 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
408 * @return the maxMamsNr |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
409 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
410 public Integer getMaxMamsNr() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
411 return maxMamsNr; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
412 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
413 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
414 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
415 * @param maxMamsNr the maxMamsNr to set |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
416 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
417 public void setMaxMamsNr(Integer maxMamsNr) { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
418 this.maxMamsNr = maxMamsNr; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
419 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
420 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
421 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
422 * @return the subjectTexts |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
423 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
424 public Map<String, List<Entity>> getSubjectTexts() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
425 return subjectTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
426 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
427 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
428 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
429 * @return the subjectPublicTexts |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
430 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
431 public Map<String, List<Entity>> getSubjectPublicTexts() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
432 return subjectPublicTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
433 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
434 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
435 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
436 * @return the subjectPrivateTexts |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
437 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
438 public Map<String, List<Entity>> getSubjectPrivateTexts() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
439 return subjectPrivateTexts; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
440 } |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
441 |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
442 /** |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
443 * @return the subjectEntity |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
444 */ |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
445 public Map<String, Entity> getSubjectEntity() { |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
446 return subjectEntity; |
c63d39034b60
PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
175
diff
changeset
|
447 } |
170
8604b368ec19
still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
169
diff
changeset
|
448 |
153
3c83f42a8a39
first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
449 } |