You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/10/14 02:23:15 UTC

cvs commit: jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view prototype.jsp profiler-admin.jsp

taylor      2004/10/13 17:23:15

  Modified:    applications/pam/src/webapp/WEB-INF/view profiler-admin.jsp
  Added:       applications/pam/src/webapp/WEB-INF/view prototype.jsp
  Log:
  here are some examples of using JSF
  two portlets to look at under the Administrative Folder:
  
  - Profiler Admin demonstrates a Tree View
  - JSF Prototype demonstrates a Datatable, PanelGroups and PanelTabbedPanes
  
  (Im going to replace the Profiler Admin demo with a real portlet to administer the profiler soon)
  
  Revision  Changes    Path
  1.5       +3 -3      jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view/profiler-admin.jsp
  
  Index: profiler-admin.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view/profiler-admin.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- profiler-admin.jsp	12 Oct 2004 21:29:50 -0000	1.4
  +++ profiler-admin.jsp	14 Oct 2004 00:23:15 -0000	1.5
  @@ -24,7 +24,7 @@
   //-->
   
   <%
  -   if (pageContext.getAttribute("treeModel", PageContext.SESSION_SCOPE) == null) {
  +   if (pageContext.getAttribute("treeModel2", PageContext.SESSION_SCOPE) == null) {
         DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
         DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
         root.insert(a);
  @@ -46,13 +46,13 @@
         node = new DefaultMutableTreeNode("x2");
         a.insert(node);
   
  -      pageContext.setAttribute("treeModel", new DefaultTreeModel(root), PageContext.SESSION_SCOPE);
  +      pageContext.setAttribute("treeModel2", new DefaultTreeModel(root), PageContext.SESSION_SCOPE);
      }
   %>
   
   <f:view>
   	<h:form>
  -                <x:tree id="tree" value="#{treeModel}"
  +                <x:tree id="tree" value="#{treeModel2}"
                           styleClass="tree"
                           nodeClass="treenode"
                           selectedNodeClass="treenodeSelected"
  
  
  
  1.1                  jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/view/prototype.jsp
  
  Index: prototype.jsp
  ===================================================================
  <%--
  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.
  --%>
  <%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
  <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  <%@ taglib uri="http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld" prefix="x"%>
  
  <link href='css/security-admin.css' type='text/css'/>
  
  <f:view>
  <h:panelGrid columns='2'>
  <h:panelGroup>
  <h:dataTable
      value="#{users.users}"
      var="user"
      styleClass="portlet-section-body"
      headerClass="portlet-form-button"
      rowClasses="portlet-menu-item-selected,portlet-MintyBlue"
  >
      <h:column>
         <f:facet name="header">
           <h:outputText value="User"
              style="font-weight: bold"/>
         </f:facet>
          <h:outputText value='#{user.last}'/>
      </h:column>
      <h:column>
          <f:verbatim>
          ...
         </f:verbatim>        
      </h:column>    
      <h:column>
          <h:selectBooleanCheckbox value="false"/>
      </h:column>
  </h:dataTable>
  </h:panelGroup>
  <h:panelGroup>
  
  <x:panelTabbedPane bgcolor="#FFFFCC" >
  
      <f:verbatim>
          <p>User Information</p>
      </f:verbatim>
  
      <x:panelTab id="tab1" label="Attributes" rendered="#{tabbedPaneBean.tab1Visible}">
          <h:inputText id="inp1"/><f:verbatim><br></f:verbatim>
          <h:inputText id="inp2" required="true" /><h:message for="inp2" showSummary="false" showDetail="true" />
      </x:panelTab>
  
      <x:panelTab id="tab2" label="Roles" rendered="#{tabbedPaneBean.tab2Visible}">
  
      <f:verbatim>
          <p> TAB TWO </p>
      </f:verbatim>
      </x:panelTab>
  
      <x:panelTab id="tab3" label="Prefs" rendered="#{tabbedPaneBean.tab3Visible}">
          <h:inputText id="inp3"/><f:verbatim><br></f:verbatim>
          <h:inputText id="inp4"/><f:verbatim><br></f:verbatim>
          <h:inputText id="inp5"/><f:verbatim><br></f:verbatim>
      </x:panelTab>
  
      <f:verbatim><br></f:verbatim>
  
      <h:selectBooleanCheckbox value="#{tabbedPaneBean.tab1Visible}"/><f:verbatim>Tab 1 visible<br></f:verbatim>
      <h:selectBooleanCheckbox value="#{tabbedPaneBean.tab2Visible}"/><f:verbatim>Tab 2 visible<br></f:verbatim>
      <h:selectBooleanCheckbox value="#{tabbedPaneBean.tab3Visible}"/><f:verbatim>Tab 3 visible<br></f:verbatim>
  
      <h:commandButton value="Save" />
  
  </x:panelTabbedPane>
  
  
  </h:panelGroup>
  </h:panelGrid>
  </f:view>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org