comparison src/main/java/de/mpiwg/web/jsp/SessionBean.java @ 43:9dbbbfd474f4

new: 1.existing topic in search result. 2.difference-set of book for topic
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 23 Dec 2015 16:03:32 +0100
parents ba9515f22897
children db2088ac1f50
comparison
equal deleted inserted replaced
42:815cd86bb9ec 43:9dbbbfd474f4
9 import org.apache.commons.lang.StringUtils; 9 import org.apache.commons.lang.StringUtils;
10 import org.apache.log4j.Logger; 10 import org.apache.log4j.Logger;
11 11
12 import de.mpiwg.gazetteer.dataverse.DataverseUtils; 12 import de.mpiwg.gazetteer.dataverse.DataverseUtils;
13 import de.mpiwg.gazetteer.dataverse.bo.VDCUser; 13 import de.mpiwg.gazetteer.dataverse.bo.VDCUser;
14 import de.mpiwg.gazetteer.utils.DataProvider;
14 15
15 public class SessionBean extends AbstractJSPPage { 16 public class SessionBean extends AbstractJSPPage {
16 17
17 private static Logger logger = Logger.getLogger(SessionBean.class); 18 private static Logger logger = Logger.getLogger(SessionBean.class);
18 public static final String BEAN_NAME = "sessionBean"; 19 public static final String BEAN_NAME = "sessionBean";
54 this.user = null; 55 this.user = null;
55 this.searchPage = new SearchPage(); 56 this.searchPage = new SearchPage();
56 this.homePage = new HomePage(); 57 this.homePage = new HomePage();
57 this.createFilePage = new CreateFilePage(); 58 this.createFilePage = new CreateFilePage();
58 this.branchPage = new BranchPage(); 59 this.branchPage = new BranchPage();
60
61 this.booksPage = new BooksPage();
62 this.topicListPage = new TopicListPage();
63 this.topicPage = new TopicPage();
64
59 this.userName = new String(); 65 this.userName = new String();
60 this.password = new String(); 66 this.password = new String();
67
61 } 68 }
62 69
63 public List<String> getMsgList() { 70 public List<String> getMsgList() {
64 return msgList; 71 return msgList;
65 } 72 }
87 theUserGroups.add("nuist"); 94 theUserGroups.add("nuist");
88 95
89 // check if user has role in the "Chinese Local Gazetteers" Dataverse, rather than the following hardcoded checking 96 // check if user has role in the "Chinese Local Gazetteers" Dataverse, rather than the following hardcoded checking
90 // use dvn/getRoleAssignments?user=&password=&datasetId= 97 // use dvn/getRoleAssignments?user=&password=&datasetId=
91 if ( StringUtils.equals(userName, "dataverseAdmin") || DataverseUtils.isUserInLG(userName, password) || DataverseUtils.isUserInGroups(this.user.getUserName(), theUserGroups)){ 98 if ( StringUtils.equals(userName, "dataverseAdmin") || DataverseUtils.isUserInLG(userName, password) || DataverseUtils.isUserInGroups(this.user.getUserName(), theUserGroups)){
99
92 this.user.setPassword(this.password); 100 this.user.setPassword(this.password);
93 this.homePage.loadParameters(request, response); 101 this.homePage.loadParameters(request, response);
94 this.homePage.reloadBranches(); 102 this.homePage.reloadBranches();
103
104
95 105
96 } else { 106 } else {
97 this.user = null; 107 this.user = null;
98 108
99 addMsg("Please contact/email us to activate your account!"); 109 addMsg("Please contact/email us to activate your account!");