01: /*
02: * SourceStatementsHelp.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db;
13:
14: /**
15: *
16: * @author support@sql-workbench.net
17: */
18: public class SourceStatementsHelp {
19:
20: public SourceStatementsHelp() {
21: }
22:
23: public static final String VIEW_ERROR_START = "Support for displaying view source is currently not configured for:";
24: public static final String PROC_ERROR_START = "Support for displaying procedure source is currently not configured for:";
25:
26: public String explainMissingViewSourceSql(String product) {
27: String explain = VIEW_ERROR_START
28: + " "
29: + product
30: + "\n\nTo enable this, create a file called ViewSourceStatements.xml\n"
31: + "in the same directory where Workbench.jar is located by using the supplied sample below\n"
32: + "filling out the necessary SELECT statement where indicated to retrieve the source from the DBMS:\n\n"
33: + "--- Example ViewSourceStatements.xml starts here ---\n"
34: + "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n"
35: + "<java version=\"1.4.0_01\" class=\"java.beans.XMLDecoder\"> \n"
36: + " \n"
37: + " <object class=\"java.util.HashMap\"> \n"
38: + " <void method=\"put\"> \n"
39: + " <string>"
40: + product
41: + "</string> \n"
42: + " <object class=\"workbench.db.GetMetaDataSql\"> \n"
43: + " <void property=\"baseSql\"> \n"
44: + " <string>THE SELECT TO RETRIEVE THE SOURCE FOR A VIEW</string> \n"
45: + " </void> \n"
46: + " <void property=\"objectNameField\"> \n"
47: + " <string>THE COLUMN FROM THE SELECT THAT IDENTIFIES THE VIEW NAME</string> \n"
48: + " </void> \n"
49: + " <void property=\"schemaField\"> \n"
50: + " <string>THE COLUMN FROM THE SELECT THAT IDENTIFIES THE VIEW SCHEMA (if necessary)</string> \n"
51: + " </void> \n"
52: + " <void property=\"orderBy\"> \n"
53: + " <string>DEFINE AN ORDER BY CLAUSE FOR THE SELECT STATEMENT</string> \n"
54: + " </void> \n" + " </object> \n"
55: + " </void> \n" + " \n" + " </object> \n"
56: + "</java>";
57: return explain;
58: }
59:
60: public String explainMissingProcSourceSql(String product) {
61: String explain = PROC_ERROR_START
62: + " "
63: + product
64: + "\n\nTo enable this, create a file called ProcSourceStatements.xml\n"
65: + "in the same directory where Workbench.jar is located by using the supplied sample below\n"
66: + "filling out the necessary SELECT statement where indicated to retrieve the source from the DBMS:\n\n"
67: + "--- Example ProcSourceStatements.xml starts here ---\n"
68: + "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n"
69: + "<java version=\"1.4.0_01\" class=\"java.beans.XMLDecoder\"> \n"
70: + " <object class=\"java.util.HashMap\"> \n"
71: + " <void method=\"put\"> \n"
72: + " <string>"
73: + product
74: + "</string> \n"
75: + " <object class=\"workbench.db.GetMetaDataSql\"> \n"
76: + " <void property=\"baseSql\"> \n"
77: + " <string>THE SELECT TO RETRIEVE THE SOURCE FOR A PROCEDURE/FUNCTION</string> \n"
78: + " </void> \n"
79: + " <void property=\"objectNameField\"> \n"
80: + " <string>THE COLUMN FROM THE SELECT THAT IDENTIFIES THE PROCEDURE NAME</string> \n"
81: + " </void> \n"
82: + " <void property=\"schemaField\"> \n"
83: + " <string>THE COLUMN FROM THE SELECT THAT IDENTIFIES THE PROCEDURE SCHEMA (if necessary)</string> \n"
84: + " </void> \n"
85: + " <void property=\"orderBy\"> \n"
86: + " <string>DEFINE AN ORDER BY CLAUSE FOR THE SELECT STATEMENT (if necessary)</string> \n"
87: + " </void> \n" + " </object> \n"
88: + " </void> \n" + " \n" + " </object> \n"
89: + "</java> ";
90: return explain;
91: }
92:
93: }
|