Author: lahiru
Date: Fri Sep 21 16:25:24 2012
New Revision: 1388564
URL: http://svn.apache.org/viewvc?rev=1388564&view=rev
Log:
applying AIRAVATA-581.2.patch for derby support
Modified:
airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
airavata/trunk/modules/distribution/src/main/resources/bin/airavata-server.sh
airavata/trunk/modules/distribution/src/main/resources/bin/derby.sh
airavata/trunk/modules/distribution/src/main/resources/bin/startNetworkServer
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
Modified: airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
(original)
+++ airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml Fri
Sep 21 16:25:24 2012
@@ -142,6 +142,7 @@
<fileSet>
<directory>src/main/resources/bin</directory>
<outputDirectory>bin</outputDirectory>
+ <fileMode>777</fileMode>
<includes>
<include>*.sh</include>
<include>*.bat</include>
@@ -231,11 +232,21 @@
<dependencySets>
<dependencySet>
<outputDirectory>standalone-server/lib</outputDirectory>
+
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.apache.derby:derby:jar</include>
<include>org.apache.derby:derbytools:jar</include>
- <include>org.apache.derby:derbyclient:jar</include>
<include>org.apache.derby:derbynet:jar</include>
+ <include>org.apache.derby:derbyclient:jar</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>standalone-server/lib</outputDirectory>
+ <includes>
+ <!--<include>org.apache.derby:derby:jar</include>-->
+ <!--<include>org.apache.derby:derbytools:jar</include>-->
+ <!--<include>org.apache.derby:derbyclient:jar</include>-->
+ <!--<include>org.apache.derby:derbynet:jar</include>-->
<include>org.apache.jackrabbit:jackrabbit-core:jar</include>
<include>org.apache.jackrabbit:jackrabbit-jcr-rmi:jar</include>
<include>org.slf4j:log4j-over-slf4j:jar</include>
Modified:
airavata/trunk/modules/distribution/src/main/resources/bin/airavata-server.sh
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/src/main/resources/bin/airavata-server.sh?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/distribution/src/main/resources/bin/airavata-server.sh
(original)
+++
airavata/trunk/modules/distribution/src/main/resources/bin/airavata-server.sh
Fri Sep 21 16:25:24 2012
@@ -18,9 +18,5 @@
# under the License.
. `dirname $0`/setenv.sh
-#cd $AIRAVATA_HOME/bin
-#chmod 777 derby.sh
-#chmod 777 startNetworkServer
-#./derby.sh &
cd $AIRAVATA_HOME/standalone-server/bin
./axis2server.sh $*
Modified: airavata/trunk/modules/distribution/src/main/resources/bin/derby.sh
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/src/main/resources/bin/derby.sh?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/src/main/resources/bin/derby.sh
(original)
+++ airavata/trunk/modules/distribution/src/main/resources/bin/derby.sh Fri Sep
21 16:25:24 2012
@@ -1,4 +1,23 @@
+#!/bin/sh
+
+# 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.
+
. `dirname $0`/setenv.sh
export DERBY_HOME=$AIRAVATA_HOME/standalone-server
cd $AIRAVATA_HOME/bin
-./startNetworkServer $*
+./startNetworkServer $*
\ No newline at end of file
Modified:
airavata/trunk/modules/distribution/src/main/resources/bin/startNetworkServer
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/src/main/resources/bin/startNetworkServer?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/distribution/src/main/resources/bin/startNetworkServer
(original)
+++
airavata/trunk/modules/distribution/src/main/resources/bin/startNetworkServer
Fri Sep 21 16:25:24 2012
@@ -90,8 +90,6 @@ fi
# set local classpath, don't overwrite the user's
LOCALCLASSPATH=$DERBY_LIB/derby.jar:$DERBY_LIB/derbynet.jar:$DERBY_LIB/derbytools.jar:$DERBY_LIB/derbyclient.jar
-#LOCALCLASSPATH=$DERBY_LIB/derby-10.9.1.0.jar:$DERBY_LIB/derbynet-10.9.1.0.jar:$DERBY_LIB/derbytools-10.9.1.0.jar:$DERBY_LIB/derbyclient-10.9.1.0.jar
-
# if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
# user CLASSPATH first and derby-found jars after.
Modified:
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
(original)
+++
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
Fri Sep 21 16:25:24 2012
@@ -103,6 +103,10 @@ public class NodeDataResource extends Ab
}
public void save() {
+ if(lastUpdateTime == null){
+ java.util.Date date= new java.util.Date();
+ lastUpdateTime = new Timestamp(date.getTime());
+ }
EntityManager em = ResourceUtils.getEntityManager();
Node_Data existingNodeData = em.find(Node_Data.class, new
Node_DataPK(workflowDataResource.getWorkflowInstanceID(), nodeID));
em.close();
Modified:
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
(original)
+++
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
Fri Sep 21 16:25:24 2012
@@ -32,6 +32,7 @@ import org.apache.airavata.persistance.r
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.sql.Date;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
@@ -132,6 +133,10 @@ public class UserWorkflowResource extend
em.getTransaction().begin();
User_Workflow userWorkflow = new User_Workflow();
userWorkflow.setTemplate_name(name);
+ if(lastUpdateDate == null){
+ java.util.Date date= new java.util.Date();
+ lastUpdateDate = new java.sql.Date(date.getTime());
+ }
userWorkflow.setLast_updated_date(lastUpdateDate);
byte[] bytes = content.getBytes();
userWorkflow.setWorkflow_graph(bytes);
@@ -147,7 +152,7 @@ public class UserWorkflowResource extend
existingWF.setWorkflow_graph(bytes);
userWorkflow = em.merge(existingWF);
} else {
- em.merge(userWorkflow);
+ em.persist(userWorkflow);
}
em.getTransaction().commit();
em.close();
Modified:
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
(original)
+++
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
Fri Sep 21 16:25:24 2012
@@ -73,7 +73,6 @@ public class WorkflowDataResource extend
this.lastUpdatedTime = lastUpdatedTime;
}
- @Override
public Resource create(ResourceType type) {
switch (type){
case NODE_DATA:
@@ -89,7 +88,6 @@ public class WorkflowDataResource extend
}
}
- @Override
public void remove(ResourceType type, Object name) {
EntityManager em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
@@ -117,7 +115,6 @@ public class WorkflowDataResource extend
em.close();
}
- @Override
public Resource get(ResourceType type, Object name) {
EntityManager em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
@@ -153,7 +150,6 @@ public class WorkflowDataResource extend
}
}
- @Override
public List<Resource> get(ResourceType type) {
List<Resource> resourceList = new ArrayList<Resource>();
EntityManager em = ResourceUtils.getEntityManager();
@@ -199,8 +195,11 @@ public class WorkflowDataResource extend
return resourceList;
}
- @Override
public void save() {
+ if(lastUpdatedTime == null){
+ java.util.Date date= new java.util.Date();
+ lastUpdatedTime = new Timestamp(date.getTime());
+ }
EntityManager em = ResourceUtils.getEntityManager();
Workflow_Data existingWFData = em.find(Workflow_Data.class,
workflowInstanceID);
em.close();
Modified:
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql?rev=1388564&r1=1388563&r2=1388564&view=diff
==============================================================================
---
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
(original)
+++
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
Fri Sep 21 16:25:24 2012
@@ -56,6 +56,7 @@ create table Project
gateway_name varchar(255),
user_name varchar(255),
project_name varchar(255),
+ PRIMARY KEY (project_name),
FOREIGN KEY (gateway_name) REFERENCES Gateway(gateway_name) ON DELETE
CASCADE,
FOREIGN KEY (user_name) REFERENCES Users(user_name) ON DELETE CASCADE
);
@@ -80,7 +81,7 @@ create table User_Workflow
gateway_name varchar(255),
owner varchar(255),
template_name varchar(255),
- last_updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
+ last_updated_date TIMESTAMP DEFAULT CURRENT TIMESTAMP,
path varchar (255),
workflow_graph BLOB,
PRIMARY KEY(gateway_name, owner, template_name),