Source Code Cross Referenced for WorkflowProperty.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » workflow » properties » 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 » Content Management System » harmonise » org.openharmonise.rm.resources.workflow.properties 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.rm.resources.workflow.properties;
020:
021:        import java.util.*;
022:
023:        import org.openharmonise.commons.dsi.AbstractDataStoreInterface;
024:        import org.openharmonise.rm.*;
025:        import org.openharmonise.rm.resources.lifecycle.*;
026:        import org.openharmonise.rm.resources.metadata.properties.*;
027:        import org.openharmonise.rm.resources.metadata.properties.domains.Domain;
028:        import org.openharmonise.rm.resources.metadata.properties.ranges.*;
029:        import org.openharmonise.rm.resources.workflow.properties.domains.WorkflowPropertyDomain;
030:        import org.openharmonise.rm.resources.workflow.properties.ranges.WorkflowRange;
031:        import org.openharmonise.rm.resources.workflow.values.WorkflowStageValueGroup;
032:
033:        /**
034:         * This class represents a definition of a workflow lifecycle, containing references to 
035:         * workflow stages which must be completed before the workflow is completed.
036:         * 
037:         * The class is implemented as an extension of <code>Property</code>, offering
038:         * extra utility methods to manage work flow specific data. The range of this 
039:         * property object must always be <code>WorkflowRange</code>.
040:         * 
041:         * @author Michael Bell
042:         * @version $Revision: 1.2 $
043:         *
044:         */
045:        public class WorkflowProperty extends Property {
046:
047:            public static final String TAG_WORKFLOW_PROPERTY = "WorkflowProperty";
048:
049:            static {
050:                RangeFactory.getInstance().addNewRange(
051:                        WorkflowRange.class.getName(),
052:                        WorkflowRange.class.getName());
053:            }
054:
055:            //initialise range
056:            {
057:                m_range = new WorkflowRange();
058:            }
059:
060:            /**
061:             * Basic constructor.
062:             */
063:            public WorkflowProperty() {
064:                super ();
065:            }
066:
067:            /**
068:             * Basic constructor which takes a datastore interface.
069:             * 
070:             * @param dbintrf
071:             */
072:            public WorkflowProperty(AbstractDataStoreInterface dbintrf) {
073:                super (dbintrf);
074:
075:            }
076:
077:            /**
078:             * Constructs a specific instance of a workflow definition, defined
079:             * by the given identifier.
080:             * 
081:             * @param dbintrf
082:             * @param nId
083:             */
084:            public WorkflowProperty(AbstractDataStoreInterface dbintrf, int nId) {
085:                super (dbintrf, nId);
086:            }
087:
088:            /**
089:             * Constructs a specific historical workflow instance.
090:             * 
091:             * @param dbintrf
092:             * @param nId
093:             * @param bIsHist
094:             */
095:            public WorkflowProperty(AbstractDataStoreInterface dbintrf,
096:                    int nId, int nKey, boolean bIsHist) {
097:                super (dbintrf, nId, nKey, bIsHist);
098:
099:            }
100:
101:            /* (non-Javadoc)
102:             * @see org.openharmonise.rm.resources.metadata.properties.Property#setRange(org.openharmonise.rm.resources.metadata.properties.ranges.Range)
103:             */
104:            public void setRange(Range range) throws PopulateException {
105:                if (range instanceof  WorkflowRange) {
106:                    super .setRange(range);
107:                } else {
108:                    String sRangeClass = null;
109:                    if (range != null) {
110:                        sRangeClass = range.getClass().getName();
111:                    }
112:                    throw new InvalidRangeException(
113:                            "Range has to be instance of workflowrange, not "
114:                                    + sRangeClass);
115:                }
116:
117:            }
118:
119:            public void setWorkflowValueGroup(WorkflowStageValueGroup valGrp)
120:                    throws PopulateException {
121:
122:                try {
123:                    ((WorkflowRange) m_range).addAllowedParent(valGrp
124:                            .getFullPath());
125:                } catch (DataAccessException e) {
126:                    throw new PopulateException(e.getLocalizedMessage(), e);
127:                }
128:            }
129:
130:            /* (non-Javadoc)
131:             * @see org.openharmonise.rm.resources.AbstractChildObject#getParentObjectClassName()
132:             */
133:            public String getParentObjectClassName() {
134:
135:                return WorkflowPropertyGroup.class.getName();
136:            }
137:
138:            /* (non-Javadoc)
139:             * @see org.openharmonise.rm.resources.metadata.properties.Property#checkDomainAndRange(org.openharmonise.rm.resources.metadata.properties.domains.Domain)
140:             */
141:            protected void checkDomainAndRange(Domain domain)
142:                    throws EditException {
143:                //do nothing as there's no point
144:            }
145:
146:            /* (non-Javadoc)
147:             * @see org.openharmonise.rm.resources.lifecycle.Editable#changeStatus(org.openharmonise.rm.resources.lifecycle.Status)
148:             */
149:            public Editable changeStatus(Status status) throws EditException {
150:
151:                try {
152:                    List domains = getDomains();
153:
154:                    ListIterator iter = domains.listIterator();
155:
156:                    while (iter.hasNext()) {
157:                        Domain domain = (Domain) iter.next();
158:
159:                        if (WorkflowPropertyDomain.validate(this , domain) == false) {
160:                            throw new StatusChangeNotAllowedException(
161:                                    "Domain not valid");
162:                        }
163:
164:                    }
165:                } catch (DataAccessException e) {
166:                    throw new EditException(e);
167:                }
168:
169:                return super .changeStatus(status);
170:            }
171:
172:            /* (non-Javadoc)
173:             * @see org.openharmonise.rm.publishing.Publishable#getTagName()
174:             */
175:            public String getTagName() {
176:                return TAG_WORKFLOW_PROPERTY;
177:            }
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.