Mercurial > hg > LGServices
annotate src/main/java/de/mpiwg/gazetteer/utils/FileManager.java @ 102:6a508b605b5f
1. add new page : footer.jsp.
2. embed footer.jsp into other pages.
author | Calvin Yeh <cyeh@mpipw-berlin.mpg.com> |
---|---|
date | Fri, 29 Sep 2017 16:03:06 +0200 |
parents | 824b808a7481 |
children |
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 |
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
|
3 import java.io.File; |
39 | 4 import java.io.IOException; |
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.io.PrintWriter; |
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.nio.file.Files; |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
7 import java.nio.file.Path; |
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
|
8 import java.nio.file.Paths; |
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 import java.text.DateFormat; |
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 java.text.SimpleDateFormat; |
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 java.util.Date; |
39 | 12 import java.util.List; |
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
|
13 |
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 org.apache.commons.lang.StringUtils; |
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 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
|
16 |
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
|
17 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
|
18 import de.mpiwg.gazetteer.bo.LGFile; |
39 | 19 import de.mpiwg.gazetteer.bo.LGFullTextSearchFile; |
20 import de.mpiwg.gazetteer.db.DBBook; | |
21 import de.mpiwg.gazetteer.db.DBContents; | |
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
|
22 |
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 public class FileManager { |
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 |
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 private static Logger logger = Logger.getLogger(FileManager.class); |
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 |
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 private static DateFormat dfmt = new SimpleDateFormat( "yyyy.MM.dd_hh.mm.ss.SSS" ); |
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
|
28 |
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 |
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 private static String getRootPath() 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
|
32 String base = PropertiesUtils.getPropValue("files_root"); |
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 |
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 if(StringUtils.isEmpty(base)){ |
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 throw new Exception("Property files_root no found. The files can be stored without this property."); |
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 } |
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
|
37 |
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
|
38 if(!base.endsWith("/")){ |
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
|
39 base += "/"; |
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
|
40 } |
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 |
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("files_root=" + base); |
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 |
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
|
44 return base; |
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
|
45 } |
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
|
46 |
39 | 47 |
48 public static void saveFullTextSearchFileAsCsv(LGFullTextSearchFile file, Long userId, List<DBContents> list) throws Exception{ | |
49 | |
50 // String absolutePath = PropertiesUtils.getPropValue("ftsearch_root") + "/csv/" + userId.toString() + "/"; | |
51 String absolutePath = PropertiesUtils.getPropValue("lgmap_datasets") + "/"; | |
52 | |
53 String fileName = file.getUserId() + "_" + file.getFileName() + ".csv"; | |
54 | |
55 File folder = new File(absolutePath); | |
56 folder.mkdirs(); | |
57 | |
58 logger.info("Trying to save file " + absolutePath + fileName + "."); | |
59 | |
60 PrintWriter out = new PrintWriter(absolutePath + fileName); | |
61 | |
62 String text = new String(); // make it from list | |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
63 text += "Address,LEVEL1,LEVEL2,Name,DYNASTY,PERIOD,ADMIN_TYPE,TimeSpan:begin,TimeSpan:end,Longitude,Latitude,PAGE,SECTION,CONTENT,BOOK_ID,Author,Edition,Volume,Description\n"; |
39 | 64 |
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
|
65 for (DBContents c : list) { |
39 | 66 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
67 if (c.getSection() != null && !c.isRemoved()){ // only those are not removed to csv which means to LGMap |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
68 |
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
|
69 DBBook book = c.getSection().getBook(); |
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
|
70 |
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
|
71 String description = book.getVolume() + "/" + book.getAuthor() + "/" + book.getEdition(); |
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
|
72 |
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
|
73 text += c.getCoordinatesBook().getPlace_name() + "," + |
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
|
74 book.getLevel1() + "," + |
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
|
75 book.getLevel2() + "," + |
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
|
76 book.getName() + "," + |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
77 book.getDynasty() + "," + |
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
|
78 book.getPeriod() + "," + |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
79 book.getAdmin_type() + "," + |
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
|
80 book.getStart_year() + "," + |
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
|
81 book.getEnd_year() + "," + |
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
|
82 c.getCoordinatesBook().getX() + "," + |
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
|
83 c.getCoordinatesBook().getY() + "," + |
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
|
84 c.getPage() + "," + |
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
|
85 c.getSection().getName() + "," + |
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
|
86 c.getContent() + "," + |
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
|
87 c.getBookId() + "," + |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
88 |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
89 |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
90 // add author, edition, volume |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
91 book.getAuthor() + "," + |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
92 book.getEdition() + "," + |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
93 book.getVolume() + "," + |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
94 |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
95 |
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
|
96 description + "\n"; |
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
|
97 } |
39 | 98 } |
99 | |
100 text = text.substring(0, text.length()-2); // cut the last 2 chars, which are "\n" here | |
101 | |
102 out.println(text); | |
103 out.close(); | |
104 | |
105 logger.info("The file " + fileName + " has been saved correctly."); | |
106 | |
107 | |
108 } | |
109 | |
110 | |
111 private static String getLGMapUrl(LGFullTextSearchFile file) throws IOException{ | |
112 String lgmap = PropertiesUtils.getPropValue("lgmap") + "&file=" + file.getUserId().toString() + "_" + file.getFileName() + ".csv&name=" + file.getSearchTerms(); | |
113 | |
114 return lgmap; | |
115 } | |
116 | |
117 public static void saveFullTextSearchFileAsHtml(LGFullTextSearchFile file, Long userId, List<DBContents> list) throws Exception{ | |
118 | |
119 String absolutePath = PropertiesUtils.getPropValue("ftsearch_root") + "/html/" + userId.toString() + "/"; | |
120 String fileName = file.getFileName() + ".html"; | |
121 | |
122 File folder = new File(absolutePath); | |
123 folder.mkdirs(); | |
124 | |
125 logger.info("Trying to save file " + absolutePath + fileName + "."); | |
126 | |
127 PrintWriter out = new PrintWriter(absolutePath + fileName); | |
128 | |
129 String text = new String(); | |
130 String header = new String(); | |
131 text += "<html>"; | |
132 | |
133 String root_server = PropertiesUtils.getPropValue("root_server"); | |
134 | |
135 header = "<head>" + | |
136 "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>" + | |
137 | |
138 "<link href='" + root_server + "/resources/css/style.css' type='text/css' rel='stylesheet'/>" + | |
139 "<script src='" + root_server + "/resources/js/jquery.min.js' type='text/javascript'></script>" + | |
140 "<script src='" + root_server + "/resources/js/LGSearch.js' type='text/javascript'></script>" + | |
141 | |
142 "</head>"; | |
143 | |
144 text += header; | |
145 text += "<body>" | |
146 + "<div class='subTitel'>Table name: " + file.getFileName() + "<div>" | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
147 + "<div class='label'>" + list.size() + " row(s) in the table.</dvi>" |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
148 + "<div class='label'>searching by keywords: " + '"' + "<span id='searchTerm'>" + file.getSearchTerms() + "</span>" + '"' + "</div>" |
39 | 149 + "<div class='label'><a href='" + getLGMapUrl(file) + "' target='_blank'>view on LGMap</a><div>" |
150 + "<br>" | |
151 + "<table class='pageTable'>" | |
152 + "<tr>" | |
153 + "<td class='tableTitle'>#</td>" | |
154 + "<td class='tableTitle'>book id</td>" | |
155 + "<td class='tableTitle'>book name</td>" | |
156 + "<td class='tableTitle'>level1</td>" | |
157 + "<td class='tableTitle'>level2</td>" | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
158 + "<td class='tableTitle'>dynasty</td>" |
39 | 159 + "<td class='tableTitle'>period</td>" |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
160 + "<td class='tableTitle'>admin type</td>" |
39 | 161 + "<td class='tableTitle'>section name</td>" |
162 + "<td class='tableTitle'>page</td>" | |
163 + "<td class='tableTitle'>content</td>" | |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
164 + "<td class='tableTitle hiddenField'>content id</td>" |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
165 + "<td class='tableTitle hiddenField'>isRemoved</td>" |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
166 |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
167 // add author, edition, volume, place name, coordinates (x,y) |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
168 + "<td class='tableTitle'>author</td>" |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
169 + "<td class='tableTitle'>edition</td>" |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
170 + "<td class='tableTitle'>volume</td>" |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
171 + "<td class='tableTitle'>place name</td>" |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
172 + "<td class='tableTitle'>cooridnates(x,y)</td>" |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
173 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
174 |
39 | 175 + "<tr>"; |
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
|
176 for (DBContents c : list) { |
39 | 177 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
178 //if ( c.getSection() != null && !c.isRemoved()){ |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
179 if ( c.getSection() != null){ |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
180 |
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
|
181 DBBook book = c.getSection().getBook(); |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
182 |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
183 if (c.isRemoved()) { |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
184 text += "<tr class='hiddenField'>"; |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
185 } else { |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
186 text += "<tr>"; |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
187 |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
188 } |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
189 text += |
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
|
190 "<td>" + c.getInx() + "</td>" + |
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
|
191 "<td>" + c.getBookId() + "</td>" + |
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
|
192 "<td>" + book.getName() + "</td>" + |
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
|
193 "<td>" + book.getLevel1() + "</td>" + |
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
|
194 "<td>" + book.getLevel2() + "</td>" + |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
195 "<td>" + book.getDynasty() + "</td>" + |
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
|
196 "<td>" + book.getPeriod() + "</td>" + |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
197 "<td>" + book.getAdmin_type() + "</td>" + |
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
|
198 "<td>" + c.getSection().getName() + "</td>" + |
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
|
199 "<td>" + c.getPage() + "</td>" + |
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
|
200 "<td class='content'>" + c.getContent() + "</td>" + |
62
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
201 "<td class='hiddenField'>" + c.getId() + "</td>" + |
824b808a7481
improvements and bug fixed
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
202 "<td class='hiddenField'>" + c.isRemoved() + "</td>" + |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
203 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
204 "<td>" + book.getAuthor() + "</td>" + |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
205 "<td>" + book.getEdition() + "</td>" + |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
206 "<td>" + book.getVolume() + "</td>" + |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
207 "<td>" + c.getCoordinatesBook().getPlace_name() + "</td>" + |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
208 "<td> (" + c.getCoordinatesBook().getX() + "," + c.getCoordinatesBook().getY() + ")</td>" + |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
209 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
210 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
211 "</tr>"; |
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
|
212 } |
39 | 213 } |
214 | |
215 text += "</table></body></html>"; | |
216 | |
217 out.println(text); | |
218 out.close(); | |
219 | |
220 logger.info("The file " + fileName + " has been saved correctly."); | |
221 | |
222 | |
223 } | |
224 | |
225 | |
226 | |
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
|
227 public static String saveFile(LGBranch branch, LGFile file, Date date, 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
|
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 String absolutePath = getRootPath() + branch.getSectionId() + "/"; |
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 String 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
|
231 branch.getSectionId() + "_" + |
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 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
|
233 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
|
234 dfmt.format(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
|
235 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
|
236 ".txt"; |
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 File folder = new File(absolutePath); |
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 folder.mkdirs(); |
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 logger.info("Trying to save file " + absolutePath + 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
|
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 PrintWriter out = new PrintWriter(absolutePath + 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
|
244 out.println(file.getContent()); |
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 out.close(); |
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 |
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 logger.info("The file " + fileName + " has been saved correctly."); |
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 return 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
|
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 |
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 public static String getFileAsText(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
|
252 |
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 LGBranch branch = DataProvider.getInstance().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
|
254 |
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 String absolutePath = getRootPath() + branch.getSectionId() + "/" + file.getFileName(); |
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 System.out.println("Loading: " + absolutePath); |
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 byte[] encoded = Files.readAllBytes(Paths.get(absolutePath)); |
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 return new String(encoded, "UTF8"); |
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 } |
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 |
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 public static File getFileAsFile(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
|
262 |
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 LGBranch branch = DataProvider.getInstance().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
|
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 String absolutePath = getRootPath() + branch.getSectionId() + "/" + file.getFileName(); |
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 System.out.println("Loading: " + absolutePath); |
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 return new File(absolutePath); |
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 } |
39 | 269 |
270 | |
271 public static String getFullTextSearchHtmlFileText(LGFullTextSearchFile file) throws Exception { | |
272 | |
273 String absolutePath = PropertiesUtils.getPropValue("ftsearch_root") + "/html/" + file.getUserId().toString() + "/" + file.getFileName() + ".html"; | |
274 System.out.println("Loading: " + absolutePath); | |
275 | |
276 byte[] encoded = Files.readAllBytes(Paths.get(absolutePath)); | |
277 return new String(encoded, "UTF8"); | |
278 | |
279 } | |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
280 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
281 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
282 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
283 protected static void deleteFileFromFileSystemByAbsolutePath(String absolutePath) { |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
284 try{ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
285 File file = new File(absolutePath); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
286 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
287 if(file.delete()){ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
288 System.out.println(file.getName() + " is deleted!"); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
289 }else{ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
290 System.out.println("Delete operation is failed."); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
291 } |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
292 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
293 }catch(Exception e){ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
294 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
295 e.printStackTrace(); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
296 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
297 } |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
298 } |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
299 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
300 public static void deleteFullTextSearchFileCsv(LGFullTextSearchFile file) throws IOException { |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
301 // csv file is in LGMap/datasets/ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
302 String absolutePath = PropertiesUtils.getPropValue("lgmap_datasets") + "/" + file.getUserId() + "_" + file.getFileName() + ".csv"; |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
303 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
304 deleteFileFromFileSystemByAbsolutePath(absolutePath); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
305 } |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
306 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
307 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
308 public static void deleteFullTextSearchFileHtml(LGFullTextSearchFile file) throws IOException { |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
309 // html file is in ftsearch-data/... |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
310 String absolutePath = PropertiesUtils.getPropValue("ftsearch_root") + "/html/" + file.getUserId().toString() + "/" + file.getFileName() + ".html"; |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
311 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
312 deleteFileFromFileSystemByAbsolutePath(absolutePath); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
313 } |
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
|
314 |
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
|
315 |
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
|
316 } |