Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\net\sdk\em2go\homeTemplate.jspf
<%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="homeuix" %> <%@ taglib uri="http://xmlns.oracle.com/oem/jsp/tag" prefix="homeoem" %> <%-- To use the page, the component needs to follow a few simple steps: 1. write a home page jsp like that below. This is basically an include of the generic home page, plus building a tree for the top right plugin 2. add a view model for this home page to the controller, the view model should extend oracle.sysman.emSDK.tgt.home.HomePageHandler. The HomePageHandler provides the databindings for the generic home page. The extended home view model should also add databindings for the top right plugin if needed. 3. add code to query target-specific data from the repository by implementing public void prepareTargetData(PageInfo pageInfo, OracleConnection connection) 4. implement data binding methods for any target specific data, e.g. in home.jsp <... textBinding="myAttr" /> in home.java public String getMyAttr() { return m_myAttr; } 5. specify the sub tabs to use in the page by overridding getSubTabs public SubTabs getSubTabs(PageInfo pageInfo) { SubTabs subTabs = new SubTabs(); subTabs.addHomeTab(pageInfo); // required! subTabs.addSubTab(tabName, tabDest); return subTabs; } 6. add any additional metrics to the metric list by overriding getGeneralMetrics public GeneralMetrics getGeneralMetrics(PageInfo pageInfo) { GeneralMetrics metrics = new GeneralMetrics(); metrics.addGerneralMetrics(metricLabel, metricValue, metricDest); return metrics; } 7. add any related links by overriding getRelatedLinks 8. add any related targets by overridding getRelatedTargets sample home page template: ----------------------------------- <%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="uix" %> <%@ taglib uri="http://xmlns.oracle.com/oem/jsp/tag" prefix="oem" %> <homeuix:buildTree nodeID="homePlugin"> <homeuix:flowLayout> <homeuix:text textBinding="image@viewModel@servletRequest" /> </homeuix:flowLayout> </homeuix:buildTree> <%@include file="/sdk/homeTemplate.jsp" %> ----------------------------------- Note: this is a macro include so the user doesn't have to ref this tree. --%> <jsp:include page="/sdk/alertsInclude.jsp" /> <%@ page import='java.util.Map' %> <%@ page import='java.util.List' %> <%@ page import='java.util.Iterator' %> <homeuix:renderingContext id="renderingContext"><homeoem:setURLEncoder id="renderingContext"/> <homeuix:bundle name="sdkMsg" class="oracle.sysman.emSDK.eml.SDKUIMsg"/> <%@ include file="/em2go/em2goHrGlobal.jspf" %> <homeuix:dataScope currentDataBinding="viewModel@servletRequest" > <homeuix:document> <%@ include file="/enablePPR.jspf" %> <homeuix:body> <!-- homeuix:pageLayout --> <%@ include file="/em2go/em2goBreadCrumbs.jspf" %> <homeoem:messageBox messageTypeBinding = "messageType@servletRequest" msgBundleBinding="ListenerMsg@servletRequest" errorTableBinding="errors@servletRequest" destTableBinding="msgUrls@servletRequest" titleTextKey="titleText" mainTextKey="mainText"/> <homeuix:header textBinding="targetDisplayName"> <homeuix:contents> <homeuix:tableLayout width="75%"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="50%"> <homeuix:header textBinding="GENERAL@sdkMsg"> <homeuix:borderLayout> <homeuix:tableLayout width="100%" hAlign="left" > <homeuix:rowLayout> <homeuix:cellFormat vAlign="top" hAlign="left" > <homeuix:tableLayout hAlign="left" > <uix:switcher childNameBinding ="showNormal@viewModel@servletRequest" > <uix:case name="false"> <homeuix:rowLayout > <homeuix:tableLayout width="100%"> </homeuix:tableLayout> </homeuix:rowLayout> </uix:case> </uix:switcher> <%-- unfortunately, the only way to do iterate over a list is to either use a JSTL tag, create a custom tag, or use this code. If it will be a while before we start using JSTL, we should put this in a custom iterator --%> <% java.util.List metricsList = (java.util.List)request.getAttribute("generalMetrics"); int itemCount = metricsList.size(); if (metricsList != null) { for (java.util.Iterator i=metricsList.iterator(); i.hasNext(); ) { java.util.Map map = (Map)i.next(); String name = (String)map.get("name"); if("Alias".equals(name)|| "Version".equals(name)|| "Oracle Home".equals(name)|| "TNS Address".equals(name)|| "".equals(name)|| "LISTENER.ORA Location".equals(name)|| "Host".equals(name)|| "Start Time".equals(name) ){ continue; } String value = (String)map.get("value"); String link = (String)map.get("link"); String style = (String)map.get("style"); Boolean buttonVisible = (Boolean)map.get("buttonVisible"); String buttonLabel = (String)map.get("buttonLabel"); String buttonLink = (String)map.get("buttonLink"); if (link == null) { %> <% if("Status".equals(name)){ %> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> <homeuix:button textBinding="CHANGE_STATE@ListenerBundle@servletRequest" destinationBinding="stateChangeDest@viewModel@servletRequest"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:styledText styleClass="OraPromptText" text="<%=value%>" /> <homeuix:spacer width="5" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% }else{ %> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:styledText styleClass="OraPromptText" text="<%=value%>" /> <homeuix:spacer width="5" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% }//else of if("Status".equals(name)) } else { %> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:link text="<%=value%>" destination="<%=link%>" /> <homeuix:spacer width="5" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% } } } %> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText styleClass="OraPromptText" textBinding="LSN_TNS_PING_MS@ListenerBundle@servletRequest"/> </homeuix:cellFormat> <homeuix:cellFormat> <spacer width="8"/> <homeuix:image sourceBinding="tnsPingSevIcon@defaultBean@servletRequest" destinationBinding="tnsPingDest@defaultBean@servletRequest"/> </homeuix:cellFormat> <homeuix:cellFormat> <homeuix:link textBinding="tnsPing@defaultBean@servletRequest" destinationBinding="tnsPingDest@defaultBean@servletRequest"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText styleClass="OraPromptText" textBinding="LSN_EST_CONN_MIN@ListenerBundle@servletRequest"/> </homeuix:cellFormat> <spacer width="8"/> <homeuix:cellFormat> </homeuix:cellFormat> <homeuix:cellFormat> <homeuix:link textBinding="estConns@defaultBean@servletRequest" destinationBinding="estConnsDest@defaultBean@servletRequest"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText styleClass="OraPromptText" textBinding="LSN_REFUSE_CONN_MIN@ListenerBundle@servletRequest"/> </homeuix:cellFormat> <spacer width="8"/> <homeuix:cellFormat> </homeuix:cellFormat> <homeuix:cellFormat> <homeuix:link textBinding="refConns@defaultBean@servletRequest" destinationBinding="refConnsDest@defaultBean@servletRequest"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> <% SubTabs subTabs = (SubTabs)request.getAttribute("subTabs"); List subTabList = subTabs.getSubTabs(); if (subTabList != null) { for (Iterator i=subTabList.iterator(); i.hasNext(); ) { Map map = (Map)i.next(); String name = (String)map.get("name"); String link = (String)map.get("link"); %> <homeuix:link text="<%=name%>" destination="<%=link%>"/> <% } } %> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:left> <homeuix:image sourceBinding="statusImage"/> </homeuix:left> </homeuix:borderLayout> </homeuix:header> </homeuix:cellFormat> <homeuix:cellFormat width="50%"> <homeuix:ref refID="homePlugin" /> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <% java.lang.Object otherPlugin = request.getAttribute("homeOtherPlugin"); if (otherPlugin != null) { %> <homeuix:tableLayout width="100%" renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:ref refID="homeOtherPlugin" /> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <% } %> <uix:switcher childNameBinding ="showNormal@viewModel@servletRequest" > <uix:case name="true"> <homeuix:stackLayout> <homeuix:tableLayout width="100%" renderedBinding="showAlertsSection@netHomePageMainTargetAlerts@servletRequest"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:dataScope currentDataBinding="netHomePageMainTargetAlerts@servletRequest"> <homeuix:ref refID="AlertsTable" /> </homeuix:dataScope> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:tableLayout width="100%" renderedBinding="showAlertsSection@netHomePageRelatedAlerts@servletRequest"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:dataScope currentDataBinding="netHomePageRelatedAlerts@servletRequest"> <homeuix:ref refID="AlertsTable" /> </homeuix:dataScope> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> </homeuix:stackLayout> </uix:case> </uix:switcher> <homeuix:spacer height="10"/> </homeuix:contents> </homeuix:header> <!-- /homeuix:pageLayout--> </homeuix:body> </homeuix:document> </homeuix:dataScope> <%@ include file="/em2go/em2goThinFooter.jspf" %> </homeuix:renderingContext>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de