| career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/admin/importexport/jive/,v 1.3 2005/01/18 11:52:14 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.3 $
 * $Date: 2005/01/18 11:52:14 $
 * ====================================================================
 * Copyright (C) 2002-2005 by
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * and in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 * Support can be obtained from support forums at:
 * Correspondence and Marketing Questions can be sent to:
 * @author: Igor Manic
package com.mvnforum.admin.importexport.jive;

import com.mvnforum.admin.GroupXML;
import net.myvietnam.mvncore.exception.*;

 * @author <a href="">Igor Manic
 * @version $Revision: 1.3 $, $Date: 2005/01/18 11:52:14 $
 * <br/>
 * <code>JiveGroupXML class encapsulates processing of
 * groups' definitions found in the Jive XML file. It implements
 * methods to be called from XML parsing routine, adds some additional
 * processing and checking, and calls corresponding methods of
 * <code>GroupXML and other neccessary classes in order to perform
 * the actual creation of a group, as well as assigning members to the group.
public class JiveGroupXML {

    private GroupXML groupXML=null;
    private boolean groupCreated=false;

    public JiveGroupXML() {
        groupXML=new GroupXML();

    public void setGroupID(String id) {

     * This method simply calls <code>setGroupID().
     * It's defined only to avoid property-setter problems with digester
     * (since it doesn't seem to recognize <code>setGroupID() as a setter
     * method for <code>groupID property).
    public void setGroupId(String id) {

    private String groupName=null;
    public void setGroupName(String value) throws CreateException {
        if ( (value==null) || (value.equals("")) ) {
            throw new CreateException("Cannot create a group with an empty GroupName.");
        } else this.groupName=value;

    private String groupDesc=null;
    public void setGroupDescription(String value) throws CreateException {

    private String groupCreationDate=null;
    public void setGroupCreationDate(String value) throws CreateException {

    private String groupModifiedDate=null;
    public void setGroupModifiedDate(String value) throws CreateException {

    private String groupOwnerName=null;
    public void setGroupOwnerName(String value) throws CreateException {

    public void addJiveGroup() throws CreateException, DuplicateKeyException,
    ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException {
        /* First check if the digester already called this method.
         * It will happen even under normal circumstances, if this group has
         * subelements that need it already be defined, so they first call
         * this method to create group before creating data that refer him.
        if (groupCreated) return;
        if ( (groupName==null) || (groupName.equals("")) ) {
            throw new CreateException("Cannot create a group with an empty GroupName.");
        } else {
            ImportJive.addMessage("Adding Jive group \""+groupName+"\".");
            groupXML.addGroup(groupOwnerName, groupName, groupDesc,
                              null/*groupOption*/, groupCreationDate, groupModifiedDate);

    public void addJiveGroupMember(String username)
    throws CreateException, DuplicateKeyException, ObjectNotFoundException,
    DatabaseException, ForeignKeyNotFoundException {
        if ( (!groupCreated) || (groupXML.getGroupID()<0) ) {
        if ( (username==null) || (username.equals("")) ) {
            throw new CreateException("Cannot create a group member with an empty MemberName.");
        } else {
            ImportJive.addMessage("Adding group member \""+username+"\".");
            groupXML.addMemberGroup(username, null/*privilege*/,
                                    null/*creationDate*/, null/*modifiedDate*/);


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

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
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.