|
| 1 | +<!-- |
| 2 | +Knowage, Open Source Business Intelligence suite |
| 3 | +Copyright (C) 2016 Engineering Ingegneria Informatica S.p.A. |
| 4 | + |
| 5 | +Knowage is free software: you can redistribute it and/or modify |
| 6 | +it under the terms of the GNU Affero General Public License as published by |
| 7 | +the Free Software Foundation, either version 3 of the License, or |
| 8 | +(at your option) any later version. |
| 9 | + |
| 10 | +Knowage is distributed in the hope that it will be useful, |
| 11 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +GNU Affero General Public License for more details. |
| 14 | + |
| 15 | +You should have received a copy of the GNU Affero General Public License |
| 16 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +--> |
| 18 | + |
| 19 | +<%@page import="it.eng.knowage.commons.security.KnowageSystemConfiguration"%> |
| 20 | +<%@page import= "it.eng.spagobi.engines.whatif.common.WhatIfConstants" %> |
| 21 | +<%@page import= "java.util.Enumeration" %> |
| 22 | +<%@ page language="java" |
| 23 | + contentType="text/html; charset=UTF-8" |
| 24 | + pageEncoding="UTF-8" %> |
| 25 | + |
| 26 | + |
| 27 | +<%-- ---------------------------------------------------------------------- --%> |
| 28 | +<%-- JAVA IMPORTS --%> |
| 29 | +<%-- ---------------------------------------------------------------------- --%> |
| 30 | +<%@page import= "it.eng.spago.configuration.*" %> |
| 31 | +<%@page import= "it.eng.spago.base.*"%> |
| 32 | +<%@page import= "it.eng.spagobi.engines.whatif.WhatIfEngineConfig" %> |
| 33 | +<%@page import= "it.eng.spagobi.engines.whatif.WhatIfEngineInstance" %> |
| 34 | +<%@page import= "it.eng.spagobi.utilities.engines.EngineConstants" %> |
| 35 | +<%@page import= "it.eng.spagobi.commons.constants.SpagoBIConstants" %> |
| 36 | +<%@page import= "java.util.Locale"%> |
| 37 | +<%@page import= "it.eng.spagobi.services.common.EnginConf" %> |
| 38 | +<%@page import= "it.eng.spagobi.utilities.engines.rest.ExecutionSession" %> |
| 39 | +<%@page import="org.apache.commons.lang.StringEscapeUtils"%> |
| 40 | +<%@page import="it.eng.spagobi.utilities.KnowageStringUtils"%> |
| 41 | +<%@page import="it.eng.spago.security.IEngUserProfile" %> |
| 42 | +<%@page import="java.util.List"%> |
| 43 | +<%@page import="java.util.ArrayList"%> |
| 44 | +<%@page import="it.eng.spagobi.commons.bo.UserProfile"%> |
| 45 | +<%@page import="it.eng.spagobi.utilities.engines.EngineStartServletIOManager"%> |
| 46 | +<%@page import="it.eng.knowage.commons.utilities.urls.UrlBuilder"%> |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +<%-- ---------------------------------------------------------------------- --%> |
| 52 | +<%-- JAVA CODE --%> |
| 53 | +<%-- ---------------------------------------------------------------------- --%> |
| 54 | + |
| 55 | +<% |
| 56 | + String spagoBiContext = KnowageSystemConfiguration.getKnowageContext(); |
| 57 | + String thisContext = request.getContextPath(); |
| 58 | + UrlBuilder urlBuilder = new UrlBuilder(spagoBiContext, thisContext); |
| 59 | + |
| 60 | + WhatIfEngineInstance whatIfEngineInstance; |
| 61 | + //UserProfile profile; |
| 62 | + Locale locale =null; |
| 63 | + String isFromCross; |
| 64 | + String spagobiContext = null; |
| 65 | + String documentLabel = null; |
| 66 | + String documentId = null; |
| 67 | + String engine = null; |
| 68 | + String sbiExecutionID = null; |
| 69 | + String mode = null; |
| 70 | + String schemaID = null; |
| 71 | + String schemaName = null; |
| 72 | + String cubeName = null; |
| 73 | + String currentContentId = null; |
| 74 | + String jsonTemplate = null; |
| 75 | + String editModeCurrentContentId = null; |
| 76 | + ExecutionSession es = new ExecutionSession(request, request.getSession()); |
| 77 | + String curr_language=(String)es.getAttribute(SpagoBIConstants.AF_LANGUAGE); |
| 78 | + String curr_country=(String)es.getAttribute(SpagoBIConstants.AF_COUNTRY); |
| 79 | + String curr_script=(String)es.getAttribute(SpagoBIConstants.AF_SCRIPT); |
| 80 | + |
| 81 | + whatIfEngineInstance = (WhatIfEngineInstance)es.getAttributeFromSession(EngineConstants.ENGINE_INSTANCE ); |
| 82 | + |
| 83 | + //load user profile |
| 84 | + IEngUserProfile userProfile = (IEngUserProfile)whatIfEngineInstance.getEnv().get(EngineConstants.ENV_USER_PROFILE); |
| 85 | + String userUniqueIdentifier=""; |
| 86 | + String userId=""; |
| 87 | + String userName=""; |
| 88 | + List userRoles = new ArrayList(); |
| 89 | + |
| 90 | + //if (userProfile!=null) userId=(String)userProfile.getUserUniqueIdentifier(); |
| 91 | + if (userProfile!=null){ |
| 92 | + userId=(String)((UserProfile)userProfile).getUserId(); |
| 93 | + userUniqueIdentifier=(String)userProfile.getUserUniqueIdentifier(); |
| 94 | + userName=(String)((UserProfile)userProfile).getUserName(); |
| 95 | + userRoles = (ArrayList)userProfile.getRoles(); |
| 96 | + |
| 97 | + } |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + //profile = (UserProfile)whatIfEngineInstance.getEnv().get(EngineConstants.ENV_USER_PROFILE); |
| 103 | + locale = (Locale)whatIfEngineInstance.getEnv().get(EngineConstants.ENV_LOCALE); |
| 104 | + |
| 105 | + if(whatIfEngineInstance.getEnv().get("DOCUMENT_LABEL" ) != null){ |
| 106 | + documentLabel = (String)whatIfEngineInstance.getEnv().get("DOCUMENT_LABEL" ); |
| 107 | + } |
| 108 | + if(whatIfEngineInstance.getEnv().get("DOCUMENT_ID" ) != null){ |
| 109 | + documentId = (String)whatIfEngineInstance.getEnv().get("DOCUMENT_ID" ); |
| 110 | + } |
| 111 | + |
| 112 | + isFromCross = (String)whatIfEngineInstance.getEnv().get( "isFromCross"); |
| 113 | + |
| 114 | + if (isFromCross == null) { |
| 115 | + isFromCross = "false"; |
| 116 | + } |
| 117 | + |
| 118 | + WhatIfEngineConfig whatIfEngineConfig = WhatIfEngineConfig.getInstance(); |
| 119 | + |
| 120 | + // if server Host anc context are null means we are in standalone version |
| 121 | + if(!whatIfEngineInstance.isStandalone()) { |
| 122 | + spagobiContext = KnowageSystemConfiguration.getKnowageContext(); |
| 123 | + } |
| 124 | + |
| 125 | + sbiExecutionID = request.getParameter("SBI_EXECUTION_ID" ); |
| 126 | + if(request.getParameter("mode") != null){ |
| 127 | + mode = request.getParameter("mode"); |
| 128 | + |
| 129 | + }else if(request.getParameter(EngineStartServletIOManager.ON_EDIT_MODE) != null){ |
| 130 | + mode = "edit"; |
| 131 | + }else{ |
| 132 | + mode = "full" ; |
| 133 | + } |
| 134 | + if(request.getParameter("schemaID") != null){ |
| 135 | + schemaID = request.getParameter("schemaID"); |
| 136 | + }else{ |
| 137 | + schemaID = "-1"; |
| 138 | + } |
| 139 | + if(request.getParameter("cubeName") != null){ |
| 140 | + cubeName = request.getParameter("cubeName"); |
| 141 | + } |
| 142 | + if(request.getParameter("schemaName") != null){ |
| 143 | + schemaName = request.getParameter("schemaName"); |
| 144 | + } |
| 145 | + if(request.getParameter("currentContentId") != null){ |
| 146 | + currentContentId = request.getParameter("currentContentId"); |
| 147 | + } |
| 148 | + if(request.getParameter("template") != null){ |
| 149 | + jsonTemplate = KnowageStringUtils.escape(request.getParameter("template"),'\'','\\'); |
| 150 | + } |
| 151 | + if(request.getParameter("SBI_ARTIFACT_VERSION_ID") != null){ |
| 152 | + editModeCurrentContentId = request.getParameter("SBI_ARTIFACT_VERSION_ID"); |
| 153 | + } |
| 154 | + |
| 155 | + |
| 156 | + if(request.getParameter("ENGINE") != null){ |
| 157 | + |
| 158 | + engine = request.getParameter("ENGINE"); |
| 159 | + } |
| 160 | +%> |
| 161 | + |
| 162 | +<%@include file="../../commons/includeMessageResource.jspf"%> |
0 commit comments