Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows |
Drag-and-drop support was not available before V6.0, so you cannot access this functionality in migrated skins from V5.0.2.2 or V5.0.2.3 unless you explicitly enable it.
Use the following steps to enable drag-and-drop in your migrated skins<%@ taglib uri="/WEB-INF/tld/dnd.tld" prefix="dnd" %> <dnd:DNDPortletHelper/> <%! private static com.ibm.portal.identification.Identification identification; public void jspInit(){ try{ /* Perform this JNDI lookup once as it hinders performance */ javax.naming.Context ctx = new javax.naming.InitialContext(); identification = (com.ibm.portal.identification.Identification) ctx.lookup( "portal:service/Identification" ); } catch ( javax.naming.NamingException ne ){ // nothing is logged here because if Portal ever enters // this catch statement then severe problems have // occurred and will have already been logged by // errors reported by the lookup. } } %>
<%-- Modification for Drag and Drop - need to pass the portlet control ID - Cannot use the tag because it is 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()); } %> <dnd:drag namespace="wp" type="portlet_windowID" value="<%=currentLayoutNodeStr%>" includeDragHandle="false" validator="com.ibm.wps.dnd.impl.DNDDragPortletValidator"> ....... BEGIN SKIN MARKUP ....... ....... BEGIN TITLE BAR ....... <dnd:dragHandle>TITLE BAR CONTENT</dnd:dragHandle>TITLEBAR BUTTONS ....... END TITLE BAR ....... ....... PORTLET RENDER ....... ....... END SKIN MARKUP ....... </dnd:drag>