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

jforum example source code file (EditGroupContent.jsp)

This example jforum source code file (EditGroupContent.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, by, could, enter, group, group, principalcomparator, save, stringbuffer, stringbuffer, the, utf-8, utf-8, you

The jforum EditGroupContent.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="org.apache.log4j.*" %>
<%@ page errorPage="/Error.jsp" %>
<%! 
    Category log = Category.getInstance("JSPWiki"); 
%>

<%
  // 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>Edit Group <%=name%>

<div class="formcontainer">
  <div class="instructions">
    This page allows you to add or edit members for the wiki group called 
    <em><%=name%>. Generally, only members of the group can edit the 
    membership list. By default, the person who creates the group is a member.
  </div>
  <div class="instructions">
    <wiki:Messages div="error" topic="group" prefix="Could not save group: " />
  </div>
  <form id="editGroup" action="
      <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">
      <!-- Any errors? -->
      <div class="instructions">
        When you click “Save group,” this group will be saved as a group
        called <strong><%=name%>. You can specify this
        name in page access control lists (ACLs).
      </div>
      <input type="submit" name="ok" value="Save group" />
      <input type="hidden" name="group" value="<%=name%>" />
      <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 EditGroupContent.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.