You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hise-commits@incubator.apache.org by rr...@apache.org on 2010/01/13 23:20:58 UTC
svn commit: r898994 [1/7] - in /incubator/hise/trunk: ./ hise-services/
hise-services/src/main/java/org/apache/hise/api/
hise-services/src/main/java/org/apache/hise/dao/
hise-services/src/main/java/org/apache/hise/engine/
hise-services/src/main/java/or...
Author: rr
Date: Wed Jan 13 23:20:54 2010
New Revision: 898994
URL: http://svn.apache.org/viewvc?rev=898994&view=rev
Log:
Quite a large refactoring. Resolved: HISE-7 (notifications on task completion), HISE-9 (split DAO package into task logic and simple DAO); Work in progress for: HISE-11 (implement scheduler), HISE-8 (improve deployment description)
Added:
incubator/hise/trunk/.gitignore
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/Scheduler.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSClient.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TransactionHandler.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/CompileException.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDD.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/ResponseHandler.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskLifecycle.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/RegexpTemplateEngine.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/TaskXmlUtils.java (with props)
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java (with props)
incubator/hise/trunk/hise-services/src/main/resources/org/
incubator/hise/trunk/hise-services/src/main/resources/org/apache/
incubator/hise/trunk/hise-services/src/main/resources/org/apache/hise/
incubator/hise/trunk/hise-services/src/main/resources/org/apache/hise/persistence.xml (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/ClientTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/DaoTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/MessageTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/MockHiseDao.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/MockTask.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/MockTaskOperationsImpl.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/RegexpTemplateEngineTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/SchedulerTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/TaskEvaluatorTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/TaskOperationsTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/TaskTest.java (with props)
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/TaskXmlUtilsTest.java (with props)
incubator/hise/trunk/hise-services/src/test/resources/dao.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/duplicateTaskDef.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/epr.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/epr2.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/outcome.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/taskEvaluator.xml (with props)
incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml (with props)
incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml (with props)
incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml (with props)
incubator/hise/trunk/hise-web/src/main/resources/hise-cxf.xml (with props)
incubator/hise/trunk/hise-web/src/test/java/
incubator/hise/trunk/hise-web/src/test/java/org/
incubator/hise/trunk/hise-web/src/test/java/org/apache/
incubator/hise/trunk/hise-web/src/test/java/org/apache/hise/
incubator/hise/trunk/hise-web/src/test/java/org/apache/hise/Client2Test.java (with props)
incubator/hise/trunk/hise-web/src/test/java/org/apache/hise/SampleUsers.java (with props)
incubator/hise/trunk/hise-web/src/test/resources/epr.xml (with props)
incubator/hise/trunk/hise-web/src/test/resources/epr2.xml (with props)
incubator/hise/trunk/hise-web/src/test/resources/hise-ds.xml (with props)
Removed:
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HumanInteractionsManager.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HumanTaskServices.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/PeopleQuery.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/TemplateEngine.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEJaxWSService.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HumanInteractionsManagerImpl.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HumanTaskServicesImpl.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/PropertyBasedPeopleQuery.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/RegexpTemplateEngine.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/TaskOperationsImpl.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/TaskXmlUtils.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/TransactionHandler.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTConfigurationException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTIllegalAccessException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTIllegalArgumentException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTIllegalOperationException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTIllegalStateException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/faults/HTRecipientNotAllowedException.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Assignee.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/AssigneeDao.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Attachment.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Base.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/BasicDao.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Comment.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Deadline.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Fault.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/GenericHumanRole.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Group.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/JpaAssigneeDao.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/JpaTaskDao.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Message.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Person.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/PresentationParameter.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskDao.java
incubator/hise/trunk/hise-services/src/main/resources/hise/applicationContext.xml
incubator/hise/trunk/hise-services/src/main/resources/hise/persistence.xml
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/engine/HumanInteractionsManagerImplTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/engine/PropertyBasedPeopleQueryUnitTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/engine/ServicesIntegrationTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/lang/HumanInteractionsManagerImplUnitTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/lang/TaskDefinitionUnitTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/runtime/MessageTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/runtime/TaskIntegrationTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/runtime/TaskMockery.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/runtime/TaskUnitTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/runtime/TaskXmlUtilsTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/utils/RegexpTemplateEngineTest.java
incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/utils/TestUtil.java
incubator/hise/trunk/hise-services/src/test/resources/hise-jboss-ds.xml
incubator/hise/trunk/hise-services/src/test/resources/test.xml
incubator/hise/trunk/hise-test-example/src/main/resources/hise-ds.xml
incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-endpoint.xml
incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-human-interaction.xml
incubator/hise/trunk/hise-test-example/src/main/resources/testHtdDuplicateTaskDefinition.xml
incubator/hise/trunk/hise-web/src/main/resources/cxf-server.xml
incubator/hise/trunk/hise-web/src/main/resources/hise-config.xml
Modified:
incubator/hise/trunk/hise-services/pom.xml
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/HumanInteractions.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskStateListener.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java
incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XmlUtils.java
incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl
incubator/hise/trunk/hise-web/pom.xml
incubator/hise/trunk/hise-web/soapui-tests/hise-soapui-project.xml
incubator/hise/trunk/hise-web/src/main/resources/hise-ds.xml
incubator/hise/trunk/hise-web/src/main/webapp/WEB-INF/web.xml
incubator/hise/trunk/hise-web/src/test/resources/log4j.xml
incubator/hise/trunk/pom.xml
Added: incubator/hise/trunk/.gitignore
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/.gitignore?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/.gitignore (added)
+++ incubator/hise/trunk/.gitignore Wed Jan 13 23:20:54 2010
@@ -0,0 +1,11 @@
+.classpath
+.settings
+.project
+target
+*.trc
+*.log
+*.local
+*.settings
+*.xml.releaseBackup
+*~
+*.rej
Modified: incubator/hise/trunk/hise-services/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/pom.xml?rev=898994&r1=898993&r2=898994&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/pom.xml (original)
+++ incubator/hise/trunk/hise-services/pom.xml Wed Jan 13 23:20:54 2010
@@ -110,12 +110,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.hise</groupId>
- <artifactId>hise-test-example</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+@Entity
+@Table(name = "ATTACHMENT")
+public class Attachment extends JpaBase {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "attc_seq")
+ @SequenceGenerator(name = "attc_seq", sequenceName = "attc_seq")
+ private Long id;
+
+ @Column
+ private String attachment;
+
+ @Column
+ private String name;
+
+ @Column
+ private String accessType;
+
+ @Column
+ private String contentType;
+
+ @Column
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date attachedAt;
+
+ @Column
+ private long userId;
+
+ @ManyToOne
+ @JoinColumn(name = "TASK_ID")
+ private Task task;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getAccessType() {
+ return this.accessType;
+ }
+
+ public void setAccessType(String accessType) {
+ this.accessType = accessType;
+ }
+
+ public String getContentType() {
+ return this.contentType;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+ public Date getAttachedAt() {
+ return (this.attachedAt == null) ? null : (Date) this.attachedAt.clone();
+ }
+
+ public void setAttachedAt(Date attachedAt) {
+ this.attachedAt = (attachedAt == null) ? null : (Date) attachedAt.clone();
+ }
+
+ public long getUserId() {
+ return this.userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ public String getAttachment() {
+ return this.attachment;
+ }
+
+ public void setAttachment(String attachment) {
+ this.attachment = attachment;
+ }
+
+ public Task getTask() {
+ return this.task;
+ }
+
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id, name };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Attachment.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+/**
+ * Task content.
+ *
+ * @author Witek WoÅejszo
+ * @author Mateusz LipczyÅski
+ */
+@Entity
+@Table(name = "T_COMMENT")
+public class Comment extends JpaBase {
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ @Column(name = "COMMENT_DATE")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date date;
+
+ @Column(length = 4096)
+ private String content;
+
+ @ManyToOne
+ @JoinColumn(name = "TASK_ID")
+ private Task task;
+
+ public Comment(String content, Task task) {
+ this.content = content;
+ this.date = new Date();
+ this.task = task;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public Date getDate() {
+ return this.date;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getContent() {
+ return this.content;
+ }
+
+ public Task getTask() {
+ return this.task;
+ }
+
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+
+/**
+ * Holds start or completion deadline information.
+ *
+ * @author Witek WoÅejszo
+ *
+ */
+@Entity
+@Table(name = "DEADLINE")
+public class Deadline extends JpaBase {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "ddln_seq")
+ @SequenceGenerator(name = "ddln_seq", sequenceName = "ddln_seq")
+ private Long id;
+
+ @Column(name = "EVENT_DATE")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date eventDate;
+
+ @Column(name="ESCALATION_NAME", length = 256)
+ private String escalationName;
+
+ @Column(name="COMPLETION")
+ private Boolean completion;
+
+ @ManyToOne
+ @JoinColumn(name = "TASK_ID")
+ private Task task;
+
+ public Date getEventDate() {
+ return eventDate;
+ }
+
+ public void setEventDate(Date eventDate) {
+ this.eventDate = eventDate;
+ }
+
+ public String getEscalationName() {
+ return escalationName;
+ }
+
+ public void setEscalationName(String escalationName) {
+ this.escalationName = escalationName;
+ }
+
+ public Boolean getCompletion() {
+ return completion;
+ }
+
+ public void setCompletion(Boolean completion) {
+ this.completion = completion;
+ }
+
+ public Task getTask() {
+ return task;
+ }
+
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Deadline.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Transient;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Fault.
+ * @author Witek WoÅejszo
+ */
+@Embeddable
+public class Fault extends JpaBase {
+ @Column(name = "fault_name", nullable = true)
+ private String name;
+
+ @Column(name = "fault_data", nullable = true)
+ private String data;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getData() {
+ return this.data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { name, data };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Fault.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,11 @@
+package org.apache.hise.dao;
+
+public enum GenericHumanRole {
+ ACTUALOWNER,
+ TASKSTAKEHOLDERS,
+ POTENTIALOWNERS,
+ EXCLUDEDOWNERS,
+ BUSINESSADMINISTRATORS,
+ TASKINITIATOR,
+ RECIPIENTS
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/GenericHumanRole.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,388 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
+import javax.persistence.Query;
+
+import org.apache.commons.lang.Validate;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hise.dao.TaskOrgEntity.OrgEntityType;
+import org.apache.hise.engine.wsdl.IllegalArgumentFault;
+import org.apache.hise.engine.wsdl.IllegalStateFault;
+import org.apache.hise.lang.xsd.htd.TTask;
+import org.apache.hise.lang.xsd.htda.TStatus;
+import org.springframework.orm.jpa.EntityManagerFactoryUtils;
+import org.springframework.orm.jpa.JpaCallback;
+import org.springframework.orm.jpa.support.JpaDaoSupport;
+
+public class HISEDao extends JpaDaoSupport {
+
+ private static final Log log = LogFactory.getLog(HISEDao.class);
+
+ // /**
+ // * Returns tasks. See {@link HumanTaskServices#getMyTasks(String, TaskTypes, GenericHumanRole, String, List, String, String, Integer)}
+ // * for method contract.
+ // */
+ // public List<Task> getTasks(Assignee owner, TaskTypes taskType, GenericHumanRole genericHumanRole, String workQueue, List<Status> statuses,
+ // String whereClause, String orderByClause, String createdOnClause, Integer maxTasks, Integer offset) {
+ //
+ // Map<String, Object> namedParameters = new HashMap<String, Object>();
+ //
+ // StringBuilder queryBuilder = new StringBuilder("SELECT t FROM Task t ");
+ //
+ // //query for human role must be first
+ //
+ // if (genericHumanRole != null) {
+ //
+ // switch (genericHumanRole) {
+ //
+ // //TODO: owner for now but should be workQueue
+ //
+ // case ACTUAL_OWNER:
+ // //duplicates statement set when workQueue is null - not an error
+ // queryBuilder.append("WHERE t.actualOwner = :owner AND ");
+ // namedParameters.put("owner", owner);
+ // break;
+ //
+ // case BUSINESS_ADMINISTRATORS:
+ // //TODO implement
+ // throw new UnsupportedOperationException("Query for BUSINESS_ADMINISTRATORS not implemented.");
+ // //break;
+ //
+ // case NOTIFICATION_RECIPIENTS:
+ // queryBuilder.append("JOIN t.notificationRecipients ghr WHERE ghr = :owner AND ");
+ // namedParameters.put("owner", owner);
+ // break;
+ //
+ // case POTENTIAL_OWNERS:
+ // queryBuilder.append("JOIN t.potentialOwners ghr WHERE ghr = :owner AND ");
+ // namedParameters.put("owner", owner);
+ // break;
+ //
+ // case TASK_INITIATOR:
+ // //TODO implement
+ // throw new UnsupportedOperationException("Query for TASK_INITIATOR not implemented.");
+ // //break;
+ //
+ // case TASK_STAKEHOLDERS:
+ // queryBuilder.append("JOIN t.taskStakeholders ghr WHERE ghr = :owner AND ");
+ // namedParameters.put("owner", owner);
+ // break;
+ //
+ // default:
+ // }
+ //
+ // } else {
+ //
+ // queryBuilder.append("WHERE ");
+ // }
+ //
+ // if (workQueue == null) {
+ //
+ // //workQueue = owner.toString();
+ // //TODO ACTUAL_OWNER.toString() ?
+ // queryBuilder.append("t.actualOwner = :actualOwner AND ");
+ // namedParameters.put("actualOwner", owner);
+ // }
+ //
+ // if (statuses != null && !statuses.isEmpty()) {
+ //
+ // queryBuilder.append("t.status in (:statuses) AND ");
+ // namedParameters.put("statuses", statuses);
+ // }
+ //
+ // if (createdOnClause != null) {
+ //
+ // queryBuilder.append("t.createdOn = :createdOnClause AND ");
+ // namedParameters.put("createdOn", createdOnClause);
+ // }
+ //
+ // if (whereClause != null) {
+ //
+ // queryBuilder.append(whereClause);
+ // queryBuilder.append(" AND ");
+ // }
+ //
+ // String queryString = queryBuilder.toString();
+ //
+ // if (queryString.endsWith(" AND ")) {
+ // queryString = queryString.substring(0, queryString.length() - 4);
+ // }
+ //
+ // if (queryString.endsWith(" WHERE ")) {
+ // queryString = queryString.substring(0, queryString.length() - 6);
+ // }
+ //
+ // if (orderByClause != null) {
+ //
+ // queryBuilder = new StringBuilder(queryString);
+ // queryBuilder.append(" ORDER BY ");
+ // queryBuilder.append(orderByClause);
+ // queryBuilder.append(" ");
+ //
+ // } else {
+ //
+ // queryBuilder = new StringBuilder(queryString);
+ // queryBuilder.append( " ORDER BY t.activationTime ");
+ //
+ // }
+ //
+ // //TODO extract query building
+ // queryString = queryBuilder.toString();
+ //
+ // if (log.isDebugEnabled()) {
+ // log.debug("query: " + queryString);
+ // log.debug("parameters: " + namedParameters);
+ // }
+ //
+ // Query query = entityManager.createQuery(queryString);
+ //
+ // if (maxTasks != null && maxTasks > 0) {
+ // //query.setFirstResult(0);
+ // query.setMaxResults(maxTasks);
+ // }
+ //
+ // if (offset != null) {
+ // query.setFirstResult(offset);
+ // } else {
+ // query.setFirstResult(0);
+ // }
+ //
+ // for (Map.Entry<String, Object> parameter : namedParameters.entrySet()) {
+ // query.setParameter(parameter.getKey(), parameter.getValue());
+ // }
+ //
+ // List<Task> result = query.getResultList();
+ // return result;
+ // }
+ // /**
+ // * Checks if given task exists.
+ // * @param primaryKey Primary key of the entity
+ // * @return true if entity exists false otherwise
+ // */
+ // public boolean exists(Long id) {
+ // try {
+ // entityManager.find(Task.class,id);
+ // return true;
+ // } catch (EntityNotFoundException xENF) {
+ // return false;
+ // }
+ // }
+ //
+ // /**
+ // * Retrieves domain object from persistent store.
+ // * @param id Identifier of requested domain object
+ // * @return fetched domain object
+ // */
+ // public Task fetch(Long id) {
+ // return entityManager.find(Task.class, id);
+ // }
+ //
+ // /**
+ // * Saves domain object in persistent store.
+ // * @param entity Domain object to save
+ // */
+ // public void update(Task entity) {
+ // entityManager.merge(entity);
+ // }
+ //
+ // /**
+ // * Creates domain object in persistent store.
+ // * @param entity Domain object to create
+ // */
+ // public void create(Task entity) {
+ // entityManager.persist(entity);
+ // }
+ //
+ // public List<Task> getTasks(Assignee owner, TaskTypes taskType, GenericHumanRole genericHumanRole, String workQueue, List<Status> status, String whereClause, String orderByClause, String createdOnClause, Integer maxTasks, Integer offset) {
+ // // TODO Auto-generated method stub
+ // return null;
+ // }
+ //
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public Assignee fetch(Long id) {
+ // return entityManager.find(Assignee.class, id);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void update(Assignee entity) {
+ // entityManager.merge(entity);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public void create(Assignee entity) {
+ // entityManager.persist(entity);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // public Group getGroup(String name) {
+ //
+ // Query query = entityManager.createQuery("SELECT g FROM Group g WHERE g.name = :name");
+ // query.setParameter("name", name);
+ //
+ // try {
+ //
+ // return (Group) query.getSingleResult();
+ // } catch (NoResultException e) {
+ //
+ // return null;
+ // }
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // * TODO should work when ids are set
+ // */
+ // public Set<Assignee> saveNotExistingAssignees(Set<Assignee> assignees) {
+ //
+ // Set<Assignee> result = new HashSet<Assignee>();
+ //
+ // for (Assignee a : assignees) {
+ //
+ // if (a instanceof Person) {
+ //
+ // Person p = this.getPerson(a.getName());
+ // if (p == null) {
+ // this.create(a);
+ // p = (Person) a;
+ // }
+ // result.add(p);
+ //
+ // } else if (a instanceof Group) {
+ //
+ // Group g = this.getGroup(a.getName());
+ // if (g == null) {
+ // this.create(a);
+ // g = (Group) a;
+ // }
+ // result.add(g);
+ // }
+ // }
+ //
+ // return result;
+ // }
+ //
+
+ public Task loadTask(Long taskId) {
+ return getJpaTemplate().find(Task.class, taskId);
+ }
+
+ public void saveTask(Task t) {
+ getJpaTemplate().persist(t);
+ }
+
+ // public Person loadUser(String userId) {
+ // return getJpaTemplate().find(Person.class, userId);
+ // }
+
+ public OrgEntity getOrgEntity(final String name) {
+ return (OrgEntity) getJpaTemplate().execute(new JpaCallback() {
+ public Object doInJpa(EntityManager e) throws PersistenceException {
+ Query query = e.createQuery("FROM OrgEntity o WHERE o.name = :name");
+ query.setParameter("name", name);
+ return query.getSingleResult();
+ }
+ });
+ }
+
+ private Collection<String> getUserGroups(OrgEntity user) {
+ Collection<String> r = new ArrayList<String>();
+ for (OrgEntity g : user.getUserGroups()) {
+ Validate.isTrue(g.getType() == OrgEntityType.GROUP);
+ r.add(g.getName());
+ }
+ return r;
+ }
+
+ public List<Task> getUserTasks(final OrgEntity user, String taskType, final GenericHumanRole genericHumanRole, String workQueue, List<TStatus> status, String whereClause, String createdOnClause, final Integer maxTasks) {
+// TaskOrgEntity to;to.g
+ switch (genericHumanRole) {
+ case ACTUALOWNER:
+ return (List<Task>) getJpaTemplate().executeFind(new JpaCallback() {
+ public Object doInJpa(EntityManager em) throws PersistenceException {
+ return em.createQuery("select distinct t from Task t where t.actualOwner.name = :user")
+ .setParameter("user", user.name)
+ .setMaxResults(maxTasks)
+ .getResultList();
+ }
+ });
+ case POTENTIALOWNERS:
+// return (List<Task>) getJpaTemplate().find("select distinct t from Task t, TaskOrgEntity e where e.task = t and (e.name = ? and e.type = 'USER' or e.name in (?) and e.type = 'GROUP') and e.genericHumanRole = ?", user.getName(), getUserGroups(user), genericHumanRole);
+ return (List<Task>) getJpaTemplate().executeFind(new JpaCallback() {
+ public Object doInJpa(EntityManager em) throws PersistenceException {
+ return em.createQuery("select distinct t from Task t, TaskOrgEntity e where e.task = t and (e.name = :user and e.type = 'USER' or e.name in (:groups) and e.type = 'GROUP') and e.genericHumanRole = :role")
+ .setParameter("user", user.name)
+ .setParameter("groups", getUserGroups(user))
+ .setParameter("role", genericHumanRole)
+ .setMaxResults(maxTasks)
+ .getResultList();
+ }
+ });
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ public List<Job> listJobs(final Date until, final int maxResult) {
+ return (List<Job>) getJpaTemplate().executeFind(new JpaCallback() {
+ public Object doInJpa(EntityManager em) throws PersistenceException {
+ return em.createQuery("select j from Job j where j.fire < :until order by j.fire")
+ .setParameter("until", until)
+ .setMaxResults(maxResult)
+ .getResultList();
+ }
+ });
+ }
+
+ public void saveOrgEntity(OrgEntity o) {
+ getJpaTemplate().persist(o);
+ }
+
+ public void remove(Object o) {
+ getJpaTemplate().remove(o);
+ }
+
+ public void persist(Object o) {
+ getJpaTemplate().persist(o);
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,61 @@
+package org.apache.hise.dao;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class Job extends JpaBase {
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ private Date fire;
+
+ @ManyToOne
+ private Task task;
+
+ private String action;
+ private String details;
+
+ public Long getId() {
+ return id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public Date getFire() {
+ return fire;
+ }
+ public void setFire(Date fire) {
+ this.fire = fire;
+ }
+
+ public Task getTask() {
+ return task;
+ }
+ public void setTask(Task task) {
+ this.task = task;
+ }
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public String getDetails() {
+ return details;
+ }
+ public void setDetails(String details) {
+ this.details = details;
+ }
+ @Override
+ public Object[] getKeys() {
+ return new Object[] {id};
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Job.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.persistence.MappedSuperclass;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.springframework.beans.factory.annotation.Configurable;
+
+@Configurable
+@MappedSuperclass
+public abstract class JpaBase {
+
+ public abstract Object[] getKeys();
+
+ @Override
+ public int hashCode() {
+ HashCodeBuilder b = new HashCodeBuilder();
+ for (Object o : getKeys()) {
+ b.append(o);
+ }
+ return b.toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ List<Object> l1 = new ArrayList<Object>();
+ Collections.addAll(l1, getKeys());
+ List<Object> l2 = new ArrayList<Object>();
+ Collections.addAll(l2, ((JpaBase) obj).getKeys());
+ return l1.equals(l2);
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this);
+ for (Object o : getKeys()) {
+ b.append(o);
+ }
+ return b.toString();
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapKey;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.lang.Validate;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hise.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * Message part related to Task. It can be either part of input message or part of output message.
+ *
+ * @author Witek WoÅejszo
+ */
+@Entity
+@Table(name = "MESSAGE")
+public class Message extends JpaBase {
+
+ private static final Log log = LogFactory.getLog(Message.class);
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "mssg_seq")
+ @SequenceGenerator(name = "mssg_seq", sequenceName = "mssg_seq")
+ private Long id;
+
+ private String partName;
+
+ @Basic(fetch = FetchType.LAZY)
+ @Column(nullable = false)
+ @Lob
+ private String message;
+
+ public Message() {}
+
+ public Message(String partName, String message) {
+ Validate.notNull(message);
+ this.partName = partName;
+ this.message = message;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getId() {
+ return this.id;
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
+
+ public String getPartName() {
+ return this.partName;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Message.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.OneToMany;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+/**
+ * Task Assignee - member of generic human role.
+ * @author Witek WoÅejszo
+ */
+@Entity
+@Table(name = "ORG_ENTITY")
+public class OrgEntity extends JpaBase {
+
+// @Id
+// @GeneratedValue(strategy = GenerationType.AUTO, generator = "asgn_seq")
+// @SequenceGenerator(name = "asgn_seq", sequenceName = "asgn_seq")
+// protected Long id;
+
+ @Id
+ protected String name;
+
+ @Enumerated(value = EnumType.STRING)
+ private TaskOrgEntity.OrgEntityType type;
+
+ private String userPassword;
+
+ @OneToMany(mappedBy="name", cascade = {CascadeType.ALL})
+ private Set<OrgEntity> userGroups = new HashSet<OrgEntity>();
+
+ public Set<OrgEntity> getUserGroups() {
+ return userGroups;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUserPassword() {
+ return userPassword;
+ }
+
+ public void setUserPassword(String userPassword) {
+ this.userPassword = userPassword;
+ }
+
+ public TaskOrgEntity.OrgEntityType getType() {
+ return type;
+ }
+
+ public void setType(TaskOrgEntity.OrgEntityType type) {
+ this.type = type;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] {name} ;
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/OrgEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,257 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.annotations.Index;
+
+/**
+ * Evaluated value of Task's presentation parameter.
+ * @author Witek WoÅejszo
+ */
+@Entity
+@Table(name = "PRESENTATION_PARAMETERS")
+public class PresentationParameter extends JpaBase {
+
+ private static final Log log = LogFactory.getLog(PresentationParameter.class);
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "prpr_seq")
+ @SequenceGenerator(name = "prpr_seq", sequenceName = "prpr_seq")
+ private Long id;
+
+ private String name;
+
+ private String stringValue;
+
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date dateValue;
+
+ private BigDecimal bigDecimalValue;
+
+ private Double doubleValue;
+
+ private Integer integerValue;
+
+ private Boolean booleanValue;
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id };
+ }
+
+ @ManyToOne
+ @JoinColumn(name = "task_id", nullable = false)
+ @Index(name = "prpr_task_id_idx")
+ private Task task;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+//
+// /**
+// * @param stringValue the stringValue to set
+// */
+// public void setValue(Object value) {
+//
+// if (value instanceof String) {
+//
+// this.setValue((String)value);
+//
+// } else if (value instanceof BigDecimal) {
+//
+// this.setValue((BigDecimal)value);
+//
+// } else if (value instanceof Double) {
+//
+// this.setValue((Double)value);
+//
+// } else if (value instanceof Integer) {
+//
+// this.setValue((Integer)value);
+//
+// } else if (value instanceof Boolean) {
+//
+// this.setValue((Boolean)value);
+//
+// } else if (value instanceof Date) {
+//
+// this.setValue((Date)value);
+//
+// }
+// }
+//
+// /**
+// * @param stringValue the stringValue to set
+// */
+// public void setValue(String stringValue) {
+// cleanValues();
+// this.stringValue = stringValue;
+// }
+//
+// /**
+// * @param dateValue the dateValue to set
+// */
+// public void setValue(Date dateValue) {
+// cleanValues();
+// this.dateValue = dateValue;
+// }
+//
+// /**
+// * @param numericValue the numericValue to set
+// */
+// public void setValue(BigDecimal bigDecimalValue) {
+// cleanValues();
+// this.bigDecimalValue = bigDecimalValue;
+// }
+//
+// /**
+// * @param booleanValue the booleanValue to set
+// */
+// public void setValue(Boolean booleanValue) {
+// cleanValues();
+// this.booleanValue = booleanValue;
+// }
+//
+// /**
+// * @param doubleValue the doubleValue to set
+// */
+// public void setValue(Double doubleValue) {
+// cleanValues();
+// if (!doubleValue.isNaN()) {
+// this.doubleValue = doubleValue;
+// } else {
+// log.warn("NaN value passed. Storing null");
+// }
+// }
+//
+// /**
+// * @param integerValue the integerValue to set
+// */
+// public void setValue(Integer integerValue) {
+// cleanValues();
+// this.integerValue = integerValue;
+// }
+//
+// /**
+// * Returns value of proper type.
+// * @return value
+// */
+// public Object getValue() {
+//
+// if (this.stringValue != null) {
+//
+// return this.stringValue;
+//
+// } else if (this.dateValue != null) {
+//
+// return this.dateValue;
+//
+// } else if (this.bigDecimalValue != null) {
+//
+// return this.bigDecimalValue;
+//
+// } else if (this.doubleValue != null) {
+//
+// return this.doubleValue;
+//
+// } else if (this.integerValue != null) {
+//
+// return this.integerValue;
+//
+// } else if (this.booleanValue != null) {
+//
+// return this.booleanValue;
+//
+// } else {
+//
+// return null;
+// }
+// }
+//
+ /**
+ * @param task the task to set
+ */
+ public void setTask(Task task) {
+ this.task = task;
+ }
+//
+//
+// private void cleanValues() {
+//
+// this.stringValue = null;
+// this.dateValue = null;
+// this.bigDecimalValue = null;
+// this.doubleValue = null;
+// this.integerValue = null;
+// this.booleanValue = null;
+// }
+//
+// /**
+// * Returns the presentation element hash code.
+// * @return presentation element hash code
+// */
+// @Override
+// public int hashCode() {
+// HashCodeBuilder hcb = new HashCodeBuilder();
+// return hcb.append(this.id).toHashCode();
+// }
+//
+// /**
+// * Checks whether the presentation element is equal to another object.
+// * @param obj object to compare
+// * @return true if the objects are equal, false otherwise
+// */
+// @Override
+// public boolean equals(Object obj) {
+// if (obj instanceof PresentationParameter == false) {
+// return false;
+// }
+// if (this == obj) {
+// return true;
+// }
+// PresentationParameter pp = (PresentationParameter) obj;
+// return new EqualsBuilder().append(this.id, pp.id).isEquals();
+// }
+
+
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/PresentationParameter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,507 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.annotation.Resource;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapKey;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.Transient;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import net.sf.saxon.Configuration;
+import net.sf.saxon.query.DynamicQueryContext;
+import net.sf.saxon.query.StaticQueryContext;
+import net.sf.saxon.query.XQueryExpression;
+import net.sf.saxon.trans.XPathException;
+import net.sf.saxon.type.AnyItemType;
+
+import org.apache.commons.lang.Validate;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Configurable;
+
+
+/**
+ * Holds task instance information. Provides task business operations.
+ *
+ * @author Kamil Eisenbart
+ * @author Witek WoÅejszo
+ * @author Mateusz LipczyÅski
+ * @author Warren Crossing
+ */
+@Entity
+@Table(name = "TASK")
+@Configurable(preConstruction = true)
+public class Task extends JpaBase {
+
+ private static final Log __log = LogFactory.getLog(Task.class);
+
+ @Column(nullable = false)
+ private String taskDefinitionKey;
+
+ public static enum TaskTypes {
+ ALL, TASKS, NOTIFICATIONS;
+ }
+
+ /**
+ * Task statuses.
+ */
+ public static enum Status {
+
+ /**
+ * Upon creation. Remains CREATED if there are no potential owners.
+ */
+ CREATED,
+
+ /**
+ * Created task with multiple potential owners.
+ */
+ READY,
+
+ /**
+ * Created task with single potential owner. Work started. Actual owner set.
+ */
+ RESERVED,
+
+ /**
+ * Work started and task is being worked on now. Actual owner set.
+ */
+ IN_PROGRESS,
+
+ /**
+ * In any of its active states (Ready, Reserved, InProgress), a task can be suspended,
+ * transitioning it into the Suspended state. On resumption of the task, it transitions
+ * back to the original state from which it had been suspended.
+ */
+ SUSPENDED,
+
+ /**
+ * Successful completion of the work. One of the final states.
+ */
+ COMPLETED,
+
+ /**
+ * Unsuccessful completion of the work. One of the final states.
+ */
+ FAILED,
+
+ /**
+ * Unrecoverable error in human task processing. One of the final states.
+ */
+ ERROR,
+
+ /**
+ * TODO javadoc, One of the final states.
+ */
+ EXITED,
+
+ /**
+ * Task is no longer needed - skipped. This is considered a âgoodâ outcome of a task. One of the final states.
+ */
+ OBSOLETE;
+
+ public String value() {
+ return name();
+ }
+
+ public static Status fromValue(String v) {
+ return valueOf(v);
+ }
+
+ }
+
+ /**
+ * Task operations. Enumeration used to trigger comments.
+ */
+ private static enum Operations {
+ CREATE, STATUS, NOMINATE, CLAIM, START, DELEGATE, RELEASE, COMPLETE, FAIL;
+ }
+
+ /**
+ * Task's id. Autogenerated.
+ */
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO, generator = "task_seq")
+ @SequenceGenerator(name = "task_seq", sequenceName = "task_seq")
+ private Long id;
+
+ /**
+ * Task input message map. Maps message part to message. If
+ * document style Web HumanTaskServicesImpl are used to start Task, part name
+ * should be set to {@link Message.DEFAULT_PART_NAME_KEY}.
+ */
+ @OneToMany(cascade = { CascadeType.ALL })
+ @MapKey(name = "partName")
+ @JoinTable(name = "TASK_MSG_INPUT")
+ private Map<String, Message> input = new HashMap<String, Message>();
+
+ /**
+ * Task output message map. Maps message part to message.
+ */
+ @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ @MapKey(name = "partName")
+ @JoinTable(name = "TASK_MSG_OUTPUT")
+ private Map<String, Message> output = new HashMap<String, Message>();
+
+ /**
+ * Task status.
+ */
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+// @Index(name = "task_status_idx")
+ private Status status;
+
+ /**
+ * Previous status of SUSPENDED Task. When Task is resumed this
+ * status is copied to the status field.
+ */
+ @Enumerated(EnumType.STRING)
+ private Status statusBeforeSuspend;
+
+ /**
+ * People assigned to different generic human roles.
+ */
+ @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ private OrgEntity actualOwner;
+
+ /**
+ * This element is used to specify the priority of the task. It is an optional element which value is an integer expression. If not present, the priority of
+ * the task is unspecified. 0 is the highest priority, larger numbers identify lower priorities.
+ */
+ private int priority;
+
+ /**
+ * Task initiator. Depending on how the task has been instantiated the task initiator may or may not be defined.
+ */
+ private String createdBy;
+
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date createdOn;
+
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date activationTime;
+
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date expirationTime;
+
+ @OneToOne
+ private Job suspendUntil;
+
+ private boolean skippable;
+
+ private boolean escalated;
+
+ private boolean notification = false;
+
+ public boolean isNotification() {
+ return notification;
+ }
+
+ @OneToMany(mappedBy="task", cascade = {CascadeType.ALL})
+ private Set<TaskOrgEntity> peopleAssignments;
+
+// @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+// @JoinTable(name = "TASK_EXCLUDED_OWNERS", joinColumns = @JoinColumn(name = "TASK"), inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
+// private Set<TaskOrgEntity> excludedOwners;
+//
+// @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+// @JoinTable(name = "TASK_STAKEHOLDERS", joinColumns = @JoinColumn(name = "TASK"), inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
+// private Set<TaskOrgEntity> taskStakeholders;
+//
+// @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+// @JoinTable(name = "TASK_BUSINESS_AMINISTRATORS", joinColumns = @JoinColumn(name = "TASK"), inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
+// private Set<TaskOrgEntity> businessAdministrators;
+//
+// @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+// @JoinTable(name = "TASK_NOTIFICATION_RECIPIENTS", joinColumns = @JoinColumn(name = "TASK"), inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
+// private Set<TaskOrgEntity> notificationRecipients;
+
+ @OneToMany(mappedBy = "task", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ private List<Comment> comments = new ArrayList<Comment>();
+
+ @OneToMany(mappedBy = "task", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ private List<Attachment> attachments = new ArrayList<Attachment>();
+
+ @OneToMany(mappedBy = "task", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+ private List<Deadline> deadlines = new ArrayList<Deadline>();
+
+ /**
+ * Fault information. Set when task fail method is called.
+ */
+ private Fault fault;
+
+ /**
+ * Task presentation parameters recalculated on input message change.
+ * Maps presentation parameter name to its value. Can be used as a where clause parameter
+ * in task query operations.
+ */
+ @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "task", fetch = FetchType.EAGER)
+ @MapKey(name = "name")
+ private Map<String, PresentationParameter> presentationParameters = new HashMap<String, PresentationParameter>();
+
+
+ public List<Deadline> getDeadlines() {
+ return deadlines;
+ }
+
+ public void setDeadlines(List<Deadline> deadlines) {
+ this.deadlines = deadlines;
+ }
+
+ public String getTaskDefinitionKey() {
+ return taskDefinitionKey;
+ }
+
+ public void setTaskDefinitionKey(String taskDefinitionKey) {
+ this.taskDefinitionKey = taskDefinitionKey;
+ }
+
+ public QName getTaskDefinitionName() {
+ return QName.valueOf(getTaskDefinitionKey());
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Map<String, Message> getInput() {
+ return input;
+ }
+
+ public void setInput(Map<String, Message> input) {
+ this.input = input;
+ }
+
+ public Map<String, Message> getOutput() {
+ return output;
+ }
+
+ public void setOutput(Map<String, Message> output) {
+ this.output = output;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ public Status getStatusBeforeSuspend() {
+ return statusBeforeSuspend;
+ }
+
+ public void setStatusBeforeSuspend(Status statusBeforeSuspend) {
+ this.statusBeforeSuspend = statusBeforeSuspend;
+ }
+
+ public OrgEntity getActualOwner() {
+ return actualOwner;
+ }
+
+ public void setActualOwner(OrgEntity actualOwner) {
+ this.actualOwner = actualOwner;
+ }
+
+ public int getPriority() {
+ return priority;
+ }
+
+ public void setPriority(int priority) {
+ this.priority = priority;
+ }
+
+ public String getCreatedBy() {
+ return createdBy;
+ }
+
+ public void setCreatedBy(String createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ public Date getCreatedOn() {
+ return createdOn;
+ }
+
+ public void setCreatedOn(Date createdOn) {
+ this.createdOn = createdOn;
+ }
+
+ public Date getActivationTime() {
+ return activationTime;
+ }
+
+ public void setActivationTime(Date activationTime) {
+ this.activationTime = activationTime;
+ }
+
+ public Date getExpirationTime() {
+ return expirationTime;
+ }
+
+ public void setExpirationTime(Date expirationTime) {
+ this.expirationTime = expirationTime;
+ }
+
+
+ public boolean isSkippable() {
+ return skippable;
+ }
+
+ public void setSkippable(boolean skippable) {
+ this.skippable = skippable;
+ }
+
+ public boolean isEscalated() {
+ return escalated;
+ }
+
+ public void setEscalated(boolean escalated) {
+ this.escalated = escalated;
+ }
+
+
+
+// public Set<TaskOrgEntity> getExcludedOwners() {
+// return excludedOwners;
+// }
+//
+// public void setExcludedOwners(Set<TaskOrgEntity> excludedOwners) {
+// this.excludedOwners = excludedOwners;
+// }
+//
+// public Set<TaskOrgEntity> getTaskStakeholders() {
+// return taskStakeholders;
+// }
+//
+// public void setTaskStakeholders(Set<TaskOrgEntity> taskStakeholders) {
+// this.taskStakeholders = taskStakeholders;
+// }
+//
+// public Set<TaskOrgEntity> getBusinessAdministrators() {
+// return businessAdministrators;
+// }
+//
+// public void setBusinessAdministrators(Set<TaskOrgEntity> businessAdministrators) {
+// this.businessAdministrators = businessAdministrators;
+// }
+//
+// public Set<TaskOrgEntity> getNotificationRecipients() {
+// return notificationRecipients;
+// }
+//
+// public void setNotificationRecipients(Set<TaskOrgEntity> notificationRecipients) {
+// this.notificationRecipients = notificationRecipients;
+// }
+
+ public Set<TaskOrgEntity> getPeopleAssignments() {
+ return peopleAssignments;
+ }
+
+ public void setPeopleAssignments(Set<TaskOrgEntity> peopleAssignments) {
+ this.peopleAssignments = peopleAssignments;
+ }
+
+ public List<Comment> getComments() {
+ return comments;
+ }
+
+ public void setComments(List<Comment> comments) {
+ this.comments = comments;
+ }
+
+ public List<Attachment> getAttachments() {
+ return attachments;
+ }
+
+ public void setAttachments(List<Attachment> attachments) {
+ this.attachments = attachments;
+ }
+
+ public Fault getFault() {
+ return fault;
+ }
+
+ public void setFault(Fault fault) {
+ this.fault = fault;
+ }
+
+ public Map<String, PresentationParameter> getPresentationParameters() {
+ return presentationParameters;
+ }
+
+ public void setPresentationParameters(Map<String, PresentationParameter> presentationParameters) {
+ this.presentationParameters = presentationParameters;
+ }
+
+ public void setNotification(boolean notification) {
+ this.notification = notification;
+ }
+
+
+ public Job getSuspendUntil() {
+ return suspendUntil;
+ }
+
+ public void setSuspendUntil(Job suspendUntil) {
+ this.suspendUntil = suspendUntil;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] { id };
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.dao;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.ManyToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementRef;
+
+/**
+ * Task Assignee - member of generic human role.
+ * @author Witek WoÅejszo
+ */
+@Entity
+public class TaskOrgEntity extends JpaBase {
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ @ManyToOne
+ private Task task;
+
+ private String name;
+
+ public static enum OrgEntityType {
+ USER, GROUP;
+ }
+
+ @Enumerated(value = EnumType.STRING)
+ private OrgEntityType type;
+
+ @Enumerated(value = EnumType.STRING)
+ private GenericHumanRole genericHumanRole;
+
+ public Task getTask() {
+ return task;
+ }
+
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+
+ public OrgEntityType getType() {
+ return type;
+ }
+
+
+
+ public void setType(OrgEntityType type) {
+ this.type = type;
+ }
+
+
+ public GenericHumanRole getGenericHumanRole() {
+ return genericHumanRole;
+ }
+
+ public void setGenericHumanRole(GenericHumanRole genericHumanRole) {
+ this.genericHumanRole = genericHumanRole;
+ }
+
+ @Override
+ public Object[] getKeys() {
+ return new Object[] {id} ;
+ }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/TaskOrgEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java?rev=898994&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java Wed Jan 13 23:20:54 2010
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hise.engine;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.hise.dao.HISEDao;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class HISEDaoPasswordCallback implements CallbackHandler {
+
+ private HISEDao hiseDao;
+
+ public void setHiseDao(HISEDao hiseDao) {
+ this.hiseDao = hiseDao;
+ }
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+ String pass = hiseDao.getOrgEntity(pc.getIdentifer()).getUserPassword();
+ if (pass != null) {
+ pc.setPassword(pass);
+ return;
+ }
+ }
+
+ //
+ // Password not found
+ //
+ throw new IOException();
+ }
+
+// public void setAliasPassword(String alias, String password) {
+// passwords.put(alias, password);
+// }
+}
Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEDaoPasswordCallback.java
------------------------------------------------------------------------------
svn:eol-style = native