1<!-- $HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/apps/igeoportal-standard/branches/2.5_testing/menubartop.jsp $ -->
2<%-- $Id: menubartop.jsp 25889 2010-08-16 05:43:37Z jwilden $ --%>
3<%--
4 This file is part of deegree, http://deegree.org/
5 Copyright (C) 2001-2009 by:
6 - Department of Geography, University of Bonn -
7 and
8 - lat/lon GmbH -
9
10 This library is free software; you can redistribute it and/or modify it under
11 the terms of the GNU Lesser General Public License as published by the Free
12 Software Foundation; either version 2.1 of the License, or (at your option)
13 any later version.
14 This library is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17 details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with this library; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Contact information:
23
24 lat/lon GmbH
25 Aennchenstr. 19, 53177 Bonn
26 Germany
27 http://lat-lon.de/
28
29 Department of Geography, University of Bonn
30 Prof. Dr. Klaus Greve
31 Postfach 1147, 53001 Bonn
32 Germany
33 http://www.geographie.uni-bonn.de/deegree/
34
35 e-mail: info@deegree.org
36--%>
37<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
38<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
39<%@ page import="org.deegree.i18n.Messages" %>
40<%@ page import="java.util.Locale" %>
41<%
42    Locale loc = request.getLocale();
43%>
44<html>
45    <head>
46        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
47        <meta name="author" content="lat/lon GmbH" />
48        <meta name="KeyWords" content="deegree iGeoPortal lat/lon" />
49        <title>deegree iGeoPortal</title>
50        <link href="css/deegree.css" rel="stylesheet" type="text/css" />
51        <script language="JavaScript1.2" type="text/javascript">
52            function register() {
53                if ( parent.controller == null ) {
54                    parent.controller = new parent.Controller();
55                    parent.controller.init();
56                }
57            }
58
59            function initMenuBar() {
60                parent.controller.initMenuBarTop(document);
61            }
62
63            function openHelp() {
64                <%
65                String lang = Locale.getDefault().getLanguage();
66                // NOTE: if-branch needs to be adjusted as soon as other languages than "de" or "en" are supported
67                if ( "".equals( lang ) || !"de".equals( lang ) ) {
68                    lang = "en";
69                }
70                %>
71                var fiw = window.open( "./help/<%=lang%>/help.html", "Help",
72                                       "width=925,height=775,left=100,top=100,resizable=no,scrollbars=yes");
73                fiw.focus();
74            }
75
76            function gotoHome() {
77                var fiw = window.open( "http://www.deegree.org", "Home",
78                                       "width=600,height=400,left=100,top=100,scrollbars=yes");
79                fiw.focus();
80                //parent.controller.replace("http://www.deegree.org");
81            }
82
83            function openSaveContext() {
84                var fiw = null;
85                if ( parent.controller.vSessionKeeper != null && parent.controller.vSessionKeeper.id == null ) {
86                    // the user has to login before saving a new context to the user's folder
87                    fiw = window.open( "./missinglogin.jsp" ,"LoginInfo",
88                                       "width=500,height=200,left=100,top=100,scrollbars=yes" );
89                } else {
90                    fiw = window.open( "./savecontext.jsp", "save",
91                                       "width=500,height=200,left=100,top=100,scrollbars=yes" );
92                }
93                fiw.focus();
94            }
95
96            function openLoadContext() {
97            	var fiw = null;
98                if ( parent.controller.vSessionKeeper != null && parent.controller.vSessionKeeper.id == null ) {
99                    /* the user has to login before loading a context from the user's folder */
100                    fiw = window.open( "./missinglogin.jsp" ,"LoginInfo",
101                                       "width=500,height=200,left=100,top=100,scrollbars=yes" );
102                } else {
103                    var sessionID = null;
104                    if ( parent.controller.vSessionKeeper != null ) {
105                        sessionID = parent.controller.vSessionKeeper.id;
106                    }
107                    var s = "control?rpc=<?xml version='1.0' encoding='UTF-8'?><methodCall>" +
108                            "<methodName>mapClient:listContexts</methodName><params><param><value><struct>"+
109                            "<member><name>sessionID</name><value><string>" + sessionID + "</string></value></member>" +
110                            "</struct></value></param></params></methodCall>";
111                    fiw = window.open( s, "load", "width=550,height=300,left=100,top=100,scrollbars=yes");
112                }
113                fiw.focus();
114            }
115
116            /* needed for wmc_testSecurity.xml */
117            function openLogin() {
118                if ( parent.controller.vSessionKeeper != null ) {
119                    var fiw = parent.open( "login.jsp" ,"Login",
120                                           "width=500,height=300,left=100,top=100,scrollbars=yes" );
121                    fiw.focus();
122                } else {
123                    var msg = '<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_NO_LOGIN" ) %>';
124                    fiw = window.open( "message.jsp?msg=" + encodeURIComponent( msg ), "Information", "width=400,height=250,left=100,top=100,scrollbars=yes");
125                }
126            }
127
128            /* needed for wmc_testSecurity.xml */
129            function performLogout() {
130                if ( parent.controller.vSessionKeeper != null ) {
131                    if ( parent.controller.vSessionKeeper.id != null ) {
132                        var fiw = window.open( "logout.jsp", "logout",
133                                               "width=500,height=300,left=100,top=100,scrollbars=yes" );
134                        fiw.focus();
135                    } else {
136                        alert( '<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_MSG_NOUSER" ) %>' );
137                    }
138                } else {
139                    var msg = '<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_NO_LOGOUT" ) %>';
140                    alert(msg);
141                    fiw = window.open( "message.jsp?msg=" + encodeURIComponent( msg ), "Information", "width=400,height=250,left=100,top=100,scrollbars=yes");
142                }
143            }
144
145            /* needed for wmc_testCswClient.xml */
146            function openMetadata() {
147                if ( parent.controller.vCswModule != null ) {
148                    var s = "control?rpc=<?xml version='1.0' encoding='UTF-8'?>"+
149                            "<methodCall><methodName>cswClient:initClient</methodName></methodCall>";
150                    fiw = window.open( s, "Search", "width=870,height=620,left=100,top=100,scrollbars=yes");
151                    fiw.focus();
152                } else {
153                    var msg = '<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_NO_METADATA" ) %>';
154                    fiw = window.open( "message.jsp?msg=" + encodeURIComponent( msg ), "Information", "width=400,height=250,left=100,top=100,scrollbars=yes");
155                }
156            }
157        </script>
158    </head>
159    <body onload="register(); initMenuBar();" class="pMenubarTop">
160        <table height="100%">
161            <tbody>
162	            <tr>
163	                <td align="center"><div class="buttonIcon"><a href="javascript:openSaveContext()"><img src="./images/mt_save.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_SAVE" ) %>' border="0" /></a></div>&nbsp;</td>
164	                <td align="center"><div class="buttonIcon"><a href="javascript:openLoadContext()"><img src="./images/mt_load.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_LOAD" ) %>' border="0" /></a></div>&nbsp;</td>
165	                <td align="center"><div class="buttonIcon"><a href="javascript:openHelp()"><img src="./images/mt_help.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_HELP" ) %>' border="0" /></a></div>&nbsp;</td>
166	                <td align="center"><div class="buttonIcon"><a href="javascript:openMetadata()"><img src="./images/mt_metadata.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_MDSEARCH" ) %>' border="0" /></a></div>&nbsp;</td>
167	                <td align="center"><div class="buttonIcon"><a href="javascript:openLogin()"><img src="./images/mt_login.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_LOGIN" ) %>' border="0" /></a></div>&nbsp;</td>
168	                <td align="center"><div class="buttonIcon"><a href="javascript:performLogout()"><img src="./images/mt_logout.gif" title='<%=Messages.get( loc, "IGEO_STD_MENUBARTOP_TT_LOGOUT" ) %>' border="0" /></a></div>&nbsp;</td>
169	            </tr>
170            </tbody>
171        </table>
172    </body>
173</html>
174