Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\sdk\groupHomeTemplate.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/groupHomeTemplate.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="/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="mntrResourceBundle" class="oracle.sysman.resources.MntrResourceBundle"/> <homeuix:dataScope currentDataBinding="viewModel@servletRequest" > <homeuix:document> <%@ include file="/enablePPR.jspf" %> <%@ include file="/oemTitle.jspf" %> <homeuix:metaContainer> <homeuix:head titleBinding="targetDisplayName" /> </homeuix:metaContainer> <homeuix:body> <homeuix:pageLayout> <%@ include file="/oemGlobal.jspf" %> <%-- <homeuix:form name="groupHomeForm" method="POST" destinationBinding="samePageURL@viewModel@servletRequest"> --%> <homeuix:header textBinding="targetDisplayName" > <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" shortDescBinding="REFRESH@sdkMsg"/> <homeuix:button rendered="false" textBinding="EDIT_GROUP_DEFINITION@sdkMsg" destinationBinding="editGroupLink" /> </homeuix:rowLayout> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:contents> <homeuix:ref refID="topTabBar" /> <homeuix:tableLayout width="100%" cellSpacing="10"> <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" > <%-- 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 image = (String)map.get("image"); String link = (String)map.get("link"); Boolean buttonVisible = (Boolean)map.get("buttonVisible"); String buttonLabel = (String)map.get("buttonLabel"); String buttonLink = (String)map.get("buttonLink"); if (link == null) { %> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat hAlign="center"> <homeuix:image source="<%=image%>" /> </homeuix:cellFormat> <homeuix:spacer width="5"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:flowLayout> <homeuix:styledText styleClass="OraDataText" text="<%=value%>" /> <homeuix:spacer width="5" /> <homeuix:button rendered="<%=buttonVisible%>" text="<%=buttonLabel%>" destination="<%=buttonLink%>" /> </homeuix:flowLayout> </homeuix:cellFormat> </homeuix:rowLayout> <% } else { %> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right"> <homeuix:styledText text="<%=name%>" styleClass="OraPromptText"/> </homeuix:cellFormat> <homeuix:spacer width="8"/> <homeuix:cellFormat hAlign="center"> <homeuix:image source="<%=image%>" shortDesc="<%=name%>"/> </homeuix:cellFormat> <homeuix:spacer width="5"/> <homeuix:cellFormat wrappingDisabled="true"> <homeuix:link text="<%=value%>" destination="<%=link%>" /> </homeuix:cellFormat> </homeuix:rowLayout> <% } } } %> </homeuix:tableLayout> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> </homeuix:borderLayout> </homeuix:header> </homeuix:cellFormat> <homeuix:cellFormat width="50%"> <homeuix:ref refID="homePlugin" /> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:tableLayout width="50%" cellSpacing="10"> <homeuix:rowLayout> <homeuix:cellFormat vAlign="top" width="50%" > <homeuix:header textBinding="ADVICE@mntrResourceBundle"> <homeuix:rowLayout> <homeuix:cellFormat hAlign="right" vAlign="top" wrappingDisabled="true"> <homeuix:contents> <homeuix:styledText styleClass="OraPromptText" textBinding="POLICY_VIOLATIONS@mntrResourceBundle"/> </homeuix:contents> </homeuix:cellFormat> <homeuix:spacer width="10"/> <homeuix:cellFormat> <homeuix:link textBinding="violationCount@servletRequest" destinationBinding="violationLink@servletRequest"/> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:header> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <homeuix:tableLayout width="100%" cellSpacing="10"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:dataScope currentDataBinding="homePageMainTargetAlerts@servletRequest"> <homeuix:ref refID="AlertsTable" /> </homeuix:dataScope> </homeuix:cellFormat> </homeuix:rowLayout> </homeuix:tableLayout> <% java.util.List relatedLinks = (java.util.List)request.getAttribute("relatedLinks"); if (relatedLinks != null) { int len = relatedLinks.size(); %> <homeuix:tableLayout width="100%" cellSpacing="10"> <homeuix:rowLayout vAlign="top"> <homeuix:cellFormat width="100%"> <homeuix:header textBinding="RELATED_LINKS@sdkMsg" > <homeuix:tableLayout> <homeuix:rowLayout vAlign="top" width="100%"> <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:spacer height="10" /> <homeuix:ref refID="bottomTabBar" /> </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