src/index.jsp
author RM packaging bot <staff.rm@openbravo.com>
Fri, 05 Oct 2012 10:33:28 +0000
changeset 18130 1cd80d4b32bb
parent 16865 9dc141df1f43
child 19365 e5c99a21da3e
permissions -rw-r--r--
Update AD_MODULE version to 3.0MP16
ivan@10243
     1
<%@ page import="java.util.Properties" %>
ivan@10243
     2
<%@ page import="org.openbravo.base.HttpBaseServlet" %>
martin@13190
     3
<%@ page import="org.openbravo.dal.core.OBContext"%>
ivan@10243
     4
<%@ page import="org.openbravo.base.util.OBClassLoader" %>
ivan@10243
     5
<%@ page import="org.openbravo.authentication.AuthenticationManager" %>
david@16048
     6
<%@ page import="org.openbravo.client.kernel.KernelUtils" %>
ivan@16865
     7
<%@ page import="org.openbravo.client.kernel.KernelConstants" %>
david@16048
     8
<%@ page import="org.openbravo.dal.core.OBContext" %>
david@16048
     9
<%@ page import="org.openbravo.model.ad.module.Module" %>
stefan@12524
    10
<%@ page import="org.apache.log4j.Logger" %>
ivan@10243
    11
<%@ page contentType="text/html; charset=UTF-8" %>
ivan@10243
    12
<%
ivan@13719
    13
  /*
ivan@10243
    14
 *************************************************************************
ivan@10243
    15
 * The contents of this file are subject to the Openbravo  Public  License
ivan@10243
    16
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
ivan@10243
    17
 * Version 1.1  with a permitted attribution clause; you may not  use this
ivan@10243
    18
 * file except in compliance with the License. You  may  obtain  a copy of
ivan@10243
    19
 * the License at http://www.openbravo.com/legal/license.html 
ivan@10243
    20
 * Software distributed under the License  is  distributed  on  an "AS IS"
ivan@10243
    21
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
ivan@10243
    22
 * License for the specific  language  governing  rights  and  limitations
ivan@10243
    23
 * under the License. 
ivan@10243
    24
 * The Original Code is Openbravo ERP. 
ivan@10243
    25
 * The Initial Developer of the Original Code is Openbravo SLU 
ivan@15412
    26
 * All portions are Copyright (C) 2011-2012 Openbravo SLU
ivan@10243
    27
 * All Rights Reserved. 
martin@15614
    28
 * Contributor(s):  ______________________________________.
ivan@10243
    29
 ************************************************************************
ivan@10243
    30
 */
stefan@12524
    31
stefan@12524
    32
Logger log = Logger.getLogger(org.openbravo.authentication.AuthenticationManager.class); 
ivan@10243
    33
ivan@16797
    34
AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(this);
ivan@10243
    35
ivan@10243
    36
String userId = authManager.authenticate(request, response);
ivan@16797
    37
ivan@10243
    38
if(userId == null){
ivan@10243
    39
  return;
ivan@10243
    40
}
david@11337
    41
david@16048
    42
boolean uncompSC = false;
david@16052
    43
String scDevModulePackage = "org.openbravo.userinterface.smartclient.dev";
david@16048
    44
OBContext.setAdminMode();
david@16048
    45
try {
david@16048
    46
  if (KernelUtils.getInstance().isModulePresent(scDevModulePackage)) {
david@16048
    47
    uncompSC = KernelUtils.getInstance().getModule(scDevModulePackage).isInDevelopment();
david@16048
    48
  }
david@16048
    49
} catch (Exception e) {
david@16052
    50
  log.error("Error trying to acquire module \"" + scDevModulePackage + "\": " + e.getMessage(), e);
david@16048
    51
} finally {
david@16048
    52
  OBContext.restorePreviousMode();
david@16048
    53
}
david@16048
    54
david@11337
    55
String ua = request.getHeader( "User-Agent" );
david@11337
    56
boolean isMSIE = ( ua != null && ua.indexOf( "MSIE" ) != -1 );
david@11337
    57
int verMSIE = 0;
david@11337
    58
String verMSIEtmp = "";
david@11337
    59
if (isMSIE) {
david@11337
    60
  verMSIEtmp = ua.substring(ua.indexOf("MSIE") + 5);
david@11337
    61
  verMSIEtmp = verMSIEtmp.substring(0, verMSIEtmp.indexOf("."));
david@11337
    62
  if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/4") != -1) {
david@11337
    63
    //In case IE8 runs in "IE8 Compatibility mode, look for Trident/4.0 to know that is IE8 although MSIE string is MSIE 7.0
david@11337
    64
    verMSIEtmp = "8";
david@11337
    65
  } else if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/5") != -1) {
david@11337
    66
    // In case IE9 runs in "IE8 Compatibility mode, look for Trident/5.0 to know that is IE9 although MSIE string is MSIE 7.0
david@11337
    67
    verMSIEtmp = "9";
david@11337
    68
  } else if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/") != -1) {
david@11337
    69
    // For hypothetic future IE versions in case IEX runs in "IEX Compatibility mode, look for Trident/ to know that is IEX although MSIE string is MSIE 7.0
david@11337
    70
    verMSIEtmp = "10"; //If this 'if' statement is not updated, could be 10 or 11 or anything... but set 10 just to ensure it is not in IE7
david@11337
    71
  }
david@11337
    72
  verMSIE = Integer.parseInt(verMSIEtmp);
david@11337
    73
}
martin@15540
    74
response.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
martin@15540
    75
response.addHeader("Pragma", "no-cache");
martin@15540
    76
response.addHeader("Expires", "0");
ivan@10243
    77
%>
david@16334
    78
<!DOCTYPE html>
ivan@10243
    79
david@16384
    80
<html dir="<%=(OBContext.isRightToLeft() ? "RTL" : "LTR")%>">
david@10938
    81
<head>
ivan@10243
    82
<meta http-equiv="Expires" content="Tue, 24 Apr 1979 00:00:01 GMT"/>
ivan@10243
    83
<meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
martin@15539
    84
<meta http-equiv="Cache-Control" content="no-cache no-store must-revalidate" >
ivan@10243
    85
<meta http-equiv="Pragma" content="no-cache" >
ivan@10243
    86
<meta name="author" content="Openbravo S.L.U.">
ivan@10243
    87
<meta name="keywords" content="openbravo">
ivan@10243
    88
<meta name="description" content="Openbravo S.L.U.">
ivan@10257
    89
<link rel="shortcut icon" href="./web/images/favicon.ico" />
ivan@16865
    90
<link rel="stylesheet" type="text/css" href="./org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_appName=OB3&_skinVersion=Default&_cssDataUri=<%=(!isMSIE || (isMSIE && verMSIE >=8))%>"/>
david@11337
    91
ivan@10243
    92
<title>Openbravo</title>
ivan@16479
    93
<script src="./web/org.openbravo.client.kernel/js/scopeleaks.min.js"></script>
ivan@16479
    94
<script src="./web/org.openbravo.client.kernel/js/LAB.min.js"></script>
ivan@16479
    95
<script src="./web/org.openbravo.client.kernel/js/BigDecimal-all-1.0.1.min.js"></script>
david@11337
    96
ivan@10243
    97
<!-- styles used during loading -->
ivan@16479
    98
<style>
ivan@10243
    99
  html, body {
ivan@10243
   100
      height: 100%;
ivan@10243
   101
      width: 100%;
ivan@10243
   102
  }
ivan@10243
   103
ivan@10243
   104
  .OBCenteredBox {
ivan@10243
   105
      position: fixed;
ivan@10243
   106
      z-index: 1000000;
ivan@10243
   107
      top: 50%;
ivan@10243
   108
      left: 50%;
ivan@10243
   109
      margin: -25px 0 0 -150px;
ivan@10243
   110
      width: 300px;
ivan@10243
   111
      height: 50px;
ivan@10243
   112
  }
ivan@10243
   113
ivan@10243
   114
  .OBLoadingPromptLabel {
ivan@10243
   115
      font-family: 'Arial';
ivan@10243
   116
      font-size: 12px;
ivan@10243
   117
      color: #ccd0d4;
ivan@10243
   118
  }
ivan@10243
   119
ivan@10243
   120
  .OBLoadingPromptModalMask {
ivan@10243
   121
      left: 0;
ivan@10243
   122
      top: 0;
ivan@10243
   123
      width: 100%;
ivan@10243
   124
      height: 100%;
ivan@10243
   125
      background-color: #7f7f7f;
ivan@10243
   126
  }
ivan@10243
   127
</style>
ivan@10243
   128
ivan@10243
   129
</head>
david@16384
   130
<body>
ivan@10243
   131
ivan@10243
   132
<!-- shows the loading div -->
ivan@10243
   133
<div class="OBLoadingPromptModalMask" id="OBLoadingDiv">
ivan@10243
   134
    <div class="OBCenteredBox">
ivan@10243
   135
        <table>
ivan@10243
   136
            <tr>
ivan@10243
   137
                <td>
ivan@10243
   138
                    <span class="OBLoadingPromptLabel">LOADING...</span>
ivan@10243
   139
                </td>
ivan@10243
   140
                <td>
martin@12927
   141
                    <img width="220" height="16" src="./web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/images/system/windowLoading.gif"/>
ivan@10243
   142
                </td>
ivan@10243
   143
            </tr>
ivan@10243
   144
        </table>
ivan@10243
   145
    </div>
ivan@10243
   146
</div>
ivan@10243
   147
<!-- load the rest -->
ivan@16479
   148
<script>
ivan@16865
   149
// Bootstrap error handling: Shows an alert to the user when an error occurs loading static resources
ivan@16865
   150
// This error handler gets removed at the end of static resources
ivan@16865
   151
window.onerror = function <%=KernelConstants.BOOTSTRAP_ERROR_HANDLER_NAME%> (errorMsg, url, lineNumber) {
ivan@16865
   152
  var msg = errorMsg + ' - ' + url + ':' + lineNumber;
ivan@16865
   153
  document.body.removeChild(document.getElementById('OBLoadingDiv'));
ivan@16865
   154
  alert(msg);
ivan@16865
   155
};
ivan@16865
   156
martin@15593
   157
$LAB.setGlobalDefaults({AppendTo: 'body'});
martin@15593
   158
ivan@10243
   159
var isomorphicDir='./web/org.openbravo.userinterface.smartclient/isomorphic/';
ivan@10243
   160
ivan@10243
   161
// starts the application is called as the last statement in the StaticResources part
ivan@15690
   162
function OBStartApplication() {
martin@12948
   163
  OB.Layout.initialize();
ivan@10243
   164
  OB.Layout.draw();
ivan@10243
   165
  OB.Layout.ViewManager.createAddStartTab();
ivan@10243
   166
  // get rid of the loading stuff
ivan@10243
   167
  document.body.removeChild(document.getElementById('OBLoadingDiv'));
ivan@10243
   168
  OB.GlobalHiddenForm = document.forms.OBGlobalHiddenForm;
ivan@13342
   169
<%
ivan@13342
   170
  if (session.getAttribute("STARTUP-MESSAGE") != null) {
ivan@13342
   171
    String text = (String) session.getAttribute("STARTUP-MESSAGE");
ivan@13342
   172
    String title = (String) session.getAttribute("STARTUP-MESSAGE-TITLE");
ivan@13342
   173
    session.removeAttribute("STARTUP-MESSAGE");
ivan@13342
   174
    session.removeAttribute("STARTUP-MESSAGE-TITLE");
ivan@13342
   175
%>
ivan@13342
   176
  isc.say('<%=text%>', null, {title: '<%=title%>'});
ivan@13342
   177
<%
ivan@13342
   178
  }
ivan@13342
   179
%>
ivan@10243
   180
}
ivan@10243
   181
</script>
ivan@16479
   182
<script src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined<%=(uncompSC ? ".uncompressed" : "")%>.js"></script>
ivan@16479
   183
<script src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History<%=(uncompSC ? ".uncompressed" : "")%>.js"></script>
ivan@16865
   184
<script src="./org.openbravo.client.kernel/OBCLKER_Kernel/StaticResources?_appName=OB3&_skinVersion=Default"></script>
ivan@11956
   185
<iframe name="background_target" id="background_target" height="0" width="0" style="display:none;"></iframe>
antonio@11954
   186
<form name="OBGlobalHiddenForm" method="post" action="blank.html" target="background_target">
antonio@11344
   187
</form>
ivan@10243
   188
</body>
ivan@14579
   189
</html>