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 2014/12/18 13:13:33 UTC

[1/9] stratos git commit: application delete support added

Repository: stratos
Updated Branches:
  refs/heads/master 93243b8dd -> 1f7224f09


application delete support added


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

Branch: refs/heads/master
Commit: 228dd183dfe0fcd48ead75abf32cc900afa9002e
Parents: 93243b8
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 13:45:17 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:20 2014 +0530

----------------------------------------------------------------------
 .../applications/application_requests.jag       |  3 ++
 .../console/controllers/rest/rest_calls.jag     |  4 ++
 .../theme0/partials/applications_form.hbs       | 43 ++++++++++++++++++++
 3 files changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/228dd183/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 6d583b0..e85e34d 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
@@ -39,6 +39,9 @@ try {
         case "deployments":
             formSubmit = util.RESTCalls.deployDeploymentPolicyDefinition(formPayload);
             break;
+        case "deleteapplication":
+            formSubmit = util.RESTCalls.deleteApplication(formPayload);
+            break;
         default:
             session.put("deploy-status", { "message": "Sorry Endpoint Error", "status": "error" });
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/228dd183/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 09232fb..0e2a019 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
@@ -71,6 +71,10 @@ RESTCalls = new function(){
         return this.send("POST","/applications", applicationDefinition);
     };
 
+    this.deleteApplication = function(applicationId){
+        return this.send("DELETE","/applications/" + applicationId,{});
+    };
+
     this.subscribeToCartridge = function(cartridgeBeanInfo){
         return this.sendReceive("POST","/cartridge/subscribe", cartridgeBeanInfo);
     };

http://git-wip-us.apache.org/repos/asf/stratos/blob/228dd183/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 ac893e3..ad6e2a2 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
@@ -339,6 +339,7 @@
 
         });//end of deploy button trigger
 
+
         //  $('div[data-schemapath="root"]').find('h3 span').first().css({"display":"none"} );
 
         $.fn.bootstrapSwitch.defaults.onText = 'JSON';
@@ -347,4 +348,46 @@
 
     });
 
+    $('.general-table').on('click', '.hover-delete', function (event) {
+
+        var payload =$(this).attr("id");
+        noty({
+            layout: 'bottomRight',
+            type: 'warning',
+            text: 'Are you sure you want to delete application: '+$(this).attr("id"),
+            buttons: [
+                {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
+                    var formtype = 'deleteapplication';
+                    $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();
+                }
+                }
+            ]
+        });
+    });
 </script>


[3/9] stratos git commit: application deployment view hbs added

Posted by im...@apache.org.
application deployment view hbs added


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

Branch: refs/heads/master
Commit: 4d7bece2835e98a3320b7b85732740055de5201b
Parents: d902418
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:47:58 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_deploy.hbs     | 66 ++++++++++++++++++++
 1 file changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4d7bece2/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
new file mode 100644
index 0000000..183a841
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_deploy.hbs
@@ -0,0 +1,66 @@
+<div id="centered">
+    <div class="row title">
+        <div class="title-main text-center">
+            <h1>Create Deployment Policy for Application {{applicationName}}</h1>
+        </div>
+    </div>
+    <div class='container' id='content'>
+        <div class='row'>
+            <div class='container text-center form-toolbar'>
+                <div class='col-md-5'>
+                    <div class="editor-button">
+
+                    </div>
+
+                </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-default btn-lg pull-right button-gap' type='button' onclick='window.location.replace("../")'> Cancel</button>
+
+                </div>
+            </div>
+        </div>
+        <div class="right-side">
+            <div class="app-creator">
+                <div id="whiteboard">
+
+                </div>
+            </div>
+            <div class="app-details">
+                <div role="tabpanel app-details-tab" >
+
+                    <!-- Nav tabs -->
+                    <ul class="nav nav-tabs" role="tablist">
+                        <li role="presentation" class="active"><a href="#general" aria-controls="general" role="tab"
+                                                                  data-toggle="tab">General Details</a></li>
+                        <li role="presentation"><a href="#components" aria-controls="components"
+                                                   role="tab" data-toggle="tab">Child Policies</a></li>
+
+                    </ul>
+
+                    <!-- Tab panes -->
+                    <div class="tab-content app-details-tab-content">
+                        <div role="tabpanel" class="tab-pane active" id="general">
+                            <textarea  id="deployjsonedit" class="form-control"
+                                      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>
+            </div>
+        </div>
+    </div>
+
+</div>
+<script>
+    var applicationJSON = {{{applicationJSON}}};
+</script>
\ No newline at end of file


[8/9] stratos git commit: application editor zoom effect added for group preview

Posted by im...@apache.org.
application editor zoom effect added for group preview


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

Branch: refs/heads/master
Commit: 1f7224f09e38968f2a7fc0ebfbb362a8718eef67
Parents: ae4419d
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:54:14 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/js/custom/applications-editor.js    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1f7224f0/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 5581b58..33daac6 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
@@ -287,9 +287,16 @@ function generateGroupPreview(data) {
     var diagonal = d3.svg.diagonal()
         .projection(function(d) { return [d.x, d.y]; });
 
+    function redraw() {
+        svg.attr("transform",
+                "translate(" + d3.event.translate + ")"
+                + " scale(" + d3.event.scale + ")");
+    }
+
     var svg = d3.select(".description-section").append("svg")
         .attr("width", width)
         .attr("height", height)
+        .call(d3.behavior.zoom().on("zoom", redraw))
         .append("g")
         .attr("transform", "translate(" + -90+ "," + margin.top + ")");
 


[7/9] stratos git commit: application deployment view js added

Posted by im...@apache.org.
application deployment view js added


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

Branch: refs/heads/master
Commit: 5eae1409eb27f92e37e058137bad76ec32f0b42d
Parents: 2ad2952
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:48:41 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../theme0/js/custom/applications-deploy.js     | 236 +++++++++++++++++++
 1 file changed, 236 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5eae1409/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
new file mode 100644
index 0000000..d3c96e7
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
@@ -0,0 +1,236 @@
+// repaint
+function Repaint(){
+    $("#whiteboard").resize(function(){
+        jsPlumb.repaintEverything();
+    });
+}
+// drag
+function DragEl(el){
+    jsPlumb.draggable($(el) ,{
+        containment:"#whiteboard"
+    });
+}
+
+
+// JsPlumb Config
+var color = "gray",
+    exampleColor = "#00f",
+    arrowCommon = { foldback:0.7, fillStyle:color, width:14 };
+
+jsPlumb.importDefaults({
+    Connector : [ "Bezier", { curviness:63 } ],
+    /*Overlays: [
+     [ "Arrow", { location:0.7 }, arrowCommon ],
+     ]*/
+});
+
+
+var nodeDropOptions = {
+    activeClass:"dragActive"
+};
+
+var bottomConnectorOptions = {
+    endpoint:"Rectangle",
+    paintStyle:{ width:25, height:21, fillStyle:'#666' },
+    isSource:true,
+    connectorStyle : { strokeStyle:"#666" },
+    isTarget:false,
+    maxConnections:20
+};
+
+var endpointOptions = {
+    isTarget:true,
+    endpoint:"Dot",
+    paintStyle:{
+        fillStyle:"gray"
+    },
+    dropOptions: nodeDropOptions,
+    maxConnections:1
+};
+
+var groupOptions = {
+    isTarget:true,
+    endpoint:"Dot",
+    paintStyle:{
+        fillStyle:"gray"
+    },
+    dropOptions: nodeDropOptions,
+    maxConnections:1
+};
+
+var generatedCartridgeEndpointOptions = {
+    isTarget:false,
+    endpoint:"Dot",
+    paintStyle:{
+        fillStyle:"gray"
+    },
+    dropOptions: '',
+    maxConnections:1
+};
+
+var generatedGroupOptions = {
+    isTarget:false,
+    endpoint:"Dot",
+    paintStyle:{
+        fillStyle:"gray"
+    },
+    dropOptions: nodeDropOptions,
+    maxConnections:1
+};
+
+function dagrePosition(){
+    // construct dagre graph from JsPlumb graph
+    var g = new dagre.graphlib.Graph();
+    g.setGraph({ranksep:'80'});
+    g.setDefaultEdgeLabel(function() { return {}; });
+    var nodes = $(".stepnode");
+
+    for (var i = 0; i < nodes.length; i++) {
+        var n = nodes[i];
+        g.setNode(n.id, {width: 52, height: 52});
+    }
+    var edges = jsPlumb.getAllConnections();
+    for (var i = 0; i < edges.length; i++) {
+        var c = edges[i];
+        g.setEdge(c.source.id,c.target.id );
+    }
+    // calculate the layout (i.e. node positions)
+    dagre.layout(g);
+
+    // Applying the calculated layout
+    g.nodes().forEach(function(v) {
+        $("#" + v).css("left", g.node(v).x + "px");
+        $("#" + v).css("top", g.node(v).y + "px");
+    });
+    jsPlumb.repaintEverything();
+}
+//add group to editor
+var cartridgeCounter =0;
+//add group to editor
+function addJsplumbGroup(groupJSON, cartridgeCounter){
+
+    var divRoot = $('<div>').attr({'id':cartridgeCounter+'-'+groupJSON.alias,'data-type':'group','data-ctype':groupJSON.alias})
+        .text(groupJSON.alias)
+        .addClass('input-false')
+        .addClass('stepnode')
+        .appendTo('#whiteboard');
+    $(divRoot).append('<div class="notification"><i class="fa fa-exclamation-circle fa-2x"></i></div>');
+    jsPlumb.addEndpoint($(divRoot), {
+        anchor:"BottomCenter"
+    }, bottomConnectorOptions);
+
+    DragEl($(divRoot));
+    if(groupJSON['components']['cartridges']) {
+        genJsplumbCartridge(groupJSON['components']['cartridges'], divRoot, groupJSON.alias);
+    }
+    if(groupJSON['components']['groups']){
+        genJsplumbGroups(groupJSON['components']['groups'], divRoot, groupJSON.alias);
+    }
+
+    function genJsplumbCartridge(item, currentParent, parentName){
+        for (var prop in item) {
+            var id = item[prop].type;
+            var divCartridge = $('<div>').attr({'id':cartridgeCounter+'-'+parentName+'-'+item[prop].type} )
+                .text(item[prop].type)
+                .addClass('input-false')
+                .addClass('stepnode')
+                .appendTo('#whiteboard');
+            $(divCartridge).append('<div class="notification"><i class="fa fa-exclamation-circle fa-2x"></i></div>');
+            jsPlumb.addEndpoint($(divCartridge), {
+                anchor: "TopCenter"
+            }, generatedCartridgeEndpointOptions);
+
+            //add connection options
+            jsPlumb.connect({
+                source:$(currentParent),
+                target:$(divCartridge),
+                paintStyle:{strokeStyle:"blue", lineWidth:1 },
+                Connector : [ "Bezier", { curviness:63 } ],
+                anchors:["BottomCenter", "TopCenter"],
+                endpoint:"Dot"
+            });
+
+            DragEl($(divCartridge));
+        }
+    }
+
+    function genJsplumbGroups(item, currentParent, parentName) {
+        for (var prop in item) {
+            var divGroup = $('<div>').attr({'id':cartridgeCounter+'-'+parentName+'-'+item[prop]['name'],'data-type':'group','data-ctype':item[prop]['name'] })
+                .text(item[prop]['name'])
+                .addClass('stepnode')
+                .addClass('input-false')
+                .appendTo('#whiteboard');
+            $(divGroup).append('<div class="notification"><i class="fa fa-exclamation-circle fa-2x"></i></div>');
+            jsPlumb.addEndpoint($(divGroup), {
+                anchor:"BottomCenter"
+            }, bottomConnectorOptions);
+
+            jsPlumb.addEndpoint($(divGroup), {
+                anchor: "TopCenter"
+            }, generatedGroupOptions);
+
+            //add connection options
+            jsPlumb.connect({
+                source:$(currentParent),
+                target:$(divGroup),
+                paintStyle:{strokeStyle:"blue", lineWidth:1 },
+                Connector : [ "Bezier", { curviness:63 } ],
+                anchors:["BottomCenter", "TopCenter"],
+                endpoint:"Dot"
+            });
+
+            DragEl($(divGroup));
+
+            if(item[prop].hasOwnProperty('cartridges')) {
+                genJsplumbCartridge(item[prop].cartridges, divGroup, parentName+'-'+item[prop]['name'] );
+            }
+            if(item[prop].hasOwnProperty('groups')) {
+                genJsplumbGroups(item[prop].groups, divGroup, parentName+'-'+item[prop]['name'])
+            }
+        }
+    }
+
+
+
+}
+
+
+jsPlumb.bind("ready", function() {
+    addJsplumbGroup(applicationJSON, cartridgeCounter);
+    //reposition after group add
+    dagrePosition();
+});
+
+
+// Document ready events
+$(document).ready(function(){
+    //trigger deploy button
+    $('#deploy').click(function(){
+        var deployjson = $('textarea#deployjsonedit').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);
+        $.ajax({
+            type: "POST",
+            url: caramel.context + "/controllers/applications/application_requests.jag",
+            dataType: 'json',
+            data: { "formPayload": deployjson, "formtype": formtype, "appId":applicationId },
+            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'});
+                }
+            }
+        })
+            .always(function () {
+                btn.html('Add '+formtype);
+            });
+
+    });
+});
\ No newline at end of file


[6/9] stratos git commit: application topology zoom option added

Posted by im...@apache.org.
application topology zoom option added


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

Branch: refs/heads/master
Commit: d902418e6828eee4cf21dbf951421efd0229e9da
Parents: 228dd18
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 13:46:07 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_topology.hbs       | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d902418e/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
index 18aa9ce..463dd21 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
@@ -120,23 +120,29 @@ $(document).ready(function () {
 // ************** Generate the tree diagram	 *****************
     var margin = {top: 40, right: 120, bottom: 20, left: 120},
             width = 960 - margin.right - margin.left,
-            height = 500 - margin.top - margin.bottom;
+            height = 900 - margin.top - margin.bottom;
 
     var i = 0;
 
     var tree = d3.layout.tree()
-            .size([height, width]);
+            .separation(function(a, b) { return ((a.parent == root) && (b.parent == root)) ? 5 : 4; })
+            .size([height+100, width]);
 
     var diagonal = d3.svg.diagonal()
             .projection(function (d) {
                 return [d.x, d.y];
             });
+    function redraw() {
+        svg.attr("transform",
+                        "translate(" + d3.event.translate + ")"
+                        + " scale(" + d3.event.scale + ")");
+    }
 
     var svg = d3.select(".application-topology").append("svg")
             .attr("width", width + margin.right + margin.left)
             .attr("height", height + margin.top + margin.bottom)
-            .append("g")
-            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
+            .call(d3.behavior.zoom().on("zoom", redraw))
+            .append("g");
 
     var i = 0;
     duration = 750;
@@ -153,7 +159,7 @@ $(document).ready(function () {
 
         // Normalize for fixed-depth.
         nodes.forEach(function (d) {
-            d.y = d.depth * 80;
+            d.y = d.depth * 100;
         });
 
         // Declare the nodes…


[5/9] stratos git commit: application deployment view helper added

Posted by im...@apache.org.
application deployment view helper added


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

Branch: refs/heads/master
Commit: 2ad295298f1dae245ad2f11d2b27e4937d625204
Parents: 4d7bece
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:48:18 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/helpers/applications_deploy.js     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2ad29529/components/org.apache.stratos.manager.console/console/themes/theme0/helpers/applications_deploy.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/helpers/applications_deploy.js b/components/org.apache.stratos.manager.console/console/themes/theme0/helpers/applications_deploy.js
new file mode 100644
index 0000000..e6bdd7e
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/helpers/applications_deploy.js
@@ -0,0 +1,8 @@
+var resources = function (page, meta) {
+    return {
+        js: ['JSONEditor-0.7.12/jsoneditor-0.7.12.js','bootstrap-switch-3.0.2/bootstrap-switch.min.js', 'custom/script.js','custom/form.js',
+            'jquery.contextMenu/jquery.contextMenu.js', 'jquery.contextMenu/jquery.ui.position.js', 'jsplumb-1.7.2/dom.jsPlumb-1.7.2-min.js',
+            'dagre-v0.7.0/dagre.min.js', 'custom/applications-deploy.js'],
+        css: ['bootstrap-switch-3.0.2/bootstrap-switch.min.css', 'custom/style.css', 'custom/applications_deploy.css']
+    };
+};


[2/9] stratos git commit: application wrapper remove from topology view

Posted by im...@apache.org.
application wrapper remove from topology view


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

Branch: refs/heads/master
Commit: c381851a31ec67d84b47ff81d9d58cd6b7930f88
Parents: baa36a5
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:50:03 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/partials/applications_topology.hbs   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c381851a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
index 463dd21..e2a3bee 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
@@ -31,7 +31,7 @@ $(document).ready(function () {
         var rawout = [];
 
         var rootnode = {};
-        rootnode.name = data.applications.id;
+        rootnode.name = data.id;
         rootnode.parent = null;
         //create initial root node
         rawout.push(rootnode);
@@ -88,8 +88,8 @@ $(document).ready(function () {
             }
         }
 
-        secondorylevelclusters(data.applications.clusters, rawout, data.applications.id);
-        secondarylevelgroups(data.applications.groups, rawout, data.applications.id);
+        secondorylevelclusters(data.clusters, rawout, data.id);
+        secondarylevelgroups(data.groups, rawout, data.id);
         return rawout;
 
     }


[4/9] stratos git commit: application deployment view css added

Posted by im...@apache.org.
application deployment view css added


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

Branch: refs/heads/master
Commit: baa36a556ad503c7ead1ba93875f245426298596
Parents: 5eae140
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:49:03 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../theme0/css/custom/applications_deploy.css   | 51 ++++++++++++++++++++
 1 file changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/baa36a55/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/applications_deploy.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/applications_deploy.css b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/applications_deploy.css
new file mode 100644
index 0000000..38d9a09
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom/applications_deploy.css
@@ -0,0 +1,51 @@
+.right-side{
+    float: left;
+    width: 100%;
+    margin-top:20px;
+}
+
+.app-creator {
+    height: 600px;
+    background-color: rgb(244, 244, 244);
+    border: 1px solid #ddd;
+    border-radius: 4px;
+    margin-left: 10px;
+    position: relative;
+}
+
+#whiteboard{
+    width: 100%;
+    height: 585px;
+    position: absolute;
+    overflow: auto;
+}
+.stepnode {
+    border: 1px solid silver;
+    position: absolute !important;
+    width: 5em;
+    height: 5em;
+    padding: 0.5em;
+    z-index: 1;
+    border-radius: 0.5em;
+    box-shadow: 2px 2px 19px #aaa;
+    background: white;
+    word-wrap: break-word;
+    padding-top: 24px;
+    text-align: center;
+    cursor: pointer;
+}
+.stepnode i {
+    margin-top: 2px;
+    color: #e67e22;
+}
+
+.notification {
+    position: absolute;
+    background-color: #fff;
+    width: 30px;
+    height: 30px;
+    border-radius: 15px;
+    top: 52px;
+    left: 52px;
+}
+


[9/9] stratos git commit: application deployemnt initiated

Posted by im...@apache.org.
application deployemnt initiated


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

Branch: refs/heads/master
Commit: ae4419dc41dfaca06693c1e8ddc9d520bac29fa2
Parents: c381851
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Thu Dec 18 16:50:34 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Dec 18 17:43:21 2014 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag               | 40 ++++++++----
 .../applications/application_requests.jag       |  5 +-
 .../console/controllers/rest/rest_calls.jag     |  4 ++
 .../theme0/partials/applications_form.hbs       |  8 +--
 .../theme0/renderers/applications_form.js       | 67 ++++++++++++++++++++
 5 files changed, 107 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ae4419dc/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 e34cc2d..bdac23e 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,8 @@ var log = new Log("apachestratos.applications_form"),
         elements = uriMatcher.match('/{context}/applications/{formtype}/'),
         breadcrumbPathLevelOne = 'applications',
         formDataEdit = topology_data = editorGroups = editorCartridges = '',
-        isEdit = applicationView = applicationEditor= isForm = false,
+        isEdit = applicationView = applicationEditor = isForm = false,
+        applicationDeploy = false,
         userPermissions = session.get('PERMISSIONS');
 
 //create left menu
@@ -42,18 +43,32 @@ var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
 
 if (!elements) {
     elements = uriMatcher.match('/{context}/applications/{formtype}/{action}/');
-    isForm = true;
 
-    if (elements.formtype == 'applications' && elements.action != 'new') {
-        applicationView = true;
-        topology_data = util.RESTCalls.getApplicationTopology(elements.action);
-    }else if(elements.formtype == 'applications' && elements.action == 'new'){
-        applicationEditor = true;
-        editorGroups =  util.RESTCalls.getGroups();
-        editorCartridges = util.RESTCalls.getCartridges();
-    }else  if(elements.action != 'new'){
-        isEdit = true;
+    if(!elements){
+        elements = uriMatcher.match('/{context}/applications/{formtype}/{applicationId}/{action}');
+        if(elements.action == 'view'){
+
+        }else if(elements.action == 'deploy'){
+            var applicationName = elements.applicationId;
+            applicationDeploy = true;
+            //get application json
+            var applicationJSON = util.RESTCalls.getApplicationJSON(applicationName);
+        }
+
+    }else{
+        isForm = true;
+        if (elements.formtype == 'applications' && elements.action != 'new') {
+            applicationView = true;
+            topology_data = util.RESTCalls.getApplicationTopology(elements.action);
+        }else if(elements.formtype == 'applications' && elements.action == 'new'){
+            applicationEditor = true;
+            editorGroups =  util.RESTCalls.getGroups();
+            editorCartridges = util.RESTCalls.getCartridges();
+        }else  if(elements.action != 'new'){
+            isEdit = true;
+        }
     }
+
 }
 
 try {
@@ -118,6 +133,9 @@ var caramelData = {
     editorCartridges: JSON.stringify(editorCartridges),
     applicationView: applicationView,
     applicationEditor: applicationEditor,
+    applicationDeploy:applicationDeploy,
+    applicationName:applicationName,
+    applicationJSON:JSON.stringify(applicationJSON),
     formTitle: formTitle,
     formDataRaw: JSON.stringify(formDataRaw),
     formtype:elements.formtype,

http://git-wip-us.apache.org/repos/asf/stratos/blob/ae4419dc/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 e85e34d..0f555cd 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
@@ -23,8 +23,9 @@ var log = new Log("apachestratos.configure_request"),
         util = require('/controllers/rest/rest_calls.jag'),
         formPayload = request.getParameter('formPayload'),
         formtype = request.getParameter('formtype'),
+        applicationId = request.getParameter('appId'),
         formSubmit;
-
+log.info(formPayload)
 //add login validator for pages
 include('/controllers/login/validator.jag');
 
@@ -37,7 +38,7 @@ try {
             formSubmit = util.RESTCalls.deployApplicationDefinition(formPayload);
             break;
         case "deployments":
-            formSubmit = util.RESTCalls.deployDeploymentPolicyDefinition(formPayload);
+            formSubmit = util.RESTCalls.deployDeploymentPolicyDefinition(applicationId, formPayload);
             break;
         case "deleteapplication":
             formSubmit = util.RESTCalls.deleteApplication(formPayload);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ae4419dc/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 0e2a019..ba235c1 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
@@ -142,6 +142,10 @@ RESTCalls = new function(){
         return this.sendReceive("GET","/applications/" + appId + '/runtime',{});
     };
 
+    this.getApplicationJSON = function(appId){
+        return this.sendReceive("GET","/applications/"+appId ,{});
+    };
+
     this.getClusterInfo = function(clusterId){
         return this.sendReceive("GET","/cluster/clusterId/" + clusterId,{});
     };

http://git-wip-us.apache.org/repos/asf/stratos/blob/ae4419dc/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 ad6e2a2..43465c2 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
@@ -120,11 +120,11 @@
                                             id="{{applicationId}}"> Delete</button>
                                     <button class="btn btn-info btn-lg hover-details" type="button"
                                             id="details_list_{{applicationId}}"
-                                            data-url="{{url ""}}/applications/applications/{{applicationId}}/" > View
+                                            data-url="{{url ""}}/applications/applications/{{applicationId}}/view" > View
                                     </button>
                                     <button class="btn btn-warning btn-lg hover-details" type="button"
                                             id="details_{{applicationId}}"
-                                            data-url="{{url ""}}/applications/applications/{{applicationId}}/" > Deploy
+                                            data-url="{{url ""}}/applications/applications/{{applicationId}}/deploy" > Deploy
                                     </button>
                                 </div>
                                 <div class="bottom-bar-wrapper">
@@ -133,11 +133,11 @@
                                                 id="{{applicationId}}"> Delete</button>
                                         <button class="btn btn-info btn-lg hover-details" type="button"
                                                 id="details_{{applicationId}}"
-                                                data-url="{{url ""}}/applications/applications/{{applicationId}}/" > View
+                                                data-url="{{url ""}}/applications/applications/{{applicationId}}/view" > View
                                         </button>
                                         <button class="btn btn-warning btn-lg hover-details" type="button"
                                                 id="details_{{applicationId}}"
-                                                data-url="{{url ""}}/applications/applications/{{applicationId}}/" > Deploy
+                                                data-url="{{url ""}}/applications/applications/{{applicationId}}/deploy" > Deploy
                                         </button>
 
                                     </div>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ae4419dc/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 d02a2e5..b0e4e55 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
@@ -87,6 +87,72 @@ var render = function (theme, data, meta, require) {
 
                 ]
             });
+        }else if(data.applicationDeploy == true){
+            theme('index', {
+                page_meta: [
+                    {
+                        partial: 'index_title',
+                        context: {
+                            page_title: 'Apache Stratos - Application Managment',
+                            page_description: 'Apache Stratos - Application Managment'
+                        }
+                    }
+                ],
+                header: [
+                    {
+                        partial: 'index_header',
+                        context: {
+                        }
+                    }
+                ],
+                sub_header: [
+                    {
+                        partial: 'index_sub_header',
+                        context: {
+                            breadcrumbPathLevelOne: data.breadcrumbPathLevelOne,
+                            breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo
+                        }
+                    }
+                ],
+                left_menu: [
+                    {
+                        partial: 'index_left_menu',
+                        context: {
+                            left_menu: data.left_menu
+                        }
+                    }
+                ],
+                right_menu_help: [
+                    {
+                        partial: 'index_right_menu_help',
+                        context: {
+
+                        }
+                    }
+                ],
+                content: [
+                    {
+                        partial: 'applications_deploy',
+                        context: {
+                            formContext: data.breadcrumbPathLevelTwo,
+                            applicationName: data.applicationName,
+                            applicationJSON: data.applicationJSON,
+                            editorCartridges: data.editorCartridges,
+                            editorGroups:data.editorGroups,
+                            form_action: data.form_action,
+                            formHtml: data.formHtml,
+                            formData: data.formData,
+                            formDataRaw: data.formDataRaw,
+                            formDataEdit: data.formDataEdit,
+                            isForm: data.isForm,
+                            isEdit: data.isEdit,
+                            formTitle: data.formTitle
+
+                        }
+                    }
+
+                ]
+            });
         }else if(data.applicationEditor == true){
             theme('index', {
                 page_meta: [
@@ -152,6 +218,7 @@ var render = function (theme, data, meta, require) {
 
                 ]
             });
+
         }else{
             theme('index', {
                 page_meta: [