incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r919028 [1/2] - in /incubator/hise/trunk: hise-services/ hise-services/src/main/java/org/apache/hise/ 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/h...
Date Thu, 04 Mar 2010 15:42:22 GMT
Author: rr
Date: Thu Mar  4 15:42:21 2010
New Revision: 919028

URL: http://svn.apache.org/viewvc?rev=919028&view=rev
Log:
Added OpenJPA enhancer, Improved messages to tasks routing, extended itest

Added:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java   (with
props)
    incubator/hise/trunk/hise-services/src/main/resources/META-INF/
    incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml   (with
props)
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java
  (with props)
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java
  (with props)
    incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java
  (with props)
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml
  (with props)
Removed:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/SampleUsers.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/Test.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/TestImpl.java
Modified:
    incubator/hise/trunk/hise-services/pom.xml
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java
    incubator/hise/trunk/hise-test-example-osgi/pom.xml
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml
    incubator/hise/trunk/itest/hise-soapui-project.xml

Modified: incubator/hise/trunk/hise-services/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/pom.xml?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/pom.xml (original)
+++ incubator/hise/trunk/hise-services/pom.xml Thu Mar  4 15:42:21 2010
@@ -45,6 +45,37 @@
                     </execution>
                 </executions>
             </plugin>
+
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>openjpa-enhancer</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <property name="maven.runtime.classpath" refid="maven.compile.classpath"/>
+                <path id="classpath">
+		   <pathelement path="${maven.runtime.classpath}"/>
+		</path>
+		<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="classpath"/>
+                <openjpac>
+		    <fileset dir="${basedir}/src/main">
+                <include name="org/apache/hise/dao/*.java" />
+		    </fileset>
+		    <classpath>
+		     <pathelement location="${basedir}/target/classes"/>
+		     <pathelement path="${maven.runtime.classpath}"/>
+		    </classpath>
+		 </openjpac>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
         </plugins>
     </build>
     <profiles>

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java Thu
Mar  4 15:42:21 2010
@@ -2,6 +2,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.hise.dao.HISEDao;
 import org.apache.hise.engine.store.HISEDD;
 import org.apache.hise.engine.store.TaskDD;
 import org.apache.hise.lang.TaskDefinition;
@@ -10,12 +11,12 @@
 
 public interface HISEEngine {
     public static class TaskInfo {
-        public String taskKey;
         public TaskDefinition taskDefinition;
         public HISEDD parent;
         public TaskDD dd;
     }
     
     public void registerTask(TaskInfo ti);
-    public Node receive(QName portType, String operation, Element body, Node requestHeader);
+    public Node receive(Handler handler, QName portType, String operation, Element body,
Node requestHeader);
+    public HISEDao getHiseDao();
 }

Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java (added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java Thu
Mar  4 15:42:21 2010
@@ -0,0 +1,5 @@
+package org.apache.hise.api;
+
+public interface Handler {
+	public String getId();
+}

Propchange: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Handler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 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=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/HISEDao.java Thu
Mar  4 15:42:21 2010
@@ -345,7 +345,7 @@
                                     " or e.name in (:groups) and e.type = :constGroup", 
                                     new JQBParam("constGroup", TaskOrgEntity.OrgEntityType.GROUP)
                                 }),
-                            ") and e.genericHumanRole = :role",
+                            ") and e.genericHumanRole = :role and t.actualOwner is null",
                             new JQBParam("role", query.getGenericHumanRole())
                     })
                     .setMaxResults(query.getMaxTasks())

Modified: 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=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java Thu Mar
 4 15:42:21 2010
@@ -163,9 +163,9 @@
     /**
      * Task operations. Enumeration used to trigger comments.
      */
-    private static enum Operations {
-        CREATE, STATUS, NOMINATE, CLAIM, START, DELEGATE, RELEASE, COMPLETE, FAIL; 
-    }
+//    public static enum Operations {
+//        CREATE, STATUS, NOMINATE, CLAIM, START, DELEGATE, RELEASE, COMPLETE, FAIL; 
+//    }
 
     /**
      * Task's id. Autogenerated.

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
Thu Mar  4 15:42:21 2010
@@ -30,6 +30,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.hise.api.HISEEngine;
 import org.apache.hise.api.HISEUserDetails;
+import org.apache.hise.api.Handler;
 import org.apache.hise.dao.HISEDao;
 import org.apache.hise.dao.Job;
 import org.apache.hise.engine.jaxws.HISEJaxWSClient;
@@ -83,18 +84,21 @@
         return new QName(ns, q.getLocalPart());
     }
     
-    public static String tasksKey(QName portType, String operation) {
-        return getCanonicalQName(portType) + ";" + operation; 
+    public static String tasksKey(Handler handler, QName portType, String operation) {
+        return "" + System.identityHashCode(handler) + ";" + getCanonicalQName(portType)
+ ";" + operation; 
     }
 
     public void registerTask(TaskInfo ti) {
-        log.debug("registering route " + ti.taskKey + " -> " + ti.taskDefinition.getTaskName());
+        TaskDefinition d = ti.taskDefinition;
+        String taskKey = HISEEngineImpl.tasksKey(ti.dd.getHandler(), d.getTaskInterface().getPortType(),
d.getTaskInterface().getOperation());
+        log.debug("registering route " + taskKey + " -> " + ti.taskDefinition.getTaskName());
         
-        if (tasks.containsKey(ti.taskDefinition.getTaskName()) || tasksMap.containsKey(ti.taskKey))
{
+        QName taskName = ti.taskDefinition.getTaskName();
+        if (tasks.containsKey(taskName) || tasksMap.containsKey(taskKey)) {
             log.warn("Unable to deploy " + ti + " is already deployed.");
         }
         
-        tasksMap.put(ti.taskKey, ti.taskDefinition.getTaskName());
+        tasksMap.put(taskKey, ti.taskDefinition.getTaskName());
         tasks.put(ti.taskDefinition.getTaskName(), ti);
         
         log.debug("registered");
@@ -105,9 +109,11 @@
         return tasks.get(taskName).taskDefinition;
     }
     
-    public QName getTaskName(QName portType, String operation) {
-        QName n = tasksMap.get(tasksKey(portType, operation));
-        Validate.notNull(n, "Task for " + portType + " " + operation + " not found in routing
table.");
+    public QName getTaskName(Handler handler, QName portType, String operation) {
+    	java.util.logging.Logger l;
+    	String key = tasksKey(handler, portType, operation);
+        QName n = tasksMap.get(key);
+        Validate.notNull(n, "Task for " + portType + " " + operation + " not found in routing
table. Key: " + key);
         return n;
     }
     
@@ -118,10 +124,10 @@
         return r.size() == 1 ? (String) r.get(0) : "";
     }
     
-    public Node receive(QName portType, String operation, Element body, Node requestHeader)
{
+    public Node receive(Handler handler, QName portType, String operation, Element body,
Node requestHeader) {
         String createdBy = fetchCreatedBy(requestHeader);
         
-        QName taskName = getTaskName(portType, operation);
+        QName taskName = getTaskName(handler, portType, operation);
         assert(taskName != null);
         log.debug("routed " + portType + " " + operation + " -> " + taskName);
         TaskDefinition def = getTaskDefinition(taskName);

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
Thu Mar  4 15:42:21 2010
@@ -35,6 +35,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hise.api.HISEEngine;
+import org.apache.hise.api.Handler;
 import org.apache.hise.engine.HISEEngineImpl;
 import org.springframework.orm.jpa.JpaCallback;
 import org.springframework.orm.jpa.JpaTemplate;
@@ -50,7 +51,7 @@
 
 @WebServiceProvider
 @ServiceMode(value = Service.Mode.MESSAGE)
-public class HISEJaxWSService implements Provider<SOAPMessage> {
+public class HISEJaxWSService implements Provider<SOAPMessage>, Handler {
     private static Log __log = LogFactory.getLog(HISEJaxWSService.class);
 
     private HISEEngine hiseEngine;
@@ -58,6 +59,7 @@
     private PlatformTransactionManager transactionManager;
     private MessageFactory messageFactory;
     private TransactionTemplate transactionTemplate;
+    private String id;
 
     public HISEJaxWSService() throws Exception {
         messageFactory = MessageFactory.newInstance();
@@ -67,7 +69,15 @@
         transactionTemplate = new TransactionTemplate(transactionManager);
     }
     
-    public void setHiseEngine(HISEEngine hiseEngine) {
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public void setHiseEngine(HISEEngine hiseEngine) {
         this.hiseEngine = hiseEngine;
     }
 
@@ -98,7 +108,7 @@
 
                     Element body = request.getSOAPBody();
                     __log.debug("invoking " + request + " operation:" + operation + " portType:"
+ portType + " operation2:" + operation2);
-                    Node approveResponseHeader = hiseEngine.receive(portType, operation.getLocalPart(),
body, request.getSOAPHeader());
+                    Node approveResponseHeader = hiseEngine.receive(HISEJaxWSService.this,
portType, operation.getLocalPart(), body, request.getSOAPHeader());
                     SOAPMessage m = messageFactory.createMessage();
                     
                     Document doc = m.getSOAPHeader().getOwnerDocument();

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
Thu Mar  4 15:42:21 2010
@@ -42,7 +42,6 @@
             org.apache.hise.api.HISEEngine.TaskInfo ti = new org.apache.hise.api.HISEEngine.TaskInfo();
             ti.dd = t;
             ti.parent = di;
-            ti.taskKey = HISEEngineImpl.tasksKey(d.getTaskInterface().getPortType(), d.getTaskInterface().getOperation());
             ti.taskDefinition = d;
             hiseEngine.registerTask(ti);
         }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/TaskDD.java
Thu Mar  4 15:42:21 2010
@@ -24,8 +24,8 @@
 public class TaskDD {
 
     public QName taskName;
-    public Object handler;
-    public Object sender;
+    public org.apache.hise.engine.jaxws.HISEJaxWSService handler;
+    public org.apache.hise.engine.jaxws.HISEJaxWSClient sender;
 
     public QName getTaskName() {
         return taskName;
@@ -35,19 +35,19 @@
         this.taskName = taskName;
     }
 
-    public Object getHandler() {
+    public org.apache.hise.engine.jaxws.HISEJaxWSService getHandler() {
         return handler;
     }
 
-    public void setHandler(Object handler) {
+    public void setHandler(org.apache.hise.engine.jaxws.HISEJaxWSService handler) {
         this.handler = handler;
     }
 
-    public Object getSender() {
+    public org.apache.hise.engine.jaxws.HISEJaxWSClient getSender() {
         return sender;
     }
 
-    public void setSender(Object sender) {
+    public void setSender(org.apache.hise.engine.jaxws.HISEJaxWSClient sender) {
         this.sender = sender;
     }
 

Added: incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml (added)
+++ incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml Thu Mar
 4 15:42:21 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+    ~ 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.
+  -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
+  <persistence-unit name="org.apache.hise">
+    <class>org.apache.hise.dao.Attachment</class>
+    <class>org.apache.hise.dao.Comment</class>
+    <class>org.apache.hise.dao.Fault</class>
+    <class>org.apache.hise.dao.JpaBase</class>
+    <class>org.apache.hise.dao.Message</class>
+    <class>org.apache.hise.dao.OrgEntity</class>
+    <class>org.apache.hise.dao.TaskOrgEntity</class>
+    <class>org.apache.hise.dao.PresentationParameter</class>
+    <class>org.apache.hise.dao.Task</class>
+    <class>org.apache.hise.dao.Job</class>
+    <exclude-unlisted-classes/>
+
+    <!--  OpenJPA & HSQL -->
+    <!-- 
+    <properties>
+      <property name="openjpa.ConnectionDriverName" value="org.h2.Driver"/>
+      <property name="openjpa.ConnectionURL" value="jdbc:h2:file:hise-h2-db;DB_CLOSE_ON_EXIT=false"/>
+      <property name="openjpa.ConnectionUserName" value="sa"/>
+      <property name="openjpa.ConnectionPassword" value=""/>
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
+      <property name="openjpa.Log" value="commons"/>
+        value="DefaultLevel=INFO, Runtime=TRACE, Tool=INFO,
+SQL=TRACE" /> 
+      <property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72"/>
+    </properties>
+     -->
+  </persistence-unit>
+</persistence>

Propchange: incubator/hise/trunk/hise-services/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/hise/trunk/hise-test-example-osgi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/pom.xml?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/pom.xml (original)
+++ incubator/hise/trunk/hise-test-example-osgi/pom.xml Thu Mar  4 15:42:21 2010
@@ -57,8 +57,8 @@
    org.springframework.osgi.service,
    org.springframework.osgi.service.importer,
                         </Import-Package>
+                        <Private-Package>org.apache.hise.test</Private-Package>
                         <!--
-                        <Private-Package>org.apache.hise*</Private-Package>
                         <Export-Package>org.apache.hise*,org.w3._2001.xmlschema</Export-Package>
                         -->
                         <DynamicImport-Package>*</DynamicImport-Package>
@@ -111,5 +111,10 @@
       <scope>test</scope>
     </dependency>
      -->
+    <dependency>
+      <groupId>org.apache.hise</groupId>
+      <artifactId>hise-services</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 </project>

Added: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java
(added)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java
Thu Mar  4 15:42:21 2010
@@ -0,0 +1,86 @@
+package org.apache.hise.test;
+
+import org.apache.hise.api.HISEEngine;
+import org.apache.hise.dao.OrgEntity;
+import org.apache.hise.dao.TaskOrgEntity;
+import org.springframework.orm.jpa.JpaSystemException;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.transaction.support.TransactionTemplate;
+
+public class SampleUsers {
+    
+    private HISEEngine hiseEngine;
+    private PlatformTransactionManager transactionManager;
+
+    public void setHiseEngine(HISEEngine hiseEngine) {
+		this.hiseEngine = hiseEngine;
+	}
+
+	public void setTransactionManager(PlatformTransactionManager transactionManager) {
+        this.transactionManager = transactionManager;
+    }
+    
+    private void addUser(String name, String pass) {
+        OrgEntity o = new OrgEntity();
+        o.setName(name);
+        o.setType(TaskOrgEntity.OrgEntityType.USER);
+        o.setUserPassword(pass);
+        hiseEngine.getHiseDao().persist(o);
+    }
+
+    public void init() {
+    	try {
+        TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
+        
+        transactionTemplate.execute(new TransactionCallback() {
+            public Object doInTransaction(TransactionStatus arg0) {
+                {
+                    OrgEntity g = new OrgEntity();
+                    g.setName("group1");
+                    g.setType(TaskOrgEntity.OrgEntityType.GROUP);
+                    hiseEngine.getHiseDao().persist(g);
+                }
+                OrgEntity someGroup = new OrgEntity();
+                {
+                	OrgEntity g = someGroup;
+                    g.setName("someGroup");
+                    g.setType(TaskOrgEntity.OrgEntityType.GROUP);
+                    hiseEngine.getHiseDao().persist(g);
+                }
+                {
+                    OrgEntity o = new OrgEntity();
+                    o.setName("someUser");
+                    o.setType(TaskOrgEntity.OrgEntityType.USER);
+                    o.setUserPassword("someUser");
+                    o.getUserGroups().add(someGroup);
+                    hiseEngine.getHiseDao().persist(o);
+                }
+                {
+                    OrgEntity o = new OrgEntity();
+                    o.setName("someUser2");
+                    o.setType(TaskOrgEntity.OrgEntityType.USER);
+                    o.setUserPassword("someUser2");
+                    o.getUserGroups().add(someGroup);
+                    hiseEngine.getHiseDao().persist(o);
+                }
+                {
+                    OrgEntity o = new OrgEntity();
+                    o.setName("someUser3");
+                    o.setType(TaskOrgEntity.OrgEntityType.USER);
+                    o.setUserPassword("someUser3");
+                    o.getUserGroups().add(someGroup);
+                    hiseEngine.getHiseDao().persist(o);
+                }
+                addUser("user1", "user1pass");
+                addUser("user2", "user2pass");
+                addUser("user5", "user5pass");
+                return null;
+            }
+        });
+    	} catch (RuntimeException e) {
+    		e.printStackTrace();
+    	}
+    }
+}

Propchange: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/SampleUsers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java
(added)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java
Thu Mar  4 15:42:21 2010
@@ -0,0 +1,8 @@
+package org.apache.hise.test;
+
+import javax.jws.WebService;
+
+@WebService
+public interface Test {
+    void cleanup() throws Exception;
+}

Propchange: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java
(added)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java
Thu Mar  4 15:42:21 2010
@@ -0,0 +1,39 @@
+package org.apache.hise.test;
+
+import javax.jws.WebService;
+
+import org.apache.hise.api.HISEEngine;
+import org.apache.hise.dao.Job;
+import org.apache.hise.dao.Task;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.transaction.support.TransactionTemplate;
+
+@WebService(endpointInterface = "org.apache.hise.test.Test")
+public class TestImpl implements Test {
+    
+    private PlatformTransactionManager transactionManager;
+    
+    private HISEEngine e;
+    
+    public void setE(HISEEngine hiseEngine) {
+		this.e = hiseEngine;
+	}
+
+	public void setTransactionManager(PlatformTransactionManager transactionManager) {
+        this.transactionManager = transactionManager;
+    }
+
+    public void cleanup() throws Exception {
+        TransactionTemplate tt = new TransactionTemplate(transactionManager);
+        tt.execute(new TransactionCallback() {
+            public Object doInTransaction(TransactionStatus status) {
+//                hiseDao.clearAllRecords(OrgEntity.class);
+                e.getHiseDao().clearAllRecords(Task.class);
+                e.getHiseDao().clearAllRecords(Job.class);
+                return null;
+            }
+        });
+    }
+}

Propchange: incubator/hise/trunk/hise-test-example-osgi/src/main/java/org/apache/hise/test/TestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
(original)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
Thu Mar  4 15:42:21 2010
@@ -30,6 +30,17 @@
               <property name="handler" ref="hiseJaxWSService1"/>
               <property name="sender" ref="hiseJaxWSSender1"/>
             </bean>
+
+            <bean class="org.apache.hise.engine.store.TaskDD">
+              <property name="taskName">
+                <bean class="javax.xml.namespace.QName" factory-method="valueOf">
+                  <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}Task4"></constructor-arg>
+                </bean>
+              </property>
+              <property name="handler" ref="hiseJaxWSService2"/>
+              <property name="sender" ref="hiseJaxWSSender2"/>
+            </bean>
+            
             
             <bean class="org.apache.hise.engine.store.TaskDD">
               <property name="taskName">
@@ -46,30 +57,12 @@
   </bean>
 
   <bean id="hiseJaxWSService1" class="org.apache.hise.engine.jaxws.HISEJaxWSService" init-method="init">
+    <property name="id" value="hiseJaxWSService1"/>
     <property name="hiseEngine" ref="hiseEngine"/>
     <property name="transactionManager" ref="transactionManager"></property>
   </bean>
 
-  <jaxws:endpoint id="testHtd1" address="/ClaimsHandlingService/" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimsHandlingService" endpointName="ins:ClaimsHandlingPort" publish="true"
wsdlLocation="classpath:ExampleTasks.wsdl">
-  <!-- 
-    <jaxws:handlers>
-      <ref bean="transactionHandler"/>
-    </jaxws:handlers>
-    <jaxws:inInterceptors>
-      <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
-        <constructor-arg>
-          <map>
-            <entry key="action" value="UsernameToken"/>
-            <entry key="passwordType" value="PasswordDigest"/>
-            <entry key="passwordCallbackRef">
-              <ref bean="hisePasswordCallback"/>
-            </entry>
-          </map>
-        </constructor-arg>
-      </bean>
-    </jaxws:inInterceptors>
-     -->
-  </jaxws:endpoint>
+  <jaxws:endpoint id="testHtd1" address="/ClaimsHandlingService/" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimsHandlingService" endpointName="ins:ClaimsHandlingPort" publish="true"
wsdlLocation="classpath:ExampleTasks.wsdl"/>
 
   <bean id="hiseJaxWSSender1" class="org.apache.hise.engine.jaxws.HISEJaxWSClient" init-method="init">
     <property name="wsdlDocumentLocation" value="classpath:ExampleTasks.wsdl"></property>
@@ -83,7 +76,25 @@
 <!-- 
   <jaxws:client id="testHtd1Sender" address="http://localhost:9999" wsdlLocation="classpath:ExampleTasks.wsdl"/>
    -->
-  <jaxws:endpoint id="testHtd2" address="/ClaimApprovalReminderService/" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimApprovalReminderService" endpointName="ins:ClaimApprovalReminderPort"
publish="true" wsdlLocation="classpath:ExampleTasks.wsdl"/>
+  <jaxws:endpoint id="testHtdReminder" address="/ClaimApprovalReminderService/" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimApprovalReminderService" endpointName="ins:ClaimApprovalReminderPort"
publish="true" wsdlLocation="classpath:ExampleTasks.wsdl"/>
    
+
+
+  <bean id="hiseJaxWSService2" class="org.apache.hise.engine.jaxws.HISEJaxWSService" init-method="init">
+    <property name="id" value="hiseJaxWSService2"/>
+    <property name="hiseEngine" ref="hiseEngine"/>
+    <property name="transactionManager" ref="transactionManager"></property>
+  </bean>
+  <jaxws:endpoint id="testHtd2" address="/ClaimsHandlingService2/" implementor="#hiseJaxWSService2"
serviceName="ins:ClaimsHandlingService" endpointName="ins:ClaimsHandlingPort" publish="true"
wsdlLocation="classpath:ExampleTasks.wsdl"/>
+
+  <bean id="hiseJaxWSSender2" class="org.apache.hise.engine.jaxws.HISEJaxWSClient" init-method="init">
+    <property name="wsdlDocumentLocation" value="classpath:ExampleTasks.wsdl"></property>
+    <property name="serviceName">
+      <bean class="javax.xml.namespace.QName" factory-method="valueOf">
+        <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}ClaimsResolvingService"></constructor-arg>
+      </bean>
+    </property>
+  </bean>
+
 </beans>    
 

Added: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml?rev=919028&view=auto
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml
(added)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml
Thu Mar  4 15:42:21 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+    ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xmlns:htd="http://www.example.org/WS-HT"
xmlns:htda="http://www.example.org/WS-HT/api" xmlns:htdt="http://www.example.org/WS-HT/api/xsd"
xmlns:htdaw="http://www.example.org/WS-HT/api/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ins="http://www.insurance.example.com/claims"
+xmlns:osgi="http://www.springframework.org/schema/osgi"
+  xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.0.xsd
+       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+       http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+       http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+       http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
+       ">
+
+<osgi:reference id="hiseEngine" interface="org.apache.hise.api.HISEEngine" bean-name="hiseEngine"/>
+<osgi:reference id="transactionManager" interface="org.springframework.transaction.PlatformTransactionManager"
bean-name="transactionManager"/>
+
+  <jaxws:endpoint id="test" address="/test/" implementor="#test2" publish="true"/>
+  
+  <bean id="test2" class="org.apache.hise.test.TestImpl">
+    <property name="transactionManager" ref="transactionManager"/>
+    <property name="e" ref="hiseEngine"></property>
+  </bean>
+  
+    <bean id="sampleUsers" class="org.apache.hise.test.SampleUsers" init-method="init">
+        <property name="hiseEngine" ref="hiseEngine"></property>
+        <property name="transactionManager" ref="transactionManager"></property>
+    </bean>
+  
+</beans>

Propchange: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/hise-itest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml?rev=919028&r1=919027&r2=919028&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml (original)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml Thu Mar  4
15:42:21 2010
@@ -425,6 +425,109 @@
     </htd:completionDeadline>
   </htd:deadlines>
         </htd:task>    
+
+        <htd:task name="Task4">
+            
+            <htd:documentation xml:lang="en-US">This task is used to handle claims
that require manual approval. </htd:documentation>
+            <htd:interface portType="tns:ClaimsHandlingPT" operation="approve" responsePortType="tns:ClaimsResolvingPT"
responseOperation="resolve"/>
+            <htd:priority> htd:getInput("ClaimApprovalRequest")/priority </htd:priority>
+            
+            <htd:peopleAssignments>
+            	<htd:potentialOwners>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:groups>
+                                <htd:group>someGroup</htd:group>
+                            </htd:groups>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:potentialOwners>
+                
+                <htd:businessAdministrators>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:groups>
+                                <htd:group>group1</htd:group>
+                                <htd:group>group2</htd:group>
+                            </htd:groups>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:businessAdministrators>
+
+                <htd:businessAdministrators>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:users>
+                                <htd:user>user1</htd:user>
+                                <htd:user>user2</htd:user>
+                            </htd:users>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:businessAdministrators>
+                
+            	<htd:taskStakeholders>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:users>
+                                <htd:user>user3</htd:user>
+                            </htd:users>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:taskStakeholders>
+                
+            </htd:peopleAssignments>
+            
+            <htd:delegation potentialDelegatees="nobody"/>
+            
+            <htd:presentationElements>
+                
+                <htd:name xml:lang="en-US"> Approve Claim </htd:name>
+                
+                <htd:presentationParameters>
+                    
+                    <htd:presentationParameter name="firstname" type="xsd:string">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:string(htd:getInput("request")/ClaimApprovalRequest/cla:cust/cla:firstname)
+</htd:presentationParameter>
+                    
+                    <htd:presentationParameter name="lastname" type="xsd:string">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:string(htd:getInput("request")/ClaimApprovalRequest/cla:cust/cla:lastname)
+</htd:presentationParameter>
+                    
+                    <htd:presentationParameter name="euroAmount" type="xsd:double">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:double(htd:getInput("request")/ClaimApprovalRequest/cla:amount)
+</htd:presentationParameter>
+                        
+                </htd:presentationParameters>
+                
+<htd:subject xml:lang="en-US"> Approve the insurance claim for PLN {$euroAmount} on
behalf of {$firstname} {$lastname} </htd:subject>
+
+                <htd:description xml:lang="en-US" contentType="text/plain"> Approve
this claim following corporate guideline #4711.0815/7 for {$firstname} {$lastname} </htd:description>
+
+            </htd:presentationElements>
+            
+            <htd:outcome>
+                <![CDATA[
+                  <cla:resolve xmlns:cla="http://www.insurance.example.com/claims" xmlns:htd="http://www.example.org/WS-HT">
+                     <claimId>{htd:getInput("request")/ClaimApprovalRequest/cla:cust/cla:id/text()}</claimId>
+                     <ok>{$outcome}</ok>
+                  </cla:resolve>
+                ]]>
+            </htd:outcome>
+        </htd:task>    
     </htd:tasks>    
     
     <htd:notifications>



Mime
View raw message