| <% |
| /* |
| * |
| * 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. |
| * |
| */ |
| var caramel = require('caramel'); |
| var error = []; |
| var process = require('process'); |
| var step = request.getParameter('step'); |
| if(step == null){ |
| step = 1; |
| } |
| |
| var step_data = {}; |
| |
| var wizard = { |
| "step":step |
| }; |
| |
| var utils = require('/util/utility.jag'); |
| |
| if(wizard.step == 1){ |
| var step_data = utils.consoleAppUtil.getPartitions(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.partition; |
| } |
| }else if(wizard.step == 2){ |
| step_data = utils.consoleAppUtil.getPolicyAutoScale(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.autoscalePolicy; |
| } |
| }else if(wizard.step == 3){ |
| step_data = utils.consoleAppUtil.getPolicyDeployment(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.deploymentPolicy; |
| } |
| }else if(wizard.step == 4){ |
| step_data = utils.consoleAppUtil.getLbCartridges(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.cartridge; |
| } |
| }else if(wizard.step == 5){ |
| step_data = utils.consoleAppUtil.getCartridges(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.cartridge; |
| for(var i=0;i<step_data.length;i++) { |
| if(step_data[i].loadBalancer == true ) { |
| step_data.splice(i,1); |
| i = i - 1; |
| } |
| } |
| } |
| }else if(wizard.step == 6){ |
| step_data = utils.consoleAppUtil.getServices(); |
| if(step_data == null || step_data == undefined || step_data == ""){ |
| step_data = {}; |
| } |
| if(step_data.Error != undefined){ |
| error.push(step_data.Error); |
| }else{ |
| step_data = step_data.serviceDefinitionBean; |
| } |
| } |
| |
| var bamInfo ={bamip:process.getProperty('bam.ip'),bamport:process.getProperty('bam.port')}; |
| caramel.render({ |
| step_data:step_data, |
| wizard:wizard, |
| bamInfo:bamInfo, |
| error:error |
| }); |
| %> |