| <% |
| /* |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| */ |
| (function(){ |
| var log = new Log("controller.wizardSubmit"); |
| var utils = require('/util/utility.jag'); |
| var action = request.getParameter("action"); |
| if(action !=null && action == "undeploy"){ |
| var type = request.getParameter("type"); |
| undeployMsg = utils.consoleAppUtil.undeployCartridge(type); |
| print(undeployMsg); |
| }else{ |
| var thisStep = request.getParameter("thisStep"); |
| var nextStep = request.getParameter("nextStep"); |
| var skip = request.getParameter("skip"); |
| if(parseInt(thisStep)<parseInt(nextStep) && skip != "true"){ |
| var policy = request.getParameter("policy") |
| |
| if(parseInt(thisStep) == 1 && policy != "" ){ |
| utils.consoleAppUtil.deployPartitionDefinition(policy); |
| session.put("deploy_artifacts", "Partition Deployment"); |
| |
| } |
| if(parseInt(thisStep) == 2 && policy != "" ){ |
| utils.consoleAppUtil.deployAutoscalePolicyDefinition(policy); |
| session.put("deploy_artifacts", "Autoscale Policy Deployment"); |
| |
| } |
| if(parseInt(thisStep) == 3 && policy != "" ){ |
| var foo = utils.consoleAppUtil.deployDeploymentPolicyDefinition(policy); |
| session.put("deploy_artifacts", "Deployment Policy Deployment"); |
| |
| } |
| if(parseInt(thisStep) == 4 && policy != "" ){ |
| utils.consoleAppUtil.deployLbDefinition(policy); |
| session.put("deploy_artifacts", "Lb Deployment"); |
| |
| } |
| if(parseInt(thisStep) == 5 && policy != "" ){ |
| utils.consoleAppUtil.deployCartridgeDefinition(policy); |
| session.put("deploy_artifacts", "Cartridge Deployment"); |
| |
| } |
| if(parseInt(thisStep) == 6 && policy != "" ){ |
| utils.consoleAppUtil.deployServiceDefinition(policy); |
| session.put("deploy_artifacts", "Service Deployment"); |
| |
| } |
| } |
| |
| var configuring = session.get("configuring"); |
| var get_status = session.get("get-status"); |
| var deploy_status = session.get("deploy-status"); |
| var url = ""; |
| |
| if(deploy_status != null && deploy_status != "succeeded") { |
| url = request.getContextPath() + '/configure_stratos_wizard.jag?step=' + thisStep; |
| } else { |
| url = request.getContextPath() + '/configure_stratos_wizard.jag?step=' + nextStep; |
| } |
| if(configuring == "true"){ |
| url = request.getContextPath() + '/configure_stratos.jag?step=' + thisStep; |
| } |
| response.sendRedirect(url); |
| } |
| |
| }()); |
| %> |