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.console.web.admin.macro.execute;
009:
010: //base classes
011: import java.io.IOException;
012: import java.util.ArrayList;
013: import javax.servlet.ServletException;
014:
015: //project specific classes
016: import org.jfolder.common.files.BaseVirtualFileSystemHolder;
017: import org.jfolder.common.tagging.ConceptRollupTag;
018: import org.jfolder.common.tagging.ConceptTagCharacteristic;
019: import org.jfolder.common.tagging.RootConceptTagHolder;
020: import org.jfolder.common.utils.misc.CommonSeparators;
021: import org.jfolder.common.utils.web.ParameterSet;
022: import org.jfolder.common.web.template.ConsoleTemplateFunctionsContext;
023: import org.jfolder.common.web.template.SubmitActionContext;
024: import org.jfolder.common.web.template.SubmitActionParameters;
025: import org.jfolder.console.base.BaseConsoleServlet;
026: import org.jfolder.console.base.ConsolePageContext;
027: import org.jfolder.console.base.ConsolePageParameters;
028: import org.jfolder.console.base.ConsolePageSession;
029: import org.jfolder.console.base.NamesForParentCpc;
030: import org.jfolder.console.macro.ConsoleMacro;
031: import org.jfolder.console.macro.ConsoleMacroTagHelper;
032: import org.jfolder.console.macro.v1.GoToAndChangeValueConsoleMacroTag;
033: import org.jfolder.console.macro.v1.GoToConsoleMacroTag;
034: import org.jfolder.console.macro.v1.OpenSectionIfClosedConsoleMacroTag;
035: import org.jfolder.console.macro.v1.RootV1ConsoleMacroTag;
036: import org.jfolder.console.macro.v1.SimpleClickConsoleMacroTag;
037: import org.jfolder.console.macro.v1.SubmitActionConsoleMacroTag;
038: import org.jfolder.console.web.base.ConsoleScreenContext;
039: import org.jfolder.console.web.base.SubAppDirConsolePageContext;
040: import org.jfolder.security.model.UserHolder;
041:
042: //other classes
043:
044: public class PetStoreActivityOpenWebPage extends CommonPetStoreActivity {
045:
046: //
047: private PetStoreActivityOpenWebPage() {
048: }
049:
050: //
051: public final static void getOpenWebPage(
052: RootV1ConsoleMacroTag inRv1cmt, String inAppName,
053: String inDirName, String inWebPage) {
054:
055: //
056: ConceptTagCharacteristic currentActionCtchar = null;
057: String fromHandle = null;
058: String sourPage = null;
059: String destPage = null;
060: String treeState = null;
061: ////////////
062: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
063: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
064: destPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
065: treeState = getBaseTree();
066: //
067: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
068: fromHandle, sourPage, destPage);
069: //
070: OpenSectionIfClosedConsoleMacroTag.newInstance(
071: currentActionCtchar, getSectionDev(),
072: getSectionDevToggler());
073: //
074: OpenSectionIfClosedConsoleMacroTag.newInstance(
075: currentActionCtchar, getSectionDevApps(),
076: getSectionDevAppsToggler());
077: //
078: OpenSectionIfClosedConsoleMacroTag.newInstance(
079: currentActionCtchar,
080: getSectionDevAppsSpecificApp(inAppName),
081: getSectionDevAppsSpecificAppToggler(inAppName));
082: //
083: OpenSectionIfClosedConsoleMacroTag.newInstance(
084: currentActionCtchar,
085: getSectionDevAppsSpecificAppWebDocs(inAppName),
086: getSectionDevAppsSpecificAppWebDocsToggler(inAppName));
087: //
088: ArrayList dirNameParts = BaseVirtualFileSystemHolder
089: .parseDirectoryName(inDirName);
090: //
091: StringBuffer currentDirName = new StringBuffer();
092: currentDirName.append(getAppSubDir(inAppName));
093: //
094: OpenSectionIfClosedConsoleMacroTag.newInstance(
095: currentActionCtchar, currentDirName.toString(),
096: appendSubDirImage(currentDirName.toString()),
097: appendSubDirImage(currentDirName.toString()),
098: ConsolePageParameters.GIF_OPEN_FOLDER);
099: for (int i = 0; i < dirNameParts.size(); i++) {
100: currentDirName.append(","
101: + SubAppDirConsolePageContext.PREFIX__DIRECTORY
102: + dirNameParts.get(i));
103: OpenSectionIfClosedConsoleMacroTag.newInstance(
104: currentActionCtchar, currentDirName.toString(),
105: appendSubDirImage(currentDirName.toString()),
106: appendSubDirImage(currentDirName.toString()),
107: ConsolePageParameters.GIF_OPEN_FOLDER);
108: }
109: //
110: GoToConsoleMacroTag.newInstance(currentActionCtchar,
111: currentDirName.toString() + ","
112: + SubAppDirConsolePageContext.PREFIX__FILE
113: + inWebPage + ",[STATIC_IMAGE],IMAGE__EDIT");
114: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
115: //
116: SubmitActionContext openWebPageSac = SubmitActionContext
117: .newInstance(sourPage, fromHandle, fromHandle);
118: //
119: SubAppDirConsolePageContext.initializeEditWebPage(
120: openWebPageSac, false, inAppName, inDirName, inWebPage);
121: //GoToAndChangeValueConsoleMacroTag.newInstance(
122: // currentActionCtchar,
123: // "(main),DEVELOP,APPLICATIONS," + inAppName
124: // + ",WEB,[TEXT_BOX],INPUT_DIRECTORY_NAME",
125: // inDirName);
126: //
127: //GoToAndChangeValueConsoleMacroTag.newInstance(
128: // currentActionCtchar,
129: // "(main),DEVELOP,APPLICATIONS," + inAppName
130: // + ",WEB,[TEXT_BOX],INPUT_CREATE_PAGE",
131: // inWebPage);
132: //
133: //
134: //GoToConsoleMacroTag.newInstance(
135: // currentActionCtchar,
136: // "(main),DEVELOP,APPLICATIONS," + inAppName
137: // + ",WEB,[TABLE_BUTTON],BUTTON__US_CRE_PAGE");
138: //SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
139: //
140: //
141: //
142: //
143: //
144: //SubmitActionContext createWebPageSac =
145: // SubmitActionContext.newInstance(
146: // sourPage, fromHandle, fromHandle);
147: //
148: //ConsoleScreenContext.initializeCreateWebPageSac(
149: // createWebPageSac, inAppName, inDirName, inWebPage, false);
150: //
151: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
152: openWebPageSac);
153: //
154:
155: //notes
156: //include property to select database type
157: //
158: //declare properties
159: //if project is deployed, remove it
160: //if project is under development, remove it
161: //create project under development
162: }
163:
164: protected final static String getAppSubDir(String inAppName) {
165: return ("(main),DEVELOP,APPLICATIONS,"
166: + inAppName
167: + ",WEB,("
168: + SubAppDirConsolePageContext.constructName(inAppName,
169: false) + ")");
170: }
171:
172: protected final static String appendSubDirImage(String inHandle) {
173:
174: return (inHandle + ",[STATIC_IMAGE],I_DIRECTORY_IMAGE");
175: }
176: }
|