You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/03/08 07:33:02 UTC

[01/15] stratos git commit: fix Removing Autoscaling policies gives an error in the UI

Repository: stratos
Updated Branches:
  refs/heads/master 7c7510c6d -> e6d98dea5


fix Removing Autoscaling policies gives an error in the UI


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f9fd3711
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f9fd3711
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f9fd3711

Branch: refs/heads/master
Commit: f9fd3711d367094d37ac9d1231e5719cd9ad8113
Parents: 16b798a
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 19:14:41 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:54 2015 +0530

----------------------------------------------------------------------
 .../console/controllers/rest/rest_calls.jag                  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f9fd3711/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index 93fbfa9..7f2f08d 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -72,11 +72,11 @@ RESTCalls = new function(){
         return this.send("POST","/autoscalingPolicies",policyDefinition);
     };
 
-    this.deleteAutoscalePolicyDefinition = function(deploymentPolicyId){
+    this.deleteDeploymentPolicyDefinition = function(deploymentPolicyId){
         return this.send("DELETE","/deploymentPolicies/" + deploymentPolicyId,{});
     };
 
-    this.deleteDeploymentPolicyDefinition = function(autoscalePolicyId){
+    this.deleteAutoscalePolicyDefinition = function(autoscalePolicyId){
         return this.send("DELETE","/autoscalingPolicies/" + autoscalePolicyId,{});
     };
 
@@ -202,6 +202,10 @@ RESTCalls = new function(){
         return this.sendReceive("GET","/applications/"+appId ,{});
     };
 
+    this.getApplicationPartitions = function(appId){
+        return this.sendReceive("GET","/applications/"+appId + "/networkPartitions" ,{});
+    };
+
     this.getClusterInfo = function(clusterId){
         return this.sendReceive("GET","/cluster/clusterId/" + clusterId,{});
     };


[11/15] stratos git commit: refactor application detail retrive logic

Posted by im...@apache.org.
refactor application detail retrive logic


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/bcc4b2d7
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/bcc4b2d7
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/bcc4b2d7

Branch: refs/heads/master
Commit: bcc4b2d7dea8a904b607819bc003c588377ca080
Parents: f5e92d1
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 09:39:36 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag               | 65 +++++++++-----------
 .../console/controllers/rest/rest_calls.jag     |  4 ++
 2 files changed, 32 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/bcc4b2d7/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index 0dbaecb..d56742e 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -43,35 +43,6 @@ var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
 
 if (!elements) {
     elements = uriMatcher.match('/{context}/applications/{formtype}/{action}/');
-    isForm = true;
-
-    if (elements.action != 'new') {
-        isEdit = true;
-    }
-
-    try {
-        var formData = require('controllers/forms/schema/applications/' + elements.formtype + '.json'),
-                formDataRaw = require('controllers/forms/default/applications/' + elements.formtype + '.json'),
-                formTitle = formData.title,
-                buttonText = formData.name;
-    } catch (e) {
-        log.error(e.message);
-        error.push({"errorMessage": e.message});
-    }
-
-    //get the detail view for each listing
-    if (elements.action != 'new' && isEdit) {
-        formTitle = formData.title + ' Details - ' + elements.action;
-
-        var formtype = elements.formtype,
-                id = escape(elements.action);
-
-        switch (formtype) {
-            case "applicationpolicies":
-                formDataEdit = util.RESTCalls.getPolicyApplication(id);
-                break;
-        }
-    }
 
     if(!elements){
         elements = uriMatcher.match('/{context}/applications/{formtype}/{applicationId}/{action}');
@@ -88,6 +59,17 @@ if (!elements) {
         }
 
     }else{
+
+        try {
+            var formData = require('controllers/forms/schema/applications/' + elements.formtype + '.json'),
+                    formDataRaw = require('controllers/forms/default/applications/' + elements.formtype + '.json'),
+                    formTitle = formData.title,
+                    buttonText = formData.name;
+        } catch (e) {
+            log.error(e.message);
+            error.push({"errorMessage": e.message});
+        }
+
         isForm = true;
         if (elements.formtype == 'applications' && elements.action != 'new') {
 
@@ -102,9 +84,25 @@ if (!elements) {
         }else  if(elements.formtype == 'groups' && elements.action == 'new'){
             applicationHbs = 'applicationsGroupEditor';
             editorCartridges = util.RESTCalls.getCartridges();
-        }else  if(elements.formtype == 'groups' && elements.action != 'new'){
+        }else  if( (elements.formtype == 'groups' || elements.formtype == 'applicationpolicies') && elements.action != 'new'){
             isEdit = true;
 
+            //get the detail view for each listing
+            if (elements.action != 'new' && isEdit) {
+                formTitle = formData.title + ' Details - ' + elements.action;
+
+                var formtype = elements.formtype,
+                        id = escape(elements.action);
+
+                switch (formtype) {
+                    case "applicationpolicies":
+                        formDataEdit = util.RESTCalls.getPolicyApplication(id);
+                        break;
+                    case "groups":
+                        formDataEdit = util.RESTCalls.getPolicyCartridgeGroup(id);
+                        break;
+                }
+            }
         }
 
     }
@@ -121,13 +119,6 @@ switch (formtype) {
         list_data = util.RESTCalls.getGroups();
         if (list_data && list_data.length === 0) {
             list_data = null;
-        }else{
-            formDataEdit = list_data;
-            for (specNumber in list_data) {
-                if (list_data[specNumber].name == elements.action) {
-                    formDataEdit = list_data[specNumber];
-                }
-            }
         }
         break;
     case "applications":

http://git-wip-us.apache.org/repos/asf/stratos/blob/bcc4b2d7/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index fe05283..f14e49e 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -173,6 +173,10 @@ RESTCalls = new function(){
         return this.sendReceive("GET","/applicationPolicies/"+applicationPolicyId,{});
     };
 
+    this.getPolicyCartridgeGroup = function(cartridgeGroupId){
+        return this.sendReceive("GET","/cartridgeGroups/"+cartridgeGroupId,{});
+    };
+
     this.getPolicyAutoScale = function(autoscalePolicyId){
         return this.sendReceive("GET","/autoscalingPolicies/"+autoscalePolicyId,{});
     };


[14/15] stratos git commit: This closes #262 on GitHub

Posted by im...@apache.org.
This closes #262 on GitHub


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e6d98dea
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e6d98dea
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e6d98dea

Branch: refs/heads/master
Commit: e6d98dea5a98517cc026db6b004291c4735d8fbd
Parents: 044da42
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Mar 8 12:02:56 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:56 2015 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[07/15] stratos git commit: add application policy schema and defaults

Posted by im...@apache.org.
add application policy schema and defaults


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/69adfb2d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/69adfb2d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/69adfb2d

Branch: refs/heads/master
Commit: 69adfb2d66bfc50b70a9f59f89aae520cef3aac0
Parents: e8aa78f
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 09:18:33 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../applications/applicationpolicies.json       | 17 +++++
 .../applications/applicationpolicies.json       | 69 ++++++++++++++++++++
 2 files changed, 86 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/69adfb2d/components/org.apache.stratos.manager.console/console/controllers/forms/default/applications/applicationpolicies.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/applications/applicationpolicies.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/applications/applicationpolicies.json
new file mode 100644
index 0000000..a0c18ee
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/default/applications/applicationpolicies.json
@@ -0,0 +1,17 @@
+{
+    "id": "application-policy-1",
+    "algorithm":"one-after-another",
+    "networkPartitions":[
+        "network-partition-1"
+    ],
+    "properties":[
+        {
+            "name": "key-1",
+            "value": "value-1"
+        },
+        {
+            "name": "key-2",
+            "value": "value-2"
+        }
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/69adfb2d/components/org.apache.stratos.manager.console/console/controllers/forms/schema/applications/applicationpolicies.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/applications/applicationpolicies.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/applications/applicationpolicies.json
new file mode 100644
index 0000000..051adab
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/applications/applicationpolicies.json
@@ -0,0 +1,69 @@
+{
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "id": "root",
+    "type": "object",
+    "title": "Application Policy Definition",
+    "name": "Application Policy",
+    "options": {
+        "disable_properties": true,
+        "disable_collapse": true
+    },
+    "properties": {
+        "id": {
+            "id": "root/id",
+            "type": "string"
+        },
+        "algorithm": {
+            "id": "root/algorithm",
+            "type": "string"
+        },
+        "networkPartitions": {
+            "id": "root/networkPartitions",
+            "type": "array",
+            "items": {
+                "id": "root/networkPartitions/0",
+                "type": "string"
+            }
+        },
+        "properties": {
+            "id": "root/properties",
+            "type": "array",
+            "items": [
+                {
+                    "id": "root/properties/0",
+                    "type": "object",
+                    "properties": {
+                        "name": {
+                            "id": "root/properties/0/name",
+                            "type": "string"
+                        },
+                        "value": {
+                            "id": "root/properties/0/value",
+                            "type": "string"
+                        }
+                    }
+                },
+                {
+                    "id": "root/properties/1",
+                    "type": "object",
+                    "properties": {
+                        "name": {
+                            "id": "root/properties/1/name",
+                            "type": "string"
+                        },
+                        "value": {
+                            "id": "root/properties/1/value",
+                            "type": "string"
+                        }
+                    }
+                }
+            ]
+        }
+    },
+    "required": [
+        "id",
+        "algorithm",
+        "networkPartitions",
+        "properties"
+    ]
+}
\ No newline at end of file


[10/15] stratos git commit: remove child section from deploy view

Posted by im...@apache.org.
remove child section from deploy view


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1ee2f9f5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1ee2f9f5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1ee2f9f5

Branch: refs/heads/master
Commit: 1ee2f9f5d84751e66e91f3d3c0b2dc2406320254
Parents: 9e66e6e
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 20:45:44 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../themes/theme0/partials/applications_deploy.hbs        | 10 ----------
 1 file changed, 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1ee2f9f5/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
index 4543c25..c07cd6f 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
@@ -33,8 +33,6 @@
                     <ul class="nav nav-tabs" role="tablist">
                         <li role="presentation" class="active"><a href="#general" aria-controls="general" role="tab"
                                                                   data-toggle="tab">Application Policy</a></li>
-                        <li role="presentation"><a href="#components" aria-controls="components"
-                                                   role="tab" data-toggle="tab">Child Policies</a></li>
 
                     </ul>
 
@@ -46,14 +44,6 @@
                                       autocomplete="off" style="height: 576px;"></textarea>
 
                         </div>
-                        <div role="tabpanel" class="tab-pane components" id="components">
-                            <button type="button" class="btn btn-primary" id="component-info-update" disabled="disabled">Update</button>
-                            <br/>
-                            <div id="component-data">
-                                <h4>Click on each node to get group or cartridge related information. Once you
-                                    fill all required fileds click on "Update" button.</h4>
-                            </div>
-                        </div>
                     </div>
 
                 </div>


[09/15] stratos git commit: fix css issue on group editor

Posted by im...@apache.org.
fix css issue on group editor


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9e66e6e3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9e66e6e3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9e66e6e3

Branch: refs/heads/master
Commit: 9e66e6e3ab82c16455a0c96e5565c9c48547c224
Parents: 0fd4465
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 19:50:05 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/css/custom/application_group_editor.css | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9e66e6e3/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/application_group_editor.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/application_group_editor.css b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/application_group_editor.css
index 3dd7528..a8f0fba 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/application_group_editor.css
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/application_group_editor.css
@@ -124,8 +124,9 @@
 }
 
 .stepnode i {
-    margin-top: 2px;
+    margin-top: 0px;
     color: #e67e22;
+    margin-left: -7px;
 }
 
 .notification {


[04/15] stratos git commit: update menu url for application policies

Posted by im...@apache.org.
update menu url for application policies


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e8aa78f3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e8aa78f3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e8aa78f3

Branch: refs/heads/master
Commit: e8aa78f3c09efd96a25c79d34c9abddc9f7f432c
Parents: 475ac04
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 09:17:50 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/controllers/menu/menu.json                             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e8aa78f3/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json b/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
index 87bc50b..2de4645 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
@@ -104,7 +104,7 @@
                     "description": "Manage cartridge groups"
                 },
                 {
-                    "link": "applications/applicationpolicy/",
+                    "link": "applications/applicationpolicies/",
                     "linkexternal": false,
                     "context": "/applications",
                     "title": "Application Policies",


[08/15] stratos git commit: improve deployment policy section

Posted by im...@apache.org.
improve deployment policy section


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0fd44654
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0fd44654
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0fd44654

Branch: refs/heads/master
Commit: 0fd44654e15ec9fab851f0095ab0bfd648f50887
Parents: 8185cce
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 19:34:15 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../controllers/forms/schema/configure/deploymentpolicies.json    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0fd44654/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/deploymentpolicies.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/deploymentpolicies.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/deploymentpolicies.json
index 7155d1f..8aad3c0 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/deploymentpolicies.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/deploymentpolicies.json
@@ -21,6 +21,7 @@
             "items": {
                 "id": "root/networkPartition/0",
                 "type": "object",
+                "title":"Network Partition",
                 "properties": {
                     "id": {
                         "id": "root/networkPartition/0/id",
@@ -37,9 +38,11 @@
                     "partitions": {
                         "id": "root/networkPartition/0/partitions",
                         "type": "array",
+                        "title":"Partitions",
                         "items": {
                             "id": "root/networkPartition/0/partitions/0",
                             "type": "object",
+                            "title":"Partition",
                             "properties": {
                                 "id": {
                                     "id": "root/networkPartition/0/partitions/0/id",


[06/15] stratos git commit: improve network partion section

Posted by im...@apache.org.
improve network partion section


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/8185cce8
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/8185cce8
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/8185cce8

Branch: refs/heads/master
Commit: 8185cce848f74d7ca5a3fc48d4de9c8a84c5377e
Parents: f9fd371
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 19:21:23 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/configure_form.jag                          |  4 ++--
 .../controllers/forms/schema/configure/partitions.json  | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/8185cce8/components/org.apache.stratos.manager.console/console/configure_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/configure_form.jag b/components/org.apache.stratos.manager.console/console/configure_form.jag
index 9ed9882..8397881 100644
--- a/components/org.apache.stratos.manager.console/console/configure_form.jag
+++ b/components/org.apache.stratos.manager.console/console/configure_form.jag
@@ -69,8 +69,8 @@ if(isEdit == false && elements.action != 'new') {
     switch (formtype) {
 
         case "partitions":
-            formTitle = "Partition Definition",
-                    buttonText = "Partition Definition";
+            formTitle = "Network Partition Definition",
+                    buttonText = "Network Partition Definition";
             list_data = util.RESTCalls.getPartitions();
             if (list_data && list_data.length === 0) {
                 list_data = null;

http://git-wip-us.apache.org/repos/asf/stratos/blob/8185cce8/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
index c3e7eb0..88f11a0 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
@@ -2,8 +2,8 @@
     "$schema": "http://json-schema.org/draft-04/schema#",
     "id": "root",
     "type": "object",
-    "title":"Partition Definition",
-    "name": "Partition Policy",
+    "title":"Network Partition Definition",
+    "name": "Network Partition Policy",
     "options": {
         "disable_properties": true,
         "disable_collapse": true
@@ -11,18 +11,22 @@
     "properties": {
         "id": {
             "id": "root/id",
-            "type": "string"
+            "type": "string",
+            "title":"Network Partition Id"
         },
         "activeByDefault": {
             "id": "root/activeByDefault",
-            "type": "boolean"
+            "type": "boolean",
+            "title":"Active By Default"
         },
         "partitions": {
             "id": "root/partitions",
             "type": "array",
+            "title":"Partitions",
             "items": {
                 "id": "root/partitions/0",
                 "type": "object",
+                "title":"Partition",
                 "properties": {
                     "id": {
                         "id": "root/partitions/0/id",


[13/15] stratos git commit: added application policies to menu

Posted by im...@apache.org.
added application policies to menu


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/475ac04f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/475ac04f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/475ac04f

Branch: refs/heads/master
Commit: 475ac04fda719da7fe1e22c073e4859b7db178bb
Parents: 1ee2f9f
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 08:15:42 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/controllers/menu/menu.json                      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/475ac04f/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json b/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
index 1bfda32..87bc50b 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/menu/menu.json
@@ -104,6 +104,15 @@
                     "description": "Manage cartridge groups"
                 },
                 {
+                    "link": "applications/applicationpolicy/",
+                    "linkexternal": false,
+                    "context": "/applications",
+                    "title": "Application Policies",
+                    "icon": "fa-road",
+                    "permissionPaths": ["/permission", "/permission/admin", "/permission/admin/manage/view/subscription"],
+                    "description": "Manage application policies"
+                },
+                {
                     "link": "applications/applications/",
                     "linkexternal": false,
                     "context": "/applications",


[12/15] stratos git commit: initial work for manage application policies

Posted by im...@apache.org.
initial work for manage application policies


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f5e92d1e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f5e92d1e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f5e92d1e

Branch: refs/heads/master
Commit: f5e92d1ed7b5c642f2bf0e682523cf2137bf1eec
Parents: 69adfb2
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 09:20:33 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag               | 53 ++++++++++++++++----
 .../applications/application_requests.jag       |  3 ++
 .../console/controllers/rest/rest_calls.jag     | 12 +++++
 .../theme0/partials/applications_form.hbs       | 28 +++++++++++
 .../theme0/renderers/applications_form.js       |  1 +
 5 files changed, 88 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e92d1e/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index d65d92d..0dbaecb 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -43,6 +43,35 @@ var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
 
 if (!elements) {
     elements = uriMatcher.match('/{context}/applications/{formtype}/{action}/');
+    isForm = true;
+
+    if (elements.action != 'new') {
+        isEdit = true;
+    }
+
+    try {
+        var formData = require('controllers/forms/schema/applications/' + elements.formtype + '.json'),
+                formDataRaw = require('controllers/forms/default/applications/' + elements.formtype + '.json'),
+                formTitle = formData.title,
+                buttonText = formData.name;
+    } catch (e) {
+        log.error(e.message);
+        error.push({"errorMessage": e.message});
+    }
+
+    //get the detail view for each listing
+    if (elements.action != 'new' && isEdit) {
+        formTitle = formData.title + ' Details - ' + elements.action;
+
+        var formtype = elements.formtype,
+                id = escape(elements.action);
+
+        switch (formtype) {
+            case "applicationpolicies":
+                formDataEdit = util.RESTCalls.getPolicyApplication(id);
+                break;
+        }
+    }
 
     if(!elements){
         elements = uriMatcher.match('/{context}/applications/{formtype}/{applicationId}/{action}');
@@ -82,20 +111,13 @@ if (!elements) {
 
 }
 
-try {
-    var formData = require('controllers/forms/schema/applications/' + elements.formtype + '.json'),
-            formDataRaw = require('controllers/forms/default/applications/' + elements.formtype + '.json'),
-            formTitle = formData.title,
-            buttonText = formData.name;
-} catch (e) {
-    log.error(e.message);
-    error.push({"errorMessage": e.message});
-}
 
 var formtype = elements.formtype;
 
 switch (formtype) {
     case "groups":
+        formTitle = "Cartridge Group Definition",
+                buttonText = "Cartridge Group Definition";
         list_data = util.RESTCalls.getGroups();
         if (list_data && list_data.length === 0) {
             list_data = null;
@@ -109,11 +131,23 @@ switch (formtype) {
         }
         break;
     case "applications":
+        formTitle = "Application Definition",
+                buttonText = "Application Definition";
         list_data = util.RESTCalls.getApplications();
         if (list_data && list_data.length === 0) {
             list_data = null;
         }
         break;
+
+    case "applicationpolicies":
+        formTitle = "Application Policy Definition",
+                buttonText = "Application Policy Definition";
+        list_data = util.RESTCalls.getApplicationPolicies();
+        if (list_data && list_data.length === 0) {
+            list_data = null;
+        }
+        break;
+
     default:
         error.push({"errorMessage":"Incorrect resource path found"});
 }
@@ -136,6 +170,7 @@ var caramelData = {
     formTitle: formTitle,
     formDataRaw: JSON.stringify(formDataRaw),
     formtype:elements.formtype,
+    buttonText: buttonText,
     //formDataRaw: JSON.stringify(partition_data.partition[0]),
     formDataEdit: JSON.stringify(formDataEdit),
     formData: JSON.stringify(formData),

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e92d1e/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
index 87ea0b0..b0aa166 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
@@ -37,6 +37,9 @@ try {
         case "deletegroups":
             formSubmit = util.RESTCalls.deleteGroup(formPayload);
             break;
+        case "applicationpolicies":
+            formSubmit = util.RESTCalls.deployApplicationPolicyDefinition(formPayload);
+            break;
         case "applications":
             formSubmit = util.RESTCalls.deployApplicationDefinition(formPayload);
             break;

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e92d1e/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index 7f2f08d..fe05283 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -96,6 +96,10 @@ RESTCalls = new function(){
         return this.send("POST","/applications", applicationDefinition);
     };
 
+    this.deployApplicationPolicyDefinition = function(applicationPolicyDefinition){
+        return this.send("POST","/applicationPolicies", applicationPolicyDefinition);
+    };
+
     this.deleteApplication = function(applicationId){
         return this.send("DELETE","/applications/" + applicationId,{});
     };
@@ -165,6 +169,10 @@ RESTCalls = new function(){
         return this.sendReceive("GET","/autoscalingPolicies",{});
     };
 
+    this.getPolicyApplication = function(applicationPolicyId){
+        return this.sendReceive("GET","/applicationPolicies/"+applicationPolicyId,{});
+    };
+
     this.getPolicyAutoScale = function(autoscalePolicyId){
         return this.sendReceive("GET","/autoscalingPolicies/"+autoscalePolicyId,{});
     };
@@ -194,6 +202,10 @@ RESTCalls = new function(){
         return this.sendReceive("GET","/applications",{});
     };
 
+    this.getApplicationPolicies = function(){
+        return this.sendReceive("GET","/applicationPolicies",{});
+    };
+
     this.getApplicationTopology = function(appId){
         return this.sendReceive("GET","/applications/" + appId + '/runtime',{});
     };

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e92d1e/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
index a9935af..dbe107f 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
@@ -174,6 +174,34 @@
                         </div>
                     {{/each}}
                 {{/ifCond}}
+                {{#ifCond formtype "==" "applicationpolicies"}}
+                    {{#each content_body.sections}}
+                        <div class="block col-md-4 grid-group-item border-right">
+                            <div class="toggle-menu-icon">
+                                <i class="fa fa-th-large"></i>
+                            </div>
+                            <h2 class="truncate">{{id}} </h2>
+
+                            <div class="toggle-menu-description">{{description}} </div>
+                            <div class="list-button" style="display: none;">
+                                <button class="btn btn-danger btn-lg hover-delete-group" type="button"
+                                        id="{{id}}"> Delete</button>
+                                <button class="btn btn-info btn-lg hover-details" type="button" id="details_list_{{id}}"
+                                        data-url="{{url ""}}/applications/applicationpolicies{{id}}/" > Details
+                                </button>
+                            </div>
+                            <div class="bottom-bar-wrapper">
+                                <div class="bottom-bar">
+                                    <button class="btn btn-danger btn-lg hover-delete-group" type="button"
+                                            id="{{id}}"> Delete</button>
+                                    <button class="btn btn-info btn-lg hover-details" type="button" id="details_{{id}}"
+                                            data-url="{{url ""}}/applications/applicationpolicies/{{id}}/" > Details
+                                    </button>
+                                </div>
+                            </div>
+                        </div>
+                    {{/each}}
+                {{/ifCond}}
             </div>
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e92d1e/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index de011b6..324e5c2 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -409,6 +409,7 @@ var render = function (theme, data, meta, require) {
                                 formDataRaw: data.formDataRaw,
                                 formDataEdit: data.formDataEdit,
                                 formtype:data.formtype,
+                                buttonText: data.buttonText,
                                 isForm: data.isForm,
                                 isEdit:data.isEdit,
                                 formTitle: data.formTitle,


[05/15] stratos git commit: fix flow issue for application deployment

Posted by im...@apache.org.
fix flow issue for application deployment


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b75179e5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b75179e5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b75179e5

Branch: refs/heads/master
Commit: b75179e50872388061a83f2fe473191403d514dc
Parents: bcc4b2d
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 10:32:07 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:55 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag                  |  5 +++--
 .../applications/application_requests.jag          |  2 +-
 .../console/controllers/rest/rest_calls.jag        |  4 ++--
 .../themes/theme0/js/custom/applications-deploy.js |  4 ++--
 .../themes/theme0/partials/applications_deploy.hbs | 17 ++++++++++++-----
 .../themes/theme0/renderers/applications_form.js   |  1 +
 6 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index d56742e..409ab8f 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -33,7 +33,7 @@ var log = new Log("apachestratos.applications_form"),
         elements = uriMatcher.match('/{context}/applications/{formtype}/'),
         breadcrumbPathLevelOne = 'applications',
         formDataEdit = topologyData = editorGroups = editorCartridges = editorAutoscalePolicies = applicationHbs ='',
-        editorDeploymentPolicies = '',
+        editorDeploymentPolicies = applicationPolicyData ='',
         isEdit  = isForm = false,
         userPermissions = session.get('PERMISSIONS');
 
@@ -56,6 +56,7 @@ if (!elements) {
             applicationHbs = 'applicationView';
         }else if(elements.action == 'deploy'){
             applicationHbs = 'applicationDeploy';
+            applicationPolicyData = util.RESTCalls.getApplicationPolicies();
         }
 
     }else{
@@ -72,7 +73,6 @@ if (!elements) {
 
         isForm = true;
         if (elements.formtype == 'applications' && elements.action != 'new') {
-
             applicationHbs = 'applicationTopology';
             topologyData = util.RESTCalls.getApplicationTopology(elements.action);
         }else if(elements.formtype == 'applications' && elements.action == 'new'){
@@ -155,6 +155,7 @@ var caramelData = {
     editorAutoscalePolicies: JSON.stringify(editorAutoscalePolicies),
     editorDeploymentPolicies:JSON.stringify(editorDeploymentPolicies),
     applicationHbs: applicationHbs,
+    applicationPolicyData:applicationPolicyData,
     applicationAlias:applicationAlias,
     applicationName:applicationName,
     applicationJSON:JSON.stringify(applicationJSON),

http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
index b0aa166..f26e214 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
@@ -44,7 +44,7 @@ try {
             formSubmit = util.RESTCalls.deployApplicationDefinition(formPayload);
             break;
         case "deployments":
-            formSubmit = util.RESTCalls.deployDeploymentPolicyDefinition(applicationId, formPayload);
+            formSubmit = util.RESTCalls.deployApplicationDeployment(applicationId, formPayload);
             break;
         case "deleteapplication":
             formSubmit = util.RESTCalls.deleteApplication(formPayload);

http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index f14e49e..84e96bc 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -60,8 +60,8 @@ RESTCalls = new function(){
         return this.send("POST","/tenant/availability/" + tenantDomain,{});
     };
 
-    this.deployApplicationDeployment = function(applicationID, policyDefinition){
-        return this.send("POST","/applications/"+applicationID+"/deploy",policyDefinition);
+    this.deployApplicationDeployment = function(applicationID, applicationPolicyId){
+        return this.send("POST","/applications/"+applicationID+"/deploy/"+applicationPolicyId,{});
     };
 
     this.deployDeploymentPolicyDefinition = function(policyDefinition){

http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
index 2cfc093..770baf8 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
@@ -380,12 +380,12 @@ $(document).ready(function(){
 
     //trigger deploy button
     $('#deploy').click(function(){
-        var deployjson = $('textarea#deployjsonedit').val();
+        var deployjson = $('#app-policy-id').val();
         var formtype = 'deployments';
         var applicationId = applicationJSON.applicationId;
         var btn = $(this);
         console.log('hit kme')
-        btn.html("<i class='fa fa-spinner fa-spin'></i> Adding "+formtype);
+        btn.html("<i class='fa fa-spinner fa-spin'></i> Adding Application Policy ");
         $.ajax({
             type: "POST",
             url: caramel.context + "/controllers/applications/application_requests.jag",

http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
index c07cd6f..4f6e45c 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
@@ -14,7 +14,7 @@
 
                 </div>
                 <div class='col-md-7'>
-                    <button class='btn btn-info btn-lg pull-right' type='button' id='deploy' data-form='{{formContext}}'> Deploy {{formTitle}}</button>
+                    <button class='btn btn-info btn-lg pull-right' type='button' id='deploy' data-form='{{formContext}}'> Deploy Application Policy</button>
                     <button class='btn btn-default btn-lg pull-right button-gap' type='button' onclick='window.location.replace("../")'> Cancel</button>
 
                 </div>
@@ -27,6 +27,7 @@
                 </div>
             </div>
             <div class="app-details">
+                <br/>
                 <div role="tabpanel app-details-tab" >
 
                     <!-- Nav tabs -->
@@ -39,10 +40,16 @@
                     <!-- Tab panes -->
                     <div class="tab-content app-details-tab-content">
                         <div role="tabpanel" class="tab-pane active" id="general">
-                            <div id='deploy-ui'></div>
-                            <textarea  id="deployjsonedit" class="form-control"
-                                      autocomplete="off" style="height: 576px;"></textarea>
-
+                            <div class="form-group">
+                                <label for="inputEmail3" class="col-sm-2 control-label">Select Policy: </label>
+                                <div class="col-sm-10">
+                                    <select class="form-control " id="app-policy-id">
+                                        {{#each applicationPolicyData}}
+                                            <option value="{{id}}">{{id}}</option>
+                                        {{/each}}
+                                    </select>
+                                </div>
+                            </div>
                         </div>
                     </div>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/b75179e5/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index 324e5c2..4c8559c 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -205,6 +205,7 @@ var render = function (theme, data, meta, require) {
                                 editorCartridges: data.editorCartridges,
                                 editorGroups:data.editorGroups,
                                 form_action: data.form_action,
+                                applicationPolicyData:data.applicationPolicyData,
                                 formHtml: data.formHtml,
                                 formData: data.formData,
                                 formDataRaw: data.formDataRaw,


[15/15] stratos git commit: fix application policy delete feature

Posted by im...@apache.org.
fix application policy delete feature


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/044da421
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/044da421
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/044da421

Branch: refs/heads/master
Commit: 044da42104dba1ae4ba4116186caeef621e8eaf7
Parents: b75179e
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Mar 8 10:43:04 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:56 2015 +0530

----------------------------------------------------------------------
 .../applications/application_requests.jag       |  3 ++
 .../console/controllers/rest/rest_calls.jag     |  4 ++
 .../console/themes/theme0/css/custom/style.css  |  4 ++
 .../theme0/partials/applications_form.hbs       | 47 +++++++++++++++++++-
 4 files changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/044da421/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
index f26e214..516ba3e 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
@@ -40,6 +40,9 @@ try {
         case "applicationpolicies":
             formSubmit = util.RESTCalls.deployApplicationPolicyDefinition(formPayload);
             break;
+        case "deleteapppolicy":
+            formSubmit = util.RESTCalls.deleteApplicationPolicyDefinition(formPayload);
+            break;
         case "applications":
             formSubmit = util.RESTCalls.deployApplicationDefinition(formPayload);
             break;

http://git-wip-us.apache.org/repos/asf/stratos/blob/044da421/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index 84e96bc..d062389 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -104,6 +104,10 @@ RESTCalls = new function(){
         return this.send("DELETE","/applications/" + applicationId,{});
     };
 
+    this.deleteApplicationPolicyDefinition = function(applicationPolicyId){
+        return this.send("DELETE","/applicationPolicies/" + applicationPolicyId,{});
+    };
+
     this.undeployApplication = function(applicationId){
         return this.send("POST","/applications/"+applicationId+"/undeploy",{});
     };

http://git-wip-us.apache.org/repos/asf/stratos/blob/044da421/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/style.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/style.css b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/style.css
index ee66998..78fb4b2 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/style.css
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/style.css
@@ -252,4 +252,8 @@ button.hover-delete-autoscale{
     background-color: rgb(255, 252, 196);
     padding: 2px 10px;
     border-radius: 4px;
+}
+
+button.hover-delete-app-policy{
+    margin-top: .7em;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/044da421/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
index dbe107f..14ec016 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
@@ -184,7 +184,7 @@
 
                             <div class="toggle-menu-description">{{description}} </div>
                             <div class="list-button" style="display: none;">
-                                <button class="btn btn-danger btn-lg hover-delete-group" type="button"
+                                <button class="btn btn-danger btn-lg hover-delete-app-policy" type="button"
                                         id="{{id}}"> Delete</button>
                                 <button class="btn btn-info btn-lg hover-details" type="button" id="details_list_{{id}}"
                                         data-url="{{url ""}}/applications/applicationpolicies{{id}}/" > Details
@@ -192,7 +192,7 @@
                             </div>
                             <div class="bottom-bar-wrapper">
                                 <div class="bottom-bar">
-                                    <button class="btn btn-danger btn-lg hover-delete-group" type="button"
+                                    <button class="btn btn-danger btn-lg hover-delete-app-policy" type="button"
                                             id="{{id}}"> Delete</button>
                                     <button class="btn btn-info btn-lg hover-details" type="button" id="details_{{id}}"
                                             data-url="{{url ""}}/applications/applicationpolicies/{{id}}/" > Details
@@ -466,6 +466,49 @@
         });
     });
 
+    $('.general-table').on('click', '.hover-delete-app-policy', function (event) {
+
+        var payload =$(this).attr("id");
+        noty({
+            layout: 'bottomRight',
+            type: 'warning',
+            text: 'Are you sure you want to delete Application Policy: <strong>'+$(this).attr("id") + "</strong> ?",
+            buttons: [
+                {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
+                    var formtype = 'deleteapppolicy';
+                    $noty.close();
+
+                    $.ajax({
+                        type: "POST",
+                        url: caramel.context + "/controllers/applications/application_requests.jag",
+                        dataType: 'json',
+                        data: { "formPayload": payload, "formtype": formtype },
+                        success: function (data) {
+                            if (data.status == 'error') {
+                                var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
+                            } else if (data.status == 'warning') {
+                                var n = noty({text: data.message, layout: 'bottomRight', type: 'warning'});
+                            } else {
+                                var n = noty({text: data.message, layout: 'bottomRight', type: 'success'});
+                            }
+                            window.setTimeout(function(){
+                                location.reload();
+                            }, 1000);
+                        }
+                    }).always(function () {
+
+                    });
+
+                }
+                },
+                {addClass: 'btn btn-danger', text: 'No', onClick: function($noty) {
+                    $noty.close();
+                }
+                }
+            ]
+        });
+    });
+
     $('.general-table').on('click', '.hover-undeploy', function (event) {
 
         var payload =$(this).attr("id");


[02/15] stratos git commit: fix jira [STRATOS-1233]

Posted by im...@apache.org.
fix jira [STRATOS-1233]


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/16b798a9
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/16b798a9
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/16b798a9

Branch: refs/heads/master
Commit: 16b798a9ccf9e4b191db8ef7f609904c12ad2545
Parents: 54f736d
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Mar 7 19:09:47 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:54 2015 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/js/custom/applications_group_editor.js   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/16b798a9/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
index d071f17..f30d7b0 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
@@ -315,7 +315,7 @@ var groupBlockTemplate = {
                 "terminationBehaviour": {
                     "id": "root/dependencies/terminationBehaviour",
                     "type": "string",
-                    "title": "Termination Behaviour: ",
+                    "title": "Termination Behavior: ",
                     "enum": ["terminate-none","terminate-dependents","terminate-all"]
                 },
                 "required": [


[03/15] stratos git commit: add deployment policy to application editor

Posted by im...@apache.org.
add deployment policy to application editor


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/54f736d5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/54f736d5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/54f736d5

Branch: refs/heads/master
Commit: 54f736d50406ea96ca12fa3c3b9cd0ff0a52cded
Parents: 7c7510c
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Feb 28 15:13:08 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:54 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag                |  3 +++
 .../theme0/js/custom/applications-editor.js      | 19 ++++++++++++++++++-
 .../theme0/partials/applications_editor.hbs      |  1 +
 .../themes/theme0/renderers/applications_form.js |  1 +
 4 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index 4273069..d65d92d 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -33,6 +33,7 @@ var log = new Log("apachestratos.applications_form"),
         elements = uriMatcher.match('/{context}/applications/{formtype}/'),
         breadcrumbPathLevelOne = 'applications',
         formDataEdit = topologyData = editorGroups = editorCartridges = editorAutoscalePolicies = applicationHbs ='',
+        editorDeploymentPolicies = '',
         isEdit  = isForm = false,
         userPermissions = session.get('PERMISSIONS');
 
@@ -68,6 +69,7 @@ if (!elements) {
             editorGroups =  util.RESTCalls.getGroups();
             editorCartridges = util.RESTCalls.getCartridges();
             editorAutoscalePolicies = util.RESTCalls.getPolicyAutoScales();
+            editorDeploymentPolicies = util.RESTCalls.getPolicyDeployments();
         }else  if(elements.formtype == 'groups' && elements.action == 'new'){
             applicationHbs = 'applicationsGroupEditor';
             editorCartridges = util.RESTCalls.getCartridges();
@@ -126,6 +128,7 @@ var caramelData = {
     editorGroups: JSON.stringify(editorGroups),
     editorCartridges: JSON.stringify(editorCartridges),
     editorAutoscalePolicies: JSON.stringify(editorAutoscalePolicies),
+    editorDeploymentPolicies:JSON.stringify(editorDeploymentPolicies),
     applicationHbs: applicationHbs,
     applicationAlias:applicationAlias,
     applicationName:applicationName,

http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
index 5d0a0a2..ab09072 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
@@ -497,6 +497,14 @@ var cartridgeBlockTemplate = {
                     "enum": [],
                     "required":false
                 },
+                "deploymentPolicy": {
+                    "type":"string",
+                        "id": "root/subscribableInfo/deploymentPolicy",
+                        "default": "deployment_policy_1",
+                        "title":"Deployment Policy: ",
+                        "enum": [],
+                        "required":false
+                },
                 "artifactRepository": {
                     "id": "root/subscribableInfo/artifactRepository",
                     "type": "object",
@@ -536,6 +544,7 @@ var cartridgeBlockDefault = {
     "subscribableInfo":{
         "alias":"alias2",
         "autoscalingPolicy":"",
+        "deploymentPolicy":"",
         "artifactRepository":{
             "privateRepo":"true",
             "repoUrl":"http://xxx:10080/git/default.git",
@@ -741,9 +750,17 @@ $(document).ready(function(){
             for(var i=0; i<policies.length; i++){
                 policiesEnum.push(policies[i].id);
             }
-
             cartridgeBlockTemplate['properties']['subscribableInfo']['properties']['autoscalingPolicy']['enum']
                 =policiesEnum;
+            //get list of deploymentpolicies
+            var dpolicies = editorDeploymentPolicies;
+            var dpoliciesEnum = [];
+            for(var i=0; i<dpolicies.length; i++){
+                dpoliciesEnum.push(dpolicies[i].id);
+            }
+            cartridgeBlockTemplate['properties']['subscribableInfo']['properties']['deploymentPolicy']['enum']
+                =dpoliciesEnum;
+
         }else{
             startval = groupBlockDefault;
             startval['name'] = ctype;

http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
index 771cb7d..7fbaca5 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
@@ -149,4 +149,5 @@
     var cartridgeList = {{{editorCartridges}}};
     var groupList = {{{editorGroups}}};
     var editorAutoscalePolicies = {{{editorAutoscalePolicies}}};
+    var editorDeploymentPolicies = {{{editorDeploymentPolicies}}};
 </script>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index 220ddc7..de011b6 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -272,6 +272,7 @@ var render = function (theme, data, meta, require) {
                                 editorCartridges: data.editorCartridges,
                                 editorGroups:data.editorGroups,
                                 editorAutoscalePolicies: data.editorAutoscalePolicies,
+                                editorDeploymentPolicies: data.editorDeploymentPolicies,
                                 form_action: data.form_action,
                                 formHtml: data.formHtml,
                                 formData: data.formData,