%@ 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" %>
<%@include file="/sdk/groupHomeTemplate.jsp" %>
-----------------------------------
Note: this is a macro include so the user doesn't have to ref this tree.
--%>
<%@ page import='java.util.Map' %>
<%@ page import='java.util.List' %>
<%@ page import='java.util.Iterator' %>
<%@ include file="/enablePPR.jspf" %>
<%@ include file="/oemTitle.jspf" %>
<%@ include file="/oemGlobal.jspf" %>
<%-- --%>
<%--
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)
{
%>
<%
}
else
{
%>
<%
}
}
}
%>
<%
java.util.List relatedLinks = (java.util.List)request.getAttribute("relatedLinks");
if (relatedLinks != null)
{
int len = relatedLinks.size();
%>
<% 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");
%>
<% } // end for %>
<% 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");
%>
<% } // end for %>
<% 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");
%>
<% } // end for %>
<%
} // end if(relatedLinks != null)
%>