jford 2004/10/11 14:56:05 Modified: applications/pam/src/webapp/WEB-INF/view pam-browser.jsp Log: Fixed diffs Revision Changes Path 1.9 +108 -1 jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view/pam-browser.jsp Index: pam-browser.jsp =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view/pam-browser.jsp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- pam-browser.jsp 11 Oct 2004 21:51:37 -0000 1.8 +++ pam-browser.jsp 11 Oct 2004 21:56:05 -0000 1.9 @@ -1 +1,108 @@ -<%-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ page language="java" import="javax.portlet.*, java.util.List, java.util.Iterator, org.apache.jetspeed.om.common.portlet.MutablePortletApplication" session="true" %> <%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/pam.tld" prefix="pam" %>
<%@ page import="java.util.Collection" %> <%@ page import ="java.util.Map" %> <%@ page import="org.apache.jetspeed.search.ParsedObject" %> <portlet:defineObjects/> <h2>Portlet Application Manager</h2> <h3>Application Tree View</h3> <hr /> <portlet:actionURL var="searchLink" /> <portlet:actionURL var="searchSelectLink"/> <form action="<c:out value="${searchLink}"/>" method="post"> <input type="text" name="query" value="" /> <input type="submit" value="Search"/> </form> <c:set var="results" value="${requestScope.search_results}" /> <c:if test="${results != null}"> <c:forEach var="result" items="${search_results}"> <% String name = ""; ParsedObject po = (ParsedObject)pageContext.findAttribute("result"); Map fields = po.getFields(); if(fields != null) { Object id = fields.get("ID"); if(id != null) { if(id instanceof Collection) { out.write("IT's A CoLLCTION"); Collection coll = (Collection)id; name = (String) coll.iterator().next(); } else { name = (String)id; } } if(po.getType().equals("portlet")) { Object pa = fields.get("portlet_application"); String paName = ""; if(pa != null) { if(id instanceof Collection) { out.write("IT's A CoLLCTION"); Collection coll = (Collection)pa; paName = (String) coll.iterator().next(); } else { paName = (String)pa; } } name = paName + "::" + name; } } %> <a href="<c:out value="${searchSelectLink}"/>?select_node=<%=name%>"><c:out value="${result.title}"/></a> <br /> <%-- | <c:out value="${result.description}"/> <br /> --%> </c:forEach> </c:if> <hr /> <portlet:actionURL var="nodeLink" > <portlet:param name="node" value="${name}" /> </portlet:actionURL> <pam:tree tree="j2_tree" images="/pam/images" scope="portlet_request" action="<%= nodeLink %>" /> <%-- style="tree-control" styleSelected="tree-control-selected" styleUnselected="tree-control-unselected" --%> \ No newline at end of file +<%-- +Copyright 2004 The Apache Software Foundation +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--%> +<%@ page language="java" import="javax.portlet.*, java.util.List, java.util.Iterator, org.apache.jetspeed.om.common.portlet.MutablePortletApplication" session="true" %> +<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pam.tld" prefix="pam" %> + +<%@ page import="java.util.Collection" %> +<%@ page import ="java.util.Map" %> +<%@ page import="org.apache.jetspeed.search.ParsedObject" %> + +<portlet:defineObjects/> +<h2>Portlet Application Manager</h2> +<h3>Application Tree View</h3> + +<hr /> + +<portlet:actionURL var="searchLink" /> +<portlet:actionURL var="searchSelectLink"/> + +<form action="<c:out value="${searchLink}"/>" method="post"> + + <input type="text" name="query" value="" /> <input type="submit" value="Search"/> + +</form> + +<c:set var="results" value="${requestScope.search_results}" /> + +<c:if test="${results != null}"> + <c:forEach var="result" items="${search_results}"> + + <% + String name = ""; + ParsedObject po = (ParsedObject)pageContext.findAttribute("result"); + Map fields = po.getFields(); + if(fields != null) + { + Object id = fields.get("ID"); + + if(id != null) + { + if(id instanceof Collection) + { + out.write("IT's A CoLLCTION"); + Collection coll = (Collection)id; + name = (String) coll.iterator().next(); + } + else + { + name = (String)id; + } + } + + if(po.getType().equals("portlet")) + { + Object pa = fields.get("portlet_application"); + String paName = ""; + if(pa != null) + { + if(id instanceof Collection) + { + out.write("IT's A CoLLCTION"); + Collection coll = (Collection)pa; + paName = (String) coll.iterator().next(); + } + else + { + paName = (String)pa; + } + } + name = paName + "::" + name; + } + } + %> + + <a href="<c:out value="${searchSelectLink}"/>?select_node=<%=name%>"><c:out value="${result.title}"/></a> <br /> + <%-- | <c:out value="${result.description}"/> <br /> --%> + </c:forEach> +</c:if> + +<hr /> + + + +<portlet:actionURL var="nodeLink" > + <portlet:param name="node" value="${name}" /> +</portlet:actionURL> + +<pam:tree tree="j2_tree" images="/pam/images" scope="portlet_request" + action="<%= nodeLink %>" + /> + + <%-- + style="tree-control" + styleSelected="tree-control-selected" + styleUnselected="tree-control-unselected" + --%> + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]