src/index.jsp
author Martin Taal <martin.taal@openbravo.com>
Wed, 25 May 2011 12:06:44 +0200
changeset 12425 0f8274676fcf
parent 11956 5da8a5ebe26e
child 12524 3bf5295a7f03
permissions -rw-r--r--
Fixes issue 16947: OPTIMIZE-15: Splitter bar does not work in all states, Fixes issue 17345: Third level tabs are not shown when selected
ivan@10243
     1
<%@ page import="java.util.Properties" %>
ivan@10243
     2
<%@ page import="org.openbravo.base.HttpBaseServlet" %>
ivan@10243
     3
<%@ page import="org.openbravo.base.util.OBClassLoader" %>
ivan@10243
     4
<%@ page import="org.openbravo.base.session.OBPropertiesProvider" %>
ivan@10243
     5
<%@ page import="org.openbravo.authentication.AuthenticationManager" %>
ivan@10243
     6
<%@ page contentType="text/html; charset=UTF-8" %>
ivan@10243
     7
<%
ivan@10243
     8
/*
ivan@10243
     9
 *************************************************************************
ivan@10243
    10
 * The contents of this file are subject to the Openbravo  Public  License
ivan@10243
    11
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
ivan@10243
    12
 * Version 1.1  with a permitted attribution clause; you may not  use this
ivan@10243
    13
 * file except in compliance with the License. You  may  obtain  a copy of
ivan@10243
    14
 * the License at http://www.openbravo.com/legal/license.html 
ivan@10243
    15
 * Software distributed under the License  is  distributed  on  an "AS IS"
ivan@10243
    16
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
ivan@10243
    17
 * License for the specific  language  governing  rights  and  limitations
ivan@10243
    18
 * under the License. 
ivan@10243
    19
 * The Original Code is Openbravo ERP. 
ivan@10243
    20
 * The Initial Developer of the Original Code is Openbravo SLU 
ivan@10243
    21
 * All portions are Copyright (C) 2011 Openbravo SLU
ivan@10243
    22
 * All Rights Reserved. 
ivan@10243
    23
 * Contributor(s):  ______________________________________.
ivan@10243
    24
 ************************************************************************
ivan@10243
    25
 */
ivan@10243
    26
 
ivan@10243
    27
Properties obProperties = OBPropertiesProvider.getInstance().getOpenbravoProperties();
ivan@10243
    28
String authClass = obProperties.getProperty("authentication.class");
ivan@10243
    29
ivan@10243
    30
if(authClass == null || authClass.equals("")) {
ivan@10243
    31
  authClass = "org.openbravo.authentication.basic.DefaultAuthenticationManager";
ivan@10243
    32
}
ivan@10243
    33
ivan@10243
    34
AuthenticationManager authManager = (AuthenticationManager) OBClassLoader.getInstance().loadClass(authClass).newInstance();
ivan@10243
    35
ivan@10243
    36
HttpBaseServlet s = new HttpBaseServlet(); // required for ConnectionProvider
ivan@10243
    37
s.init(getServletConfig());
ivan@10243
    38
s.initialize(request, response);
ivan@10243
    39
ivan@10243
    40
authManager.init(s);
ivan@10243
    41
ivan@10243
    42
String userId = authManager.authenticate(request, response);
ivan@10243
    43
if(userId == null){
ivan@10243
    44
  return;
ivan@10243
    45
}
david@11337
    46
david@11337
    47
String ua = request.getHeader( "User-Agent" );
david@11337
    48
boolean isMSIE = ( ua != null && ua.indexOf( "MSIE" ) != -1 );
david@11337
    49
int verMSIE = 0;
david@11337
    50
String verMSIEtmp = "";
david@11337
    51
if (isMSIE) {
david@11337
    52
  verMSIEtmp = ua.substring(ua.indexOf("MSIE") + 5);
david@11337
    53
  verMSIEtmp = verMSIEtmp.substring(0, verMSIEtmp.indexOf("."));
david@11337
    54
  if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/4") != -1) {
david@11337
    55
    //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
    56
    verMSIEtmp = "8";
david@11337
    57
  } else if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/5") != -1) {
david@11337
    58
    // 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
    59
    verMSIEtmp = "9";
david@11337
    60
  } else if (ua.indexOf("MSIE 7.0") != -1 && ua.indexOf("Trident/") != -1) {
david@11337
    61
    // 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
    62
    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
    63
  }
david@11337
    64
  verMSIE = Integer.parseInt(verMSIEtmp);
david@11337
    65
}
ivan@10243
    66
%>
ivan@10243
    67
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
ivan@10243
    68
        "http://www.w3.org/TR/html4/loose.dtd">
ivan@10243
    69
ivan@10243
    70
<html>
david@10937
    71
<head>
martin@12425
    72
<meta http-equiv="X-UA-Compatible" content="IE=8">
ivan@10243
    73
<meta http-equiv="Expires" content="Tue, 24 Apr 1979 00:00:01 GMT"/>
ivan@10243
    74
<meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
ivan@10243
    75
<meta http-equiv="Pragma" content="no-cache" >
ivan@10243
    76
<meta name="author" content="Openbravo S.L.U.">
ivan@10243
    77
<meta name="keywords" content="openbravo">
ivan@10243
    78
<meta name="description" content="Openbravo S.L.U.">
ivan@10256
    79
<link rel="shortcut icon" href="./web/images/favicon.ico" />
david@11337
    80
<link rel="stylesheet" type="text/css" href="./org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_mode=3.00&_skinVersion=3.00&_cssDataUri=<%=(!isMSIE || (isMSIE && verMSIE >=8))%>"/>
david@11337
    81
ivan@10243
    82
<title>Openbravo</title>
ivan@10243
    83
<script type="text/javascript" src="./web/org.openbravo.client.kernel/js/LAB.min.js"></script>
david@11337
    84
ivan@10243
    85
<!-- styles used during loading -->
ivan@10243
    86
<style type="text/css">
ivan@10243
    87
  html, body {
ivan@10243
    88
      height: 100%;
ivan@10243
    89
      width: 100%;
ivan@10243
    90
  }
ivan@10243
    91
ivan@10243
    92
  .OBCenteredBox {
ivan@10243
    93
      position: fixed;
ivan@10243
    94
      z-index: 1000000;
ivan@10243
    95
      top: 50%;
ivan@10243
    96
      left: 50%;
ivan@10243
    97
      margin: -25px 0 0 -150px;
ivan@10243
    98
      width: 300px;
ivan@10243
    99
      height: 50px;
ivan@10243
   100
  }
ivan@10243
   101
ivan@10243
   102
  .OBLoadingPromptLabel {
ivan@10243
   103
      font-family: 'Arial';
ivan@10243
   104
      font-size: 12px;
ivan@10243
   105
      color: #ccd0d4;
ivan@10243
   106
  }
ivan@10243
   107
ivan@10243
   108
  .OBLoadingPromptModalMask {
ivan@10243
   109
      left: 0;
ivan@10243
   110
      top: 0;
ivan@10243
   111
      width: 100%;
ivan@10243
   112
      height: 100%;
ivan@10243
   113
      background-color: #7f7f7f;
ivan@10243
   114
  }
ivan@10243
   115
</style>
ivan@10243
   116
ivan@10243
   117
</head>
ivan@10243
   118
<body>
ivan@10243
   119
ivan@10243
   120
<!-- shows the loading div -->
ivan@10243
   121
<div class="OBLoadingPromptModalMask" id="OBLoadingDiv">
ivan@10243
   122
    <div class="OBCenteredBox">
ivan@10243
   123
        <table>
ivan@10243
   124
            <tr>
ivan@10243
   125
                <td>
ivan@10243
   126
                    <span class="OBLoadingPromptLabel">LOADING...</span>
ivan@10243
   127
                </td>
ivan@10243
   128
                <td>
ivan@10243
   129
                    <img width="220" height="16" src="./web/org.openbravo.userinterface.smartclient/openbravo/skins/3.00/org.openbravo.client.application/images/system/windowLoading.gif"/>
ivan@10243
   130
                </td>
ivan@10243
   131
            </tr>
ivan@10243
   132
        </table>
ivan@10243
   133
    </div>
ivan@10243
   134
</div>
ivan@10243
   135
<!-- load the rest -->
ivan@10243
   136
<script type="text/javascript">
ivan@10392
   137
$LAB.setGlobalDefaults({AppendTo: 'body'});
ivan@10243
   138
ivan@10243
   139
var isomorphicDir='./web/org.openbravo.userinterface.smartclient/isomorphic/';
ivan@10243
   140
ivan@10243
   141
// starts the application is called as the last statement in the StaticResources part
ivan@10243
   142
function OBStartApplication() {
ivan@10243
   143
  OB.Layout.draw();
ivan@10243
   144
  OB.Layout.ViewManager.createAddStartTab();
ivan@10243
   145
  // get rid of the loading stuff
ivan@10243
   146
  document.body.removeChild(document.getElementById('OBLoadingDiv'));
ivan@10243
   147
  OB.GlobalHiddenForm = document.forms.OBGlobalHiddenForm;
ivan@10243
   148
}
ivan@10243
   149
</script>
ivan@10243
   150
<script type="text/javascript" src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js"></script>
ivan@10243
   151
<script type="text/javascript" src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js"></script>
ivan@10243
   152
<script type="text/javascript" src="./org.openbravo.client.kernel/OBCLKER_Kernel/StaticResources?_mode=3.00&_skinVersion=3.00"></script>
ivan@11956
   153
<iframe name="background_target" id="background_target" height="0" width="0" style="display:none;"></iframe>
antonio@11954
   154
<form name="OBGlobalHiddenForm" method="post" action="blank.html" target="background_target">
antonio@11343
   155
</form>
ivan@10243
   156
</body>
ivan@10243
   157
</html>