annotate src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java @ 181:52aa06772336

fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Wed, 13 Jun 2018 17:48:06 +0200
parents 0d31c8be7c31
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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;
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
8 import java.util.Map.Entry;
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
9
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
10 import javax.faces.event.ActionEvent;
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
11
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 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
13 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
14 import org.mpi.openmind.repository.bo.Entity;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
15 import org.mpi.openmind.repository.bo.Relation;
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
16 import org.richfaces.event.ItemChangeEvent;
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
17
168
e9ab943ec528 new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 165
diff changeset
18 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
19 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
20 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
21 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
22
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 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
24
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 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
26
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 private static final long serialVersionUID = 1L;
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
28
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
29 protected String selectedTab = "aut";
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
30
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
31 protected String findAuthorName = "";
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
32 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
33 protected Integer maxMamsNr = 0;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
34
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
35 protected Entity selectedPerson;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
36 protected List<Entity> selectedPersonTexts;
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
37 protected List<String> selectedPersonSubjects;
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
38 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
39
176
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 List<String> subjectList;
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
41 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
42 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
43 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
44 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
45 protected Map<String,Entity> subjectEntity;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
46
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
47 protected FullEntityRepositoryBean browseBean;
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
48
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 public PublicByAuthorBean(){
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
51 //logger.info("AdvancedSearchBean");
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
52 browseBean = new FullEntityRepositoryBean();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
53 browseBean.setObjectClass(PERSON);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
54
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
55 selectedPersonTexts = new ArrayList<Entity>();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
56 selectedPersonSubjectMap = new HashMap<String,List<Entity>>();
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
57 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
58
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
59 public synchronized 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
60 logger.info("PublicByAuthorBean.reset()");
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
61 browseBean = new FullEntityRepositoryBean();
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
62 browseBean.setObjectClass(PERSON);
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
63
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
64 selectedPersonTexts = new ArrayList<Entity>();
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
65 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
66
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
67 makeSubjectTree();
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
68 updateSubjectTexts();
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
69 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
70 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
71
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
72 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
73 * 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
74 * 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
75 *
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
76 * 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
77 */
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
78 protected void makeSubjectTree() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
79 logger.debug("Start 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
80 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
81 subjectEntity = new HashMap<String,Entity>();
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
82 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
83 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
84 * 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
85 */
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
86 List<Entity> subjects = getWrapper().getEntitiesByDef(SUBJECT);
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
87 for (Entity subject : subjects) {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
88 if (subject.isLightweight()) {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
89 subject = getWrapper().getEntityContent(subject);
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
90 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
91 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
92 * 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
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 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
95 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
96 subjectEntity.put(subjectName, subject);
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
97 ArrayList<String> parents = new ArrayList<String>();
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
98 Entity parent = subject;
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
99 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
100 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
101 * 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
102 */
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
103 do {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
104 if (parent.isLightweight()) {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
105 parent = getWrapper().getEntityContent(parent);
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
106 }
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
107 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
108 if (!parRels.isEmpty()) {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
109 Long parentId = parRels.get(0).getTargetId();
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
110 parent = getWrapper().getEntityById(parentId);
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
111 parents.add(parent.getOwnValue());
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
112 } else {
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
113 break;
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
114 }
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
115 } 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
116 subjectParents.put(subjectName, parents);
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
117 }
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
118 logger.debug("Done makeSubjectTree.");
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
119 }
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
120
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
121 /**
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
122 * update subjectTexts, subjectPublicTexts and subjectPrivateTexts.
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
123 *
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
124 */
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
125 protected void updateSubjectTexts() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
126 logger.debug("Start updateSubjectTexts...");
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
127 subjectTexts = new HashMap<String,List<Entity>>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
128 subjectPublicTexts = new HashMap<String,List<Entity>>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
129 subjectPrivateTexts = new HashMap<String,List<Entity>>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
130 for (Entry<String, Entity> subjectItem : subjectEntity.entrySet()) {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
131 String subjectName = subjectItem.getKey();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
132 Entity subject = subjectItem.getValue();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
133 /*
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
134 * find subject's texts
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
135 */
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
136 ArrayList<Entity> textList = new ArrayList<Entity>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
137 ArrayList<Entity> pubTextList = new ArrayList<Entity>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
138 ArrayList<Entity> privTextList = new ArrayList<Entity>();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
139 for (Relation textRel : subject.getTargetRelations(has_subject, TEXT)) {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
140 Long textId = textRel.getSourceId();
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
141 Entity text = getWrapper().getEntityByIdWithContent(textId);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
142 textList.add(text);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
143 if (text.getIsPublic()) {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
144 pubTextList.add(text);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
145 } else {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
146 privTextList.add(text);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
147 }
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
148 }
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
149 subjectTexts.put(subjectName, textList);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
150 subjectPublicTexts.put(subjectName, pubTextList);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
151 subjectPrivateTexts.put(subjectName, privTextList);
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
152 }
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
153 logger.debug("Done updateSubjectTexts...");
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
154 }
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
155
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
156 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
157 reset();
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
158 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
159
171
50b8103ec85c still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 170
diff changeset
160 public void listenerAuthorIdSearch(ActionEvent event) {
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
161 setSelectedPersonById();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
162 }
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
163
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
164 protected void setSelectedPersonById() {
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
165 Entity ent = getWrapper().getEntityById(selectedPersonId);
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
166 if (ent != null) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
167 ent = getWrapper().getEntityContent(ent);
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
168 selectedPerson = ent;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
169 updateSelectedPerson();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
170 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
171 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
172
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
173 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
174 * 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
175 * 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
176 */
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
177 public void updateSelectedPerson() {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
178 // load all texts by this author
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
179 selectedPersonTexts = new ArrayList<Entity>();
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
180 selectedPersonSubjectMap = new HashMap<String,List<Entity>>();
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
181 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
182 for (Relation rel : textRels) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
183 Long textID = rel.getSourceId();
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
184 // get text
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
185 Entity text = getWrapper().getEntityByIdWithContent(textID);
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
186 selectedPersonTexts.add(text);
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
187 // get subject
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
188 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
189 if (subjectRels.isEmpty()) {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
190 String subject = "NO SUBJECT";
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
191 List<Entity> texts = selectedPersonSubjectMap.get(subject);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
192 if (texts == null) {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
193 texts = new ArrayList<Entity>();
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
194 }
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
195 // add text to list
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
196 texts.add(text);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
197 // add list to subject map
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
198 selectedPersonSubjectMap.put(subject, texts);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
199
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
200 } else {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
201 for (Relation subjectRel : subjectRels) {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
202 Long subjectId = subjectRel.getTargetId();
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
203 Entity subject = getWrapper().getEntityByIdWithContent(subjectId);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
204 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
205 if (texts == null) {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
206 texts = new ArrayList<Entity>();
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
207 }
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
208 // add text to list
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
209 texts.add(text);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
210 // add list to subject map
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
211 selectedPersonSubjectMap.put(subject.getOwnValue(), texts);
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
212 }
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
213 }
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
214 }
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
215 // update list of subjects
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
216 selectedPersonSubjects = new ArrayList<String>();
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
217 for (String sub : selectedPersonSubjectMap.keySet()) {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
218 selectedPersonSubjects.add(sub);
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
219 }
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
220 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
221
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
222
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
223 public void actionAllAuthors() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
224 browseBean.setObjectClass(PERSON);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
225 browseBean.setSortAttributeName("mams_number");
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
226 browseBean.setSortAttributeNumerically(true);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
227 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
228 browseBean.sortByAttributes();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
229 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
230 logger.error(e);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 171
diff changeset
231 }
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
232 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
233
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
234 public String actionSelectPerson() {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
235 Entity entity = (Entity) getRequestBean("entity");
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
236 selectedPersonId = entity.getId();
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
237 setSelectedPersonById();
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
238 // switch tab
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
239 setSelectedTab("autsub");
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
240 return null;
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
241 }
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 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
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 actionMakeTextAndRelatedPublic() {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
250 Entity text = (Entity) getRequestBean("text");
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
251 logger.info("MAKE PUBLIC by text for text="+text.getOwnValue());
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
252 List<String> textMsg = new ArrayList<String>();
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
253 try {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
254 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
255 // save only public state
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
256 getWrapper().saveEntityListAsNodeWithoutContent(entities, null);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
257 } catch (Exception e) {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
258 logger.error(e);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
259 }
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
260 for (String msg : textMsg) {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
261 this.addGeneralMsg(msg);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
262 logger.debug(msg);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
263 }
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
264 addGeneralMsg("The text \""+text.getOwnValue()+"\" was made public!");
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
265 return null;
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
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
268 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
269 * 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
270 * 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
271 * @return
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
272 */
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
273 public String actionMakePersonSubjectAndRelatedPublic() {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
274 String subject = (String) getRequestBean("subject");
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
275 logger.info("MAKE PUBLIC by author and subject for author="+selectedPerson.getOwnValue()+" and subject="+subject);
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
276 int pubCnt = 0;
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
277 List<Entity> texts = selectedPersonSubjectMap.get(subject);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
278 for (Entity text : texts) {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
279 List<String> textMsg = new ArrayList<String>();
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
280 try {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
281 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
282 // save only public state
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
283 getWrapper().saveEntityListAsNodeWithoutContent(entities, null);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
284 } catch (Exception e) {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
285 logger.error(e);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
286 }
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
287 for (String msg : textMsg) {
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
288 this.addGeneralMsg(msg);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
289 logger.debug(msg);
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
290 }
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
291 pubCnt += 1;
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
292 }
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
293 addGeneralMsg(pubCnt+" texts with subject "+subject+" were made public!");
175
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
294 return null;
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
295 }
3d8b31508128 PublicByAuthor feature works now.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
296
176
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 * 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
299 * 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
300 * @return
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
301 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
302 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
303 String subject = (String) getRequestBean("subject");
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
304 logger.info("MAKE PUBLIC by MAMS and subject for subject="+subject+" and maxMams="+maxMamsNr);
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
305 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
306 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
307 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
308 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
309 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
310 * 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
311 */
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
312 int pubCnt = 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
313 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
314 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
315 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
316 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
317 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
318 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
319 * 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
320 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
321 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
322 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
323 // 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
324 continue;
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 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
327 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
328 try {
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
329 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
330 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
331 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
332 // 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
333 continue;
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
334 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
335 } 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
336 // 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
337 continue;
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
338 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
339 /*
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
340 * 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
341 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
342 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
343 try {
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
344 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
345 // 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
346 getWrapper().saveEntityListAsNodeWithoutContent(entities, null);
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
347 pubCnt += 1;
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
348 } 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
349 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
350 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
351 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
352 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
353 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
354 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
355 }
177
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
356 if (pubCnt == 0) {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
357 addGeneralMsg("No text matched your criteria.");
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
358 } else {
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
359 addGeneralMsg(pubCnt+" texts with MAMS number < "+maxMamsNr+" were made public!");
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
360 }
af1018d06443 PublicByAuthor feature with new "Select by public and MAMS" works now!
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 176
diff changeset
361 updateSubjectTexts();
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
362 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
363 }
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
364
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
365
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
366 public void listenerTabChange(ItemChangeEvent event) {
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
367 String url = "?formIndex=" + selectedTab;
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
368 redirect(null, url);
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
369 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
370
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
371 /**
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
372 * @return the findAuthorName
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
373 */
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
374 public String getFindAuthorName() {
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
375 return findAuthorName;
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
376 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
377
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
378 /**
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
379 * @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
380 */
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
381 public void setFindAuthorName(String findAuthorName) {
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
382 this.findAuthorName = findAuthorName;
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
383 }
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
384
165
85fdcca37a0d working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 153
diff changeset
385 /**
168
e9ab943ec528 new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 165
diff changeset
386 * @return the browseBean
165
85fdcca37a0d working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 153
diff changeset
387 */
168
e9ab943ec528 new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 165
diff changeset
388 public EntityRepositoryBean getBrowseBean() {
e9ab943ec528 new start for publicByAuthor using EntityRepositoryBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 165
diff changeset
389 return browseBean;
165
85fdcca37a0d working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 153
diff changeset
390 }
85fdcca37a0d working on public by author feature...
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 153
diff changeset
391
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
392 /**
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
393 * @return the selectedPerson
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
394 */
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
395 public Entity getSelectedPerson() {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
396 return selectedPerson;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
397 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
398
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
399 /**
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
400 * @return the selectedPersonTexts
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
401 */
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
402 public List<Entity> getSelectedPersonTexts() {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
403 return selectedPersonTexts;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
404 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
405
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
406 /**
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
407 * @return the selectedPersonSubjects
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
408 */
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
409 public Map<String, List<Entity>> getSelectedPersonSubjectMap() {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
410 return selectedPersonSubjectMap;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
411 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
412
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
413 /**
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
414 * @param selectedPersonId the selectedPersonId to set
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
415 */
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
416 public void setSelectedPersonId(long selectedPersonId) {
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
417 this.selectedPersonId = selectedPersonId;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
418 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 168
diff changeset
419
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
420 /**
178
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
421 * @return the selectedPersonId
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
422 */
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
423 public long getSelectedPersonId() {
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
424 return selectedPersonId;
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
425 }
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
426
ca83d67a2dc9 bugfix and nicer messages for PublicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 177
diff changeset
427 /**
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
428 * @return the selectedPersonSubjects
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
429 */
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
430 public List<String> getSelectedPersonSubjects() {
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
431 return selectedPersonSubjects;
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
432 }
176
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 * @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
436 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
437 public Map<String, List<String>> getSubjectParents() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
438 if (subjectParents == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
439 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
440 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
441 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
442 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
443 }
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 /**
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 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
447 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
448 public List<String> getSubjectList() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
449 if (subjectList == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
450 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
451 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
452 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
453 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
454 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
455
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
456 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
457 * @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
458 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
459 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
460 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
461 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
462
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
463 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
464 * @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
465 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
466 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
467 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
468 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
469
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
470 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
471 * @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
472 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
473 public Map<String, List<Entity>> getSubjectTexts() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
474 if (subjectTexts == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
475 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
476 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
477 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
478 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
479 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
480
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
481 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
482 * @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
483 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
484 public Map<String, List<Entity>> getSubjectPublicTexts() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
485 if (subjectPublicTexts == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
486 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
487 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
488 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
489 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
490 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
491
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
492 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
493 * @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
494 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
495 public Map<String, List<Entity>> getSubjectPrivateTexts() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
496 if (subjectPrivateTexts == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
497 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
498 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
499 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
500 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
501 }
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
502
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
503 /**
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
504 * @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
505 */
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
506 public Map<String, Entity> getSubjectEntity() {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
507 if (subjectEntity == null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
508 makeSubjectTree();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
509 updateSubjectTexts();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 178
diff changeset
510 }
176
c63d39034b60 PublicByAuthor feature with new "Select by public and MAMS" text-UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 175
diff changeset
511 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
512 }
181
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
513
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
514 /**
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
515 * @return the selectedPublicByAuthorTab
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
516 */
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
517 public String getSelectedTab() {
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
518 return selectedTab;
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
519 }
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
520
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
521 /**
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
522 * @param selectedPublicByAuthorTab the selectedPublicByAuthorTab to set
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
523 */
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
524 public void setSelectedTab(String selectedPublicByAuthorTab) {
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
525 this.selectedTab = selectedPublicByAuthorTab;
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
526 }
52aa06772336 fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
527
170
8604b368ec19 still more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
528
153
3c83f42a8a39 first stab at new public-by-author interface.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
529 }