head	1.10;
access;
symbols
	TIGRIS_1_1_0RC2:1.4
	TIGRIS_1_1_0RC1:1.4
	TIGRIS_1_1:1.4.0.4
	TIGRIS_1_0_8:1.4
	TIGRIS_1_0_8RC3:1.4
	TIGRIS_1_0_8RC2:1.4
	TIGRIS_1_0_8RC1:1.4
	TIGRIS_1_0_7:1.4
	TIGRIS_1_0_7RC3:1.4
	TIGRIS_1_0_7RC2:1.4
	TIGRIS_1_0_7RC1:1.4
	TIGRIS_1_0_6:1.4
	TIGRIS_1_0_6RC5:1.4
	TIGRIS_1_0_6RC4:1.4
	TIGRIS_1_0_6RC3:1.4
	TIGRIS_1_0_6RC2:1.4
	TIGRIS_1_0_6RC1:1.4
	TIGRIS_1_0_5:1.4
	TIGRIS_1_0_5RC6:1.4
	TIGRIS_1_0_5RC5:1.4
	TIGRIS_1_0_5RC4:1.4
	TIGRIS_1_0_5RC3:1.4
	TIGRIS_1_0_5RC2:1.4
	TIGRIS_1_0_5RC1:1.4
	TIGRIS_1_0_4:1.4
	TIGRIS_1_0_3:1.4
	TIGRIS_1_0_2:1.4
	TIGRIS_1_0_1:1.4
	TIGRIS_1_0:1.4.0.6
	TIGRIS_1_0_0:1.4
	TIGRIS_1_0_0_RC1:1.4.0.2
	dlr:1.1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1;
locks; strict;
comment	@# @;


1.10
date	2001.08.30.16.57.41;	author dlr;	state Exp;
branches;
next	1.9;

1.9
date	2001.08.27.08.41.27;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2001.08.11.09.08.02;	author dlr;	state Exp;
branches;
next	1.7;

1.7
date	2001.07.27.20.09.40;	author leonardr;	state Exp;
branches;
next	1.6;

1.6
date	2001.06.29.00.57.49;	author leonardr;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.23.01.50.13;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.03.07.01.53.22;	author lucas;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.24.03.59.53;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.21.03.02.22;	author edk;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.13.03.09.35;	author dlr;	state dead;
branches
	1.1.1.1
	1.1.2.1;
next	;

1.1.1.1
date	2001.02.21.00.32.40;	author dlr;	state Exp;
branches;
next	;

1.1.2.1
date	2001.02.13.03.09.35;	author dlr;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.16.03.01.27;	author dlr;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.02.16.16.09.06;	author leonardr;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2001.02.16.16.26.36;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.10
log
@Updated for latest Turbine API changes.
@
text
@package org.tigris.helm.om;

// JDK classes
import java.util.*;

// Turbine classes
import org.apache.torque.util.BasePeer;
import org.apache.torque.util.Criteria;
import org.apache.commons.util.ObjectUtils;
import org.apache.commons.util.StringUtils;
import org.apache.turbine.ParameterParser;
import org.apache.turbine.util.Log;
import org.apache.commons.util.exception.NestableException;
import org.apache.torque.pool.DBConnection;

import org.tigris.helm.AlreadyExists;
import org.tigris.helm.om.*;
import org.tigris.helm.om.profile.CategoryProfile;
import org.tigris.helm.security.AccessControlList;
import org.tigris.helm.security.ACLException;
import org.tigris.helm.tool.paginate.PeerBackedList;

/** 
 * Project group business object.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 */
public class Category extends AssociationTargetProject
{
    /**
     * List of valid subproject types.
     */
    protected static String[] VALID_SUBPROJECT_TYPES = {CATEGORY_TYPE};

    /**
     * List of valid superproject types.
     */
    protected static String[] VALID_SUPERPROJECT_TYPES = 
    {
        DOMAIN_TYPE, 
        CATEGORY_TYPE
    };

    /**
     * List of valid types of projects which can be associated with this.
     * project.
     */
    protected static String[] VALID_ASSOCIATION_TYPES = {REGULAR_TYPE};

    /**
     * The permission you must have in project x to associate it with
     * this project.
     */
    private static String PROJECT_ASSOCIABILITY_PERMISSION = "Project - View";

    /**
     * Description of the audit log entry created when a project of this
     * type is added.  
     */
    private static final String AUDIT_LOG_ON_ADD = "Category added: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is deleted.
     */
    private static final String AUDIT_LOG_ON_DELETE = "Category deleted: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is edited.
     */
    private static final String AUDIT_LOG_ON_EDIT = "Category edited: ";

    /**
     * Description of the audit log entry created when a project is added
     * to this group.
     */
    private static final String AUDIT_LOG_ON_PROJECT_ADD = 
        "Project added to category: ";

    /**
     * Description of the audit log entry created when a project is removed
     * from this group.
     */
    private static final String AUDIT_LOG_ON_PROJECT_REMOVE = 
        "Project removed from category: ";

    /**
     * Constructor--make nice with Torque.
     */
    public Category()
    {
        setType(ProjectPeer.CLASSKEY_CATEGORY);
    }

    /**
     * Returns the permission neccessary to associate a project with
     * this project.  
     */
    protected String getProjectAssociabilityPermission()
    {
        return this.PROJECT_ASSOCIABILITY_PERMISSION;
    }

    /**
     * Returns the types of projects which can be subprojects of this type
     * of project.
     */
    protected String[] getValidSubprojectTypes()
    {
        return VALID_SUBPROJECT_TYPES;
    }

    /**
     * Returns the types of projects which can be superprojects of this type
     * of project.
     */
    protected String[] getValidSuperprojectTypes()
    {
        return this.VALID_SUPERPROJECT_TYPES;
    }

    /**
     * Returns the types of projects which can be associated with this
     * type of project.
     */
    protected String[] getValidAssociationTypes()
    {
        return VALID_ASSOCIATION_TYPES;
    }

    //Mutator methods.

    /**
     * Add a new category with some initial elements.
     */
    public static Category add (AccessControlList acl, Project parent,
                                String name, String isPublic,
                                String shortDescription, 
                                String longDescription, 
                                List initialElements)
        throws AlreadyExists, ACLException, Exception
    {
        return (Category)AssociationTargetProject.add
            (acl, new CategoryProfile(), parent, name, isPublic, 
             shortDescription, longDescription, initialElements);
    }         


    /**
     * Change the description information of a category.
     */
    public void updateInfo(AccessControlList acl, String shortDescription,
                           String longDescription, String isPublic)
        throws ACLException, Exception
    {
        super.updateInfo(acl, shortDescription, longDescription);
        setIsPublic(isPublic);
        save();
    }
}
@


1.9
log
@Updated for Turbine API change.
@
text
@d11 1
a11 1
import org.apache.fulcrum.util.parser.ParameterParser;
@


1.8
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d11 1
a11 1
import org.apache.turbine.util.ParameterParser;
@


1.7
log
@Duplicated accessor method so it would take.
@
text
@d7 4
a10 5
import org.apache.turbine.om.*;
import org.apache.turbine.om.peer.BasePeer;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.util.ObjectUtils;
import org.apache.turbine.util.StringUtils;
d13 2
a14 2
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.util.db.pool.DBConnection;
@


1.6
log
@Implemented basic project group and category nesting.
@
text
@d99 9
@


1.5
log
@Ported Helm from WebMacro to Velocity.
@
text
@a14 1
import org.apache.turbine.util.TurbineException;
d17 1
d19 4
a22 1
import org.tigris.helm.om.*;
d25 6
a30 9
  * The skeleton for this class was autogenerated by Torque on:
  *
  * [Mon Feb 12 19:04:35 PST 2001]
  *
  * You should add additional methods to this class to meet the
  * application requirements.  This class will only be generated as
  * long as the "firstbuild" file exists in the build directory.
  */
public class Category extends ProjectGroup
d33 26
d90 3
d95 58
a152 1
                setType(ProjectPeer.CLASSKEY_CATEGORY);
@


1.4
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d14 2
@


1.3
log
@Sync'd with latest Turbine changes.  Mostly this consists of the use of the new SimpleKey class to handle primary database keys.
@
text
@d16 2
a17 3
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;

@


1.2
log
@adding files from the branch to the head
@
text
@d7 1
a7 1
import org.apache.turbine.om.BaseObject;
@


1.1
log
@file Category.java was initially added on branch HELM_PEER_PORT_BRANCH.
@
text
@d1 67
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a0 67
package org.tigris.helm.om;

// JDK classes
import java.util.*;

// Turbine classes
import org.apache.turbine.om.BaseObject;
import org.apache.turbine.om.peer.BasePeer;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.util.ObjectUtils;
import org.apache.turbine.util.StringUtils;
import org.apache.turbine.util.ParameterParser;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.db.pool.DBConnection;

import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;


/** 
  * The skeleton for this class was autogenerated by Torque on:
  *
  * [Mon Feb 12 19:04:35 PST 2001]
  *
  * You should add additional methods to this class to meet the
  * application requirements.  This class will only be generated as
  * long as the "firstbuild" file exists in the build directory.
  */
public class Category extends ProjectGroup
{
    /**
     * Description of the audit log entry created when a project of this
     * type is added.  
     */
    private static final String AUDIT_LOG_ON_ADD = "Category added: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is deleted.
     */
    private static final String AUDIT_LOG_ON_DELETE = "Category deleted: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is edited.
     */
    private static final String AUDIT_LOG_ON_EDIT = "Category edited: ";

    /**
     * Description of the audit log entry created when a project is added
     * to this group.
     */
    private static final String AUDIT_LOG_ON_PROJECT_ADD = 
        "Project added to category: ";

    /**
     * Description of the audit log entry created when a project is removed
     * from this group.
     */
    private static final String AUDIT_LOG_ON_PROJECT_REMOVE = 
        "Project removed from category: ";

    public Category()
    {
                setType(ProjectPeer.CLASSKEY_CATEGORY);
    }
}
@


1.1.2.1
log
@Generated by Torque inheritance.
@
text
@a0 34
package org.tigris.helm.om;

// JDK classes
import java.util.*;

// Turbine classes
import org.apache.turbine.om.BaseObject;
import org.apache.turbine.om.peer.BasePeer;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.util.ObjectUtils;
import org.apache.turbine.util.StringUtils;
import org.apache.turbine.util.ParameterParser;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.db.pool.DBConnection;

import org.tigris.helm.om.peer.*;


/** 
  * The skeleton for this class was autogenerated by Torque on:
  *
  * [Mon Feb 12 19:04:35 PST 2001]
  *
  * You should add additional methods to this class to meet the
  * application requirements.  This class will only be generated as
  * long as the "firstbuild" file exists in the build directory.
  */
public class Category extends ProjectGroup
{
    public Category()
    {
                setType(ProjectPeer.CLASSKEY_CATEGORY);
    }
}
@


1.1.2.2
log
@Added new imports necessitated by Torque.
@
text
@a16 1
import org.tigris.helm.om.base.*;
@


1.1.2.3
log
@Added audit logging in a bunch of places.
@
text
@a30 32
    /**
     * Description of the audit log entry created when a project of this
     * type is added.  
     */
    private static final String AUDIT_LOG_ON_ADD = "Category added: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is deleted.
     */
    private static final String AUDIT_LOG_ON_DELETE = "Category deleted: ";

    /**
     * Description of the audit log entry created when a project of this
     * type is edited.
     */
    private static final String AUDIT_LOG_ON_EDIT = "Category edited: ";

    /**
     * Description of the audit log entry created when a project is added
     * to this group.
     */
    private static final AUDIT_LOG_ON_PROJECT_ADD = 
        "Project added to category: ";

    /**
     * Description of the audit log entry created when a project is removed
     * from this group.
     */
    private static final AUDIT_LOG_ON_PROJECT_REMOVE = 
        "Project removed from category: ";

@


1.1.2.4
log
@Fixed compile errors introduced in audit logging patch.
@
text
@d53 1
a53 1
    private static final String AUDIT_LOG_ON_PROJECT_ADD = 
d60 1
a60 1
    private static final String AUDIT_LOG_ON_PROJECT_REMOVE = 
@


