0001: /*
0002: * JFolder, Copyright 2001-2006 Gary Steinmetz
0003: *
0004: * Distributable under LGPL license.
0005: * See terms of license at gnu.org.
0006: */
0007:
0008: package org.jfolder.console.web.admin.macro.generator;
0009:
0010: //base classes
0011: import java.io.IOException;
0012: import java.util.ArrayList;
0013: import java.util.HashMap;
0014:
0015: //project specific classes
0016: import org.jfolder.common.files.BaseVirtualFileSystemHolder;
0017: import org.jfolder.common.function.WebPageTagPreferences;
0018: import org.jfolder.common.tagging.ConceptRollupTag;
0019: import org.jfolder.common.tagging.ConceptTagCharacteristic;
0020: import org.jfolder.common.tagging.ConceptTagConstraint;
0021: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
0022: import org.jfolder.common.tagging.ConceptTagPreferences;
0023: import org.jfolder.common.tagging.RootConceptTagHolder;
0024: import org.jfolder.common.utils.misc.CommonSeparators;
0025: import org.jfolder.common.utils.misc.MiscHelper;
0026: import org.jfolder.common.utils.xml.XMLHelper;
0027: import org.jfolder.common.web.template.ConsoleParameterContext;
0028: import org.jfolder.common.web.template.SubmitActionContext;
0029: import org.jfolder.common.web.template.SubmitActionParameters;
0030: import org.jfolder.console.base.ConsolePageContext;
0031: import org.jfolder.console.base.ConsolePageParameters;
0032: import org.jfolder.console.base.ConsolePageSession;
0033: import org.jfolder.console.base.NamesForParentCpc;
0034: import org.jfolder.console.macro.ConsoleMacroTagHelper;
0035: import org.jfolder.console.macro.v1.CreationParameterConsoleMacroTag;
0036: import org.jfolder.console.macro.v1.GoToAndChangeValueConsoleMacroTag;
0037: import org.jfolder.console.macro.v1.GoToConsoleMacroTag;
0038: import org.jfolder.console.macro.v1.OpenSectionIfClosedConsoleMacroTag;
0039: import org.jfolder.console.macro.v1.RcthConstraintBuilderConsoleMacroTag;
0040: import org.jfolder.console.macro.v1.RcthLeaveConsoleMacroTag;
0041: import org.jfolder.console.macro.v1.RcthSaveConsoleMacroTag;
0042: import org.jfolder.console.macro.v1.RootV1ConsoleMacroTag;
0043: import org.jfolder.console.macro.v1.SelectMenuItemConsoleMacroTag;
0044: import org.jfolder.console.macro.v1.SimpleClickConsoleMacroTag;
0045: import org.jfolder.console.macro.v1.SubmitActionConsoleMacroTag;
0046: import org.jfolder.console.web.base.ConsoleScreenContext;
0047: import org.jfolder.console.web.base.SubAppDirConsolePageContext;
0048: import org.jfolder.services.workflow.WorkflowServiceCaller;
0049: import org.jfolder.services.workflow.WorkflowServiceCallerFactory;
0050:
0051: //other classes
0052:
0053: public class AutoApplicationGeneratorHelper {
0054:
0055: //
0056: private AutoApplicationGeneratorHelper() {
0057: //
0058: }
0059:
0060: //
0061: //
0062: //
0063: protected final static void goToDatabaseAccess(
0064: RootV1ConsoleMacroTag inRv1cmt) {
0065: //
0066: //
0067: ConceptTagCharacteristic currentActionCtchar = null;
0068: String fromHandle = null;
0069: String sourPage = null;
0070: String destPage = null;
0071: //String treeState = null;
0072: ////////////
0073: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0074: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0075: destPage = ConsolePageParameters.SERVLET_DATABASE_ACCESS;
0076: //treeState = getBaseTree();
0077: //
0078: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0079: fromHandle, sourPage, destPage);
0080: //
0081: //
0082: OpenSectionIfClosedConsoleMacroTag.newInstance(
0083: currentActionCtchar, "(main),ADMINISTER",
0084: "(main),ADMINISTER,[TOGGLE_CALLER],TOG_CALL__ADMIN");
0085: //
0086: OpenSectionIfClosedConsoleMacroTag
0087: .newInstance(currentActionCtchar,
0088: "(main),ADMINISTER,MONITOR",
0089: "(main),ADMINISTER,MONITOR,[TOGGLE_CALLER],TOG_CALL__ADMIN_OTHER");
0090: //
0091: GoToConsoleMacroTag
0092: .newInstance(currentActionCtchar,
0093: "(main),ADMINISTER,MONITOR,[TABLE_BUTTON],BUTTON__DB_ACCESS");
0094: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0095: //
0096: //
0097: //
0098: //
0099: //
0100: //
0101: SubmitActionContext databaseAccessSac = SubmitActionContext
0102: .newInstance(sourPage, fromHandle, fromHandle);
0103: //
0104: databaseAccessSac.addAction(
0105: ConsoleParameterContext.FIRST_INPUT,
0106: SubmitActionParameters.OPEN);
0107: //
0108: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0109: databaseAccessSac);
0110: //
0111: }
0112:
0113: //
0114: //
0115: //
0116: protected final static void goToConsoleScreen(
0117: RootV1ConsoleMacroTag inRv1cmt) {
0118: //
0119: //
0120: //
0121: ConceptTagCharacteristic currentActionCtchar = null;
0122: String fromHandle = null;
0123: String sourPage = null;
0124: String destPage = null;
0125: //String treeState = null;
0126: ////////////
0127: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0128: sourPage = ConsolePageParameters.SERVLET_DATABASE_ACCESS;
0129: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0130: //treeState = getBaseTree();
0131: //
0132: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0133: fromHandle, sourPage, destPage);
0134: //
0135: //
0136: GoToConsoleMacroTag.newInstance(currentActionCtchar,
0137: "(main),[TABLE_BUTTON],BUTTON__GO_BACK");
0138: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0139: //
0140: //
0141: //
0142: //
0143: //
0144: //
0145: SubmitActionContext goBackSac = SubmitActionContext
0146: .newInstance(sourPage, fromHandle, fromHandle);
0147: //
0148: goBackSac.addAction(ConsoleParameterContext.FIRST_INPUT,
0149: SubmitActionParameters.RETURN);
0150: goBackSac.addAction(ConsoleParameterContext.SECOND_INPUT,
0151: SubmitActionParameters.DATABASE_ACCESS);
0152: //
0153: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0154: goBackSac);
0155: //
0156: }
0157:
0158: //
0159: //
0160: //
0161: protected final static void executeStatement(
0162: RootV1ConsoleMacroTag inRv1cmt, String inStatement,
0163: byte inUploadContent[], String inUploadName) {
0164: //
0165: //
0166: //
0167: ConceptTagCharacteristic currentActionCtchar = null;
0168: String fromHandle = null;
0169: String sourPage = null;
0170: String destPage = null;
0171: //String treeState = null;
0172: ////////////
0173: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0174: sourPage = ConsolePageParameters.SERVLET_DATABASE_ACCESS;
0175: destPage = ConsolePageParameters.SERVLET_DATABASE_ACCESS;
0176: //treeState = getBaseTree();
0177: //
0178: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0179: fromHandle, sourPage, destPage);
0180: //
0181: //
0182: //
0183: //
0184: //inStatement = XMLHelper.fromStringToJSCData(inStatement);
0185: //
0186: //
0187: //
0188: GoToAndChangeValueConsoleMacroTag.newInstance(
0189: currentActionCtchar, "(main),[DROP_DOWN_BOX],DATABASE",
0190: "DefaultDatabase");
0191: //
0192: GoToAndChangeValueConsoleMacroTag.newInstance(
0193: currentActionCtchar,
0194: "(main),[DROP_DOWN_BOX],BREAK_MULTI", "TRUE");
0195: //
0196: GoToAndChangeValueConsoleMacroTag.newInstance(
0197: currentActionCtchar, "(main),[TEXT_AREA],STATEMENT",
0198: inStatement);
0199: //
0200: if (inUploadContent != null && inUploadName != null) {
0201: //
0202: String fileUploadId = "(main),[FILE_UPLOAD],FILE_UPLOAD__BINARY";
0203: GoToAndChangeValueConsoleMacroTag.newInstance(
0204: currentActionCtchar, fileUploadId, inUploadName);
0205: //
0206: inRv1cmt.addParameterAsFileUpload(fileUploadId,
0207: inUploadName, inUploadContent);
0208: }
0209: //
0210: GoToConsoleMacroTag.newInstance(currentActionCtchar,
0211: "(main),[TABLE_BUTTON],BUTTON__EXEC_STAT");
0212: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0213: //
0214: //
0215: //
0216: //
0217: //
0218: SubmitActionContext sacExeStatement = SubmitActionContext
0219: .newInstance(sourPage, fromHandle, fromHandle);
0220: //
0221: sacExeStatement.addAction(ConsoleParameterContext.FIRST_INPUT,
0222: SubmitActionParameters.EXECUTE);
0223: sacExeStatement.addAction(ConsoleParameterContext.SECOND_INPUT,
0224: SubmitActionParameters.STATEMENT);
0225: //
0226: sacExeStatement.addParameter(
0227: ConsoleParameterContext.FIRST_INPUT, "DefaultDatabase");
0228: sacExeStatement.addParameter(
0229: ConsoleParameterContext.SECOND_INPUT, "TRUE");
0230: sacExeStatement.addParameter(
0231: ConsoleParameterContext.THIRD_INPUT, "50");
0232: sacExeStatement.addParameter(
0233: ConsoleParameterContext.FOURTH_INPUT, inStatement);
0234: sacExeStatement.addParameter(
0235: ConsoleParameterContext.FIFTH_INPUT,
0236: "(main),[FILE_UPLOAD],FILE_UPLOAD__BINARY");
0237: //
0238: //
0239: //
0240: //
0241: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0242: sacExeStatement);
0243: //
0244: }
0245:
0246: //
0247: //
0248: //
0249: //
0250: //
0251: //
0252: //
0253: //
0254: //
0255: //
0256: //
0257: //
0258: //
0259: //
0260: //
0261: //
0262: //
0263: //
0264: //
0265: //
0266: //
0267: //
0268: //
0269: //
0270: //
0271: //
0272: //
0273: //
0274: //protected final static String getBaseTree() {
0275: // return (CommonSeparators.BRANCH_SEPARATOR + "(main)"
0276: // + CommonSeparators.BRANCH_SEPARATOR);
0277: //}
0278: //
0279: protected final static String getSectionDev() {
0280: return ("(main),DEVELOP");
0281: }
0282:
0283: protected final static String getSectionDevToggler() {
0284: return ("(main),DEVELOP,[TOGGLE_CALLER],TOG_CALL__DEVEL");
0285: }
0286:
0287: protected final static String getSectionDevApps() {
0288: return ("(main),DEVELOP,APPLICATIONS");
0289: }
0290:
0291: protected final static String getSectionDevAppsToggler() {
0292: return ("(main),DEVELOP,APPLICATIONS,[TOGGLE_CALLER],TOG_CALL__DEV_APPS");
0293: }
0294:
0295: //
0296: protected final static String getSectionDevAppsSpecificApp() {
0297: return ("(main),DEVELOP,APPLICATIONS," + ConsoleMacroTagHelper
0298: .getApplicationVariableName());
0299: }
0300:
0301: protected final static String getSectionDevAppsSpecificAppToggler() {
0302: //
0303: return ("(main),DEVELOP,APPLICATIONS,"
0304: + ConsoleMacroTagHelper.getApplicationVariableName() + ",[TOGGLE_CALLER],TOG_CALL__USER_APP");
0305: }
0306:
0307: //
0308: protected final static String getSectionDevAppsSpecificAppWebDocs() {
0309: //
0310: return ("(main),DEVELOP,APPLICATIONS,"
0311: + ConsoleMacroTagHelper.getApplicationVariableName() + ",WEB");
0312: }
0313:
0314: protected final static String getSectionDevAppsSpecificAppWebDocsToggler() {
0315: //
0316: return ("(main),DEVELOP,APPLICATIONS,"
0317: + ConsoleMacroTagHelper.getApplicationVariableName() + ",WEB,[TOGGLE_CALLER],TOG_CALL__WEB");
0318: }
0319:
0320: //
0321: //
0322: //
0323: protected final static String getStudioHandle(ArrayList inHandle) {
0324:
0325: String outValue = null;
0326:
0327: outValue = MiscHelper.reassembleHandle(inHandle,
0328: CommonSeparators.TOGGLE_LINK_SEPARATOR);
0329:
0330: return outValue;
0331: }
0332:
0333: //
0334: //
0335: //
0336: protected final static String getWebPageHandle(ArrayList inHandle) {
0337:
0338: String outValue = null;
0339:
0340: WebPageTagPreferences wptp = new WebPageTagPreferences();
0341:
0342: outValue = MiscHelper.reassembleHandle(inHandle, wptp
0343: .getHandleConjunction());
0344:
0345: return outValue;
0346: }
0347:
0348: //
0349: //
0350: //
0351: //
0352: protected final static void getCreateApp(
0353: RootV1ConsoleMacroTag inRv1cmt) {
0354:
0355: //
0356: ConceptTagCharacteristic currentActionCtchar = null;
0357: String fromHandle = null;
0358: String sourPage = null;
0359: String destPage = null;
0360: //String treeState = null;
0361: ////////////
0362: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0363: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0364: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0365: //treeState = getBaseTree();
0366: //
0367: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0368: fromHandle, sourPage, destPage);
0369: //
0370: OpenSectionIfClosedConsoleMacroTag.newInstance(
0371: currentActionCtchar, getSectionDev(),
0372: getSectionDevToggler());
0373: //
0374: OpenSectionIfClosedConsoleMacroTag.newInstance(
0375: currentActionCtchar, getSectionDevApps(),
0376: getSectionDevAppsToggler());
0377: //
0378: GoToAndChangeValueConsoleMacroTag
0379: .newInstance(
0380: currentActionCtchar,
0381: "(main),DEVELOP,APPLICATIONS,[TEXT_BOX],APPLICATION_TO_CREATE",
0382: ConsoleMacroTagHelper
0383: .getApplicationVariableName());
0384: //
0385: GoToConsoleMacroTag
0386: .newInstance(currentActionCtchar,
0387: "(main),DEVELOP,APPLICATIONS,[TABLE_BUTTON],BUTTON__US_NEW_APP");
0388: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0389: //
0390: //
0391: //
0392: //
0393: //
0394: SubmitActionContext createAppSac = SubmitActionContext
0395: .newInstance(sourPage, fromHandle, fromHandle);
0396: //
0397: ConsoleScreenContext.initializeCreateAppSac(createAppSac,
0398: ConsoleMacroTagHelper.getApplicationVariableName(),
0399: false);
0400: //
0401: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0402: createAppSac);
0403: //
0404:
0405: //notes
0406: //include property to select database type
0407: //
0408: //declare properties
0409: //if project is deployed, remove it
0410: //if project is under development, remove it
0411: //create project under development
0412: }
0413:
0414: //
0415: //
0416: //
0417: //
0418: //
0419: //
0420: public final static void getCreateWebPage(
0421: RootV1ConsoleMacroTag inRv1cmt, String inDirName,
0422: String inWebPage) {
0423:
0424: //
0425: ConceptTagCharacteristic currentActionCtchar = null;
0426: String fromHandle = null;
0427: String sourPage = null;
0428: String destPage = null;
0429: //String treeState = null;
0430: ////////////
0431: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0432: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0433: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0434: //treeState = getBaseTree();
0435: //
0436: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0437: fromHandle, sourPage, destPage);
0438: //
0439: OpenSectionIfClosedConsoleMacroTag.newInstance(
0440: currentActionCtchar, getSectionDev(),
0441: getSectionDevToggler());
0442: //
0443: OpenSectionIfClosedConsoleMacroTag.newInstance(
0444: currentActionCtchar, getSectionDevApps(),
0445: getSectionDevAppsToggler());
0446: //
0447: OpenSectionIfClosedConsoleMacroTag.newInstance(
0448: currentActionCtchar, getSectionDevAppsSpecificApp(),
0449: getSectionDevAppsSpecificAppToggler());
0450: //
0451: OpenSectionIfClosedConsoleMacroTag.newInstance(
0452: currentActionCtchar,
0453: getSectionDevAppsSpecificAppWebDocs(),
0454: getSectionDevAppsSpecificAppWebDocsToggler());
0455: //
0456: //
0457: GoToAndChangeValueConsoleMacroTag.newInstance(
0458: currentActionCtchar, "(main),DEVELOP,APPLICATIONS,"
0459: + ConsoleMacroTagHelper
0460: .getApplicationVariableName()
0461: + ",WEB,[TEXT_BOX],INPUT_DIRECTORY_NAME",
0462: inDirName);
0463: //
0464: GoToAndChangeValueConsoleMacroTag.newInstance(
0465: currentActionCtchar, "(main),DEVELOP,APPLICATIONS,"
0466: + ConsoleMacroTagHelper
0467: .getApplicationVariableName()
0468: + ",WEB,[TEXT_BOX],INPUT_CREATE_PAGE",
0469: inWebPage);
0470: //
0471: //
0472: GoToConsoleMacroTag.newInstance(currentActionCtchar,
0473: "(main),DEVELOP,APPLICATIONS,"
0474: + ConsoleMacroTagHelper
0475: .getApplicationVariableName()
0476: + ",WEB,[TABLE_BUTTON],BUTTON__US_CRE_PAGE");
0477: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0478: //
0479: //
0480: //
0481: //
0482: //
0483: SubmitActionContext createWebPageSac = SubmitActionContext
0484: .newInstance(sourPage, fromHandle, fromHandle);
0485: //
0486: ConsoleScreenContext.initializeCreateWebPageSac(
0487: createWebPageSac, ConsoleMacroTagHelper
0488: .getApplicationVariableName(), inDirName,
0489: inWebPage, false);
0490: //
0491: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0492: createWebPageSac);
0493: //
0494:
0495: //notes
0496: //include property to select database type
0497: //
0498: //declare properties
0499: //if project is deployed, remove it
0500: //if project is under development, remove it
0501: //create project under development
0502: }
0503:
0504: //
0505: //
0506: //
0507: public final static void getCreateWebFile(
0508: RootV1ConsoleMacroTag inRv1cmt, String inDirName,
0509: String inWebFile, byte inWebFileContent[]) {
0510:
0511: //
0512: ConceptTagCharacteristic currentActionCtchar = null;
0513: String fromHandle = null;
0514: String sourPage = null;
0515: String destPage = null;
0516: //String treeState = null;
0517: ////////////
0518: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0519: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0520: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0521: //treeState = getBaseTree();
0522: //
0523: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0524: fromHandle, sourPage, destPage);
0525: //
0526: OpenSectionIfClosedConsoleMacroTag.newInstance(
0527: currentActionCtchar, getSectionDev(),
0528: getSectionDevToggler());
0529: //
0530: OpenSectionIfClosedConsoleMacroTag.newInstance(
0531: currentActionCtchar, getSectionDevApps(),
0532: getSectionDevAppsToggler());
0533: //
0534: OpenSectionIfClosedConsoleMacroTag.newInstance(
0535: currentActionCtchar, getSectionDevAppsSpecificApp(),
0536: getSectionDevAppsSpecificAppToggler());
0537: //
0538: OpenSectionIfClosedConsoleMacroTag.newInstance(
0539: currentActionCtchar,
0540: getSectionDevAppsSpecificAppWebDocs(),
0541: getSectionDevAppsSpecificAppWebDocsToggler());
0542: //
0543: //
0544: GoToAndChangeValueConsoleMacroTag.newInstance(
0545: currentActionCtchar, "(main),DEVELOP,APPLICATIONS,"
0546: + ConsoleMacroTagHelper
0547: .getApplicationVariableName()
0548: + ",WEB,[TEXT_BOX],INPUT_DIRECTORY_NAME",
0549: inDirName);
0550: //
0551: GoToAndChangeValueConsoleMacroTag.newInstance(
0552: currentActionCtchar, "(main),DEVELOP,APPLICATIONS,"
0553: + ConsoleMacroTagHelper
0554: .getApplicationVariableName()
0555: + ",WEB,[FILE_UPLOAD],INPUT_FILE_UPLOAD",
0556: inWebFile);
0557: //
0558: //
0559: String uploadId = "(main),DEVELOP,APPLICATIONS,"
0560: + ConsoleMacroTagHelper.getApplicationVariableName()
0561: + ",WEB,[TABLE_BUTTON],BUTTON__US_UPL_FILE";
0562: GoToConsoleMacroTag.newInstance(currentActionCtchar, uploadId);
0563: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0564: //
0565: //
0566: //
0567: inRv1cmt.addParameterAsFileUpload(uploadId, inWebFile,
0568: inWebFileContent);
0569: //
0570: //
0571: //
0572: //
0573: //
0574: //
0575: SubmitActionContext createWebFileSac = SubmitActionContext
0576: .newInstance(sourPage, fromHandle, fromHandle);
0577: //
0578: ConsoleScreenContext.initializeCreateWebFileSac(
0579: createWebFileSac, ConsoleMacroTagHelper
0580: .getApplicationVariableName(), inDirName,
0581: uploadId, false);
0582: //
0583: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0584: createWebFileSac);
0585: //
0586:
0587: //notes
0588: //include property to select database type
0589: //
0590: //declare properties
0591: //if project is deployed, remove it
0592: //if project is under development, remove it
0593: //create project under development
0594: }
0595:
0596: //
0597: //
0598: //
0599: public final static void getConstructRcthTree(
0600: RootV1ConsoleMacroTag inRv1cmt,
0601: ConceptTagConstraint inCtcon, ArrayList inHeirarchy,
0602: ArrayList inIncludeOnly[], ArrayList inExcludeOnly[],
0603: String inDocDir, String inDocFile) {
0604: //
0605: inHeirarchy.add(inCtcon.getName());
0606: //
0607: int totalMemory = MiscHelper.getTotalMemory();
0608: totalMemory = totalMemory / (1024 * 1024);
0609: //
0610: int freeMemory = MiscHelper.getTotalFreeMemory();
0611: freeMemory = freeMemory / (1024 * 1024);
0612: //
0613: MiscHelper.println("AutoAppGenHelp inCtcon (" + freeMemory
0614: + "/" + totalMemory + ") = "
0615: + inCtcon.getCharacteristic().getHandleWithoutIndex());
0616: //System.gc();
0617: //MiscHelper.profileMemory();
0618: //
0619: boolean includeActive = false;
0620: boolean excludeActive = false;
0621: //
0622: if (inIncludeOnly != null) {
0623: includeActive = false;
0624: for (int i = 0; i < inIncludeOnly.length; i++) {
0625: //
0626: includeActive |= isEqualOrSubHeirarchy(inHeirarchy,
0627: inIncludeOnly[i]);
0628: //
0629: }
0630: } else {
0631: includeActive = true;
0632: }
0633: //
0634: if (inExcludeOnly != null) {
0635: excludeActive = false;
0636: MiscHelper.println("AutoAppGenHelp ex inHeir = "
0637: + inHeirarchy);
0638: for (int i = 0; i < inExcludeOnly.length; i++) {
0639: //
0640: excludeActive |= isEqualOrSubHeirarchy(inHeirarchy,
0641: inExcludeOnly[i]);
0642: //
0643: MiscHelper.println("AutoAppGenHelp ex inExcl = "
0644: + inExcludeOnly[i]);
0645: }
0646: MiscHelper.println("AutoAppGenHelp ex value = "
0647: + excludeActive);
0648: } else {
0649: excludeActive = false;
0650: }
0651: //
0652: if (includeActive && !excludeActive) {
0653: //
0654: //ConceptTagCharacteristic currentActionCtchar = null;
0655: //
0656: String fromHandle = null;
0657: String sourPage = null;
0658: String destPage = null;
0659: //String treeState = null;
0660: ////////////
0661: fromHandle = NamesForParentCpc.getDevelopWebPageCpcName(
0662: SubmitActionParameters.USER, ConsoleMacroTagHelper
0663: .getApplicationVariableName(),
0664: SubmitActionParameters.WEB_PAGE, inDocDir,
0665: inDocFile);
0666: sourPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0667: destPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0668: //treeState = getBaseTree();
0669: //
0670: ConceptTagCharacteristic currentActionCtchar = inRv1cmt
0671: .generateNextPage(fromHandle, fromHandle, sourPage,
0672: destPage);
0673: //
0674: RcthConstraintBuilderConsoleMacroTag.newInstance(
0675: currentActionCtchar, inCtcon, inCtcon
0676: .getCharacteristic()
0677: .getHandleWithoutIndex());
0678: }
0679: //
0680: ConceptTagCharacteristic localCtchar = inCtcon
0681: .getCharacteristic();
0682: ConceptTagPreferences localCtp = localCtchar.getPreferences();
0683: for (int i = 0; i < localCtchar.getValueLength(); i++) {
0684: if (localCtchar.isHolder(i, null)) {
0685: //
0686: ConceptTagConstraintHolder nextSubCtconh = inCtcon
0687: .getConstraintHolder(i);
0688: //
0689: for (int j = 0; j < nextSubCtconh.getConstraintCount(); j++) {
0690: //
0691: ConceptTagConstraint nextSubCtcon = nextSubCtconh
0692: .getConstraint(j);
0693: getConstructRcthTree(inRv1cmt, nextSubCtcon,
0694: inHeirarchy, inIncludeOnly, inExcludeOnly,
0695: inDocDir, inDocFile);
0696: }
0697: //
0698: if (localCtp.isUnconstrainedAllowed()) {
0699: //
0700: getConstructRcthTree(inRv1cmt, nextSubCtconh
0701: .getUndefinedConstraint(), inHeirarchy,
0702: inIncludeOnly, inExcludeOnly, inDocDir,
0703: inDocFile);
0704: }
0705: }
0706: }
0707: //
0708: inHeirarchy.remove(inHeirarchy.size() - 1);
0709: }
0710:
0711: private final static boolean isEqualOrSubHeirarchy(
0712: ArrayList inSubHeirarchy, ArrayList inParentHeirarchy) {
0713:
0714: boolean outValue = false;
0715:
0716: //
0717: String subHeirarchy = MiscHelper.reassembleHandle(
0718: inSubHeirarchy, CommonSeparators.TOGGLE_LINK_SEPARATOR);
0719: String parentHeirarchy = MiscHelper.reassembleHandle(
0720: inParentHeirarchy,
0721: CommonSeparators.TOGGLE_LINK_SEPARATOR);
0722:
0723: outValue = subHeirarchy.startsWith(parentHeirarchy);
0724:
0725: return outValue;
0726: }
0727:
0728: //
0729: //
0730: //
0731: //
0732: public final static void getOpenWebPage(
0733: RootV1ConsoleMacroTag inRv1cmt, String inDirName,
0734: String inWebPage, String inDescription) {
0735:
0736: //
0737: ConceptTagCharacteristic currentActionCtchar = null;
0738: String fromHandle = null;
0739: String sourPage = null;
0740: String destPage = null;
0741: //String treeState = null;
0742: ////////////
0743: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0744: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0745: destPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0746: //treeState = getBaseTree();
0747: //
0748: inRv1cmt.addDescriptionToNextPage("Edit " + inDirName
0749: + inWebPage + " (" + inDescription + ")");
0750: //
0751: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0752: fromHandle, sourPage, destPage);
0753: //
0754: OpenSectionIfClosedConsoleMacroTag.newInstance(
0755: currentActionCtchar, getSectionDev(),
0756: getSectionDevToggler());
0757: //
0758: OpenSectionIfClosedConsoleMacroTag.newInstance(
0759: currentActionCtchar, getSectionDevApps(),
0760: getSectionDevAppsToggler());
0761: //
0762: OpenSectionIfClosedConsoleMacroTag.newInstance(
0763: currentActionCtchar, getSectionDevAppsSpecificApp(),
0764: getSectionDevAppsSpecificAppToggler());
0765: //
0766: OpenSectionIfClosedConsoleMacroTag.newInstance(
0767: currentActionCtchar,
0768: getSectionDevAppsSpecificAppWebDocs(),
0769: getSectionDevAppsSpecificAppWebDocsToggler());
0770: //
0771: ArrayList dirNameParts = BaseVirtualFileSystemHolder
0772: .parseDirectoryName(inDirName);
0773: //
0774: StringBuffer currentDirName = new StringBuffer();
0775: currentDirName.append(getAppSubDir());
0776: //
0777: OpenSectionIfClosedConsoleMacroTag.newInstance(
0778: currentActionCtchar, currentDirName.toString(),
0779: appendSubDirImage(currentDirName.toString()),
0780: appendSubDirImage(currentDirName.toString()),
0781: ConsolePageParameters.GIF_OPEN_FOLDER);
0782: for (int i = 0; i < dirNameParts.size(); i++) {
0783: currentDirName.append(","
0784: + SubAppDirConsolePageContext.PREFIX__DIRECTORY
0785: + dirNameParts.get(i));
0786: OpenSectionIfClosedConsoleMacroTag.newInstance(
0787: currentActionCtchar, currentDirName.toString(),
0788: appendSubDirImage(currentDirName.toString()),
0789: appendSubDirImage(currentDirName.toString()),
0790: ConsolePageParameters.GIF_OPEN_FOLDER);
0791: }
0792: //
0793: GoToConsoleMacroTag.newInstance(currentActionCtchar,
0794: currentDirName.toString() + ","
0795: + SubAppDirConsolePageContext.PREFIX__FILE
0796: + inWebPage + ",[STATIC_IMAGE],IMAGE__EDIT");
0797: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0798: //
0799: SubmitActionContext openWebPageSac = SubmitActionContext
0800: .newInstance(sourPage, fromHandle, fromHandle);
0801: //
0802: SubAppDirConsolePageContext.initializeEditWebPage(
0803: openWebPageSac, false, ConsoleMacroTagHelper
0804: .getApplicationVariableName(), inDirName,
0805: inWebPage);
0806: //GoToAndChangeValueConsoleMacroTag.newInstance(
0807: // currentActionCtchar,
0808: // "(main),DEVELOP,APPLICATIONS," + inAppName
0809: // + ",WEB,[TEXT_BOX],INPUT_DIRECTORY_NAME",
0810: // inDirName);
0811: //
0812: //GoToAndChangeValueConsoleMacroTag.newInstance(
0813: // currentActionCtchar,
0814: // "(main),DEVELOP,APPLICATIONS," + inAppName
0815: // + ",WEB,[TEXT_BOX],INPUT_CREATE_PAGE",
0816: // inWebPage);
0817: //
0818: //
0819: //GoToConsoleMacroTag.newInstance(
0820: // currentActionCtchar,
0821: // "(main),DEVELOP,APPLICATIONS," + inAppName
0822: // + ",WEB,[TABLE_BUTTON],BUTTON__US_CRE_PAGE");
0823: //SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0824: //
0825: //
0826: //
0827: //
0828: //
0829: //SubmitActionContext createWebPageSac =
0830: // SubmitActionContext.newInstance(
0831: // sourPage, fromHandle, fromHandle);
0832: //
0833: //ConsoleScreenContext.initializeCreateWebPageSac(
0834: // createWebPageSac, inAppName, inDirName, inWebPage, false);
0835: //
0836: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
0837: openWebPageSac);
0838: //
0839:
0840: //notes
0841: //include property to select database type
0842: //
0843: //declare properties
0844: //if project is deployed, remove it
0845: //if project is under development, remove it
0846: //create project under development
0847: }
0848:
0849: protected final static String getAppSubDir() {
0850: return ("(main),DEVELOP,APPLICATIONS,"
0851: + ConsoleMacroTagHelper.getApplicationVariableName()
0852: + ",WEB,("
0853: + SubAppDirConsolePageContext.constructName(
0854: ConsoleMacroTagHelper
0855: .getApplicationVariableName(), false) + ")");
0856: }
0857:
0858: protected final static String appendSubDirImage(String inHandle) {
0859:
0860: return (inHandle + ",[STATIC_IMAGE],I_DIRECTORY_IMAGE");
0861: }
0862:
0863: //
0864: //
0865: //
0866: //
0867: public final static void saveRcth(String inDocDir,
0868: String inDocFile, RootV1ConsoleMacroTag inRv1cmt) {
0869: //
0870: //
0871: //
0872: ConceptTagCharacteristic currentActionCtchar = null;
0873: //
0874: String fromHandle = null;
0875: String sourPage = null;
0876: String destPage = null;
0877: //String treeState = null;
0878: ////////////
0879: fromHandle = NamesForParentCpc.getDevelopWebPageCpcName(
0880: SubmitActionParameters.USER, ConsoleMacroTagHelper
0881: .getApplicationVariableName(),
0882: SubmitActionParameters.WEB_PAGE, inDocDir, inDocFile);
0883: sourPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0884: destPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0885: //treeState = getBaseTree();
0886: //
0887: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0888: fromHandle, sourPage, destPage);
0889: //
0890: RcthSaveConsoleMacroTag.newInstance(currentActionCtchar);
0891: //RcthConstraintBuilderConsoleMacroTag.newInstance(
0892: // currentActionCtchar, inCtcon,
0893: // inCtcon.getCharacteristic().getHandleWithoutIndex());
0894: }
0895:
0896: //
0897: public final static void cancelRcth(String inDocDir,
0898: String inDocFile, RootV1ConsoleMacroTag inRv1cmt) {
0899: //
0900: //
0901: //
0902: ConceptTagCharacteristic currentActionCtchar = null;
0903: //
0904: String fromHandle = null;
0905: String sourPage = null;
0906: String destPage = null;
0907: //String treeState = null;
0908: ////////////
0909: fromHandle = NamesForParentCpc.getDevelopWebPageCpcName(
0910: SubmitActionParameters.USER, ConsoleMacroTagHelper
0911: .getApplicationVariableName(),
0912: SubmitActionParameters.WEB_PAGE, inDocDir, inDocFile);
0913: sourPage = ConsolePageParameters.SERVLET_DEVELOP_WEB_PAGE;
0914: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0915: //treeState = getBaseTree();
0916: //
0917: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0918: fromHandle, sourPage, destPage);
0919: //
0920: RcthLeaveConsoleMacroTag.newInstance(currentActionCtchar);
0921: //RcthConstraintBuilderConsoleMacroTag.newInstance(
0922: // currentActionCtchar, inCtcon,
0923: // inCtcon.getCharacteristic().getHandleWithoutIndex());
0924: }
0925:
0926: //
0927: //
0928: //
0929: protected final static void deployApp(RootV1ConsoleMacroTag inRv1cmt) {
0930: //
0931: //
0932: inRv1cmt.addDescriptionToNextPage("Deploy Application");
0933: //
0934: ConceptTagCharacteristic currentActionCtchar = null;
0935: String fromHandle = null;
0936: String sourPage = null;
0937: String destPage = null;
0938: ////////////
0939: fromHandle = NamesForParentCpc.getConsoleScreenCpcName();
0940: sourPage = ConsolePageParameters.SERVLET_CONSOLE;
0941: destPage = ConsolePageParameters.SERVLET_CONSOLE;
0942: //
0943: currentActionCtchar = inRv1cmt.generateNextPage(fromHandle,
0944: fromHandle, sourPage, destPage);
0945: //
0946: //
0947: //
0948: //
0949: OpenSectionIfClosedConsoleMacroTag.newInstance(
0950: currentActionCtchar, getSectionDev(),
0951: getSectionDevToggler());
0952: //
0953: OpenSectionIfClosedConsoleMacroTag.newInstance(
0954: currentActionCtchar, getSectionDevApps(),
0955: getSectionDevAppsToggler());
0956: //
0957: OpenSectionIfClosedConsoleMacroTag.newInstance(
0958: currentActionCtchar, getSectionDevAppsSpecificApp(),
0959: getSectionDevAppsSpecificAppToggler());
0960: //
0961: GoToConsoleMacroTag.newInstance(currentActionCtchar,
0962: getSectionDevAppsSpecificApp()
0963: + ",[TABLE_BUTTON],BUTTON__USER_APP_OPTIONS");
0964: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0965: //
0966: //
0967: //
0968: CreationParameterConsoleMacroTag
0969: .newInstance(
0970: currentActionCtchar,
0971: "(main),DEVELOP,APPLICATIONS,"
0972: + ConsoleMacroTagHelper
0973: .getApplicationVariableName()
0974: + ",[CREATION_PARAMETER_CALLER],CRE_PARAM_CALL__APP_OPTIONS");
0975: //
0976: GoToConsoleMacroTag
0977: .newInstance(
0978: currentActionCtchar,
0979: "(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG),"
0980: + "CONSOLE_CREATION_STRUCTURE_7_7,[TABLE_BUTTON],"
0981: + "BUTTON__NEXT_TEXT_VALUE");
0982: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0983: //
0984: //
0985: CreationParameterConsoleMacroTag
0986: .newInstance(
0987: currentActionCtchar,
0988: "(main),DEVELOP,APPLICATIONS,"
0989: + ConsoleMacroTagHelper
0990: .getApplicationVariableName()
0991: + ",[CREATION_PARAMETER_CALLER],CRE_PARAM_CALL__DEPLOY");
0992: //
0993: GoToConsoleMacroTag
0994: .newInstance(
0995: currentActionCtchar,
0996: "(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG),"
0997: + "CONSOLE_CREATION_SUBMIT_ONE,[TABLE_BUTTON],BUTTON__CREATE");
0998: SimpleClickConsoleMacroTag.newInstance(currentActionCtchar);
0999: //
1000: //
1001: //
1002: //
1003: //
1004: //
1005: SubmitActionContext deployAppSac = SubmitActionContext
1006: .newInstance(sourPage, fromHandle, fromHandle);
1007: //
1008: //
1009: //
1010: deployAppSac.addAction(ConsoleParameterContext.FIRST_INPUT,
1011: SubmitActionParameters.COPY_TO_SERVER);
1012: //
1013: deployAppSac.addParameter(ConsoleParameterContext.FIRST_INPUT,
1014: "");
1015: deployAppSac.addParameter(ConsoleParameterContext.SECOND_INPUT,
1016: ConsoleMacroTagHelper.getApplicationVariableName());
1017: deployAppSac.addParameter(ConsoleParameterContext.THIRD_INPUT,
1018: ConsoleMacroTagHelper.getApplicationVariableName());
1019: deployAppSac.addParameter(ConsoleParameterContext.FOURTH_INPUT,
1020: SubmitActionParameters.DEPLOY_VISIBLE);
1021: //
1022: //SubAppDirConsolePageContext.initializeEditWebPage(
1023: // openWebPageSac, false, inAppName, inDirName, inWebPage);
1024: //
1025: SubmitActionConsoleMacroTag.newInstance(currentActionCtchar,
1026: deployAppSac);
1027: }
1028: }
|