Source Code Cross Referenced for AssignStaticValueConsoleMacroTag.java in  » Workflow-Engines » JFolder » org » jfolder » console » macro » v1 » 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.console.macro.v1 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.console.macro.v1;
009:
010:        //base classes
011:        import java.io.IOException;
012:        import java.util.HashMap;
013:
014:        //project specific classes
015:        import org.jfolder.common.UnexpectedSystemException;
016:        import org.jfolder.common.tagging.AppraiseConceptTagContext;
017:        import org.jfolder.common.tagging.CompoundConceptTagConstraintContext;
018:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
019:        import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
020:        import org.jfolder.common.tagging.ConceptTagConstraint;
021:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
022:        import org.jfolder.common.tagging.ConceptTagConstraintTemplate;
023:        import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
024:        import org.jfolder.common.tagging.InitializeConceptTagContext;
025:        import org.jfolder.common.tagging.RootConceptTagHolder;
026:        import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
027:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
028:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
029:        import org.jfolder.common.utils.misc.MiscHelper;
030:        import org.jfolder.common.utils.xml.XMLHelper;
031:        import org.jfolder.common.web.template.ConsoleTemplateContext;
032:        import org.jfolder.common.web.template.ConsoleTemplateSession;
033:        import org.jfolder.common.web.template.PageSetupContext;
034:        import org.jfolder.console.macro.ConsoleMacro;
035:        import org.jfolder.console.macro.ConsoleMacroTag;
036:
037:        //other classes
038:
039:        public class AssignStaticValueConsoleMacroTag implements 
040:                ConsoleMacroTag {
041:
042:            ////characteristics
043:            private ConceptTagCharacteristic valueCtchar = null;
044:
045:            //value details
046:            private final static String VALUE_CTCON = "value";
047:            private final static String VALUE_TITLE = "Value";
048:            private final static String VALUE_SHORT_DESCRIPTION = "Value";
049:
050:            ///////////////////////////////////
051:
052:            public void initialize(InitializeConceptTagContext inIctc) {
053:
054:                //
055:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
056:                        .newInstance(inIctc);
057:
058:                //constrain "value"
059:                ConceptTagConstraint valueCtcon = ConceptTagConstraint
060:                        .newInstance(VALUE_CTCON, rootCtconh);
061:                valueCtcon.setTitle(VALUE_TITLE);
062:                valueCtcon.setShortDescription(VALUE_SHORT_DESCRIPTION);
063:                //
064:                StaticConceptTagConstraintContext valueSctcc = StaticConceptTagConstraintContext
065:                        .newInstance(valueCtcon);
066:
067:                //
068:                inIctc.initialize();
069:
070:                //
071:                this .valueCtchar = valueCtcon.getCharacteristic();
072:            }
073:
074:            //
075:            public void appraise(AppraiseConceptTagContext inCtic) {
076:                if (inCtic instanceof  StudioConceptTagInstanceInfoContext) {
077:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
078:                    sctiic.setInstanceTitle("Assign Static Value");
079:                    sctiic.setInstanceDescription("Assign Static Value");
080:                } else if (inCtic instanceof  StudioConceptTagTypeInfoContext) {
081:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
082:                    scttic.setTypeTitle("Assign Static Value");
083:                    scttic.setTypeDescription("Assign Static Value");
084:                }
085:            }
086:
087:            //
088:            public final static AssignStaticValueConsoleMacroTag newInstance(
089:                    ConceptTagCharacteristic inCtchar, String inValue) {
090:                //
091:                AssignStaticValueConsoleMacroTag outValue = null;
092:
093:                outValue = new AssignStaticValueConsoleMacroTag();
094:                //
095:                ConceptTagCharacteristicHolder nextCtcharh = inCtchar.addValue(
096:                        inCtchar.getValueLength(), outValue, true);
097:                //
098:                ConceptTagCharacteristic nextValueCtchar = nextCtcharh
099:                        .registerCharacteristic(VALUE_CTCON);
100:                nextValueCtchar.addValue(0, inValue);
101:
102:                return outValue;
103:            }
104:
105:            //
106:            public void generateMacroCommands(PageSetupContext inPsc,
107:                    ConsoleTemplateSession inCts, RootConceptTagHolder inRcth,
108:                    HashMap inVars, String inFromHandle,
109:                    String inAliasFromHandle, String inSourcePage,
110:                    String inDestinationPage) {
111:                //
112:                //
113:                final int STATIC_SECTION_INDEX = 2;
114:                //try {
115:                String value = this .valueCtchar.getValueAsString(0, null);
116:                value = XMLHelper.fromStringToJSCData(value);
117:                //
118:                //text box (1)
119:                //
120:                prepareCalls(
121:                        inPsc,
122:                        ConsoleTemplateContext
123:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
124:                                        + ",CONSOLE_CREATION_STRUCTURE_1_"
125:                                        + STATIC_SECTION_INDEX),
126:                        ConsoleTemplateContext
127:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
128:                                        + ",CONSOLE_CREATION_STRUCTURE_1_"
129:                                        + STATIC_SECTION_INDEX
130:                                        + ",[TEXT_BOX]"
131:                                        + ",TEXT_BOX__NEXT_TEXT_VALUE"), null,
132:                        ConsoleTemplateContext.singleQuotes(value), false);
133:                //
134:                //text area (2)
135:                //
136:                prepareCalls(
137:                        inPsc,
138:                        ConsoleTemplateContext
139:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
140:                                        + ",CONSOLE_CREATION_STRUCTURE_2_"
141:                                        + STATIC_SECTION_INDEX),
142:                        ConsoleTemplateContext
143:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
144:                                        + ",CONSOLE_CREATION_STRUCTURE_2_"
145:                                        + STATIC_SECTION_INDEX
146:                                        + ",[TEXT_AREA]"
147:                                        + ",TEXT_AREA__NEXT_TEXT_VALUE"), null,
148:                        ConsoleTemplateContext.singleQuotes(value), false);
149:                //
150:                //inclusive (3)
151:                //
152:                prepareCalls(
153:                        inPsc,
154:                        ConsoleTemplateContext
155:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
156:                                        + ",CONSOLE_CREATION_STRUCTURE_3_"
157:                                        + STATIC_SECTION_INDEX),
158:                        ConsoleTemplateContext
159:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
160:                                        + ",CONSOLE_CREATION_STRUCTURE_3_"
161:                                        + STATIC_SECTION_INDEX
162:                                        + ",[DROP_DOWN_BOX]"
163:                                        + ",DROP_DOWN_BOX__INCLUSIVE_VALUE"),
164:                        ConsoleTemplateContext
165:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
166:                                        + ",CONSOLE_CREATION_STRUCTURE_3_"
167:                                        + STATIC_SECTION_INDEX
168:                                        + ",[TEXT_BOX]"
169:                                        + ",DROP_DOWN_BOX__INCLUSIVE_OTHER_VALUE"),
170:                        ConsoleTemplateContext.singleQuotes(value), true);
171:                //
172:                //exclusive (4)
173:                //
174:                prepareCalls(
175:                        inPsc,
176:                        ConsoleTemplateContext
177:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
178:                                        + ",CONSOLE_CREATION_STRUCTURE_4_"
179:                                        + STATIC_SECTION_INDEX),
180:                        ConsoleTemplateContext
181:                                .singleQuotes("(main),[DONT_RECORD_THIS_BRANCH],(CREATION_OF_CONCEPT_TAG)"
182:                                        + ",CONSOLE_CREATION_STRUCTURE_4_"
183:                                        + STATIC_SECTION_INDEX
184:                                        + ",[DROP_DOWN_BOX]"
185:                                        + ",DROP_DOWN_BOX__EXCLUSIVE_VALUE"),
186:                        null, ConsoleTemplateContext.singleQuotes(value), true);
187:                //}
188:                //catch (IOException ioe) {
189:                //    throw new UnexpectedSystemException(ioe);
190:                //}
191:            }
192:
193:            private final static void prepareCalls(PageSetupContext inPsc,
194:                    String inSectionId, String inTargetId,
195:                    String inAlternateTargetId, String inValue,
196:                    boolean inCheckAvailability) {
197:                //
198:                //macroGoToIfAvailable(
199:                //  inSectionId, inTargetId, inAlternateTarget,
200:                //  inValue, inCheckAvailibility)
201:                //macroClickIfOpen(inSource)
202:                //macroChangeValueIfAvailable(
203:                //  inSectionId, inTargetId, inAlternateTarget,
204:                //  inValue, inCheckAvailibility)
205:                //
206:                inPsc.addMacroCommand("macroGoToIfAvailable(" + inSectionId
207:                        + ", " + inTargetId + ", " + inAlternateTargetId + ", "
208:                        + inValue + ", " + inCheckAvailability + ")");
209:                inPsc.addMacroCommand("macroClickIfOpen(" + inSectionId + ")");
210:                inPsc.addMacroCommand("macroChangeValueIfAvailable("
211:                        + inSectionId + ", " + inTargetId + ", "
212:                        + inAlternateTargetId + ", " + inValue + ", "
213:                        + inCheckAvailability + ")");
214:            }
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.