Return-Path: X-Original-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9322FD45F for ; Fri, 7 Sep 2012 15:42:22 +0000 (UTC) Received: (qmail 39358 invoked by uid 500); 7 Sep 2012 15:42:22 -0000 Delivered-To: apmail-incubator-airavata-commits-archive@incubator.apache.org Received: (qmail 39317 invoked by uid 500); 7 Sep 2012 15:42:22 -0000 Mailing-List: contact airavata-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: airavata-dev@incubator.apache.org Delivered-To: mailing list airavata-commits@incubator.apache.org Received: (qmail 39310 invoked by uid 99); 7 Sep 2012 15:42:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2012 15:42:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2012 15:42:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 52ABA2388900; Fri, 7 Sep 2012 15:41:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1382069 - in /incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main: java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java resources/data.sql Date: Fri, 07 Sep 2012 15:41:38 -0000 To: airavata-commits@incubator.apache.org From: lahiru@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120907154138.52ABA2388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lahiru Date: Fri Sep 7 15:41:37 2012 New Revision: 1382069 URL: http://svn.apache.org/viewvc?rev=1382069&view=rev Log: More implemetnation methods. Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data.sql Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1382069&r1=1382068&r2=1382069&view=diff ============================================================================== --- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original) +++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Fri Sep 7 15:41:37 2012 @@ -457,15 +457,23 @@ public class AiravataJPARegistry extends } public void addWorkflow(String workflowName, String workflowGraphXml) { - //To change body of implemented methods use File | Settings | File Templates. + ProjectResource projectResource = new ProjectResource(); + UserWorkflowResource resource = (UserWorkflowResource)projectResource.create(ResourceType.USER_WORKFLOW); + resource.setName(workflowName); + resource.setContent(workflowGraphXml); + resource.setLastUpdateDate(new java.sql.Date(Calendar.getInstance().getTime().getTime())); + resource.save(); } public void updateWorkflow(String workflowName, String workflowGraphXml) { - //To change body of implemented methods use File | Settings | File Templates. + addWorkflow(workflowName,workflowGraphXml); } public String getWorkflowGraphXML(String workflowName) { - return null; //To change body of implemented methods use File | Settings | File Templates. + GatewayResource gatewayResource = new GatewayResource(); + UserResource resource = (UserResource)gatewayResource.get(ResourceType.USER_WORKFLOW, getUser().getUserName()); + UserWorkflowResource resource1 = (UserWorkflowResource) resource.get(ResourceType.USER_WORKFLOW, workflowName); + return resource1.getContent(); } public ResourceMetadata getWorkflowMetadata(String workflowName) { @@ -473,7 +481,9 @@ public class AiravataJPARegistry extends } public void removeWorkflow(String workflowName) { - //To change body of implemented methods use File | Settings | File Templates. + GatewayResource gatewayResource = new GatewayResource(); + UserResource resource = (UserResource)gatewayResource.get(ResourceType.USER_WORKFLOW, getUser().getUserName()); + resource.remove(ResourceType.USER_WORKFLOW, workflowName); } public void setAiravataRegistry(AiravataRegistry2 registry) { Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data.sql URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data.sql?rev=1382069&r1=1382068&r2=1382069&view=diff ============================================================================== --- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data.sql (original) +++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data.sql Fri Sep 7 15:41:37 2012 @@ -54,7 +54,7 @@ create table Published_Workflow create table User_Workflow ( - project_ID int(11), + gateway_name varchar(255), user_name varchar(255), user_workflow_name varchar(255), last_update_date DATE,