001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General Public License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General Public License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: GroupConstants.java,v $
031: * Revision 1.6 2005/10/11 18:53:07 colinmacleod
032: * Fixed some checkstyle and javadoc issues.
033: *
034: * Revision 1.5 2005/04/29 02:48:13 colinmacleod
035: * Data bugfixes.
036: * Changed primary key back to Integer.
037: *
038: * Revision 1.4 2005/04/28 18:47:10 colinmacleod
039: * Fixed XHMTL, styles and resin compatibility.
040: * Added support for URL rewriting.
041: *
042: * Revision 1.3 2005/04/10 20:09:36 colinmacleod
043: * Added new themes.
044: * Changed id type to String.
045: * Changed i tag to em and b tag to strong.
046: * Improved PicoContainerFactory with NanoContainer scripts.
047: *
048: * Revision 1.2 2005/04/09 17:19:07 colinmacleod
049: * Changed copyright text to GPL v2 explicitly.
050: *
051: * Revision 1.1.1.1 2005/03/10 17:50:31 colinmacleod
052: * Restructured ivata op around Hibernate/PicoContainer.
053: * Renamed ivata groupware.
054: *
055: * Revision 1.3 2004/07/13 19:41:13 colinmacleod
056: * Moved project to POJOs from EJBs.
057: * Applied PicoContainer to services layer (replacing session EJBs).
058: * Applied Hibernate to persistence layer (replacing entity EJBs).
059: *
060: * Revision 1.2 2004/03/21 21:16:06 colinmacleod
061: * Shortened name to ivata op.
062: *
063: * Revision 1.1.1.1 2004/01/27 20:57:51 colinmacleod
064: * Moved ivata openportal to SourceForge..
065: *
066: * Revision 1.3 2003/10/17 12:36:12 jano
067: * fixing problems with building
068: * converting intranet -> portal
069: * Eclipse building
070: *
071: * Revision 1.2 2003/10/15 13:18:02 colin
072: * fixing for XDoclet
073: *
074: * Revision 1.3 2003/08/05 14:57:35 jano
075: * addressBook extension
076: *
077: * Revision 1.2 2003/07/25 11:42:11 jano
078: * adding functionality for addressBook extension
079: *
080: * Revision 1.1 2003/02/24 19:09:21 colin
081: * moved to business
082: *
083: * Revision 1.3 2003/02/04 17:43:45 colin
084: * copyright notice
085: *
086: * Revision 1.2 2002/12/03 15:25:36 jano
087: * we have new group - "USER" it's mandatory group
088: *
089: * Revision 1.1 2002/09/27 12:53:07 jano
090: * constants of GROUP
091: * -----------------------------------------------------------------------------
092: */
093: package com.ivata.groupware.business.addressbook.person.group;
094:
095: /**
096: * <p>Store all the constants for groups.</p>
097: *
098: * @since ivata groupware 0.9 (2002-09-26)
099: * @author jano
100: * @version $Revision: 1.6 $
101: */
102: public final class GroupConstants {
103: /**
104: * <p>This group contain addressBooks groups - private and public.</p>
105: */
106: public static final Integer ADDRESS_BOOK = new Integer(4);
107: /**
108: * <p>This is a default address book, present when the system is initially
109: * created. Everyone can see this address book.</p>
110: */
111: public static final Integer ADDRESS_BOOK_DEFAULT = new Integer(7);
112: /**
113: * <p>This group contain private addressBooks - one for each user.</p>
114: */
115: public static final Integer ADDRESS_BOOK_PRIVATE = new Integer(5);
116: /**
117: * <p>This group contain public addressBooks.</p>
118: */
119: public static final Integer ADDRESS_BOOK_PUBLIC = new Integer(6);
120:
121: /**
122: * Simple method to compare two group IDs: a given group and one of the
123: * constants from above.
124: *
125: * @param compareID Unique identifier of the group to be compared.
126: * @param constantGroupID Unique group constant. Cannot be
127: * <code>null</code>.
128: * @return <code>true</code> if both are the same, and
129: * <code>compareIDM</code> is not <code>null</code>.
130: */
131: public static boolean equals(final Integer compareID,
132: final Integer constantGroupID) {
133: // none of the constants are null!
134: assert (constantGroupID != null);
135: if (compareID == null) {
136: return false;
137: }
138: return constantGroupID.equals(compareID);
139: }
140:
141: /**
142: * Private constructor enforces utility class behavior.
143: */
144: private GroupConstants() {
145: }
146: }
|