サポート > Wagby Developer Network > カスタマイズ事例 > インターネット接続ライセンス利用時にレイアウトを変更する
カスタマイズ要件
Wagby が提供する「インターネット接続ライセンス」を 追加することで、不特定多数の利用者による検索サイトを構築することができます。
このとき、インターネット経由の利用者と、内部の利用者で画面レイアウトを変更したいときがあります。 ここでは、その方法を説明します。
サイドバー部を隠す
インターネット経由の利用者アカウントを「internetuser」とします。このアカウントでログオンした場合、サイドバー部を 非表示にするために、env/template/base_classic2.jsp を次のように変更します。
...
<body class="${sessionScope.__jfc_cssfilename}" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="padding: 10; margin: 0; border: 0;" onLoad="Initializer.init();" onUnload="Initializer.fin();">
<%-- Dojo Layout container --%>
<div id="dojolayout" dojoType="dijit.layout.BorderContainer" style="width:100%; height: 100%; padding:0; margin:0; border:0;">
<%-- page top --%>
...
<c:if test="${sessionScope.__jfc_sidebar_mode == true
&& __jfc_user.username != 'internetuser'}">
<%-- side bar --%>
<c:choose>
<c:when test="${sessionScope.__jfc_sidebar_mode == true}">
<div id="sidebararea" class="sidebararea" dojoType="dijit.layout.ContentPane" region="left" style="width: 8em;">
<div dojoType="dijit.layout.AccordionContainer" region="leading" style="height: 80%;" splitter="true">
<tiles:insert attribute="sidebar"/>
</div>
</div>
</c:when>
<c:otherwise>
<div id="sidebararea" dojoType="dijit.layout.ContentPane" region="left" style="width: 0%; visibility: hidden;"></div>
</c:otherwise>
</c:choose>
<%-- side bar --%>
</c:if>
...
JSP ファイル内では、EL 式で示される ${__jfc_user.username} という変数が、ログオンアカウントを表現します。 この値を直接、判定することでサイドバー部の非表示を実現しています。
ログオンユーザ部を隠す
ログオンユーザ部も隠すことができます。env/template/jspc/logonuserinfo.jsp を次のように変更します。
<%@ page pageEncoding="UTF-8"%>
<c:if test="${__jfc_user.username != 'internetuser'}">
<div class="logonuserinfo">
<fmt:setBundle basename="jfcapp"/>
<fmt:message key="__jfc_common.logon.message">
<fmt:param value="${__jfc_user.username}"/>
</fmt:message>
</div>
</c:if>
グローバルリンク部を隠す
グローバルリンク部も隠すことができます。env/template/jspc/globallink.jsp を次のように変更します。
<%@ page pageEncoding="UTF-8"%>
<fmt:setBundle basename="jfcapp"/>
<div class="globallink">
<c:if test="${__jfc_user.username != 'internetuser'}">
<span dojoType="dijit.Tooltip" connectId="mainMenu_msg" style="display:none;"><fmt:message key="__jfc_common.globallink.menu"/></span>
<span dojoType="dijit.Tooltip" connectId="help_msg" style="display:none;"><fmt:message key="__jfc_common.globallink.help"/></span>
<span dojoType="dijit.Tooltip" connectId="logoff_msg" style="display:none;"><fmt:message key="__jfc_common.globallink.logoff"/></span>
<table>
<tr>
<td><span id="mainMenu_msg"><a href= "mainMenu.do"><div class="btnMainMenu"></div></a></span></td>
<td><span id="help_msg"><a href= "help/index.jsp" target="_blank"><div class="btnPopAppHelp"></div></a></span></td>
<td><span id="logoff_msg"><a href= "logoff.do"><div class="btnLogoff"></div></a></span></td>
</tr>
</table>
</c:if>
</div>
