Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\net\sdk\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/topTabBarInclude.jsp" /> <jsp:include page="/sdk/bottomTabBarInclude.jsp" /> <jsp:include page="/net/sdk/relAlertsInclude.jsp" /> <jsp:include page="/net/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"/> <homeuix:bundle name="instanceMsg" class="oracle.sysman.db.rsc.inst.DBMsg"/> <homeuix:bundle name="lsnrMsg" class="oracle.sysman.db.rsc.net.lsnr.ListenerMsg"/> <homeuix:dataScope currentDataBinding="viewModel@servletRequest" > <homeuix:document> <%@ include file="/enablePPR.jspf" %> <%@ include file="/oemTitle.jspf" %> <homeuix:body> <homeuix:pageLayout> <%@ include file="/oemGlobal.jspf" %> <homeoem:messageBox messageTypeBinding = "messageType@servletRequest" msgBundleBinding="ListenerMsg@servletRequest" errorTableBinding="errors@servletRequest" destTableBinding="msgUrls@servletRequest" titleTextKey="titleText" mainTextKey="mainText"/> <homeuix:switcher childNameBinding="siha_msg@servletRequest"> <homeuix:case name="true"> <homeoem:messageBox messageTypeBinding="sihaMessageType@servletRequest" errorTableBinding="sihaMsgBox@servletRequest" destTableBinding="sihaMsgUrls@servletRequest" titleTextKey="titleText" mainTextKey="mainText"/> </homeuix:case> </homeuix:switcher> <homeuix:header textBinding="targetDisplayName"> <homeuix:contents> <homeuix:tableLayout width="100%" > <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="2%" hAlign="right"> <homeuix:spacer height="2"/> </homeuix:cellFormat> <homeuix:cellFormat width="98%" hAlign="left"> <homeuix:spacer height="2"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="2%" hAlign="right"> <homeuix:spacer height="2"/> </homeuix:cellFormat> <homeuix:cellFormat width="98%" hAlign="left"> <homeuix:styledText styleClass="OraInstructionText" textBinding="LISTENER_PROCESS_TIP@lsnrMsg"/> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="2%" hAlign="right"> <homeuix:spacer height="5"/> </homeuix:cellFormat> <homeuix:cellFormat width="98%" hAlign="left"> <homeuix:spacer height="5"/> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:ref refID="topTabBar" /> <homeuix:tableLayout width="100%" > <homeuix:rowLayout hAlign="right"> <homeuix:cellFormat> <homeuix:rowLayout> <homeuix:styledText styleClass="OraTipText" textBinding="PAGE_REFRESHED_TIME@sdkMsg"/> <homeuix:spacer width="4"/> <homeuix:styledText styleClass="OraTipLabel" textBinding="lastUpdateTime"/> <homeuix:spacer width="4"/> <homeuix:image sourceBinding="refreshImage" destinationBinding="refreshLink" shortDesc="Refresh Page"/> </homeuix:rowLayout> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:tableLayout width="100%"> <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" > <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true" hAlign="right"> <homeuix:flowLayout> <homeuix:button textBinding="EDIT@defaultMsgBundle@servletRequest" shortDescBinding="EDIT@defaultMsgBundle@servletRequest" destinationBinding="editDest@viewModel@servletRequest"/> <homeuix:spacer width="5" /> <homeuix:button textBinding="changeStateButtonLabel@viewModel@servletRequest" disabledBinding="isScanListener@viewModel@servletRequest" destinationBinding="stateChangeDest@viewModel@servletRequest"/> <!-- Begin Blackouts Links --> <homeuix:spacer width="5" /> <homeuix:button textBinding="END_BLACKOUT@SDKUIMsgBundle@servletRequest" shortDescBinding="END_BLACKOUT@SDKUIMsgBundle@servletRequest" destinationBinding="blackoutsLinkDest@viewModel@servletRequest" renderedBinding="stopBlackout@viewModel@servletRequest"/> <homeuix:button textBinding="CREATE_BLACKOUT@SDKUIMsgBundle@servletRequest" shortDescBinding="CREATE_BLACKOUT@SDKUIMsgBundle@servletRequest" destinationBinding="blackoutsLinkDest@viewModel@servletRequest" renderedBinding="createBlackout@viewModel@servletRequest"/> <!-- End Blackouts Links --> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <uix:switcher childNameBinding ="showNormal@viewModel@servletRequest" > <uix:case name="false"> <homeuix:rowLayout > <homeuix:tableLayout width="100%"> <homeuix:rowLayout > <homeuix:cellFormat hAlign="right"> <homeuix:styledText textBinding="STATUS@SDKUIMsgBundle@servletRequest" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:styledText styleClass="OraDataText" textBinding="statusString@viewModel@servletRequest" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout > <homeuix:cellFormat hAlign="right"> <homeuix:styledText textBinding="LAST_UPDATED@SDKUIMsgBundle@servletRequest" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:styledText styleClass="OraDataText" textBinding="lastUpdateTime@viewModel@servletRequest" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout > <homeuix:cellFormat hAlign="right"> <homeuix:styledText textBinding="LAST_UNKNOWN_LABEL@defaultMsgBundle@servletRequest" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:link textBinding="LAST_KNOWN_STATE@SDKUIMsgBundle@servletRequest" destinationBinding="lastKnownDest@viewModel@servletRequest" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> </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"); 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"); 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) { %> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right" wrappingDisabled="true" vAlign="top"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="false" vAlign="top"> <homeuix:flowLayout> <homeuix:styledText styleClass="<%=style%>" text="<%=value%>" /> <homeuix:spacer width="5" /> <homeuix:button rendered="<%=buttonVisible%>" text="<%=buttonLabel%>" destination="<%=buttonLink%>" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% } else { %> <homeuix:rowLayout renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right" wrappingDisabled="true" vAlign="top"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat wrappingDisabled="false" vAlign="top"> <homeuix:flowLayout> <homeuix:link text="<%=value%>" destination="<%=link%>" /> <homeuix:spacer width="5" /> <homeuix:button rendered="<%=buttonVisible%>" text="<%=buttonLabel%>" destination="<%=buttonLink%>" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% } } } %> <homeuix:rowLayout renderedBinding="showOracleRestart@viewModel@servletRequest"> <homeuix:cellFormat hAlign="right"> <homeuix:styledText styleClass="OraPromptText" textBinding="ORACLE_RESTART@instanceMsg"/> </homeuix:cellFormat> <homeuix:spacer width="10"/> <homeuix:cellFormat wrappingDisabled="true" hAlign="left"> <homeuix:switcher childNameBinding="sihaRegistered@viewModel@servletRequest" defaultCase="N/A"> <homeuix:case name="N/A"> <homeuix:styledText styleClass="OraPromptText" textBinding="N_A@instanceMsg"/> </homeuix:case> <homeuix:case name="YES"> <homeuix:styledText styleClass="OraPromptText" textBinding="DB_REPORT_ENABLED@instanceMsg"/> </homeuix:case> <homeuix:case name="NO"> <homeuix:link destinationBinding="sihaUrl@viewModel@servletRequest" textBinding="DB_REPORT_DISABLED@instanceMsg" shortDescBinding="ORACLE_RESTART_TIP_LSNR@instanceMsg"/> </homeuix:case> </homeuix:switcher> </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 hAlign="left"> <homeuix:spacer height="20" /> </homeuix:cellFormat> </homeuix:rowLayout> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat hAlign="left"> <homeuix:tip textBinding="LISTENER_DOWN_TIP@lsnrMsg"/> </homeuix:cellFormat> </homeuix:rowLayout> <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="RelatedAlertsTable" /> </homeuix:dataScope> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> </homeuix:stackLayout> </uix:case> </uix:switcher> <!-- policy voilation section --> <uix:include nodeBinding="policyNode@servletRequest"/> <uix:spacer height="20" /> <homeuix:spacer height="15" /> <homeuix:ref refID="bottomTabBar" /> <% java.util.List relatedLinks = (java.util.List)request.getAttribute("relatedLinks"); if (relatedLinks != null && relatedLinks.size() > 0) { int len = relatedLinks.size(); %> <homeuix:tableLayout width="100%" renderedBinding="showNormal@viewModel@servletRequest"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:header textBinding="RELATED_LINKS@sdkMsg"> <homeuix:tableLayout width="100%"> <homeuix:rowLayout width="100%" vAlign="top"> <homeuix:cellFormat width="33%"> <homeuix:stackLayout> <% for (int i = 0; i < len ; i++) { if (i%3 != 0) continue; java.util.Map map = (java.util.Map) relatedLinks.get(i); String name = (String)map.get("name"); String desc = (String)map.get("desc"); String link = (String)map.get("link"); %> <homeuix:link text="<%=name%>" shortDesc="<%=desc%>" destination="<%=link%>" /> <% } // end for %> </homeuix:stackLayout> </homeuix:cellFormat> <homeuix:spacer width="20" /> <homeuix:cellFormat width="33%"> <homeuix:stackLayout> <% for (int i = 0; i < len ; i++) { if (i%3 != 1) continue; java.util.Map map = (java.util.Map) relatedLinks.get(i); String name = (String)map.get("name"); String desc = (String)map.get("desc"); String link = (String)map.get("link"); %> <homeuix:link text="<%=name%>" shortDesc="<%=desc%>" destination="<%=link%>" /> <% } // end for %> </homeuix:stackLayout> </homeuix:cellFormat> <homeuix:spacer width="20" /> <homeuix:cellFormat width="33%"> <homeuix:stackLayout> <% for (int i = 0; i < len; i++) { if (i%3 != 2) continue; java.util.Map map = (java.util.Map) relatedLinks.get(i); String name = (String)map.get("name"); String desc = (String)map.get("desc"); String link = (String)map.get("link"); %> <homeuix:link text="<%=name%>" shortDesc="<%=desc%>" destination="<%=link%>" /> <% } // end for %> </homeuix:stackLayout> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> </homeuix:header> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <% } // end if(relatedLinks != null) %> </homeuix:contents> </homeuix:header> </homeuix:pageLayout> </homeuix:body> </homeuix:document> </homeuix:dataScope> </homeuix:renderingContext>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de