Control.jsp
<%-- Licensed Materials - Property of IBM, 5724-E76, (C) Copyright IBM Corp. 2001, 2004, 2006 - All Rights reserved.--%> <%@ page session="false" buffer="none" %> <%@ page import="com.ibm.portal.content.LayoutNode" %> <%@ page import="java.lang.StringBuffer" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-navigation" prefix="portal-navigation" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-skin" prefix="portal-skin" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-showtools" prefix="portal-showtools" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-dynamicui" prefix="portal-dynamicui" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-logic" prefix="portal-logic" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-core" prefix="portal-core" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-fmt" prefix="portal-fmt" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %> <%@ taglib uri="/WEB-INF/tld/portal-internal.tld" prefix="portal-internal" %> <%@ taglib uri="/WEB-INF/tld/dnd.tld" prefix="dnd" %> <%@ include file="./BidiInclude.jspf"%> <%-- this id and boolean are used to determine if javascript is available --%> <portal-logic:urlFindInTheme file="js/AsynchronousContextMenu.js" id="asynchJSURL" /> <% boolean isJSAvail=(asynchJSURL == null ? false: true);%> <dnd:DNDPortletHelper/> <portal-skin:portletID var="myPortletID"/> <jsp:useBean id="myPortletID" class="java.lang.String" scope="page"/> <%! private static com.ibm.portal.identification.Identification identification; public void jspInit(){ try{ /* only perform this JNDI lookup once as this is an expensive call performance wise */ javax.naming.Context ctx=new javax.naming.InitialContext(); identification=(com.ibm.portal.identification.Identification) ctx.lookup("portal:service/Identification"); } catch (javax.naming.NamingException ne){ } } %> <%-- Modification for Drag and Drop we need to pass the portlet control ID. we can't use the tag because its an attribute --%> <% String currentLayoutNodeStr=""; if (pageContext.getAttribute("currentLayoutNode", pageContext.REQUEST_SCOPE) != null) { LayoutNode currLayoutNode=(LayoutNode)pageContext.getAttribute("currentLayoutNode", pageContext.REQUEST_SCOPE); currentLayoutNodeStr=identification.serialize(currLayoutNode.getObjectID()); } else { LayoutNode currLayoutNode=(LayoutNode)pageContext.getRequest().getAttribute("com.ibm.wps.composition.element"); currentLayoutNodeStr=identification.serialize(currLayoutNode.getObjectID()); } %> <%if(isJSAvail){%> <script type="text/javascript">var menuNoActionsText_<%= myPortletID%>="<portal-fmt:text bundle='nls.engine' key='info.emptymenu' />"; var menuPortletURL_<%= myPortletID %>='<portal-navigation:url theme="portletContextMenu" > <portal-navigation:urlParam name="windowID" value="<%=currentLayoutNodeStr%>" /> </portal-navigation:url>'; </script> <%}%> <portal-core:constants/> <c-rt:if test="${themePolicy.renderPortletFragmentIDAnchor}" > <a name="<%= myPortletID %>"> </a> </c-rt:if> <% String tableWidth=""; %> <%-- This is to make sure you take up the whole space available when maximized --%> <portal-logic:if portletState="Maximized"> <% tableWidth="width: 100%;";%> </portal-logic:if> <dnd:drag namespace="wp" type="portlet_windowID" value="<%=currentLayoutNodeStr%>" includeDragHandle="false" validator="com.ibm.wps.dnd.impl.DNDDragPortletValidator"> <div class="wpsPortlet" id="mouseoverTable_<%= myPortletID %>" <%if(isJSAvail){%> <portal-logic:unless portletMode='help'>onmouseover="menuMouseOver('<%= myPortletID %>', '<portal-logic:urlFindInTheme file='images/topNav/menu_selected.gif' />')" onmouseout="menuMouseOut('<%= myPortletID %>', '<portal-logic:urlFindInTheme file='images/topNav/menu_selected_disabled.gif' />')"</portal-logic:unless> <%}%> > <table class="wpsPortletTitleBar" cellpadding="0" cellspacing="0" style="<%=tableWidth%>"> <tbody> <tr> <td align="<%= bidiAlignLeft %>" > <dnd:dragHandle> <div style="width:100%;"> <%-- check for portletTitle tag--%> <portal-skin:portletTitle> <portal-fmt:problem bundle="nls.problem"/> </portal-skin:portletTitle> <img alt="" style="border:0; text-align: <%= bidiAlignRight %>;" width="1" height="22" src='<portal-logic:urlFindInSkin file="title_minheight.gif"/>'> </div> </dnd:dragHandle> </td> <td class="wpsPortletIcons"> <%-- Do not include 'Skip to next portlet' link in standalone window or solo mode --%> <%if(isJSAvail){%> <portal-logic:unless portletMode="help"> <portal-logic:if portletSolo="no" newWindow="false"> <a href="#skipportlet<%= myPortletID %>" onfocus="menuMouseOver('<%= myPortletID %>', '<portal-logic:urlFindInTheme file='images/topNav/menu_selected.gif' />');" > <img style="border: 0;" align="absmiddle" src='<%=wpsBaseURL%>/images/icons/ClearPixel.gif' alt="<portal-fmt:text key='link.skiptonextportlet' bundle='nls.engine'/>" title="<portal-fmt:text key='link.skiptonextportlet' bundle='nls.engine'/>"> </a> </portal-logic:if> <a id='menu_<%= myPortletID %>' href='javascript:void(0);' onkeypress="javascript:accessibleShowMenu(event, '<%= myPortletID %>', menuNoActionsText_<%= myPortletID %>, <%=isRTL%>, menuPortletURL_<%= myPortletID %>,'<portal-logic:urlFindInTheme file="images/context_loading.gif" />');" onclick="javascript:showPortletMenu('<%= myPortletID %>' , menuNoActionsText_<%= myPortletID %>, <%=isRTL%>, menuPortletURL_<%= myPortletID %> , '<portal-logic:urlFindInTheme file='images/topNav/menu_selected_disabled.gif' />','<portal-logic:urlFindInTheme file="images/context_loading.gif" />'); return false;" > <img id="menu_<%= myPortletID %>_img" src='<portal-logic:urlFindInTheme file="images/topNav/menu_selected_disabled.gif" />' alt="<portal-fmt:text bundle='nls.titlebar' key='portlet.actions' />" title="<portal-fmt:text bundle='nls.titlebar' key='portlet.actions' />" style="border: 0px; background-color: transparent;" /> </a> <script type="text/javascript">javascriptEventController.register("menu_<%= myPortletID %>"); javascriptEventController.register("mouseoverTable_<%= myPortletID %>", null); </script> </portal-logic:unless> <%}%> </td> </tr> </tbody> </table> <portal-logic:if portletState="Normal,Maximized,Solo"> <div class="wpsPortletBody"> <portal-skin:portletRender> <font color="red"> <portal-fmt:problem bundle="nls.problem"/> </font> </portal-skin:portletRender> </div> </portal-logic:if> <div class="clearing"> </div> </div> </dnd:drag> <a name="skipportlet<%= myPortletID %>"></a>