alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jforum example source code file (NewGroupContent.jsp)

This example jforum source code file (NewGroupContent.jsp) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jforum tags/keywords

acls, create, enter, group, group, post, principalcomparator, stringbuffer, stringbuffer, the, the, utf-8, utf-8, you

The jforum NewGroupContent.jsp source code

<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ page import="java.security.Principal" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="com.ecyrd.jspwiki.auth.PrincipalComparator" %>
<%@ page import="com.ecyrd.jspwiki.auth.authorize.Group" %>
<%@ page import="com.ecyrd.jspwiki.auth.authorize.GroupManager" %>
<%@ page errorPage="/Error.jsp" %>

<%
  // Extract the group name and members
  String name = request.getParameter( "group" );
  Group group = (Group)pageContext.getAttribute( "Group",PageContext.REQUEST_SCOPE );
  Principal[] members = null;
  
  if ( group != null )
  {
    name = group.getName();
    members = group.members();
    Arrays.sort( members, new PrincipalComparator() );
  }
%>

<h3>Create New Group

<wiki:Messages div="error" topic="<%=GroupManager.MESSAGES_KEY%>" prefix="Error: "/>

<div class="formcontainer">
  <div class="instructions">
    This page allows you to create a new wiki group.
  </div>
  <form id="createGroup" action="
      <input type="text" name="group" size="30" value="<%=name%>" />
      <div class="description">
        The name of the new group.
      </div>
    </div>
    
    <!-- Members -->
    <%
      StringBuffer s = new StringBuffer();
      for ( int i = 0; i < members.length; i++ )
      {
        s.append( members[i].getName().trim() );
        s.append( '\n' );
      }
    %>
    <div class="block">
      <label>Members
      <textarea id="members" name="members" rows="20" cols="40"><%=s.toString()%>
      <div class="description">
        The membership for this group. Enter each user’s wiki name
        or full name, separated by carriage returns.
      </div>
    </div>

    <div class="block">
      <div class="instructions">
        When you click “Save group,” this group will be saved as a group.
        You can specify the group's name in page access control lists (ACLs).
      </div>
      <input type="submit" name="ok" value="Create group" />
      <input type="hidden" name="action" value="save" />
    </div>
  </form>
</div>

Other jforum examples (source code examples)

Here is a short list of links related to this jforum NewGroupContent.jsp source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.