01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2008 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: * $Id$
24: */
25:
26: package com.bostechcorp.cbesb.console.server;
27:
28: import java.io.File;
29: import java.io.IOException;
30:
31: import com.bostechcorp.cbesb.common.util.EsbPathHelper;
32: import com.bostechcorp.cbesb.common.util.FileUtil;
33: import com.bostechcorp.cbesb.console.i18n.ConsoleMessages;
34: import com.bostechcorp.cbesb.console.rpc.Support;
35: import com.google.gwt.core.client.GWT;
36:
37: /**
38: * @author rui.hou
39: *
40: */
41: public class SupportImpl extends ConsoleRemoteServiceServlet implements
42: Support {
43:
44: /**
45: *
46: */
47: private static final long serialVersionUID = -2839608218617985663L;
48: public static String CBESB_HOME = EsbPathHelper.getCbesbHomeDir();
49: public static String SUPPORT_HOME = "/brand";
50:
51: public String getSupportHtml(String filename) {
52: String fileContent = null;
53: File file = new File(CBESB_HOME + SUPPORT_HOME + "/" + filename);
54: if (!file.exists())
55: fileContent = "<html><table border=\"0\"><tr><td><b>Web page:</b></td>"
56: + "<td><a href=\"http://www.chainforge.net\"><big>http://www.chainforge.net</big></a></td>"
57: + "</tr><tr><td><b>Support Email:</b></td><td><a href=\"mailto:support@bostechcorp.com\"><big>support@bostechcorp.com</big></a> </td>"
58: + "</tr><tr><td><b>Support Phone:</b></td><td></big> 614-918-2880 <big></td></tr></table></html>";
59: // "There is no support file in the specified path.";
60: else {
61: try {
62: fileContent = FileUtil.readStringFromFile(CBESB_HOME
63: + SUPPORT_HOME + "/" + filename);
64: } catch (IOException e) {
65: // TODO Auto-generated catch block
66: e.printStackTrace();
67: }
68: }
69: return fileContent;
70: }
71:
72: }
|