def postUnpack(self): if self.cget("use_gamma"): lambda_path = CONFIG.get("tomcat", "catalina_home") + "webapps/" + self.cget("name") gamma_path = self.cget("gamma_path") utils.sh_mkdir_p(gamma_path) detar_command = "tar -C " + gamma_path + " -xaf " + self.cget("gamma_repo") if utils.sh_exec(detar_command): gamma_path = gamma_path + "/GaMMa" utils.sh_cp(gamma_path+"/src/scripts/gamma.js", lambda_path+"/scripts") utils.sh_cp(gamma_path+"/src/styles/gamma-style.css", lambda_path+"/styles") openlayers_repo = gamma_path + "/src/OpenLayers-2.12.tar.gz" detar_command_openlayers = "tar -C " + lambda_path + " -xaf " + openlayers_repo if utils.sh_exec(detar_command_openlayers): jsp_queryepcis = lambda_path + "/jsp/pages/queryepcis.jsp" jsp_trace = lambda_path + "/jsp/pages/trace.jsp" cmd = """sed -i ' /<\/head>/i\\ <link rel="stylesheet" type="text/css" href="OpenLayers-2.12/theme/default/style.css">\\ <link rel="stylesheet" type="text/css" href="styles/gamma-style.css">\\ <script type="text/javascript" src="./OpenLayers-2.12/OpenLayers.js"></script>\\ <script type="text/javascript" src="scripts/gamma.js"></script>' %(file)s sed -i ' /<\/body>/i\\ <div id="map" class="smallmap"></div>\\ <script type="text/javascript">\\ gamma_init(); /* OpenLayers and div map init */\\ initShowOnMap("eventItems");\\ </script>' %(file)s """ utils.sh_exec(cmd % dict(file=jsp_queryepcis)) utils.sh_exec(cmd % dict(file=jsp_trace))
def postConfigure(self): if self.cisTrue("jar_install"): lib = CONFIG.get("tomcat", "catalina_home") + "lib/" utils.sh_cp(self.cget("repo"), lib) utils.stopTomcat() utils.startTomcat()