Source Code Cross Referenced for GetTriggerAttributeWorkflowTemplateTag.java in  » Workflow-Engines » JFolder » org » jfolder » workflow » model » template » 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.workflow.model.template.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.workflow.model.template.v1;
009:
010:        //base classes
011:        import java.io.IOException;
012:        import javax.xml.parsers.ParserConfigurationException;
013:        import org.w3c.dom.Document;
014:        import org.w3c.dom.Element;
015:        import org.xml.sax.SAXException;
016:
017:        //project specific classes
018:        import org.jfolder.common.tagging.AppraiseConceptTagContext;
019:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
020:        import org.jfolder.common.tagging.ConceptTagConstraint;
021:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
022:        import org.jfolder.common.tagging.ConceptTagHelper;
023:        import org.jfolder.common.tagging.DetermineClassConceptTagContext;
024:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
025:        import org.jfolder.common.tagging.DetermineValueAndClassConceptTagException;
026:        import org.jfolder.common.tagging.InitializeConceptTagContext;
027:        import org.jfolder.common.tagging.ReturnableConceptTag;
028:        import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
029:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
030:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
031:        import org.jfolder.common.tagging.ValueAndClassForConceptTag;
032:        import org.jfolder.common.utils.misc.CommonExpressions;
033:        import org.jfolder.common.utils.misc.MiscHelper;
034:        import org.jfolder.common.utils.xml.XMLHelper;
035:
036:        //other classes
037:
038:        public class GetTriggerAttributeWorkflowTemplateTag implements 
039:                ReturnableConceptTag {
040:
041:            //ConceptTag characteristic
042:            private ConceptTagCharacteristic pathCtchar = null;
043:            private ConceptTagCharacteristic attributeCtchar = null;
044:
045:            //path details
046:            private final static String PATH_CTCON = "path";
047:            private final static String PATH_TITLE = "Path";
048:            private final static String PATH_SHORT_DESCRIPTION = "Path to the element in the trigger containing the attribute";
049:            //TO DO: elaborate above
050:
051:            //attribute details
052:            private final static String ATTRIBUTE_CTCON = "attribute";
053:            private final static String ATTRIBUTE_TITLE = "Attribute";
054:            private final static String ATTRIBUTE_SHORT_DESCRIPTION = "Attribute, not workflow but XML, sought";
055:
056:            //TO DO: elaborate above
057:
058:            public void initialize(InitializeConceptTagContext inIctc) {
059:
060:                //
061:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
062:                        .newInstance(inIctc);
063:
064:                //constrain "path"
065:                ConceptTagConstraint pathCtcon = ConceptTagConstraint
066:                        .newInstance(PATH_CTCON, rootCtconh);
067:                pathCtcon.setTitle(PATH_TITLE);
068:                pathCtcon.setShortDescription(PATH_SHORT_DESCRIPTION);
069:                //
070:                StaticConceptTagConstraintContext pathSctcc = StaticConceptTagConstraintContext
071:                        .newInstance(pathCtcon);
072:                pathSctcc.setRegularExpression(CommonExpressions.ANY_STRING);
073:                //
074:                pathSctcc.addDefaultValue("XMLPATH");
075:                //TO DO: provide better default
076:                //TO DO: define regular expression
077:
078:                //constrain "attribute"
079:                ConceptTagConstraint attributeCtcon = ConceptTagConstraint
080:                        .newInstance(ATTRIBUTE_CTCON, rootCtconh);
081:                attributeCtcon.setTitle(ATTRIBUTE_TITLE);
082:                attributeCtcon.setShortDescription(ATTRIBUTE_SHORT_DESCRIPTION);
083:                //
084:                StaticConceptTagConstraintContext attributeSctcc = StaticConceptTagConstraintContext
085:                        .newInstance(attributeCtcon);
086:                attributeSctcc
087:                        .setRegularExpression(CommonExpressions.ANY_STRING);
088:                //
089:                attributeSctcc.addDefaultValue("XMLAttribute");
090:                //TO DO: provide better default
091:                //TO DO: define regular expression
092:
093:                inIctc.initialize();
094:
095:                //initialize characteristics
096:                this .pathCtchar = pathCtcon.getCharacteristic();
097:                this .attributeCtchar = attributeCtcon.getCharacteristic();
098:
099:            }
100:
101:            public void appraise(AppraiseConceptTagContext inCtic) {
102:                if (inCtic instanceof  StudioConceptTagInstanceInfoContext) {
103:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
104:                    sctiic.setInstanceTitle("Get Trigger Attribute");
105:                    sctiic
106:                            .setInstanceDescription("Get an attribute value from a trigger element");
107:                } else if (inCtic instanceof  StudioConceptTagTypeInfoContext) {
108:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
109:                    scttic.setTypeTitle("Get Trigger Attribute");
110:                    scttic
111:                            .setTypeDescription("Get an attribute value from a trigger element");
112:                }
113:            }
114:
115:            public void determineValueAndClass(
116:                    DetermineValueAndClassConceptTagContext inRvacc) {
117:
118:                inRvacc
119:                        .setDetermineException(new DetermineValueAndClassConceptTagException(
120:                                "Not Implemented"));
121:                //ValueAndClassForConceptTag outValue = null;
122:
123:                /*
124:                ComponentsForReturnableConceptTag wcfrt =
125:                    ConceptTagHelper.getComponentsForReturnableScriptTag(
126:                        inRvacc);
127:                
128:                Trigger t = wcfrt.getTrigger();
129:                
130:                //X-Path creation and validation
131:                String xpathData = null;
132:                
133:                if (this.pathTc.isStatic()) {
134:                    xpathData = this.pathTc.getValueAsString();
135:                }
136:                else if (this.pathTc.isDynamic()) {
137:                    
138:                    ValueAndClass outValue = this.pathTc.getDetermineValueAndClass(
139:                        inRvacc);
140:                    xpathData = (String)vac.getValue();
141:                }
142:                
143:                String xpathErrors = XMLHelper.isXPathValid(xpathData);
144:                
145:                if (xpathErrors != null) {
146:                    throw new DetermineValueAndClassConceptTagException("X-Path '"
147:                        + xpathData
148:                        + "' is invalid for the following reasons - " + xpathErrors);
149:                }
150:                
151:                //elementName creation and validation
152:                String attrName = null;
153:                
154:                if (this.attributeTc.isStatic()) {
155:                    attrName = this.attributeTc.getValueAsString();
156:                }
157:                else if (this.attributeTc.isDynamic()) {
158:                    
159:                    ValueAndClass outValue =
160:                        this.attributeTc.getDetermineValueAndClass(inRvacc);
161:                    attrName = (String)vac.getValue();
162:                }
163:                
164:                //trigger document creation and validation
165:                Document doc = null;
166:                try {
167:                    doc = XMLHelper.loadDocument(t.getDataAsString());
168:                }
169:                catch (ParserConfigurationException pce) {
170:                    throw new DetermineValueAndClassConceptTagException(pce);
171:                }
172:                catch (SAXException saxe) {
173:                    throw new DetermineValueAndClassConceptTagException(saxe);
174:                }
175:                catch (IOException ioe) {
176:                    throw new DetermineValueAndClassConceptTagException(ioe);
177:                }
178:                
179:                Element element = XMLHelper.getXPathElement(doc, xpathData);
180:                
181:                return ValueAndClassFactory.newValueAndClass(
182:                    XMLHelper.getElementAttribute(doc, xpathData, attrName),
183:                        String.class);
184:                 */
185:                //return outValue;
186:            }
187:
188:            public void determineClass(DetermineClassConceptTagContext inRcc) {
189:                inRcc.setDetermineClass(String.class);
190:            }
191:
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.