Tue, 26 Dec 2017 17:36:47 +0100
adds dynamic fragments to LightPIT request handling framework + basic language recognition code
universe@1 | 1 | <%-- |
universe@1 | 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
universe@1 | 3 | |
universe@1 | 4 | Copyright 2017 Mike Becker. All rights reserved. |
universe@1 | 5 | |
universe@1 | 6 | Redistribution and use in source and binary forms, with or without |
universe@1 | 7 | modification, are permitted provided that the following conditions are met: |
universe@1 | 8 | |
universe@1 | 9 | 1. Redistributions of source code must retain the above copyright |
universe@1 | 10 | notice, this list of conditions and the following disclaimer. |
universe@1 | 11 | |
universe@1 | 12 | 2. Redistributions in binary form must reproduce the above copyright |
universe@1 | 13 | notice, this list of conditions and the following disclaimer in the |
universe@1 | 14 | documentation and/or other materials provided with the distribution. |
universe@1 | 15 | |
universe@1 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@1 | 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@1 | 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
universe@1 | 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
universe@1 | 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
universe@1 | 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
universe@1 | 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
universe@1 | 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
universe@1 | 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
universe@1 | 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
universe@1 | 26 | --%> |
universe@10 | 27 | <%@page contentType="text/html" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %> |
universe@10 | 28 | <%@page import="de.uapcore.lightpit.Constants" %> |
universe@10 | 29 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
universe@1 | 30 | <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
universe@10 | 31 | <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> |
universe@1 | 32 | |
universe@10 | 33 | <%-- Define an alias for the main menu --%> |
universe@10 | 34 | <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/> |
universe@1 | 35 | |
universe@11 | 36 | <%-- Define an alias for the module info --%> |
universe@11 | 37 | <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/> |
universe@11 | 38 | |
universe@1 | 39 | <!DOCTYPE html> |
universe@1 | 40 | <html> |
universe@1 | 41 | <head> |
universe@10 | 42 | <base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/"> |
universe@11 | 43 | <title>LightPIT - |
universe@11 | 44 | <fmt:bundle basename="${moduleInfo.bundleBaseName}"> |
universe@11 | 45 | <fmt:message key="${moduleInfo.titleKey}" /> |
universe@11 | 46 | </fmt:bundle> |
universe@11 | 47 | </title> |
universe@1 | 48 | <meta charset="UTF-8"> |
universe@10 | 49 | <link rel="stylesheet" href="lightpit.css" type="text/css"> |
universe@1 | 50 | </head> |
universe@1 | 51 | <body> |
universe@10 | 52 | <div id="mainMenu"> |
universe@11 | 53 | <c:forEach var="menu" items="${mainMenu}"> |
universe@10 | 54 | <div class="menuEntry" |
universe@11 | 55 | <c:if test="${requestScope[Constants.REQ_ATTR_MODULE_CLASSNAME] eq menu.moduleClassName}"> |
universe@10 | 56 | data-active |
universe@10 | 57 | </c:if> |
universe@10 | 58 | > |
universe@11 | 59 | <a href="${menu.pathName}"> |
universe@11 | 60 | <fmt:bundle basename="${menu.resourceKey.bundle}"> |
universe@11 | 61 | <fmt:message key="${menu.resourceKey.key}" /> |
universe@10 | 62 | </fmt:bundle> |
universe@10 | 63 | </a> |
universe@10 | 64 | </div> |
universe@10 | 65 | </c:forEach> |
universe@10 | 66 | |
universe@10 | 67 | </div> |
universe@10 | 68 | <div id="subMenu"> |
universe@10 | 69 | |
universe@10 | 70 | </div> |
universe@10 | 71 | <div id="content-area"> |
universe@11 | 72 | <%-- Resource keys should be rooted in the specific bundle for this module. --%> |
universe@11 | 73 | <fmt:bundle basename="${moduleInfo.bundleBaseName}"> |
universe@11 | 74 | TODO: load fragment |
universe@11 | 75 | </fmt:bundle> |
universe@10 | 76 | </div> |
universe@1 | 77 | </body> |
universe@1 | 78 | </html> |