From commits-return-18644-apmail-airavata-commits-archive=airavata.apache.org@airavata.apache.org Sun Dec 10 19:14:13 2017 Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5F89810AF3 for ; Sun, 10 Dec 2017 19:14:13 +0000 (UTC) Received: (qmail 7185 invoked by uid 500); 10 Dec 2017 19:14:13 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 7137 invoked by uid 500); 10 Dec 2017 19:14:13 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 7128 invoked by uid 99); 10 Dec 2017 19:14:13 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Dec 2017 19:14:13 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 25F6D81FB0; Sun, 10 Dec 2017 19:14:10 +0000 (UTC) Date: Sun, 10 Dec 2017 19:14:12 +0000 To: "commits@airavata.apache.org" Subject: [airavata-django-portal] 02/02: AIRAVATA-2598 Loading Application Interface for a given module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: machristie@apache.org In-Reply-To: <151293325051.20864.8798991026045655555@gitbox.apache.org> References: <151293325051.20864.8798991026045655555@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: airavata-django-portal X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 6f53fdd05d17decc426fb77691dcb2d8ebb6957d X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171210191411.25F6D81FB0@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git commit 6f53fdd05d17decc426fb77691dcb2d8ebb6957d Author: Marcus Christie AuthorDate: Thu Dec 7 14:05:56 2017 -0500 AIRAVATA-2598 Loading Application Interface for a given module --- django_airavata/apps/api/views.py | 21 +++++++++++++++++++++ .../js/views/CreateExperimentContainer.vue | 8 +++++++- .../js/views/ExperimentEditor.vue | 13 +++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py index c610ddc..e6f975e 100644 --- a/django_airavata/apps/api/views.py +++ b/django_airavata/apps/api/views.py @@ -238,6 +238,7 @@ class ExperimentList(APIView): class ApplicationModuleViewSet(APIBackedViewSet): serializer_class = serializers.ApplicationModuleSerializer + lookup_field = 'app_module_id' def get_list(self): return self.request.airavata_client.getAllAppModules(self.authz_token, self.gateway_id) @@ -254,6 +255,26 @@ class ApplicationModuleViewSet(APIBackedViewSet): app_module = serializer.save() self.request.airavata_client.updateApplicationModule(self.authz_token, app_module.appModuleId, app_module) + @detail_route() + def application_interface(self, request, app_module_id): + all_app_interfaces = request.airavata_client.getAllApplicationInterfaces(self.authz_token, self.gateway_id) + app_interfaces = [] + for app_interface in all_app_interfaces: + if not app_interface.applicationModules: + continue + if app_module_id in app_interface.applicationModules: + app_interfaces.append(app_interface) + if len(app_interfaces) == 1: + serializer = thrift_django_serializer.create_serializer( + ApplicationInterfaceDescription, instance=app_interfaces[0], context={'request': request}) + return Response(serializer.data) + elif len(app_interfaces) > 1: + return Response({'error': 'More than one application interface found for module id {}'.format(app_module_id)}, + status=status.HTTP_500_INTERNAL_SERVER_ERROR) + else: + return Response({'error': 'No application interface found for module id {}'.format(app_module_id)}, + status=status.HTTP_404_NOT_FOUND) + # TODO convert to APIBackedViewSet class RegisterApplicationModule(APIView): diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/CreateExperimentContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/CreateExperimentContainer.vue index 68a0828..e7d36fd 100644 --- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/CreateExperimentContainer.vue +++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/CreateExperimentContainer.vue @@ -1,5 +1,5 @@ @@ -20,6 +20,7 @@ export default { return { 'experiment': new models.Experiment(), 'appModule': null, + 'appInterface': null, } }, components: { @@ -36,6 +37,11 @@ export default { this.experiment.experimentName = appModule.appModuleName + ' on ' + moment().format('lll'); this.appModule = appModule; }); + services.ApplicationInterfaceService.getForAppModuleId(this.appModuleId) + .then(appInterface => { + this.appInterface = appInterface + console.log(JSON.stringify(appInterface)); + }); } } diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ExperimentEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ExperimentEditor.vue index aec3969..8caceaf 100644 --- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ExperimentEditor.vue +++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ExperimentEditor.vue @@ -20,12 +20,13 @@ - - + v-model="experiment.projectId" :options="projectOptions" required> + + +
App Interface name: {{ appInterface.applicationName }}
@@ -39,7 +40,7 @@ import {models, services} from 'django-airavata-api' export default { name: 'edit-experiment', - props: ['experiment', 'appModule'], + props: ['experiment', 'appModule', 'appInterface'], data () { return { 'projects': [], -- To stop receiving notification emails like this one, please contact "commits@airavata.apache.org" .