annotate src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java @ 55:95bf4ac726e6

Topic synchronization with extraction-interface. new tables in LGService database
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 16 Feb 2016 15:09:40 +0100
parents a00efd5d9e77
children 7e161f2e6660
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
1 package de.mpiwg.gazetteer.utils;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
2
54
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
3 import java.io.IOException;
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
4 import java.sql.SQLException;
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
5 import java.util.ArrayList;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
6 import java.util.Collections;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
7 import java.util.Date;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
8 import java.util.List;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
9
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
10 import org.apache.log4j.Logger;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
11 import org.hibernate.Session;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
12
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
13 import cl.maps.duplex.DuplexKey;
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
14 import de.mpiwg.gazetteer.bo.LGBranch;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
15 import de.mpiwg.gazetteer.bo.LGFile;
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
16 import de.mpiwg.gazetteer.bo.LGFullTextSearchFile;
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
17 import de.mpiwg.gazetteer.bo.LGTaglist;
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
18 import de.mpiwg.gazetteer.bo.LGTopic;
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
19 import de.mpiwg.gazetteer.bo.LGTopicSectionRelation;
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
20 import de.mpiwg.gazetteer.bo.LGTopicTagRelation;
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
21 import de.mpiwg.gazetteer.db.DBContents;
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
22 import de.mpiwg.gazetteer.db.DBSection;
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
23 import de.mpiwg.gazetteer.utils.exceptions.NoAuthorizedException;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
24 import de.mpiwg.gazetteer.utils.exceptions.VersioningException;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
25
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
26 public class DataProvider extends AbstractDataProvider{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
27
43
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
28 private static Logger logger = Logger.getLogger(DataProvider.class);
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
29 private static DataProvider instance;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
30
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
31 public static DataProvider getInstance(){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
32 if(instance == null)
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
33 instance = new DataProvider();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
34 return instance;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
35 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
36
34
2e1662afc81c new: add synchronization for files uploaded to LGDataverse
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
37 public static void resetInstance() {
2e1662afc81c new: add synchronization for files uploaded to LGDataverse
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
38 instance = null;
2e1662afc81c new: add synchronization for files uploaded to LGDataverse
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
39 }
2e1662afc81c new: add synchronization for files uploaded to LGDataverse
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 26
diff changeset
40
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
41 public DataProvider(){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
42 logger.info("##### Starting DataProvider #####");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
43 }
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
44
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
45
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
46
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
47 /* --- branch --- */
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
48
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
49 public LGFile getFile(Long fileId){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
50 return getFileMap().getValuesByOwnKey(fileId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
51 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
52
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
53 public List<LGFile> getAllFiles(Long branchId){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
54 List<LGFile> list = getFileMap().getValuesByAKey(branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
55 Collections.sort(list);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
56 Collections.reverse(list);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
57 return list;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
58 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
59
43
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
60 public List<LGTopicSectionRelation> getAllExistingTopicSectionRelation() {
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
61 List<LGTopicSectionRelation> list = new ArrayList<LGTopicSectionRelation>();
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
62 for (LGTopicSectionRelation relation : getTopicSectionRelationMap().values()) {
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
63 list.add(relation);
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
64 }
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
65 return list;
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
66 }
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
67
38
8b7a204fa929 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 37
diff changeset
68 public List<LGBranch> getAllExistingBranches(){
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
69 List<LGBranch> list = new ArrayList<LGBranch>();
37
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
70 for(LGBranch branch : getBranchMap().values()){
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
71 list.add(branch);
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
72 }
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
73 return list;
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
74 }
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
75
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
76 public List<LGBranch> getBranches(Long userId){
ed215307f426 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 34
diff changeset
77 List<LGBranch> list = new ArrayList<LGBranch>();
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
78 for(LGBranch branch : getBranchMap().values()){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
79 if(branch.hasContributor(userId)){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
80 list.add(branch);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
81 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
82 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
83 return list;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
84 }
38
8b7a204fa929 new: show all existing branches in the searching result page of search for sections
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 37
diff changeset
85
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
86
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
87 public LGBranch getBranch(Long branchId){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
88 return getBranchMap().getValuesByOwnKey(branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
89 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
90
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
91 public void deleteFile(LGFile file) throws Exception{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
92
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
93 LGBranch branch = getBranch(file.getBranchId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
94
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
95 if(branch == null){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
96 throw new Exception("There is any Branch for " + file);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
97 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
98
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
99 List<LGFile> files = getAllFiles(file.getBranchId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
100
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
101 if(files.size() == 1){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
102 throw new Exception("This file could not be deleted, because it is part of a branch that has only one file. A Branch without files is a inconsistency.");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
103 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
104
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
105 // if the file is the last version of a branch, we must replace the current file with the penultimate file.
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
106 if(branch.getCurrentLastFileId().equals(file.getId())){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
107 LGFile penultimateFile = getPenultimateFile(files);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
108
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
109 penultimateFile.setLastVersion(true);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
110 branch.setCurrentLastFileId(penultimateFile.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
111
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
112 this.updateBranch(branch);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
113 this.updateFile(penultimateFile);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
114
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
115 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
116
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
117 //deleting file from DB and cache
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
118 int modifiedFiles = DBService.deleteFileFromDB(file.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
119 getFileMap().remove(file.getKey());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
120
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
121 logger.info(modifiedFiles + " items deleted by removing file " + file);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
122 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
123
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
124 private LGFile getPenultimateFile(List<LGFile> files){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
125 LGFile penultimateFile = null;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
126 LGFile lastFile = null;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
127
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
128 for(LGFile file : files){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
129 if(lastFile == null){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
130 lastFile = file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
131 }else if(penultimateFile == null){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
132 lastFile = (lastFile.getVersion() > file.getVersion()) ? lastFile : file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
133 penultimateFile = (lastFile.getVersion() < file.getVersion()) ? lastFile : file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
134 }else{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
135 if(file.getVersion() > lastFile.getVersion()){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
136 penultimateFile = lastFile;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
137 lastFile = file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
138 }else if(file.getVersion() > penultimateFile.getVersion()){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
139 penultimateFile = file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
140 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
141 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
142 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
143
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
144 return penultimateFile;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
145 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
146
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
147 public void deleteBranch(LGBranch branch){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
148
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
149 int modifiedFiles = DBService.deleteBranchFromDB(branch.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
150 List<LGFile> fileToDelete = getFileMap().getValuesByAKey(branch.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
151
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
152 for(LGFile file : new ArrayList<LGFile>(fileToDelete)){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
153 getFileMap().remove(file.getKey());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
154 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
155 getBranchMap().remove(branch.getKey());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
156
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
157 logger.info(modifiedFiles + " items deleted by removing branch " + branch.toString());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
158 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
159
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
160 public void updateFile(LGFile file) throws Exception{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
161 if(!file.isPersistent()){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
162 throw new Exception("Trying to update a file that it is not persistent!");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
163 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
164
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
165 Date date = new Date();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
166 DBService.saveDBEntry(file, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
167 this.getFileMap().put(file.getKey(), file);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
168 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
169
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
170 public void updateBranch(LGBranch branch) throws Exception{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
171 if(!branch.isPersistent()){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
172 throw new Exception("Trying to update a branch that it is not persistent!");
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
173 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
174
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
175 Date date = new Date();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
176 DBService.saveDBEntry(branch, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
177 this.getBranchMap().put(branch.getKey(), branch);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
178 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
179
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
180 public LGFile saveFile(Long branchId, String text, Long userId, Long userPreviousFileId) throws Exception{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
181
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
182
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
183
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
184 Date date = new Date();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
185
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
186 LGBranch branch = getBranchMap().getValuesByOwnKey(branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
187
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
188 if(!branch.hasContributor(userId)){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
189 throw new NoAuthorizedException(userId, branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
190 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
191
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
192 if(!branch.getCurrentLastFileId().equals(userPreviousFileId)){
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
193 LGFile userPreviousFile = getFileMap().getValuesByOwnKey(userPreviousFileId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
194 LGFile currentLastFile = getFileMap().getValuesByOwnKey(branch.getCurrentLastFileId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
195
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
196 throw new VersioningException(userPreviousFile, currentLastFile);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
197 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
198
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
199 LGFile previousFile = getFileMap().getValuesByOwnKey(branch.getCurrentLastFileId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
200
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
201 LGFile file = new LGFile();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
202 file.setBranchId(branchId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
203 file.setVersion(previousFile.getVersion() + 1);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
204 file.setUserId(userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
205 file.setContent(text);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
206
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
207 //Saving into DB
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
208 //##################################
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
209 Session session = HibernateUtil.getSessionFactory().getCurrentSession();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
210 session.getTransaction().begin();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
211
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
212
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
213 file.setBranchId(branch.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
214 DBService.saveDBEntry0(session, file, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
215
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
216 previousFile.setLastVersion(false);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
217 DBService.saveDBEntry0(session, previousFile, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
218
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
219 branch.setCurrentLastFileId(file.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
220 DBService.saveDBEntry0(session, branch, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
221
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
222 //Saving physical file in the operating system
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
223 String fileName = FileManager.saveFile(branch, file, date, userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
224 file.setFileName(fileName);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
225 DBService.saveDBEntry0(session, file, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
226
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
227 session.getTransaction().commit();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
228 //##################################
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
229
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
230
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
231 //Saving into Cache
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
232 getBranchMap().put(branch.getKey(), branch);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
233 getFileMap().put(file.getKey(), file);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
234 getFileMap().put(previousFile.getKey(), previousFile);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
235
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
236 return file;
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
237 }
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
238
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
239 public Long saveNewFile(String text, String label, Long sectionId, Long userId) throws Exception{
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
240
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
241 Date date = new Date();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
242
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
243 LGBranch branch = new LGBranch();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
244 branch.setSectionId(sectionId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
245 branch.setUserId(userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
246 branch.setLabel(label);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
247 branch.addContributor(userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
248 branch.loadTransientData();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
249
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
250 LGFile file = new LGFile();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
251 file.setUserId(userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
252 file.setContent(text);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
253
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
254 //Saving into DB
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
255 //##################################
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
256 Session session = HibernateUtil.getSessionFactory().getCurrentSession();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
257 session.getTransaction().begin();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
258
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
259 DBService.saveDBEntry0(session, branch, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
260 file.setBranchId(branch.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
261
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
262 DBService.saveDBEntry0(session, file, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
263 branch.setCurrentLastFileId(file.getId());
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
264
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
265 //Saving physical file in the operating system
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
266 String fileName = FileManager.saveFile(branch, file, date, userId);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
267 file.setFileName(fileName);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
268 DBService.saveDBEntry0(session, file, date);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
269
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
270 session.getTransaction().commit();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
271 //##################################
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
272
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
273
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
274 //Saving into Cache
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
275 getBranchMap().put(branch.getKey(), branch);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
276 getFileMap().put(file.getKey(), file);
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
277
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
278 return branch.getId();
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
279
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
280 }
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
281
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
282 /* --- end branch --- */
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
283
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
284
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
285
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
286 /* --- full text search --- */
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
287
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
288 public List<LGFullTextSearchFile> getSearchFileList4User(Long userId) {
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
289
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
290 List<LGFullTextSearchFile> list = new ArrayList<LGFullTextSearchFile>();
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
291
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
292 for(LGFullTextSearchFile searchFile : getFullTextSearchFileMap().values()){
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
293 if(searchFile.getUserId() == userId){
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
294 list.add(searchFile);
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
295 }
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
296 }
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
297
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
298 return list;
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
299 }
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
300
49
7c2e1b14b77d new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 48
diff changeset
301
54
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
302
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
303
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
304 public void deleteLGFullTextSearchFile(LGFullTextSearchFile file) throws IOException{
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
305 //deleting file from DB: the record in table FullTextSearchFile
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
306 int modifiedFiles = DBService.deleteFullTextSearchFileFromDB(file.getId());
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
307
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
308 // delete the files from file system (html in ftsearch-data/... and csv in LGMap/datasets/)
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
309 FileManager.deleteFullTextSearchFileCsv(file);
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
310 FileManager.deleteFullTextSearchFileHtml(file);
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
311
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
312 // delete file from cache
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
313 this.getFullTextSearchFileMap().remove(file.getKey());
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
314 logger.debug("deleteLGFullTextSearchFile");
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
315 }
a00efd5d9e77 new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 49
diff changeset
316
40
35ed4e650a53 bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 39
diff changeset
317 public LGFullTextSearchFile saveLGFullTextSearchFile(List<DBContents> list, Long userId, LGFullTextSearchFile searchFile) throws Exception {
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
318 // save as csv and html file in filesystem, and records in db `FullTextSearchFile
49
7c2e1b14b77d new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 48
diff changeset
319 // List<DBContents> list is the filteredList of searching result with isRemoved field
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
320
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
321 Date date = new Date();
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
322
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
323 //Saving into DB
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
324 //##################################
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
325 Session session = HibernateUtil.getSessionFactory().getCurrentSession();
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
326 session.getTransaction().begin();
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
327
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
328 DBService.saveDBEntry0(session, searchFile, date);
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
329
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
330 //Saving physical file in the operating system
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
331 FileManager.saveFullTextSearchFileAsCsv(searchFile, userId, list); // save csv file to LGMap's datasets folder
49
7c2e1b14b77d new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 48
diff changeset
332 FileManager.saveFullTextSearchFileAsHtml(searchFile, userId, list); // save html file to LGMap's datasets folder
7c2e1b14b77d new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 48
diff changeset
333
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
334 session.getTransaction().commit();
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
335 //##################################
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
336
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
337 return searchFile;
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
338 }
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
339
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
340 public LGFullTextSearchFile getFullTextSearchFile(Long fileId) {
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
341
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
342 LGFullTextSearchFile file = getFullTextSearchFileMap().getValuesByOwnKey(fileId);
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
343
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
344 return file;
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
345 }
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
346
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
347 /* --- end full text search --- */
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
348
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
349 /* --- topic --- */
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
350
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
351 public List<LGTopic> getTopics(Long userId){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
352 List<LGTopic> list = new ArrayList<LGTopic>();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
353 for(LGTopic topic : getTopicMap().values()){
48
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
354 /*
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
355 if(topic.hasContributor(userId)){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
356 list.add(topic);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
357 }
48
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
358 */
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
359
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
360 // add topic into list anyway, without checking the contributor role.
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
361 list.add(topic);
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
362 }
48
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
363
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
364 return list;
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
365 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
366
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
367 public LGTopic getTopic(Long topicId){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
368 return getTopicMap().getValuesByOwnKey(topicId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
369 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
370
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
371
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
372 public void deleteTopic(LGTopic topic){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
373
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
374 int modifiedRelation = DBService.deleteTopicFromDB(topic.getId());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
375 getTopicMap().remove(topic.getKey());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
376
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
377 logger.info("removing " + modifiedRelation + " records in TopicSectionRelation and TopicTagRelation table for the topic " + topic.toString());
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
378
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
379 this.setTopicSectionRelationMap(null); // clear topicSectionRelationMap cache
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
380
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
381 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
382
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
383 public void createTopic(String nameEn, String nameCh,String namePinyin, String description, Long userId) {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
384 Date date = new Date();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
385
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
386 LGTopic topic = new LGTopic();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
387 topic.setNameEn(nameEn);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
388 topic.setNameCh(nameCh);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
389 topic.setNamePinyin(namePinyin);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
390 topic.setDescription(description);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
391 topic.setUserId(userId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
392 topic.setContributors("[" + userId.toString() + "]");
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
393
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
394 // auto-generating a tag for the topic: could be from nameEn replace space with '_'
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
395 String tag = new String();
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
396 tag = nameEn.replace(' ', '_');
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
397 topic.setTag(tag);
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
398
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
399 //Saving into DB
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
400 //##################################
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
401 // For Topic table
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
402 Session session = HibernateUtil.getSessionFactory().getCurrentSession();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
403 session.getTransaction().begin();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
404
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
405 DBService.saveDBEntry0(session, topic, date);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
406
55
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
407 // For Taglist table
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
408 // create record, which is the topic tag, in taglist table,
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
409 // with the taglis.name=nameCh, the taglist.tag=tag, the taglist.color=the defualt topic tag color, which is rgb(255,0,174)
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
410
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
411 LGTaglist taglist = new LGTaglist();
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
412 taglist.setName(nameCh);
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
413 taglist.setTag(tag);
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
414 taglist.setColor("rgb(255, 0, 174)");
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
415
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
416 DBService.saveDBEntry0(session, taglist, date);
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
417
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
418
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
419 logger.debug("new topic tag id=" + taglist.getId());
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
420
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
421
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
422 // For TopicTagRelation table
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
423 // link the relation between the new topic and its corresponding tag
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
424 LGTopicTagRelation relation = new LGTopicTagRelation();
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
425 relation.setTagId(taglist.getId());
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
426 relation.setTopicId(topic.getId());
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
427
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
428 DBService.saveDBEntry0(session, relation, date);
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
429
95bf4ac726e6 Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 54
diff changeset
430
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
431 session.getTransaction().commit();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
432 //##################################
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
433
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
434 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
435
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
436 public void updateTopic(LGTopic topic) throws Exception {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
437 if(!topic.isPersistent()){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
438 throw new Exception("Trying to update a topic that it is not persistent!");
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
439 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
440
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
441 Date date = new Date();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
442 DBService.saveDBEntry(topic, date);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
443 this.getTopicMap().put(topic.getKey(), topic);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
444
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
445 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
446
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
447
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
448
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
449 public List<DBSection> getAllSectionsInTopic(Long topicId) throws SQLException{
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
450
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
451 List<LGTopicSectionRelation> topicSectionRelationList = getTopicSectionRelationMap().getValuesByAKey(topicId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
452
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
453 // get sections from topicSecionRelation list
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
454 List<DBSection> list = new ArrayList<DBSection>();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
455 for (LGTopicSectionRelation aRelation : topicSectionRelationList) {
43
9dbbbfd474f4 new: 1.existing topic in search result. 2.difference-set of book for topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 41
diff changeset
456 //logger.debug(aRelation.getInfo() );
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
457
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
458 DBSection section = DBService.getSectionWithContent(aRelation.getSectionId());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
459 list.add(section);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
460
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
461 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
462
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
463
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
464 Collections.sort(list);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
465 Collections.reverse(list);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
466 return list;
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
467 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
468
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
469
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
470
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
471
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
472 public void deleteTopicSectionRelation(Long topicId, String bookId) throws Exception{
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
473 // delete record with topicId, bookId in topicSectionRelation
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
474 // this means the sectionId = 0, there is no corresponding section in the book for this topic
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
475
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
476 // TODO
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
477
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
478 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
479
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
480 public void deleteTopicSectionRelation(Long topicId, Long sectionId) throws Exception{
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
481 if (sectionId == 0) {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
482 throw new Exception("sectionId cannot be 0");
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
483 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
484
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
485 DuplexKey<Long, Long> key = new DuplexKey<Long, Long>(topicId, sectionId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
486 LGTopicSectionRelation topicSectionRelation = this.getTopicSectionRelationMap().get(key);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
487
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
488 LGTopic topic = getTopic(topicId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
489
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
490 if(topic == null){
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
491 throw new Exception("There is no topic of " + topicSectionRelation);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
492 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
493
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
494 //deleting topicSectionRelation from DB and cache
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
495 int modifiedRelation = DBService.deleteTopicSectionRelationFromDB(topicSectionRelation.getId());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
496 getTopicSectionRelationMap().remove(topicSectionRelation.getKey());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
497
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
498 logger.info(modifiedRelation + " items deleted by removing topicSectionRelation " + topicSectionRelation.toString());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
499
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
500
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
501 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
502
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
503 public String updateTopicSectionRelation(Long sectionId, Long topicId) throws Exception {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
504 DuplexKey<Long, Long> key = new DuplexKey<Long, Long>(topicId, sectionId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
505 LGTopicSectionRelation topicSectionRelation = this.getTopicSectionRelationMap().get(key);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
506
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
507 if (topicSectionRelation != null) {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
508 // the relation already existed
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
509 // would this possibly need any modification to the existing record in the topicSectionRelation table?
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
510
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
511 return "updated";
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
512
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
513 } else {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
514 createTopicSectionRelation(sectionId, topicId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
515
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
516 return "added";
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
517 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
518
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
519
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
520
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
521 }
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
522
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
523
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
524 public void createTopicSectionRelation(Long sectionId, Long topicId) throws Exception {
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
525
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
526 Date date = new Date();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
527
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
528 LGTopicSectionRelation topicSectionRelation = new LGTopicSectionRelation();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
529 topicSectionRelation.setTopicId(topicId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
530 topicSectionRelation.setSectionId(sectionId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
531
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
532 DBService.getInstance();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
533 DBSection section = DBService.getSectionWithContent(sectionId);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
534 topicSectionRelation.setBookId(section.getBookId());
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
535
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
536 //Saving into DB
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
537 //##################################
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
538 // For Topic table
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
539 Session session = HibernateUtil.getSessionFactory().getCurrentSession();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
540 session.getTransaction().begin();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
541
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
542 DBService.saveDBEntry0(session, topicSectionRelation, date);
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
543
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
544 session.getTransaction().commit();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
545 //##################################
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
546
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
547 // update cache
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
548 this.loadTopicSectionRelations();
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
549
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
550 }
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
551
48
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
552 public Integer getNumberOfSectionInTopic(Long topicId) {
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
553 List<LGTopicSectionRelation> topicSectionRelationList = getTopicSectionRelationMap().getValuesByAKey(topicId);
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
554
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
555 return topicSectionRelationList.size();
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
556 }
13555aff1f88 new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 43
diff changeset
557
39
37840afb7b80 new: full text search
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 38
diff changeset
558
41
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
559
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
560 /* --- end topic --- */
ba9515f22897 new: topic management and adding sections from searching result into topic
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 40
diff changeset
561
0
3e62083dbcbf First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
diff changeset
562 }