001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common.web.template;
009:
010: //base classes
011: import java.net.MalformedURLException;
012: import java.util.Enumeration;
013: import javax.servlet.ServletContext;
014: import javax.servlet.ServletContextEvent;
015:
016: //project specific classes
017: import org.jfolder.common.UnexpectedSystemException;
018: import org.jfolder.common.utils.misc.MiscHelper;
019:
020: //other classes
021:
022: public class ConsoleTemplateParameters {
023:
024: private ConsoleTemplateParameters() {
025: }
026:
027: //context root
028: public final static String CONTEXT_ROOT = "/jfolder";
029: public final static String IMAGES_ROOT = CONTEXT_ROOT + "/images";
030: public final static String GIF_BLANK = IMAGES_ROOT + "/blank.gif";
031: public final static String GIF_EMPTY = IMAGES_ROOT + "/empty.gif";
032: public final static String GIF_MACRO_CLICK = IMAGES_ROOT
033: + "/macroClick.gif";
034: public final static String GIF_MACRO_POINTER = IMAGES_ROOT
035: + "/macroPointer.gif";
036: //public final static String GIF_WEB_PAGE_VIEW_HIGHLIGHT =
037: // IMAGES_ROOT + "/macroPointer.gif";
038: //
039: //
040: public final static String GIF_PANE_REMOVE = IMAGES_ROOT
041: + "/pane-remove.gif";
042: public final static String GIF_PANE_STRETCH_HORIZONTALLY = IMAGES_ROOT
043: + "/pane-stretch-horizontally.gif";
044: public final static String GIF_PANE_STRETCH_VERTICALLY = IMAGES_ROOT
045: + "/pane-stretch-vertically.gif";
046: //
047: public final static String GIF_PANE_SHRINK_HORIZONTALLY = IMAGES_ROOT
048: + "/pane-shrink-horizontally.gif";
049: public final static String GIF_PANE_SHRINK_VERTICALLY = IMAGES_ROOT
050: + "/pane-shrink-vertically.gif";
051: //
052: public final static String GIF_PANE_MOVE_TO_LEFT_SECTION = IMAGES_ROOT
053: + "/pane-move-to-left-section.gif";
054: public final static String GIF_PANE_MOVE_TO_CENTER_SECTION = IMAGES_ROOT
055: + "/pane-move-to-center-section.gif";
056: public final static String GIF_PANE_MOVE_TO_RIGHT_SECTION = IMAGES_ROOT
057: + "/pane-move-to-right-section.gif";
058: public final static String GIF_PANE_SWAP_UP = IMAGES_ROOT
059: + "/pane-swap-up.gif";
060: public final static String GIF_PANE_SWAP_DOWN = IMAGES_ROOT
061: + "/pane-swap-down.gif";
062: public final static String GIF_PANE_SWAP_LEFT = IMAGES_ROOT
063: + "/pane-swap-left.gif";
064: public final static String GIF_PANE_SWAP_RIGHT = IMAGES_ROOT
065: + "/pane-swap-right.gif";
066: //
067: public final static String GIF_PANE_LIGHTBULB_ON = IMAGES_ROOT
068: + "/lightbulb-on.gif";
069: public final static String GIF_PANE_LIGHTBULB_OFF = IMAGES_ROOT
070: + "/lightbulb-off.gif";
071: //
072: public final static String GIF_COMPOUND = IMAGES_ROOT
073: + "/compound.gif";
074: //
075: public final static String GIF_WEB_PAGE_VIEW_POP_UP_CLOSE = IMAGES_ROOT
076: + "/webPageViewPopUpClose.gif";
077: //
078: private final static String CONSOLE_NAME = "/Console";
079: public final static String SERVLET_CONSOLE = CONTEXT_ROOT
080: + CONSOLE_NAME;
081: //
082: private final static String DOUBLE_SLASH = "//";
083: private final static String SINGLE_SLASH = "/";
084:
085: public final static String ACTION_FORM = "ACTION_FORM";
086:
087: public final static int COLUMN_WIDTH = 200;
088: public final static int MENU_WIDTH = 100;
089:
090: //
091: public final static String CT_MENU_PREFIX = "CT_MENU_";
092:
093: //public final static String getFilelessRequestURI(
094: // ServletContextEvent inSce) {
095: // //
096: // return getFilelessRequestURI(inSce.getServletContext());
097: //}
098: //public final static String getFilelessRequestURI(ServletContext inSc) {
099: // //
100: // try {
101: // String outValue = null;
102: //
103: // printEnum("attrNames", inSc.getAttributeNames());
104: // printEnum("initParaNames", inSc.getInitParameterNames());
105: // MiscHelper.println("ConTemParams servConName = "
106: // + inSc.getServletContextName());
107: // outValue = inSc.getResource(CONSOLE_NAME).toString();
108: // MiscHelper.println("ConTemParams outValue = " + outValue);
109: // int protocolIndex = outValue.indexOf(DOUBLE_SLASH);
110: // outValue = outValue.substring(
111: // protocolIndex + DOUBLE_SLASH.length());
112: // //
113: // int firstIndex = outValue.indexOf(SINGLE_SLASH);
114: // outValue = outValue.substring(firstIndex);
115: // int lastIndex = outValue.indexOf(SINGLE_SLASH);
116: // outValue = outValue.substring(0, lastIndex);
117: //
118: // return outValue;
119: // }
120: // catch (MalformedURLException mue) {
121: // throw new UnexpectedSystemException(mue);
122: // }
123: //}
124: //private final static void printEnum(String inLabel, Enumeration inEnum) {
125: // MiscHelper.println("ConTemParams " + inLabel);
126: // while (inEnum.hasMoreElements()) {
127: // MiscHelper.println(" - " + inEnum.nextElement());
128: // }
129: //}
130: }
|