Skip to content

Commit 628a02b

Browse files
committed
fixed ehcache issue, tinymce config
1 parent bb8d434 commit 628a02b

3 files changed

Lines changed: 66 additions & 202 deletions

File tree

src/main/java/com/trackstudio/startup/Config.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import java.io.PrintStream;
77
import java.io.Serializable;
88
import java.io.UnsupportedEncodingException;
9-
import java.net.URLEncoder;
109
import java.nio.charset.Charset;
1110
import java.sql.Connection;
1211
import java.sql.DatabaseMetaData;
@@ -39,7 +38,6 @@
3938
import com.trackstudio.app.adapter.AdapterManager;
4039
import com.trackstudio.exception.GranException;
4140
import com.trackstudio.exception.UserException;
42-
import com.trackstudio.kernel.manager.KernelManager;
4341
import com.trackstudio.kernel.manager.TSPropertyManager;
4442
import com.trackstudio.model.Acl;
4543
import com.trackstudio.model.Attachment;
@@ -97,7 +95,8 @@
9795
*/
9896
@ThreadSafe
9997
public class Config implements Serializable {
100-
public static final String TRACKSTUDIO_VERSION = "TrackStudio Enterprise/OS 6.0.0 Apache License 2.0";
98+
private static final String TRACKSTUDIO_VERSION_NUM="6.0.0";
99+
public static final String TRACKSTUDIO_VERSION = "TrackStudio Enterprise/OS "+TRACKSTUDIO_VERSION_NUM+" Apache License 2.0";
101100

102101
private static final Logger log = LoggerFactory.getLogger(Config.class);
103102
private static volatile Config instance;
@@ -777,7 +776,7 @@ public static String getContextPath(HttpServletRequest request) {
777776
* @throws com.trackstudio.exception.GranException for need
778777
*/
779778
public static String getVersionPath() throws GranException {
780-
return "/cssjs";
779+
return "/cssjs/"+TRACKSTUDIO_VERSION_NUM;
781780
}
782781

783782
/**

src/main/resources/ehcache.xml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
eternal="false"
3434
timeToIdleSeconds="600"
3535
timeToLiveSeconds="600"
36-
overflowToDisk="true"
36+
overflowToDisk="false"
3737
/>
3838

3939
<!--Predefined caches. Add your cache configuration settings here.
@@ -64,23 +64,6 @@
6464
disk cache, which in this configuration will go to wherever java.io.tmp is
6565
defined on your system. On a standard Linux system this will be /tmp"
6666
-->
67-
<cache name="sampleCache1"
68-
maxElementsInMemory="100000"
69-
eternal="false"
70-
timeToIdleSeconds="300"
71-
timeToLiveSeconds="600"
72-
overflowToDisk="true"/>
73-
74-
<!-- Sample cache named sampleCache2
75-
This cache contains 1000 elements. Elements will always be held in memory.
76-
They are not expired. -->
77-
<cache name="sampleCache2"
78-
maxElementsInMemory="10000"
79-
eternal="true"
80-
timeToIdleSeconds="0"
81-
timeToLiveSeconds="0"
82-
overflowToDisk="false"
83-
/>
8467

8568
<cache name="hibernate.test.com.trackstudio.model.Umstatus"
8669
maxElementsInMemory="10000"
Lines changed: 62 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,67 @@
1-
function pasteHandler(e) {
2-
var cbData;
3-
if (e.clipboardData) {
4-
cbData = e.clipboardData;
5-
} else if (window.clipboardData) {
6-
cbData = window.clipboardData;
7-
}
8-
9-
if (e.msConvertURL) {
10-
var fileList = cbData.files;
11-
if (fileList.length > 0) {
12-
for (var i = 0; i < fileList.length; i++) {
13-
var blob = fileList[i];
14-
console.log("Image blob: " + blob);
15-
readPastedBlob(blob);
16-
}
17-
}
18-
}
19-
if (cbData && cbData.items) {
20-
if ((text = cbData.getData("text/plain"))) {
21-
// Text pasting is already handled
22-
return;
23-
}
24-
for (var i = 0; i < cbData.items.length; i++) {
25-
if (cbData.items[i].type.indexOf('image') !== -1) {
26-
var blob = cbData.items[i].getAsFile();
27-
readPastedBlob(blob);
28-
}
29-
}
30-
}
31-
32-
function readPastedBlob(blob) {
33-
if (blob) {
34-
reader = new FileReader();
35-
reader.onload = function(evt) {
36-
pasteImage(evt.target.result);
37-
};
38-
reader.readAsDataURL(blob);
39-
}
40-
}
41-
42-
function pasteImage(source) {
43-
var image = "<img src='" + source + "' data-mce-selected='1'></img>";
44-
window.tinyMCE.execCommand('mceInsertContent', false, image);
45-
}
46-
}
47-
48-
tinymce.init({
49-
browser_spellcheck : true,
1+
tinyMCE.init({
2+
custom_shortcuts: false,
3+
content_css: contextPath + "/tinymce.css",
4+
gecko_spellcheck: true,
505
convert_urls: false,
51-
selector: '.mceEditor',
52-
statusbar: false,
53-
height: 150,
54-
// forced_root_block : 'div',
55-
// paste_as_text: true,
56-
paste_data_images: true,
57-
plugins: [
58-
'advlist autolink lists link image charmap print preview anchor',
59-
'searchreplace visualblocks code fullscreen',
60-
'insertdatetime media table contextmenu paste code',
61-
'textcolor template'
62-
],
63-
toolbar: 'insertfile undo redo | styleselect fontselect fontsizeselect | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | template',
64-
setup : function(editor)
65-
{
66-
editor.on('paste', pasteHandler);
67-
68-
editor.on('init', function()
69-
{
70-
this.getDoc().body.style.fontSize = '14px';
71-
});
72-
73-
editor.on('BeforeSetContent', function (e) {
74-
console.log(e.content);
75-
var node = e.content;
76-
if (node.indexOf('<span class="fancytree-expander">') !== -1) {
77-
var start = node.substring(0, node.indexOf('<span class="fancytree-expander">'));
78-
node = node.substring(node.indexOf('<span class="fancytree-expander">'), node.lenght);
79-
node = node.substring(node.indexOf('title="') + 7, node.lenght);
80-
node = start + '#' + node.substring(0, node.indexOf(' ')) + node.substring(node.indexOf('</span>') + 7, node.lenght);
81-
}
82-
e.content = node;
83-
console.log(e.content);
84-
});
85-
86-
editor.addMenuItem('syntax_highlight', {
87-
text: 'Add code',
88-
context: 'tools',
6+
mode: "textareas",
7+
theme: "advanced",
8+
editor_selector: "mceEditor",
9+
plugins: "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
10+
forced_root_block: false,
11+
force_br_newlines: false,
12+
force_p_newlines: false,
13+
theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,cut,copy,pastetext,pasteword,|,undo,redo,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,|,outdent,indent,|,link,unlink,anchor,image,code",
14+
theme_advanced_buttons2: "forecolor,backcolor,|,fontselect,fontsizeselect,|,tablecontrols,|,charmap,iespell,|,print,fullscreen,|,template,btnCode,",
15+
theme_advanced_buttons3: "",
16+
theme_advanced_toolbar_location: "top",
17+
theme_advanced_toolbar_align: "left",
18+
theme_advanced_statusbar_location: "bottom",
19+
theme_advanced_resizing: true,
20+
setup: function(a) {
21+
a.addButton("btnCode", {
22+
title: "Code",
23+
image: "cssimages/code.png",
8924
onclick: function() {
90-
editor.insertContent(
91-
'[code=java][/code]'
92-
);
25+
a.focus();
26+
var b = a.selection.getContent({format: "text"});
27+
a.selection.setContent("[code=java]" + b + "[/code]")
9328
}
94-
});
95-
96-
editor.addMenuItem('video', {
97-
text: 'Add video',
98-
context: 'tools',
99-
onclick: function() {
100-
editor.insertContent(
101-
'Video{task_number:attach_id}'
102-
);
103-
}
104-
});
29+
})
30+
},
31+
skin: "o2k7",
32+
skin_variant: "silver",
33+
template_external_list_url: "js/template_list.js",
34+
external_link_list_url: "js/link_list.js",
35+
external_image_list_url: "js/image_list.js",
36+
media_external_list_url: "js/media_list.js",
37+
template_cdate_classes: "cdate creationdate",
38+
template_mdate_classes: "mdate modifieddate",
39+
template_selected_content_classes: "selcontent",
40+
template_cdate_format: "%m/%d/%Y : %H:%M:%S",
41+
template_mdate_format: "%m/%d/%Y : %H:%M:%S",
42+
template_replace_values: {
43+
username: "Jack Black",
44+
staffid: "991234"
10545
},
106-
templates : [
107-
{
108-
title : "--------"
109-
},
110-
{
111-
title : "FullPathLink",
112-
url : "template_macros/FullPathLink.html",
113-
description : "It converts tasks number to a link and replaces tasks name to full link"
114-
},
115-
{
116-
title : "SimpleNameLink",
117-
url : "template_macros/SimpleNameLink.html",
118-
description : "It converts tasks number to a link"
119-
},
120-
{
121-
title : "--------"
122-
},
123-
{
124-
title : "SubtaskFilter",
125-
url : "template_macros/SubtaskFilter.html",
126-
description : "It converts tasks number to a table which has list of subtasks by filter"
127-
},
128-
{
129-
title : "--------"
130-
},
131-
{
132-
title : "UDFViewMacro",
133-
url : "template_macros/UDFViewMacro.html",
134-
description : "It converts tasks number to a view of udf"
135-
},
136-
{
137-
title : "--------"
138-
},
139-
{
140-
title : "BurndownChart",
141-
url : "template_macros/BurndownChart.html",
142-
description : "It converts tasks number to a Burndown Chat"
143-
},
144-
{
145-
title : "PersonalActivityChart",
146-
url : "template_macros/PersonalActivityChart.html",
147-
description : "It converts tasks number to a PersonalActivity Chart"
148-
},
149-
{
150-
title : "TeamActivityChart",
151-
src : "template_macros/TeamActivityChart.html",
152-
description : "It converts tasks number to a TeamActivity Chart"
153-
},
154-
{
155-
title : "TrendChart",
156-
url : "template_macros/TrendChart.html",
157-
description : "It converts tasks number to a Trend Chart"
158-
},
159-
{
160-
title : "SpentTimeChart",
161-
url : "template_macros/SpentTimeChart.html",
162-
description : "It converts tasks number to a SpentTime Chart"
163-
},
164-
{
165-
title : "WorkloadChart",
166-
url : "template_macros/WorkloadChart.html",
167-
description : "It converts tasks number to a Workload Chart"
168-
},
169-
{
170-
title : "StateChart",
171-
url : "template_macros/StateChart.html",
172-
description : "It converts tasks number to a State Chart"
173-
},
174-
{
175-
title : "ResolutionChart",
176-
url : "template_macros/ResolutionChart.html",
177-
description : "It converts tasks number to a Resolution Chart"
178-
},
179-
{
180-
title : "SyntaxHighlighter",
181-
url : "template_macros/SyntaxHighlighter.html",
182-
description : "It highlights the code"
183-
}
46+
template_templates: [
47+
{title: "--------"},
48+
{title: "FullPathLink", src: "template_macros/FullPathLink.html", description: "It converts tasks number to a link and replaces tasks name to full link"},
49+
{title: "SimpleNameLink", src: "template_macros/SimpleNameLink.html", description: "It converts tasks number to a link"},
50+
{title: "--------"},
51+
{title: "SubtaskFilter", src: "template_macros/SubtaskFilter.html", description: "It converts tasks number to a table which has list of subtasks by filter"},
52+
{title: "--------"},
53+
{title: "UDFViewMacro", src: "template_macros/UDFViewMacro.html", description: "It converts tasks number to a view of udf"},
54+
{title: "--------"},
55+
{title: "BurndownChart", src: "template_macros/BurndownChart.html", description: "It converts tasks number to a Burndown Chat"},
56+
{title: "PersonalActivityChart", src: "template_macros/PersonalActivityChart.html", description: "It converts tasks number to a PersonalActivity Chart"},
57+
{title: "TeamActivityChart", src: "template_macros/TeamActivityChart.html", description: "It converts tasks number to a TeamActivity Chart"},
58+
{title: "TrendChart", src: "template_macros/TrendChart.html", description: "It converts tasks number to a Trend Chart"},
59+
{title: "SpentTimeChart", src: "template_macros/SpentTimeChart.html", description: "It converts tasks number to a SpentTime Chart"},
60+
{title: "WorkloadChart", src: "template_macros/WorkloadChart.html", description: "It converts tasks number to a Workload Chart"},
61+
{title: "StateChart", src: "template_macros/StateChart.html", description: "It converts tasks number to a State Chart"},
62+
{title: "ResolutionChart", src: "template_macros/ResolutionChart.html", description: "It converts tasks number to a Resolution Chart"},
63+
{title: "SyntaxHighlighter", src: "template_macros/SyntaxHighlighter.html", description: "It highlights the code"}
18464
]
185-
});
65+
});
66+
67+
var is_new = true;

0 commit comments

Comments
 (0)