Source Code Cross Referenced for ConceptTagFlagsHelper.java in  » Workflow-Engines » JFolder » org » jfolder » common » tagging » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JFolder » org.jfolder.common.tagging 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.common.tagging;
0009:
0010:        //base classes
0011:        import java.sql.Connection;
0012:        import java.util.ArrayList;
0013:        import java.util.Collections;
0014:        import java.util.HashMap;
0015:        import java.util.HashSet;
0016:        import java.util.Iterator;
0017:
0018:        //project specific classes
0019:        import org.jfolder.common.StandardDataTypes;
0020:        import org.jfolder.common.UnexpectedSystemException;
0021:        import org.jfolder.common.utils.misc.CommonExpressions;
0022:        import org.jfolder.common.utils.misc.MiscHelper;
0023:        import org.jfolder.common.utils.web.WebComponentHolder;
0024:
0025:        //other classes
0026:
0027:        public class ConceptTagFlagsHelper {
0028:
0029:            //
0030:            protected final static String MAIN_NAMESPACE = "MAIN";
0031:            //
0032:            protected final static String FLAG__GLOBAL_VARIABLES = "GLOBAL_VARIABLES";
0033:            protected final static String FLAG__LOCAL_VARIABLES = "LOCAL_VARIABLES";
0034:            protected final static String FLAG__PARENT_LOCAL_VARIABLES = "PARENT_LOCAL_VARIABLES";
0035:            //
0036:            protected final static String FLAG__PARENT_DETERMINE_VAC_RESULTS = "PARENT_DETERMINE_VAC_RESULTS";
0037:            protected final static String FLAG__DETERMINE_VAC_RESULTS = "DETERMINE_VAC_RESULTS";
0038:            //
0039:            protected final static String FLAG__UNDEPLOYABLE_CONCEPT_TAG = "UNDEPLOYABLE_CONCEPT_TAG";
0040:            //
0041:            protected final static String FLAG__CAN_BE_DIRECT_CHILD_OF_ROOT = "CAN_BE_DIRECT_CHILD_OF_ROOT";
0042:            protected final static String FLAG__CAN_BE_ITERATIVE_STRUCTURE = "CAN_BE_ITERATIVE_STRUCTURE";
0043:            //
0044:            protected final static String FLAG__CAN_RETURN = "CAN_RETURN";
0045:            protected final static String FLAG__CAN_NOT_RETURN = "CAN_NOT_RETURN";
0046:            //
0047:            protected final static String FLAG__CURRENT_DATA_SOURCE = "CURRENT_DATA_SOURCE";
0048:            protected final static String FLAG__CURRENT_DATA_SOURCE_CONNECTION = "CURRENT_DATA_SOURCE_CONNECTION";
0049:            //
0050:            protected final static String FLAG__WEB_PAGE_FORMAT_CTCHARS = "WEB_PAGE_FORMAT_CTCHARS";
0051:            //
0052:            protected final static String FLAG__CURRENT_PROJECT_SYSTEM = "CURRENT_PROJECT_SYSTEM";
0053:            //
0054:            protected final static String FLAG__WEB_PAGE_TAG_MACRO_DEFINITION_SET = "WEB_PAGE_TAG_MACRO_DEFINITION_SET";
0055:            //
0056:            protected final static String FLAG__WEB_PAGE_CONTEXT = "WEB_PAGE_CONTEXT";
0057:            //
0058:            protected final static String FLAG__MACRO_CALL_VACS = "MACRO_CALL_VACS";
0059:            protected final static String FLAG__MACRO_CALL_HANDLE = "MACRO_CALL_HANDLE";
0060:            //
0061:            protected final static String FLAG__TEMPLATE_INTERFACE_SET = "TEMPLATE_INTERFACE_SET";
0062:            //
0063:            protected final static String FLAG__CONSOLE_PAGE_SESSION = "CONSOLE_PAGE_SESSION";
0064:            protected final static String FLAG__STUDIO_VALIDATION_MODE = "STUDIO_VALIDATION_MODE";
0065:            //
0066:            protected final static String FLAG__TEMPLATE_CALL_PARAMETERS = "TEMPLATE_CALL_PARAMETERS";
0067:            //
0068:            protected final static String FLAG__HTML_CONCEPT_TAG = "HTML_CONCEPT_TAG";
0069:            protected final static String FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH = "NON_ITERATIVE_COMMON_FUNCTION_DEPTH";
0070:            //
0071:            protected final static String FLAG__STUDIO_USABILITY = "STUDIO_USABILITY";
0072:            //
0073:            protected final static String FLAG__FORWARD_TO_LOCAL_WEB_PAGE = "FORWARD_TO_LOCAL_WEB_PAGE";
0074:
0075:            private ConceptTagFlagsHelper() {
0076:            }
0077:
0078:            //////////////////////////////////////////////////////////////////
0079:            private final static ArrayList getVacResults(
0080:                    ConceptTagCallContext inCtcc, String inVariableType) {
0081:                //
0082:                ArrayList outValue = null;
0083:
0084:                ConceptTagFlags ctf = inCtcc.getFlags();
0085:                if (ctf.isMainFlagPresent(inVariableType)) {
0086:                    outValue = ((ArrayList) ctf.getMainFlag(inVariableType));
0087:                } else {
0088:                    outValue = new ArrayList();
0089:                    ctf.createMainFlag(inVariableType, outValue);
0090:                }
0091:
0092:                //MiscHelper.println(
0093:                //    "ConTagFlagHelp Flags '" + inVariableType + "' = " + outValue);
0094:
0095:                return outValue;
0096:            }
0097:
0098:            private final static HashMap getVariables(
0099:                    ConceptTagCallContext inCtcc, String inVariableType) {
0100:                //
0101:                HashMap outValue = null;
0102:
0103:                ConceptTagFlags ctf = inCtcc.getFlags();
0104:                if (ctf.isMainFlagPresent(inVariableType)) {
0105:                    outValue = ((HashMap) ctf.getMainFlag(inVariableType));
0106:                } else {
0107:                    outValue = new HashMap();
0108:                    ctf.createMainFlag(inVariableType, outValue);
0109:                }
0110:
0111:                //MiscHelper.println(
0112:                //    "ConTagFlagHelp Flags '" + inVariableType + "' = " + outValue);
0113:
0114:                return outValue;
0115:            }
0116:
0117:            //
0118:            public final static boolean isVariableNameValid(String inName) {
0119:
0120:                boolean outValue = false;
0121:
0122:                if (inName.length() > 0) {
0123:                    outValue = true;
0124:                    for (int i = 0; i < inName.length(); i++) {
0125:                        if (i == 0) {
0126:                            outValue &= Character.isLetter(inName.charAt(i));
0127:                        } else {
0128:                            outValue &= (Character.isLetterOrDigit(inName
0129:                                    .charAt(i)) || (inName.charAt(i) == '_'));
0130:                        }
0131:                    }
0132:                } else {
0133:                    outValue = false;
0134:                }
0135:
0136:                return outValue;
0137:            }
0138:
0139:            private final static ArrayList getUpperCaseKeys(HashMap inValues) {
0140:
0141:                ArrayList outValue = null;
0142:
0143:                outValue = new ArrayList(inValues.keySet());
0144:                for (int i = 0; i < outValue.size(); i++) {
0145:                    String nextName = ((String) outValue.get(i));
0146:                    nextName = nextName.toUpperCase();
0147:                    outValue.remove(i);
0148:                    outValue.add(i, nextName);
0149:                }
0150:
0151:                return outValue;
0152:            }
0153:
0154:            //
0155:            public final static boolean isGlobalVariablePresent(
0156:                    ConceptTagCallContext inCtcc, String inName) {
0157:                //
0158:                boolean outValue = false;
0159:
0160:                HashMap gv = getVariables(inCtcc, FLAG__GLOBAL_VARIABLES);
0161:                ArrayList names = getUpperCaseKeys(gv);
0162:                outValue = names.contains(inName.toUpperCase());
0163:
0164:                return outValue;
0165:            }
0166:
0167:            public final static boolean isLocalVariablePresent(
0168:                    ConceptTagCallContext inCtcc, String inName) {
0169:                //
0170:                boolean outValue = false;
0171:
0172:                HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0173:                ArrayList names = getUpperCaseKeys(lv);
0174:                outValue = names.contains(inName.toUpperCase());
0175:
0176:                return outValue;
0177:            }
0178:
0179:            public final static boolean isGlobalOrLocalVariablePresent(
0180:                    ConceptTagCallContext inCtcc, String inName) {
0181:                //
0182:                boolean outValue = false;
0183:
0184:                outValue = isGlobalVariablePresent(inCtcc, inName)
0185:                        || isLocalVariablePresent(inCtcc, inName);
0186:
0187:                return outValue;
0188:            }
0189:
0190:            //
0191:            public final static void createLocalAndParentOfLocalVariable(
0192:                    ConceptTagCallContext inCtcc, Class inClass, String inName,
0193:                    Object inValue) {
0194:                //
0195:                createLocalVariable(inCtcc, inClass, inName, inValue);
0196:                //
0197:                ValueAndClassForConceptTag localVac = accessLocalVariable(
0198:                        inCtcc, inName);
0199:                HashMap plv = getVariables(inCtcc, FLAG__PARENT_LOCAL_VARIABLES);
0200:                plv.put(inName, localVac);
0201:            }
0202:
0203:            public final static void createLocalVariable(
0204:                    ConceptTagCallContext inCtcc, Class inClass, String inName,
0205:                    Object inValue) {
0206:                //
0207:                if (!isVariableNameValid(inName)) {
0208:                    throw new UnexpectedSystemException(
0209:                            "Cannot declare local variable '"
0210:                                    + inName
0211:                                    + "' because variables must start with a letter,"
0212:                                    + " and each other character must be a letter, digit,"
0213:                                    + " or underscore");
0214:                } else if (!isGlobalOrLocalVariablePresent(inCtcc, inName)) {
0215:                    HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0216:
0217:                    ValueAndClassForConceptTag vac = ValueAndClassForConceptTag
0218:                            .newInstance(inValue, inClass);
0219:                    lv.put(inName, vac);
0220:                } else {
0221:                    if (isGlobalVariablePresent(inCtcc, inName)) {
0222:                        throw new UnexpectedSystemException(
0223:                                "Cannot declare local variable '" + inName
0224:                                        + "' because it is already declared"
0225:                                        + " as a global variable");
0226:                    } else if (isLocalVariablePresent(inCtcc, inName)) {
0227:                        throw new UnexpectedSystemException(
0228:                                "Cannot declare local variable '" + inName
0229:                                        + "' because it is already declared"
0230:                                        + " as a local variable");
0231:                    } else {
0232:                        throw UnexpectedSystemException.unknownState();
0233:                    }
0234:                }
0235:            }
0236:
0237:            public final static void updateLocalVariable(
0238:                    ConceptTagCallContext inCtcc, String inName,
0239:                    ValueAndClassForConceptTag inValue) {
0240:                //
0241:
0242:                if (isLocalVariablePresent(inCtcc, inName)) {
0243:                    //
0244:                    ValueAndClassForConceptTag sourceVac = accessLocalVariable(
0245:                            inCtcc, inName);
0246:                    Class sourceClass = sourceVac.getValueClass();
0247:                    //
0248:                    Class destClass = inValue.getValueClass();
0249:                    Object destValue = inValue.getValue();
0250:
0251:                    if (destValue == null) {
0252:                    } else if (sourceClass.isAssignableFrom(destClass)) {
0253:                    } else {
0254:                        throw new UnexpectedSystemException(
0255:                                "For local variable '"
0256:                                        + inName
0257:                                        + "' of type '"
0258:                                        + StandardDataTypes
0259:                                                .getDisplayName(sourceClass)
0260:                                        + "' cannot accept value of type '"
0261:                                        + StandardDataTypes
0262:                                                .getDisplayName(destClass));
0263:                    }
0264:
0265:                    ValueAndClassForConceptTag destVac = ValueAndClassForConceptTag
0266:                            .newInstance(destValue, sourceClass);
0267:                    HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0268:                    lv.put(inName, destVac);
0269:                } else {
0270:                    throw new UnexpectedSystemException(
0271:                            "Cannot update local variable '" + inName
0272:                                    + "' because it is does not exist");
0273:                }
0274:            }
0275:
0276:            public final static void updateGlobalVariable(
0277:                    ConceptTagCallContext inCtcc, String inName,
0278:                    ValueAndClassForConceptTag inValue) {
0279:                //
0280:
0281:                if (isGlobalVariablePresent(inCtcc, inName)) {
0282:                    //
0283:                    ValueAndClassForConceptTag sourceVac = accessLocalVariable(
0284:                            inCtcc, inName);
0285:                    Class sourceClass = sourceVac.getValueClass();
0286:                    //
0287:                    Class destClass = inValue.getValueClass();
0288:                    Object destValue = inValue.getValue();
0289:
0290:                    if (destValue == null) {
0291:                    } else if (sourceClass.isAssignableFrom(destClass)) {
0292:                    } else {
0293:                        throw new UnexpectedSystemException(
0294:                                "For global variable '"
0295:                                        + inName
0296:                                        + "' of type '"
0297:                                        + StandardDataTypes
0298:                                                .getDisplayName(sourceClass)
0299:                                        + "' cannot accept value of type '"
0300:                                        + StandardDataTypes
0301:                                                .getDisplayName(destClass));
0302:                    }
0303:
0304:                    ValueAndClassForConceptTag destVac = ValueAndClassForConceptTag
0305:                            .newInstance(destValue, sourceClass);
0306:                    HashMap gv = getVariables(inCtcc, FLAG__GLOBAL_VARIABLES);
0307:                    gv.put(inName, destVac);
0308:                } else {
0309:                    throw new UnexpectedSystemException(
0310:                            "Cannot update global variable '" + inName
0311:                                    + "' because it is does not exist");
0312:                }
0313:            }
0314:
0315:            public final static void removeIterativeLocalVariables(
0316:                    ConceptTagCallContext inCtcc) {
0317:                //
0318:                HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0319:                HashMap plv = getVariables(inCtcc, FLAG__PARENT_LOCAL_VARIABLES);
0320:                //
0321:                HashSet localVarNames = new HashSet(lv.keySet());
0322:                HashSet localParentVarNames = new HashSet(plv.keySet());
0323:                //
0324:                localVarNames.removeAll(localParentVarNames);
0325:                //
0326:                Iterator iter = localVarNames.iterator();
0327:                while (iter.hasNext()) {
0328:                    String nextName = ((String) iter.next());
0329:                    removeLocalVariable(inCtcc, nextName);
0330:                }
0331:            }
0332:
0333:            public final static void removeLocalVariable(
0334:                    ConceptTagCallContext inCtcc, String inName) {
0335:                //
0336:                if (isLocalVariablePresent(inCtcc, inName)) {
0337:                    HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0338:                    lv.remove(inName);
0339:                } else {
0340:                    throw new UnexpectedSystemException(
0341:                            "Cannot remove local variable '" + inName
0342:                                    + "' because it is does not exist");
0343:                }
0344:            }
0345:
0346:            public final static ValueAndClassForConceptTag accessLocalVariable(
0347:                    ConceptTagCallContext inCtcc, String inName) {
0348:                //
0349:
0350:                ValueAndClassForConceptTag outValue = null;
0351:
0352:                if (isLocalVariablePresent(inCtcc, inName)) {
0353:                    HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0354:                    Object o = lv.get(inName);
0355:                    outValue = ((ValueAndClassForConceptTag) o);
0356:                } else {
0357:                    throw new UnexpectedSystemException(
0358:                            "Cannot access local variable '" + inName
0359:                                    + "' because it is does not exist");
0360:                }
0361:
0362:                return outValue;
0363:            }
0364:
0365:            public final static ValueAndClassForConceptTag accessGlobalVariable(
0366:                    ConceptTagCallContext inCtcc, String inName) {
0367:                //
0368:
0369:                ValueAndClassForConceptTag outValue = null;
0370:
0371:                if (isGlobalVariablePresent(inCtcc, inName)) {
0372:                    HashMap lv = getVariables(inCtcc, FLAG__GLOBAL_VARIABLES);
0373:                    Object o = lv.get(inName);
0374:                    outValue = ((ValueAndClassForConceptTag) o);
0375:                } else {
0376:                    throw new UnexpectedSystemException(
0377:                            "Cannot access global variable '" + inName
0378:                                    + "' because it is does not exist");
0379:                }
0380:
0381:                return outValue;
0382:            }
0383:
0384:            public final static ArrayList getAllVariableNames(
0385:                    ConceptTagCallContext inCtcc) {
0386:                //
0387:                ArrayList outValue = new ArrayList();
0388:
0389:                outValue.addAll(getVariables(inCtcc, FLAG__GLOBAL_VARIABLES)
0390:                        .keySet());
0391:                outValue.addAll(getVariables(inCtcc, FLAG__LOCAL_VARIABLES)
0392:                        .keySet());
0393:
0394:                Collections.sort(outValue);
0395:
0396:                return outValue;
0397:            }
0398:
0399:            //////////////////////////////////////////////////////////////////
0400:            public final static boolean isCurrentDataSourcePresent(
0401:                    ConceptTagCallContext inCtcc) {
0402:                //
0403:                boolean outValue = false;
0404:
0405:                outValue = inCtcc.getFlags().isMainFlagPresent(
0406:                        FLAG__CURRENT_DATA_SOURCE);
0407:
0408:                return outValue;
0409:            }
0410:
0411:            public final static String getCurrentDataSource(
0412:                    ConceptTagCallContext inCtcc) {
0413:                //
0414:                String outValue = null;
0415:
0416:                ConceptTagFlags localCtf = inCtcc.getFlags();
0417:                outValue = ((String) localCtf
0418:                        .getMainFlag(FLAG__CURRENT_DATA_SOURCE));
0419:
0420:                return outValue;
0421:            }
0422:
0423:            public final static void createCurrentDataSource(
0424:                    ConceptTagCallContext inCtcc, String inDataSource) {
0425:                //
0426:                ConceptTagFlags localCtf = inCtcc.getFlags();
0427:                localCtf
0428:                        .createMainFlag(FLAG__CURRENT_DATA_SOURCE, inDataSource);
0429:            }
0430:
0431:            public final static void removeCurrentDataSource(
0432:                    ConceptTagCallContext inCtcc) {
0433:                //
0434:                ConceptTagFlags localCtf = inCtcc.getFlags();
0435:                localCtf.removeMainFlag(FLAG__CURRENT_DATA_SOURCE);
0436:            }
0437:
0438:            //////////////////////////////////////////////////////////////////
0439:            public final static boolean isCurrentDataSourceConnectionPresent(
0440:                    ConceptTagCallContext inCtcc) {
0441:                //
0442:                boolean outValue = false;
0443:
0444:                outValue = inCtcc.getFlags().isMainFlagPresent(
0445:                        FLAG__CURRENT_DATA_SOURCE_CONNECTION);
0446:
0447:                return outValue;
0448:            }
0449:
0450:            public final static Connection getCurrentDataSourceConnection(
0451:                    ConceptTagCallContext inCtcc) {
0452:                //
0453:                Connection outValue = null;
0454:
0455:                ConceptTagFlags localCtf = inCtcc.getFlags();
0456:                outValue = ((Connection) localCtf
0457:                        .getMainFlag(FLAG__CURRENT_DATA_SOURCE_CONNECTION));
0458:
0459:                return outValue;
0460:            }
0461:
0462:            public final static void createCurrentDataSourceConnection(
0463:                    ConceptTagCallContext inCtcc, Connection inDataSource) {
0464:                //
0465:                ConceptTagFlags localCtf = inCtcc.getFlags();
0466:                localCtf.createMainFlag(FLAG__CURRENT_DATA_SOURCE_CONNECTION,
0467:                        inDataSource);
0468:            }
0469:
0470:            public final static void removeCurrentDataSourceConnection(
0471:                    ConceptTagCallContext inCtcc) {
0472:                //
0473:                ConceptTagFlags localCtf = inCtcc.getFlags();
0474:                localCtf.removeMainFlag(FLAG__CURRENT_DATA_SOURCE_CONNECTION);
0475:            }
0476:
0477:            //////////////////////////////////////////////////////////////////
0478:            public final static boolean isConceptTagUndeployable(ConceptTag inCt) {
0479:                //
0480:                boolean outValue = false;
0481:
0482:                SelectionCriteriaForConceptTag scfct = null;
0483:
0484:                scfct = SelectionCriteriaForConceptTag.newInstance(inCt);
0485:
0486:                inCt.appraise(scfct);
0487:
0488:                ConceptTagFlags ctf = scfct.getFlags();
0489:
0490:                if (ctf.isMainFlagPresent(FLAG__UNDEPLOYABLE_CONCEPT_TAG)) {
0491:                    Object o = ctf.getMainFlag(FLAG__UNDEPLOYABLE_CONCEPT_TAG);
0492:                    if (o instanceof  Boolean) {
0493:                        Boolean b = ((Boolean) o);
0494:                        if (b != null) {
0495:                            outValue = b.booleanValue();
0496:                        } else {
0497:                            outValue = false;
0498:                        }
0499:                    } else {
0500:                        outValue = false;
0501:                    }
0502:                } else {
0503:                    outValue = false;
0504:                }
0505:
0506:                return outValue;
0507:            }
0508:
0509:            //
0510:            public final static void setConceptTagAsUndeployable(
0511:                    SelectionCriteriaForConceptTag inScfct) {
0512:                //
0513:                ConceptTagFlags ctf = inScfct.getFlags();
0514:
0515:                ctf.createMainFlag(FLAG__UNDEPLOYABLE_CONCEPT_TAG, new Boolean(
0516:                        true));
0517:            }
0518:
0519:            //////////////////////////////////////////////////////////////////
0520:            //
0521:            public final static void assertCanBeDirectChildOfRoot(
0522:                    SelectionCriteriaForConceptTag inScfct) {
0523:                //
0524:                ConceptTagFlags ctf = inScfct.getFlags();
0525:                Boolean b = new Boolean(true);
0526:
0527:                ctf.createMainFlag(FLAG__CAN_BE_DIRECT_CHILD_OF_ROOT, b);
0528:            }
0529:
0530:            //////////////////////////////////////////////////////////////////
0531:            //
0532:            public final static void assertCanBeIterativeStructure(
0533:                    SelectionCriteriaForConceptTag inScfct) {
0534:                //
0535:                ConceptTagFlags ctf = inScfct.getFlags();
0536:                Boolean b = new Boolean(true);
0537:
0538:                ctf.createMainFlag(FLAG__CAN_BE_ITERATIVE_STRUCTURE, b);
0539:            }
0540:
0541:            //
0542:            //////////////////////////////////////////////////////////////////
0543:            public final static void declareVariableSphere(
0544:                    String inParentHandle, int inIndex,
0545:                    ConceptTagCallContext inCtcc) {
0546:                //
0547:                HashMap currentVars = getVariables(inCtcc,
0548:                        FLAG__LOCAL_VARIABLES);
0549:                currentVars = ((HashMap) currentVars.clone());
0550:                StudioConceptTagUsabilityContext localSctuc = ConceptTagFlagsHelper
0551:                        .getStudioUsability(inCtcc);
0552:                localSctuc.declareVariableSphere(inParentHandle, inIndex,
0553:                        currentVars);
0554:            }
0555:
0556:            public final static void suspendAllVariables(
0557:                    ConceptTagCallContext inCtcc, HashMap inGlobalVariables[],
0558:                    HashMap inParentLocalVariables[],
0559:                    HashMap inLocalVariables[]) {
0560:                //
0561:                inGlobalVariables[0] = getVariables(inCtcc,
0562:                        FLAG__GLOBAL_VARIABLES);
0563:                inParentLocalVariables[0] = getVariables(inCtcc,
0564:                        FLAG__PARENT_LOCAL_VARIABLES);
0565:                inLocalVariables[0] = getVariables(inCtcc,
0566:                        FLAG__LOCAL_VARIABLES);
0567:                //
0568:                ConceptTagFlags localCtf = inCtcc.getFlags();
0569:                //
0570:                localCtf.removeMainFlag(FLAG__GLOBAL_VARIABLES);
0571:                localCtf.removeMainFlag(FLAG__PARENT_LOCAL_VARIABLES);
0572:                localCtf.removeMainFlag(FLAG__LOCAL_VARIABLES);
0573:            }
0574:
0575:            public final static void reinstateAllVariables(
0576:                    ConceptTagCallContext inCtcc, HashMap inGlobalVariables[],
0577:                    HashMap inParentLocalVariables[],
0578:                    HashMap inLocalVariables[]) {
0579:                //
0580:                //get variables to make sure they exist
0581:                getVariables(inCtcc, FLAG__GLOBAL_VARIABLES);
0582:                getVariables(inCtcc, FLAG__PARENT_LOCAL_VARIABLES);
0583:                getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0584:                //
0585:                //
0586:                //
0587:                ConceptTagFlags localCtf = inCtcc.getFlags();
0588:                //
0589:                localCtf.removeMainFlag(FLAG__GLOBAL_VARIABLES);
0590:                localCtf.removeMainFlag(FLAG__PARENT_LOCAL_VARIABLES);
0591:                localCtf.removeMainFlag(FLAG__LOCAL_VARIABLES);
0592:                //
0593:                localCtf.createMainFlag(FLAG__GLOBAL_VARIABLES,
0594:                        inGlobalVariables[0]);
0595:                localCtf.createMainFlag(FLAG__PARENT_LOCAL_VARIABLES,
0596:                        inParentLocalVariables[0]);
0597:                localCtf.createMainFlag(FLAG__LOCAL_VARIABLES,
0598:                        inLocalVariables[0]);
0599:            }
0600:
0601:            //
0602:            public final static void pushLocalVariables(
0603:                    ConceptTagCallContext inCtcc,
0604:                    HashMap inParentLocalVariables[],
0605:                    HashMap inLocalVariables[]) {
0606:                //
0607:                ConceptTagFlags localCtf = inCtcc.getFlags();
0608:                //
0609:                inParentLocalVariables[0] = getVariables(inCtcc,
0610:                        FLAG__PARENT_LOCAL_VARIABLES);
0611:                inLocalVariables[0] = getVariables(inCtcc,
0612:                        FLAG__LOCAL_VARIABLES);
0613:                //
0614:                localCtf.updateMainFlag(FLAG__PARENT_LOCAL_VARIABLES,
0615:                        new HashMap(inLocalVariables[0]));
0616:                localCtf.updateMainFlag(FLAG__LOCAL_VARIABLES, new HashMap(
0617:                        inLocalVariables[0]));
0618:                //
0619:            }
0620:
0621:            public final static void popLocalVariables(
0622:                    ConceptTagCallContext inCtcc,
0623:                    HashMap inOrigParentLocalVariables[],
0624:                    HashMap inOrigLocalVariables[]) {
0625:                //
0626:                ConceptTagFlags localCtf = inCtcc.getFlags();
0627:                //
0628:                HashMap currentLocalVariables = getVariables(inCtcc,
0629:                        FLAG__LOCAL_VARIABLES);
0630:                HashMap currentParentLocalVariables = getVariables(inCtcc,
0631:                        FLAG__PARENT_LOCAL_VARIABLES);
0632:                //
0633:                //
0634:                //
0635:                //
0636:                //
0637:                HashMap updatedLocalVars = new HashMap(currentLocalVariables);
0638:                removeOutOfScopeVariables(updatedLocalVars,
0639:                        currentParentLocalVariables);
0640:                localCtf
0641:                        .updateMainFlag(FLAG__LOCAL_VARIABLES, updatedLocalVars);
0642:                //
0643:                HashMap updatedParLocalVars = new HashMap(currentLocalVariables);
0644:                removeOutOfScopeVariables(updatedParLocalVars,
0645:                        inOrigParentLocalVariables[0]);
0646:                localCtf.updateMainFlag(FLAG__PARENT_LOCAL_VARIABLES,
0647:                        updatedParLocalVars);
0648:                //
0649:            }
0650:
0651:            private final static void removeOutOfScopeVariables(
0652:                    HashMap inCurrentVariables, HashMap inOriginalVariables) {
0653:                //
0654:                Iterator currLocalVariablesIter = inCurrentVariables.keySet()
0655:                        .iterator();
0656:                ArrayList removeNames = new ArrayList();
0657:                while (currLocalVariablesIter.hasNext()) {
0658:                    Object nextCurrLocalVariableName = currLocalVariablesIter
0659:                            .next();
0660:                    if (inOriginalVariables
0661:                            .containsKey(nextCurrLocalVariableName)) {
0662:                        //do nothing
0663:                    } else {
0664:                        removeNames.add(nextCurrLocalVariableName);
0665:                    }
0666:                }
0667:                //
0668:                for (int i = 0; i < removeNames.size(); i++) {
0669:                    inCurrentVariables.remove(removeNames.get(i));
0670:                }
0671:            }
0672:
0673:            //////////////////////////////////////////////////////////////////
0674:            public final static ArrayList pushDetermineVacResults(
0675:                    ConceptTagCallContext inCtcc) {
0676:                //
0677:                ArrayList outValue = null;
0678:                //
0679:                ArrayList determineVacResults = getVacResults(inCtcc,
0680:                        FLAG__DETERMINE_VAC_RESULTS);
0681:                ArrayList parentDetermineVacResults = getVacResults(inCtcc,
0682:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0683:                //
0684:                ConceptTagFlags localCtf = inCtcc.getFlags();
0685:                localCtf.updateMainFlag(FLAG__PARENT_DETERMINE_VAC_RESULTS,
0686:                        determineVacResults);
0687:                localCtf.updateMainFlag(FLAG__DETERMINE_VAC_RESULTS,
0688:                        new ArrayList());
0689:                //
0690:                //
0691:                outValue = parentDetermineVacResults;
0692:                //
0693:                return outValue;
0694:            }
0695:
0696:            public final static void popDetermineVacResults(
0697:                    ConceptTagCallContext inCtcc, ArrayList inParentResults) {
0698:                //
0699:                ArrayList parentDetermineVacResults = getVacResults(inCtcc,
0700:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0701:                //
0702:                ConceptTagFlags localCtf = inCtcc.getFlags();
0703:                localCtf.updateMainFlag(FLAG__PARENT_DETERMINE_VAC_RESULTS,
0704:                        inParentResults);
0705:                localCtf.updateMainFlag(FLAG__DETERMINE_VAC_RESULTS,
0706:                        parentDetermineVacResults);
0707:            }
0708:
0709:            //
0710:            //////////////////////////////////////////////////////////////////
0711:            public final static void showCurrentVariables(
0712:                    ConceptTagCallContext inCtcc, String inLabel) {
0713:                //
0714:                HashMap lv = getVariables(inCtcc, FLAG__LOCAL_VARIABLES);
0715:                HashMap plv = getVariables(inCtcc, FLAG__PARENT_LOCAL_VARIABLES);
0716:                HashMap gv = getVariables(inCtcc, FLAG__GLOBAL_VARIABLES);
0717:                //
0718:                ArrayList prv = getVacResults(inCtcc,
0719:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0720:                ArrayList rv = getVacResults(inCtcc,
0721:                        FLAG__DETERMINE_VAC_RESULTS);
0722:                //
0723:                MiscHelper.println("<< " + inLabel);
0724:                MiscHelper.println("  -  lv = " + lv);
0725:                MiscHelper.println("  - plv = " + plv);
0726:                MiscHelper.println("  -  gv = " + gv);
0727:                MiscHelper.println("  - prv = " + prv);
0728:                MiscHelper.println("  -  rv = " + rv);
0729:                MiscHelper.println(">>");
0730:            }
0731:
0732:            //
0733:            //////////////////////////////////////////////////////////////////
0734:            public final static void addVacToParDetVacRes(
0735:                    ConceptTagCallContext inCtcc,
0736:                    ValueAndClassForConceptTag inVacfct) {
0737:                //
0738:                ArrayList parentResults = getVacResults(inCtcc,
0739:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0740:                //
0741:                parentResults.add(inVacfct);
0742:            }
0743:
0744:            public final static void addVacToParDetVacRes(
0745:                    ConceptTagCallContext inCtcc, String inValue) {
0746:                //
0747:                ArrayList parentResults = getVacResults(inCtcc,
0748:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0749:                //
0750:                ValueAndClassForConceptTag vac = ValueAndClassForConceptTag
0751:                        .newInstance(inValue, StandardDataTypes
0752:                                .getStringClass());
0753:                //
0754:                parentResults.add(vac);
0755:            }
0756:
0757:            public final static void emptyVacResIntoParentVacRes(
0758:                    ConceptTagCallContext inCtcc) {
0759:                //
0760:                ArrayList parentResults = getVacResults(inCtcc,
0761:                        FLAG__PARENT_DETERMINE_VAC_RESULTS);
0762:                //
0763:                parentResults.addAll(getVacResults(inCtcc,
0764:                        FLAG__DETERMINE_VAC_RESULTS));
0765:                //
0766:                ConceptTagFlags localCtf = inCtcc.getFlags();
0767:                localCtf.updateMainFlag(FLAG__DETERMINE_VAC_RESULTS,
0768:                        new ArrayList());
0769:            }
0770:
0771:            public final static int getDetermineVacResultsCount(
0772:                    ConceptTagCallContext inCtcc) {
0773:                //
0774:                int outValue = 0;
0775:
0776:                outValue = getVacResults(inCtcc, FLAG__DETERMINE_VAC_RESULTS)
0777:                        .size();
0778:
0779:                return outValue;
0780:            }
0781:
0782:            public final static ValueAndClassForConceptTag getDetermineVacResult(
0783:                    ConceptTagCallContext inCtcc, int inIndex) {
0784:                //
0785:                ValueAndClassForConceptTag outValue = null;
0786:
0787:                ArrayList results = getVacResults(inCtcc,
0788:                        FLAG__DETERMINE_VAC_RESULTS);
0789:                outValue = ((ValueAndClassForConceptTag) results.get(inIndex));
0790:
0791:                return outValue;
0792:            }
0793:
0794:            //public final static int getParentDetermineVacResultsCount(
0795:            //    ConceptTagCallContext inCtcc) {
0796:            //    //
0797:            //    int outValue = 0;
0798:            //    
0799:            //    outValue = getVacResults(
0800:            //        inCtcc, FLAG__PARENT_DETERMINE_VAC_RESULTS).size();
0801:            //    
0802:            //    return outValue;
0803:            //}
0804:            //public final static ValueAndClassForConceptTag
0805:            //    getParentDetermineVacResult(
0806:            //    ConceptTagCallContext inCtcc, int inIndex) {
0807:            //    //
0808:            //    ValueAndClassForConceptTag outValue = null;
0809:            //    
0810:            //    ArrayList results = getVacResults(
0811:            //        inCtcc, FLAG__PARENT_DETERMINE_VAC_RESULTS);
0812:            //    outValue = ((ValueAndClassForConceptTag)results.get(inIndex));
0813:            //    
0814:            //    return outValue;
0815:            //}
0816:            //////////////////////////////////////////////////////////////////
0817:            public final static ConceptTagCharacteristic[] getWebPageFormatCtchars(
0818:                    ConceptTagCallContext inCtcc) {
0819:
0820:                ConceptTagCharacteristic[] outValue = null;
0821:
0822:                ConceptTagFlags localCtf = inCtcc.getFlags();
0823:                if (localCtf.isMainFlagPresent(FLAG__WEB_PAGE_FORMAT_CTCHARS)) {
0824:                    Object o = localCtf
0825:                            .getMainFlag(FLAG__WEB_PAGE_FORMAT_CTCHARS);
0826:                    outValue = ((ConceptTagCharacteristic[]) o);
0827:                } else {
0828:                    outValue = new ConceptTagCharacteristic[0];
0829:                }
0830:
0831:                return outValue;
0832:            }
0833:
0834:            public final static void setWebPageFormatCtchars(
0835:                    ConceptTagCallContext inCtcc,
0836:                    ConceptTagCharacteristic inCtchar[]) {
0837:                //
0838:                ConceptTagFlags localCtf = inCtcc.getFlags();
0839:                localCtf
0840:                        .createMainFlag(FLAG__WEB_PAGE_FORMAT_CTCHARS, inCtchar);
0841:            }
0842:
0843:            //////////////////////////////////////////////////////////////////
0844:            public final static boolean isCurrentProjectSystemPresent(
0845:                    ConceptTagCallContext inCtcc) {
0846:                //
0847:                boolean outValue = false;
0848:
0849:                ConceptTagFlags localCtf = inCtcc.getFlags();
0850:                outValue = localCtf
0851:                        .isMainFlagPresent(FLAG__CURRENT_PROJECT_SYSTEM);
0852:
0853:                return outValue;
0854:            }
0855:
0856:            public final static Object getCurrentProjectSystem(
0857:                    ConceptTagCallContext inCtcc) {
0858:                //
0859:                Object outValue = null;
0860:
0861:                ConceptTagFlags localCtf = inCtcc.getFlags();
0862:                outValue = localCtf.getMainFlag(FLAG__CURRENT_PROJECT_SYSTEM);
0863:
0864:                return outValue;
0865:            }
0866:
0867:            public final static void setCurrentProjectSystem(
0868:                    ConceptTagCallContext inCtcc, Object inPs) {
0869:                //
0870:                ConceptTagFlags localCtf = inCtcc.getFlags();
0871:                localCtf.createMainFlag(FLAG__CURRENT_PROJECT_SYSTEM, inPs);
0872:            }
0873:
0874:            //////////////////////////////////////////////////////////////////
0875:            public final static boolean isWebPageTagMacroDefinitionSetPresent(
0876:                    ConceptTagCallContext inCtcc) {
0877:                //
0878:                boolean outValue = false;
0879:
0880:                ConceptTagFlags localCtf = inCtcc.getFlags();
0881:                outValue = localCtf
0882:                        .isMainFlagPresent(FLAG__WEB_PAGE_TAG_MACRO_DEFINITION_SET);
0883:
0884:                return outValue;
0885:            }
0886:
0887:            public final static Object getWebPageTagMacroDefinitionSet(
0888:                    ConceptTagCallContext inCtcc) {
0889:                //
0890:                Object outValue = null;
0891:
0892:                ConceptTagFlags localCtf = inCtcc.getFlags();
0893:                outValue = localCtf
0894:                        .getMainFlag(FLAG__WEB_PAGE_TAG_MACRO_DEFINITION_SET);
0895:
0896:                return outValue;
0897:            }
0898:
0899:            public final static void setWebPageTagMacroDefinitionSet(
0900:                    ConceptTagCallContext inCtcc, Object inPs) {
0901:                //
0902:                ConceptTagFlags localCtf = inCtcc.getFlags();
0903:                localCtf.createMainFlag(
0904:                        FLAG__WEB_PAGE_TAG_MACRO_DEFINITION_SET, inPs);
0905:            }
0906:
0907:            //
0908:            public final static boolean isWebComponentHolderPresent(
0909:                    ConceptTagCallContext inCtcc) {
0910:                //
0911:                boolean outValue = false;
0912:
0913:                ConceptTagFlags localCtf = inCtcc.getFlags();
0914:                outValue = localCtf.isMainFlagPresent(FLAG__WEB_PAGE_CONTEXT);
0915:
0916:                return outValue;
0917:            }
0918:
0919:            public final static WebComponentHolder getWebComponentHolder(
0920:                    ConceptTagCallContext inCtcc) {
0921:                //
0922:                WebComponentHolder outValue = null;
0923:
0924:                ConceptTagFlags localCtf = inCtcc.getFlags();
0925:                Object o = localCtf.getMainFlag(FLAG__WEB_PAGE_CONTEXT);
0926:                outValue = ((WebComponentHolder) o);
0927:
0928:                return outValue;
0929:            }
0930:
0931:            public final static void setWebComponentHolder(
0932:                    ConceptTagCallContext inCtcc, WebComponentHolder inWch) {
0933:                //
0934:                ConceptTagFlags localCtf = inCtcc.getFlags();
0935:                localCtf.createMainFlag(FLAG__WEB_PAGE_CONTEXT, inWch);
0936:            }
0937:
0938:            //
0939:            //////////////////////////////////////////////////////////////////
0940:            public final static boolean isMacroCallVacsPresent(
0941:                    ConceptTagCallContext inCtcc) {
0942:                //
0943:                boolean outValue = false;
0944:
0945:                ConceptTagFlags localCtf = inCtcc.getFlags();
0946:                outValue = localCtf.isMainFlagPresent(FLAG__MACRO_CALL_VACS);
0947:
0948:                return outValue;
0949:            }
0950:
0951:            public final static ValueAndClassForConceptTag[] getMacroCallVacs(
0952:                    ConceptTagCallContext inCtcc) {
0953:                //
0954:                ValueAndClassForConceptTag[] outValue = null;
0955:
0956:                ConceptTagFlags localCtf = inCtcc.getFlags();
0957:                Object o = localCtf.getMainFlag(FLAG__MACRO_CALL_VACS);
0958:                outValue = ((ValueAndClassForConceptTag[]) o);
0959:
0960:                return outValue;
0961:            }
0962:
0963:            public final static void popMacroCallVacs(
0964:                    ConceptTagCallContext inCtcc,
0965:                    ValueAndClassForConceptTag[] inParentVacs) {
0966:                //
0967:                ConceptTagFlags localCtf = inCtcc.getFlags();
0968:                localCtf.removeMainFlag(FLAG__MACRO_CALL_VACS);
0969:                //
0970:                if (inParentVacs != null) {
0971:                    localCtf
0972:                            .createMainFlag(FLAG__MACRO_CALL_VACS, inParentVacs);
0973:                }
0974:            }
0975:
0976:            public final static ValueAndClassForConceptTag[] pushMacroCallVacs(
0977:                    ConceptTagCallContext inCtcc,
0978:                    ValueAndClassForConceptTag[] inVacs) {
0979:                //
0980:                //
0981:                ValueAndClassForConceptTag outValue[] = null;
0982:                //
0983:                ConceptTagFlags localCtf = inCtcc.getFlags();
0984:                if (isMacroCallHandlePresent(inCtcc)) {
0985:                    //
0986:                    outValue = getMacroCallVacs(inCtcc);
0987:                    localCtf.removeMainFlag(FLAG__MACRO_CALL_VACS);
0988:                }
0989:                localCtf.createMainFlag(FLAG__MACRO_CALL_VACS, inVacs);
0990:                //
0991:                return outValue;
0992:            }
0993:
0994:            //
0995:            //////////////////////////////////////////////////////////////////
0996:            public final static boolean isMacroCallHandlePresent(
0997:                    ConceptTagCallContext inCtcc) {
0998:                //
0999:                boolean outValue = false;
1000:
1001:                ConceptTagFlags localCtf = inCtcc.getFlags();
1002:                outValue = localCtf.isMainFlagPresent(FLAG__MACRO_CALL_HANDLE);
1003:
1004:                return outValue;
1005:            }
1006:
1007:            public final static String getMacroCallHandle(
1008:                    ConceptTagCallContext inCtcc) {
1009:                //
1010:                String outValue = null;
1011:
1012:                ConceptTagFlags localCtf = inCtcc.getFlags();
1013:                Object o = localCtf.getMainFlag(FLAG__MACRO_CALL_HANDLE);
1014:                outValue = ((String) o);
1015:
1016:                return outValue;
1017:            }
1018:
1019:            public final static void popMacroCallHandle(
1020:                    ConceptTagCallContext inCtcc, String inParentHandle) {
1021:                //
1022:                ConceptTagFlags localCtf = inCtcc.getFlags();
1023:                localCtf.removeMainFlag(FLAG__MACRO_CALL_HANDLE);
1024:                //
1025:                if (inParentHandle != null) {
1026:                    localCtf.createMainFlag(FLAG__MACRO_CALL_HANDLE,
1027:                            inParentHandle);
1028:                }
1029:            }
1030:
1031:            public final static String pushMacroCallHandle(
1032:                    ConceptTagCallContext inCtcc, String inHandle) {
1033:                //
1034:                String outValue = null;
1035:
1036:                ConceptTagFlags localCtf = inCtcc.getFlags();
1037:                if (isMacroCallHandlePresent(inCtcc)) {
1038:                    //
1039:                    outValue = getMacroCallHandle(inCtcc);
1040:                    localCtf.removeMainFlag(FLAG__MACRO_CALL_HANDLE);
1041:                }
1042:                //
1043:                localCtf.createMainFlag(FLAG__MACRO_CALL_HANDLE, inHandle);
1044:
1045:                return outValue;
1046:            }
1047:
1048:            //
1049:            //////////////////////////////////////////////////////////////////
1050:            public final static boolean isTemplateInterfaceNameValid(
1051:                    ConceptTagCallContext inCtcc, String inName) {
1052:                //
1053:                boolean outValue = false;
1054:
1055:                if (inName != null
1056:                        && MiscHelper.isRegularExpressionMatch(inName,
1057:                                CommonExpressions.JAVA_NAME, false)) {
1058:                    //
1059:                    outValue = true;
1060:                }
1061:
1062:                return outValue;
1063:            }
1064:
1065:            public final static boolean isTemplateInterfacePresent(
1066:                    ConceptTagCallContext inCtcc, String inName) {
1067:                //
1068:                boolean outValue = false;
1069:
1070:                HashMap hm = getTemplateInterfaceSet(inCtcc);
1071:                outValue = hm.containsKey(inName.toUpperCase());
1072:
1073:                return outValue;
1074:            }
1075:
1076:            public final static void registerTemplateInterface(
1077:                    ConceptTagCallContext inCtcc, String inName,
1078:                    String inDescription, ConceptTagConstraint inCtcon,
1079:                    int inIndex) {
1080:                //
1081:                if (!isTemplateInterfaceNameValid(inCtcc, inName)) {
1082:                    throw new UnexpectedSystemException(
1083:                            "Template interface name '" + inName
1084:                                    + "' is invalid");
1085:                } else if (isTemplateInterfacePresent(inCtcc, inName)) {
1086:                    throw new UnexpectedSystemException("Template interface '"
1087:                            + inName + "' has already been registered");
1088:                } else {
1089:                    HashMap hm = getTemplateInterfaceSet(inCtcc);
1090:                    hm.put(inName.toUpperCase(), new Object[] { inName,
1091:                            inDescription, inCtcon, new Integer(inIndex) });
1092:                    //
1093:                    ArrayList al = getTemplateInterfaceNames(inCtcc);
1094:                    al.add(inName);
1095:                }
1096:            }
1097:
1098:            public final static HashMap getTemplateInterfaceSet(
1099:                    ConceptTagCallContext inCtcc) {
1100:                //
1101:                HashMap outValue = null;
1102:
1103:                ConceptTagFlags localCtf = inCtcc.getFlags();
1104:
1105:                if (localCtf.isMainFlagPresent(FLAG__TEMPLATE_INTERFACE_SET)) {
1106:                    Object o = localCtf
1107:                            .getMainFlag(FLAG__TEMPLATE_INTERFACE_SET);
1108:                    Object ti[] = ((Object[]) o);
1109:                    outValue = ((HashMap) ti[1]);
1110:                } else {
1111:                    outValue = new HashMap();
1112:                    localCtf.createMainFlag(FLAG__TEMPLATE_INTERFACE_SET,
1113:                            new Object[] { new ArrayList(), outValue });
1114:                }
1115:
1116:                return outValue;
1117:            }
1118:
1119:            public final static ArrayList getTemplateInterfaceNames(
1120:                    ConceptTagCallContext inCtcc) {
1121:                //
1122:                ArrayList outValue = null;
1123:
1124:                ConceptTagFlags localCtf = inCtcc.getFlags();
1125:
1126:                if (localCtf.isMainFlagPresent(FLAG__TEMPLATE_INTERFACE_SET)) {
1127:                    Object o = localCtf
1128:                            .getMainFlag(FLAG__TEMPLATE_INTERFACE_SET);
1129:                    Object ti[] = ((Object[]) o);
1130:                    outValue = ((ArrayList) ti[0]);
1131:                } else {
1132:                    outValue = new ArrayList();
1133:                    localCtf.createMainFlag(FLAG__TEMPLATE_INTERFACE_SET,
1134:                            new Object[] { outValue, new HashMap() });
1135:                }
1136:
1137:                return outValue;
1138:            }
1139:
1140:            //////////////////////////////////////////////////////////////////
1141:            public final static boolean isConsolePageSessionPresent(
1142:                    ConceptTagCallContext inCtcc) {
1143:                //
1144:                boolean outValue = false;
1145:
1146:                ConceptTagFlags localCtf = inCtcc.getFlags();
1147:                outValue = localCtf
1148:                        .isMainFlagPresent(FLAG__CONSOLE_PAGE_SESSION);
1149:
1150:                return outValue;
1151:            }
1152:
1153:            public final static Object getConsolePageSession(
1154:                    ConceptTagCallContext inCtcc) {
1155:                //
1156:                Object outValue = null;
1157:
1158:                ConceptTagFlags localCtf = inCtcc.getFlags();
1159:                outValue = localCtf.getMainFlag(FLAG__CONSOLE_PAGE_SESSION);
1160:
1161:                return outValue;
1162:            }
1163:
1164:            public final static void createConsolePageSession(
1165:                    ConceptTagCallContext inCtcc, Object inCps) {
1166:                //
1167:                ConceptTagFlags localCtf = inCtcc.getFlags();
1168:                localCtf.createMainFlag(FLAG__CONSOLE_PAGE_SESSION, inCps);
1169:            }
1170:
1171:            //////////////////////////////////////////////////////////////////
1172:            public final static boolean isStudioValidationMode(
1173:                    ConceptTagCallContext inCtcc) {
1174:                //
1175:                boolean outValue = false;
1176:
1177:                ConceptTagFlags localCtf = inCtcc.getFlags();
1178:                if (localCtf.isMainFlagPresent(FLAG__STUDIO_VALIDATION_MODE)) {
1179:                    Object o = localCtf
1180:                            .getMainFlag(FLAG__STUDIO_VALIDATION_MODE);
1181:                    outValue = ((Boolean) o).booleanValue();
1182:                }
1183:
1184:                return outValue;
1185:            }
1186:
1187:            public final static void createStudioValidationMode(
1188:                    ConceptTagCallContext inCtcc, boolean inStudioValidationMode) {
1189:                //
1190:                ConceptTagFlags localCtf = inCtcc.getFlags();
1191:                localCtf.createMainFlag(FLAG__STUDIO_VALIDATION_MODE,
1192:                        new Boolean(inStudioValidationMode));
1193:            }
1194:
1195:            //////////////////////////////////////////////////////////////////
1196:            public final static void registerTemplateCallParameters(
1197:                    ConceptTagCallContext inCtcc, HashMap inParameters) {
1198:                //
1199:                //Object o[] = new Object[]{new HashMap(), inParameters};
1200:                ConceptTagFlags localCtf = inCtcc.getFlags();
1201:                localCtf.createMainFlag(FLAG__TEMPLATE_CALL_PARAMETERS,
1202:                        inParameters);
1203:            }
1204:
1205:            public final static void unregisterTemplateCallParameters(
1206:                    ConceptTagCallContext inCtcc) {
1207:                //
1208:                ConceptTagFlags localCtf = inCtcc.getFlags();
1209:                localCtf.removeMainFlag(FLAG__TEMPLATE_CALL_PARAMETERS);
1210:            }
1211:
1212:            public final static boolean isTemplateCallParameterPresent(
1213:                    ConceptTagCallContext inCtcc, String inName) {
1214:                //
1215:                boolean outValue = false;
1216:
1217:                ConceptTagFlags localCtf = inCtcc.getFlags();
1218:                //
1219:                if (localCtf.isMainFlagPresent(FLAG__TEMPLATE_CALL_PARAMETERS)) {
1220:                    Object o = localCtf
1221:                            .getMainFlag(FLAG__TEMPLATE_CALL_PARAMETERS);
1222:                    HashMap hm = ((HashMap) o);
1223:                    outValue = hm.containsKey(inName);
1224:                } else {
1225:                    outValue = false;
1226:                }
1227:
1228:                return outValue;
1229:            }
1230:
1231:            public final static ConceptTagCharacteristic getTemplateCallParameter(
1232:                    ConceptTagCallContext inCtcc, String inName) {
1233:                //
1234:                ConceptTagCharacteristic outValue = null;
1235:
1236:                ConceptTagFlags localCtf = inCtcc.getFlags();
1237:                //
1238:                Object o = localCtf.getMainFlag(FLAG__TEMPLATE_CALL_PARAMETERS);
1239:                HashMap hm = ((HashMap) o);
1240:                //
1241:                outValue = ((ConceptTagCharacteristic) hm.get(inName));
1242:
1243:                return outValue;
1244:            }
1245:
1246:            //////////////////////////////////////////////////////////////////
1247:            public final static void registerAsHtmlConceptTag(
1248:                    ConceptTagCallContext inCtcc) {
1249:                //
1250:                ConceptTagFlags localCtf = inCtcc.getFlags();
1251:                localCtf.createMainFlag(FLAG__HTML_CONCEPT_TAG, new Boolean(
1252:                        true));
1253:            }
1254:
1255:            public final static void pushNonIterativeCommonFunctionDepth(
1256:                    ConceptTagCallContext inCtcc) {
1257:                //
1258:                ConceptTagFlags localCtf = inCtcc.getFlags();
1259:                if (localCtf
1260:                        .isMainFlagPresent(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH)) {
1261:                    //
1262:                    Object o = localCtf
1263:                            .getMainFlag(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH);
1264:                    Integer count = ((Integer) o);
1265:                    localCtf.updateMainFlag(
1266:                            FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH,
1267:                            new Integer(count.intValue() + 1));
1268:                } else {
1269:                    localCtf.createMainFlag(
1270:                            FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH,
1271:                            new Integer(1));
1272:                }
1273:            }
1274:
1275:            public final static void popNonIterativeCommonFunctionDepth(
1276:                    ConceptTagCallContext inCtcc) {
1277:                //
1278:                ConceptTagFlags localCtf = inCtcc.getFlags();
1279:                if (localCtf
1280:                        .isMainFlagPresent(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH)) {
1281:                    //
1282:                    Object o = localCtf
1283:                            .getMainFlag(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH);
1284:                    Integer count = ((Integer) o);
1285:                    if (count.intValue() > 1) {
1286:                        localCtf.updateMainFlag(
1287:                                FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH,
1288:                                new Integer(count.intValue() - 1));
1289:                    } else {
1290:                        localCtf
1291:                                .removeMainFlag(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH);
1292:                    }
1293:                } else {
1294:                    throw UnexpectedSystemException.unknownState();
1295:                }
1296:            }
1297:
1298:            public final static boolean isWithinNonIterativeCommonFunction(
1299:                    ConceptTagCallContext inCtcc) {
1300:                //
1301:                boolean outValue = false;
1302:
1303:                ConceptTagFlags localCtf = inCtcc.getFlags();
1304:                outValue = localCtf
1305:                        .isMainFlagPresent(FLAG__NON_ITERATIVE_COMMON_FUNCTION_DEPTH);
1306:
1307:                return outValue;
1308:            }
1309:
1310:            //
1311:            //
1312:            //
1313:            public final static void pushStudioUsability(
1314:                    ConceptTagCallContext inCtcc) {
1315:
1316:                ConceptTagFlags localCtf = inCtcc.getFlags();
1317:                if (localCtf.isMainFlagPresent(FLAG__STUDIO_USABILITY)) {
1318:                    localCtf.removeMainFlag(FLAG__STUDIO_USABILITY);
1319:                }
1320:                localCtf.createMainFlag(FLAG__STUDIO_USABILITY,
1321:                        new StudioConceptTagUsabilityContext());
1322:            }
1323:
1324:            public final static StudioConceptTagUsabilityContext popStudioUsability(
1325:                    ConceptTagCallContext inCtcc) {
1326:
1327:                StudioConceptTagUsabilityContext outValue = null;
1328:
1329:                outValue = getStudioUsability(inCtcc);
1330:                //
1331:                ConceptTagFlags localCtf = inCtcc.getFlags();
1332:                localCtf.removeMainFlag(FLAG__STUDIO_USABILITY);
1333:
1334:                return outValue;
1335:            }
1336:
1337:            public final static StudioConceptTagUsabilityContext getStudioUsability(
1338:                    ConceptTagCallContext inCtcc) {
1339:
1340:                StudioConceptTagUsabilityContext outValue = null;
1341:
1342:                ConceptTagFlags localCtf = inCtcc.getFlags();
1343:                Object o = localCtf.getMainFlag(FLAG__STUDIO_USABILITY);
1344:                outValue = ((StudioConceptTagUsabilityContext) o);
1345:
1346:                return outValue;
1347:            }
1348:
1349:            public final static boolean isStudioUsabilityPresent(
1350:                    ConceptTagCallContext inCtcc) {
1351:
1352:                boolean outValue = false;
1353:
1354:                ConceptTagFlags localCtf = inCtcc.getFlags();
1355:
1356:                outValue = localCtf.isMainFlagPresent(FLAG__STUDIO_USABILITY);
1357:
1358:                return outValue;
1359:            }
1360:
1361:            //
1362:            //
1363:            //
1364:            //
1365:            //
1366:            public final static boolean isForwardToLocalWebPagePresent(
1367:                    ConceptTagCallContext inCtcc) {
1368:                //
1369:                boolean outValue = false;
1370:
1371:                ConceptTagFlags localCtf = inCtcc.getFlags();
1372:
1373:                outValue = localCtf
1374:                        .isMainFlagPresent(FLAG__FORWARD_TO_LOCAL_WEB_PAGE);
1375:
1376:                return outValue;
1377:            }
1378:
1379:            public final static String getForwardToLocalWebPage(
1380:                    ConceptTagCallContext inCtcc) {
1381:                //
1382:                String outValue = null;
1383:
1384:                ConceptTagFlags localCtf = inCtcc.getFlags();
1385:                Object o = localCtf
1386:                        .getMainFlag(FLAG__FORWARD_TO_LOCAL_WEB_PAGE);
1387:                outValue = ((String) o);
1388:
1389:                return outValue;
1390:            }
1391:
1392:            public final static void registerForwardToLocalPage(
1393:                    ConceptTagCallContext inCtcc, String inLocalPage) {
1394:                //
1395:                ConceptTagFlags localCtf = inCtcc.getFlags();
1396:                localCtf.createMainFlag(FLAG__FORWARD_TO_LOCAL_WEB_PAGE,
1397:                        inLocalPage);
1398:                //
1399:            }
1400:
1401:            public final static void removeForwardToLocalPage(
1402:                    ConceptTagCallContext inCtcc) {
1403:                //
1404:                ConceptTagFlags localCtf = inCtcc.getFlags();
1405:                localCtf.removeMainFlag(FLAG__FORWARD_TO_LOCAL_WEB_PAGE);
1406:            }
1407:
1408:            //
1409:            //
1410:            public final static boolean isBreakActive(
1411:                    ConceptTagCallContext inCtcc) {
1412:                //
1413:                boolean outValue = false;
1414:
1415:                outValue = isForwardToLocalWebPagePresent(inCtcc);
1416:
1417:                return outValue;
1418:            }
1419:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.