pageContextMenu.jsp
<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"/> <%-- Licensed Materials - Property of IBM, 5724-E76, (C) Copyright IBM Corp. 2001, 2004, 2006 - All Rights reserved. NOTE: See notes in Default.jsp for information regarding editing theme JSP fragments. --%> <%@ page session="false"%> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-fmt" prefix="portal-fmt" %> <%@ 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-navigation" prefix="portal-navigation" %> <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-theme-ext" prefix="portal-theme-ext" %> <%@ taglib uri="/WEB-INF/tld/portal-internal.tld" prefix="portal-internal" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %> <%@ page import="com.ibm.portal.content.ContentNodeType"%> <%! private static com.ibm.portal.model.NavigationSelectionModelHome navigationSelectionModelHome; private static com.ibm.portal.model.ContentMetaDataModelHome cmdmHome; 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(); navigationSelectionModelHome=(com.ibm.portal.model.NavigationSelectionModelHome) ctx.lookup("portal:service/model/NavigationSelectionModel"); cmdmHome=(com.ibm.portal.model.ContentMetaDataModelHome) ctx.lookup("portal:service/model/ContentMetaDataModel"); } catch (javax.naming.NamingException ne) { } } protected Object getMetaData(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws com.ibm.portal.ModelException { com.ibm.portal.model.NavigationSelectionModelProvider nsmProvider=navigationSelectionModelHome.getNavigationSelectionModelProvider(); com.ibm.portal.navigation.NavigationSelectionModel nsm=nsmProvider.getNavigationSelectionModel(request, response); com.ibm.portal.model.ContentMetaDataModelProvider cmdmProvider=cmdmHome.getContentMetaDataModelProvider(); com.ibm.portal.content.ContentMetaDataModel cmdm=cmdmProvider.getContentMetaDataModel(request, response); Object cn=nsm.getSelectedNode(); com.ibm.portal.MetaData md=cmdm.getMetaData(cn); Object metaDataValue=md.getValue("com.ibm.portal.applicationGuid"); return metaDataValue; } %> <portal-theme-ext:initthemepolicy /><jsp:useBean id="themePolicy" class="com.ibm.portal.theme.policy.ThemePolicyBean" scope="page"/><% themePolicy.setValuesMap(portalThemePolicyMap); %> <html><body><script type="text/javascript">function getMenuContents() { var contents=new Array(); i=0; <portal-logic:if loggedIn="yes"><%-- Edit Application Properties --%> <portal-internal:adminlinkinfo name="APP_PROPERTIES"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="EditApplicationProperties" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><c:set var="extensionTitle"><portal-fmt:text key="link.app.properties" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Edit Application Layout --%> <portal-internal:adminlinkinfo name="APP_LAYOUT"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="EditApplicationLayout" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><c:set var="title"><portal-fmt:text key="link.app.layout" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Assign Application Members --%> <portal-internal:adminlinkinfo name="APP_MEMBERSHIP"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="AssignApplicationMember" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><c:set var="title"><portal-fmt:text key="link.app.members" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Manage Application Roles --%> <portal-internal:adminlinkinfo name="APP_ROLES"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="ManageApplicationRoles" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><c:set var="title"><portal-fmt:text key="link.app.roles" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Edit Workflow Layout --%> <portal-internal:adminlinkinfo name="APP_WORKFLOW"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="EditApplicationWorkflow" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" type="render" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" type="render" /><portal-navigation:urlParam name="btype" value="app" type="render" /><c:set var="title"><portal-fmt:text key="link.app.workflow" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Show Policy Status --%> <portal-internal:adminlinkinfo name="APP_POLICY_STATUS"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Solo" accessControlCheck="ShowApplicationStatusPolicy" themeTemplate=""><portal-navigation:urlParam name="cdoguid" value="<%= value %>" type="render" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" type="render" /><c:set var="title"><portal-fmt:text key="link.app.policy" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- Save As Template--%> <portal-internal:adminlinkinfo name="APP_PROPERTIES"><portal-navigation:navigation><% Object metaDataValue=getMetaData(request, response); if (metaDataValue != null) { String value=metaDataValue.toString(); %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%=wpsCompositionNode%>' portletWindowState="Normal" accessControlCheck="SaveAsTemplate" themeTemplate=""><portal-navigation:urlParam name="act" value="exp"/><portal-navigation:urlParam name="cdoguid" value="<%= value %>" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><c:set var="title"><portal-fmt:text key="link.app.save" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${title}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><%}%> </portal-navigation:navigation></portal-internal:adminlinkinfo><%-- New page --%> <portal-internal:adminlinkinfo name="PROPERTIES_PORTLET"><portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%= wpsCompositionNode %>' portletWindowState="Solo" accessControlCheck="CreatePage" themeTemplate=""><portal-navigation:urlParam name="init" value="init" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><portal-navigation:urlParam name="WCN" value="<%= wpsContentNodeID %>"/><portal-navigation:urlParam name="PAT" value="PTQ" /><portal-navigation:urlParam name="PNT" value="PNTC" /><portal-navigation:urlParam name="psh" value="push" /><c:set var="extensionTitle"><portal-fmt:text key="link.createpage" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration></portal-internal:adminlinkinfo><%-- Edit page --%> <portal-internal:adminlinkinfo name="CONTENT_LAYOUT"><% if (((ContentNodeType.COMPOSITION).toString()).equals(wpsContentNodeTypeString) || ((ContentNodeType.STATICPAGE).toString()).equals(wpsContentNodeTypeString)) { %> <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" portletWindowState="Normal" accessControlCheck="EditLayout" themeTemplate=""><portal-navigation:urlParam name="init" value="init" /><portal-navigation:urlParam name="WCN" value="<%= wpsContentNodeID %>"/><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><portal-navigation:urlParam name="WNN" value="<%= wpsNavigationNodeID %>" /><portal-navigation:urlParam name="psh" value="push" /><c:set var="extensionTitle"><portal-fmt:text key="link.editlayout" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration><% } %> </portal-internal:adminlinkinfo><%-- Properties --%> <portal-internal:adminlinkinfo name="PROPERTIES_PORTLET"><portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%= wpsCompositionNode %>' portletWindowState="Solo" accessControlCheck="EditPageProperties" themeTemplate=""><portal-navigation:urlParam name="init" value="init" /><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><portal-navigation:urlParam name="WCN" value="<%= wpsContentNodeID %>"/><portal-navigation:urlParam name="PAT" value="PTQE" /><portal-navigation:urlParam name="PAT" value="PTE" /><% if (((ContentNodeType.PAGE).toString()).equals(wpsContentNodeTypeString) || ((ContentNodeType.STATICPAGE).toString()).equals(wpsContentNodeTypeString)) { %> <portal-navigation:urlParam name="PNT" value="PNTC" /><% } else{ %> <portal-navigation:urlParam name="PNT" value="PNTL" /><% } %> <portal-navigation:urlParam name="psh" value="push" /><c:set var="extensionTitle"><portal-fmt:text key="link.editproperties" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration></portal-internal:adminlinkinfo><%-- Assign permissions --%> <portal-internal:adminlinkinfo name="ASSIGN_ROLES"><portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" layoutNode='<%= wpsCompositionNode %>' portletWindowState="Solo" accessControlCheck="AssignRoles" themeTemplate=""><portal-navigation:urlParam name="init" value="init" /><portal-navigation:urlParam name="WCN" value="<%= wpsContentNodeID %>"/><portal-navigation:urlParam name="OCN" value="<%= wpsContentNodeID %>" /><portal-navigation:urlParam name="psh" value="push" /><c:set var="extensionTitle"><portal-fmt:text key="link.assign.permissions" bundle="nls.engine"/></c:set>contents[i]="asynchDoFormSubmit('<% wpsURL.write(out); %>');"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-navigation:urlGeneration></portal-internal:adminlinkinfo></portal-logic:if><%-- Delete page --%> <portal-logic:if pageDeletable="true" ><c:set var="extensionTitle"><portal-fmt:text key="link.deletepage" bundle="nls.engine" /></c:set><c:set var="confirmMsg"><portal-fmt:text key="link.deletepage.confirm" bundle="nls.engine" /></c:set>contents[i]="if (confirm('<c-rt:out value="${confirmMsg}" escapeXml="true" />')) { asynchDoFormSubmit('<portal-navigation:url command="DeletePage" themeTemplate="" />'); }"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]=''; i=i+1; </portal-logic:if><c-rt:if test="${themePolicy.renderExtensions}" ><portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.PageContextMenuItems" ><portal-theme-ext:themeExtensionLoop><c:set var="extensionTitle"><portal-fmt:title varname="<%=(com.ibm.portal.theme.plugin.ThemeItem) themeExtension%>" /></c:set>contents[i]="document.location='<portal-theme-ext:themeExtensionItemUrl />';"; i=i+1; contents[i]='<c-rt:out value="${extensionTitle}" escapeXml="true" />'; i=i+1; contents[i]='' i=i+1; </portal-theme-ext:themeExtensionLoop></portal-theme-ext:themeExtension></c-rt:if>return contents; } </script></body></html>