Source Code Cross Referenced for AddressBookBean.java in  » Groupware » ivatagroupware » com » ivata » groupware » business » addressbook » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Groupware » ivatagroupware » com.ivata.groupware.business.addressbook 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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: AddressBookBean.java,v $
031:         * Revision 1.4  2005/04/29 02:48:14  colinmacleod
032:         * Data bugfixes.
033:         * Changed primary key back to Integer.
034:         *
035:         * Revision 1.3  2005/04/10 20:09:34  colinmacleod
036:         * Added new themes.
037:         * Changed id type to String.
038:         * Changed i tag to em and b tag to strong.
039:         * Improved PicoContainerFactory with NanoContainer scripts.
040:         *
041:         * Revision 1.2  2005/04/09 17:19:06  colinmacleod
042:         * Changed copyright text to GPL v2 explicitly.
043:         *
044:         * Revision 1.1.1.1  2005/03/10 17:50:19  colinmacleod
045:         * Restructured ivata op around Hibernate/PicoContainer.
046:         * Renamed ivata groupware.
047:         *
048:         * Revision 1.10  2004/11/12 18:17:10  colinmacleod
049:         * Ordered imports.
050:         *
051:         * Revision 1.9  2004/11/12 15:56:47  colinmacleod
052:         * Removed dependencies on SSLEXT.
053:         * Moved Persistence classes to ivata masks.
054:         *
055:         * Revision 1.8  2004/11/03 15:36:48  colinmacleod
056:         * Changed relationship between person and address:
057:         * each person for now has exactly one address.
058:         *
059:         * Revision 1.7  2004/07/18 21:59:12  colinmacleod
060:         * Removed Person from User - now you need to use addressbook/persistence manager to find the person (makes the app run faster.)
061:         *
062:         * Revision 1.6  2004/07/13 19:41:13  colinmacleod
063:         * Moved project to POJOs from EJBs.
064:         * Applied PicoContainer to services layer (replacing session EJBs).
065:         * Applied Hibernate to persistence layer (replacing entity EJBs).
066:         *
067:         * Revision 1.5  2004/03/27 10:29:41  colinmacleod
068:         * Added getAddressBook implementation.
069:         *
070:         * Revision 1.4  2004/03/26 21:34:35  colinmacleod
071:         * Split off functionality into POJO.
072:         *
073:         * Revision 1.3  2004/03/21 21:16:05  colinmacleod
074:         * Shortened name to ivata op.
075:         *
076:         * Revision 1.2  2004/02/01 22:00:32  colinmacleod
077:         * Added full names to author tags
078:         *
079:         * Revision 1.1.1.1  2004/01/27 20:57:49  colinmacleod
080:         * Moved ivata openportal to SourceForge..
081:         *
082:         * Revision 1.6  2003/12/12 11:08:58  jano
083:         * fixing aaddressbook functionaality
084:         *
085:         * Revision 1.5  2003/11/03 11:28:24  jano
086:         * commiting addressbook,
087:         * tryinjg to fix deploying problem
088:         *
089:         * Revision 1.4  2003/10/17 12:36:12  jano
090:         * fixing problems with building
091:         * converting intranet -> portal
092:         * Eclipse building
093:         *
094:         * Revision 1.3  2003/10/15 13:36:47  jano
095:         * converting to XDoclet
096:         *
097:         * Revision 1.2  2003/10/15 13:18:02  colin
098:         * fixing for XDoclet
099:         *
100:         * Revision 1.20  2003/08/21 09:49:22  jano
101:         * removed unusing methods
102:         *
103:         * Revision 1.19  2003/08/20 16:23:59  jano
104:         * fixing addressBook extension
105:         *
106:         * Revision 1.18  2003/08/19 14:53:30  jano
107:         * *** empty log message ***
108:         *
109:         * Revision 1.17  2003/08/14 15:54:19  jano
110:         * fixing bugs
111:         *
112:         * Revision 1.16  2003/08/14 08:19:59  jano
113:         * fixing bug
114:         *
115:         * Revision 1.15  2003/08/13 13:32:16  jano
116:         * addressBook exttension: next level
117:         *
118:         * Revision 1.14  2003/08/05 14:51:03  jano
119:         * addressBook extension
120:         *
121:         * Revision 1.13  2003/08/05 05:54:06  jano
122:         * new methods in addressbook
123:         *
124:         * Revision 1.12  2003/07/31 08:45:57  jano
125:         * new method findAllPeople
126:         * removing all similar methods
127:         *
128:         * Revision 1.10  2003/07/25 11:40:17  jano
129:         * adding functionality for addressBook extension
130:         *
131:         * Revision 1.9  2003/06/18 14:20:43  jano
132:         * fixing problem with removing user
133:         *
134:         * Revision 1.8  2003/05/23 13:04:46  peter
135:         * uncommented email address validation
136:         *
137:         * Revision 1.7  2003/05/12 13:45:52  colin
138:         * added new methods for finding rights
139:         *
140:         * Revision 1.6  2003/05/02 15:14:57  peter
141:         * added email address validation
142:         *
143:         * Revision 1.5  2003/04/09 08:51:48  jano
144:         * handling data of removing user
145:         *
146:         * Revision 1.4  2003/04/02 09:04:05  jano
147:         * again, fixing bug with wrong keys in validate method
148:         *
149:         * Revision 1.3  2003/03/31 15:44:04  jano
150:         * mistake in validate method, using wrong key of applicationResources
151:         *
152:         * Revision 1.2  2003/02/27 12:57:40  peter
153:         * fixed the resouceBundle paths in validation methods
154:         *
155:         * Revision 1.1  2003/02/24 19:09:20  colin
156:         * moved to business
157:         *
158:         * Revision 1.28  2003/02/21 09:23:17  colin
159:         * fixed bug when fileAs values are the same (only 1 was shown)
160:         *
161:         * Revision 1.27  2003/02/20 20:49:53  colin
162:         * changed checking of unique fileAs field to ValidaitonException
163:         *
164:         * Revision 1.26  2003/02/20 20:22:54  colin
165:         * improved validation error handling
166:         *
167:         * Revision 1.25  2003/02/20 14:34:02  colin
168:         * addGroupsToPerson no longer adds child groups to the person (just the parent)
169:         *
170:         * Revision 1.24  2003/02/18 11:11:27  colin
171:         * first release of address book with Struts
172:         *
173:         * Revision 1.23  2003/02/14 07:57:07  colin
174:         * changed finder in AddressBookBean so it finds all groups (rather than just parent groups)
175:         *
176:         * Revision 1.22  2003/02/04 17:43:44  colin
177:         * copyright notice
178:         *
179:         * Revision 1.21  2003/01/30 15:29:38  colin
180:         * added group validation
181:         *
182:         * Revision 1.20  2003/01/10 10:30:06  jano
183:         * we need information about user who created group
184:         *
185:         * Revision 1.19  2003/01/09 13:31:49  jano
186:         * we have fiield in Person called : createdBy - its name of user who created that contact
187:         *
188:         * Revision 1.18  2003/01/09 10:02:51  jano
189:         * we are not storing group's rights in geoupDO now
190:         * we are using methods in addressBookRightsBean
191:         *
192:         * Revision 1.17  2003/01/03 15:43:50  jano
193:         * we don't need tempFindTarge...... method, we are using getTargetIdsByAUD
194:         *
195:         * Revision 1.16  2002/12/16 13:41:34  jano
196:         * in there is not groupId we have to find only those contacts which we can see
197:         *
198:         * Revision 1.15  2002/12/12 15:03:28  jano
199:         * rights for groups
200:         *
201:         * Revision 1.14  2002/12/03 15:42:19  jano
202:         * if the person is user so put him to USER group if he is not there
203:         *
204:         * Revision 1.13  2002/10/11 12:51:10  colin
205:         * added check for duplicate values of fileAs
206:         *
207:         * Revision 1.12  2002/09/30 12:51:34  jano
208:         * trow exception if the group i main group for any people
209:         *
210:         * Revision 1.11  2002/09/27 14:18:19  jano
211:         * when you want delete group contain sub groups throw exception
212:         *
213:         * Revision 1.10  2002/09/17 08:36:59  colin
214:         * added checkDO to check the person before adding
215:         *
216:         * Revision 1.9  2002/09/09 08:38:10  colin
217:         * moved user handling to new security bean
218:         *
219:         * Revision 1.8  2002/09/02 08:47:48  colin
220:         * added country handling and sorting (comparator)
221:         *
222:         * Revision 1.7  2002/08/30 09:48:45  colin
223:         * added employee EJB
224:         *
225:         * Revision 1.6  2002/08/29 14:33:43  colin
226:         * changed AddressBook: added isUserEnabled method
227:         *
228:         * Revision 1.5  2002/07/26 13:07:21  colin
229:         * split user rights off into separate class
230:         * added mail server methods
231:         *
232:         * Revision 1.4  2002/06/28 13:15:22  colin
233:         * first addressbook release
234:         *
235:         * Revision 1.3  2002/06/17 10:45:47  colin
236:         * Tidied up the canUser... code
237:         *
238:         * Revision 1.2  2002/06/17 07:28:51  colin
239:         * improved and extended javadoc documentation
240:         * -----------------------------------------------------------------------------
241:         */
242:        package com.ivata.groupware.business.addressbook;
243:
244:        import java.util.List;
245:
246:        import javax.ejb.CreateException;
247:        import javax.ejb.RemoveException;
248:        import javax.ejb.SessionBean;
249:        import javax.ejb.SessionContext;
250:
251:        import org.picocontainer.PicoContainer;
252:
253:        import com.ivata.groupware.admin.security.server.SecuritySession;
254:        import com.ivata.groupware.business.addressbook.address.AddressDO;
255:        import com.ivata.groupware.business.addressbook.address.country.CountryDO;
256:        import com.ivata.groupware.business.addressbook.person.PersonDO;
257:        import com.ivata.groupware.business.addressbook.person.group.GroupDO;
258:        import com.ivata.groupware.container.PicoContainerFactory;
259:        import com.ivata.mask.util.SystemException;
260:        import com.ivata.mask.validation.ValidationErrors;
261:
262:        /**
263:         * <p>This address book provides clients with access to the register of people
264:         * within the ivata groupware system.</p>
265:         *
266:         * <p>Actions are here to retrieve people, change their details and enter new
267:         * people into the system. This bean manages people's street and
268:         * telecommunications addresses, together with which people are users and what
269:         * group(s) each person is a member of.</p>
270:         *
271:         * <p>Furthermore, this bean is responsible for assigning and maintaining
272:         * employee information.</p>
273:         *
274:         * <p><strong>Note</strong>, however that whilst the addressbook may react on which
275:         * people are users (it checks those people always have an email address), this
276:         * <em>EJB</em> is not responsible for adding, removing or amending users or their
277:         * passwords. For that functionality, see the {@link com.ivata.groupware.admin.security.SecurityBean
278:         * SecurityBean}.</p>
279:         *
280:         * @since 2002-05-12
281:         * @author Colin MacLeod
282:         * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
283:         * @version $Revision: 1.4 $
284:         * TODO: the employee and user methods need to check the user rights
285:         *
286:         * @ejb.bean
287:         *      name="AddressBook"
288:         *      display-name="AddressBook"
289:         *      type="Stateless"
290:         *      view-type="remote"
291:         *      jndi-name="AddressBookRemote"
292:         *
293:         * @ejb.transaction
294:         *      type = "Required"
295:         *
296:         *  @ejb.home
297:         *      generate="false"
298:         *      remote-class="com.ivata.groupware.business.addressbook.AddressBookRemoteHome"
299:         *
300:         *  @ejb.interface
301:         *      remote-class="com.ivata.groupware.business.addressbook.AddressBookRemote"
302:         */
303:        public class AddressBookBean implements  SessionBean, AddressBook {
304:            /**
305:             * <p>Provides the session bean with container-specific information.</p>
306:             */
307:            SessionContext sessionContext;
308:
309:            /**
310:             * <p>Add bew AddressBook.</p>
311:             * @param userName
312:             * @param groupDO
313:             * @return
314:             *
315:             * @ejb.interface-method
316:             *      view-type = "remote"
317:             */
318:            public GroupDO addAddressBook(
319:                    final SecuritySession securitySession, final GroupDO groupDO)
320:                    throws SystemException {
321:                return getAddressBook()
322:                        .addAddressBook(securitySession, groupDO);
323:            }
324:
325:            /**
326:             * <p>Add a new group to the address book.</p>
327:             *
328:             * @param userName the name of the user who wants to add the group. This is
329:             *     used to check user rights.
330:             * @param groupDO a data object containing all the details
331:             *     of the group to add.
332:             * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
333:             *     provided is not entitled to add this group
334:             * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
335:             *     if a field value in the new group contains an invalid value
336:             * @return the new group data object, with the details as they
337:             *     now are in the adressbook.
338:             *
339:             * @ejb.interface-method
340:             *      view-type = "remote"
341:             */
342:            public GroupDO addGroup(final SecuritySession securitySession,
343:                    final GroupDO groupDO) throws SystemException {
344:                return getAddressBook().addGroup(securitySession, groupDO);
345:            }
346:
347:            /**
348:             * <p>Add a new person to the address book.</p>
349:             *
350:             * @param personDO data object containing the details of the
351:             *     person you want to add.
352:             * @return the new person data object, with the details as they
353:             *     now are in the adressbook.
354:             *
355:             * @ejb.interface-method
356:             *      view-type = "remote"
357:             */
358:            public PersonDO addPerson(final SecuritySession securitySession,
359:                    final PersonDO personDO) throws SystemException {
360:                return getAddressBook().addPerson(securitySession, personDO);
361:            }
362:
363:            /**
364:             * <p>add new userGroup.</p>
365:             * @param userName
366:             * @param groupDO
367:             * @return
368:             *
369:             * @ejb.interface-method
370:             *      view-type = "remote"
371:             */
372:            public GroupDO addUserGroup(final SecuritySession securitySession,
373:                    final GroupDO groupDO) throws SystemException {
374:                return getAddressBook().addUserGroup(securitySession, groupDO);
375:            }
376:
377:            /**
378:             * <p>Amend the details of a group in the public address book.</p>
379:             *
380:             * @param userName the name of the user who wants to amend the group. This
381:             *     is used to check user rights.
382:             * @param groupDO a data object containing all the details
383:             *     of the group to amend.
384:             * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
385:             *     provided is not entitled to amend this group.
386:             * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
387:             *     if a field value in the new group contains an invalid value.
388:             * @return the new group data object, with the details as they
389:             *     now are in the adressbook.
390:             *
391:             * @ejb.interface-method
392:             *      view-type = "remote"
393:             */
394:            public GroupDO amendGroup(final SecuritySession securitySession,
395:                    final GroupDO groupDO) throws SystemException {
396:                return getAddressBook().amendGroup(securitySession, groupDO);
397:            }
398:
399:            /**
400:             * <p>Change/update a person's details in the addressbook.</p>
401:             *
402:             * @param personDO data object containing the details of the
403:             *     person you want to amend.
404:             * @return the new person data object, with the details as they
405:             *     now are in the adressbook.
406:             *
407:             * @ejb.interface-method
408:             *      view-type = "remote"
409:             */
410:            public PersonDO amendPerson(final SecuritySession securitySession,
411:                    final PersonDO personDO) throws SystemException {
412:                return getAddressBook().amendPerson(securitySession, personDO);
413:            }
414:
415:            /**
416:             * <p>Called by the container to notify an entity object it has been
417:             * activated.</p>
418:             */
419:            public void ejbActivate() {
420:            }
421:
422:            /**
423:             * <p>Called by the container just after the bean has been created.</p>
424:             *
425:             * @exception CreateException if any error occurs. Never thrown by this
426:             *     class.
427:             *
428:             * @ejb.create-method
429:             */
430:            public void ejbCreate() throws CreateException {
431:            }
432:
433:            /**
434:             * <p>Called by the container to notify the entity object it will be
435:             * deactivated. Called just before deactivation.</p>
436:             */
437:            public void ejbPassivate() {
438:            }
439:
440:            /**
441:             * <p>This method is called by the container when the bean is about
442:             * to be removed.</p>
443:             *
444:             * <p>This method will be called after a client calls the <code>remove</code>
445:             * method of the remote/local home interface.</p>
446:             *
447:             * @throws RemoveException if any error occurs. Currently never thrown by
448:             *     this class.
449:             */
450:            public final void ejbRemove() {
451:            }
452:
453:            /**
454:             * <p>get Map of all address book names which are allowed with specific access.</p>
455:             * @param userName
456:             * @param access
457:             * @return
458:             *
459:             * @ejb.interface-method
460:             *      view-type = "remote"
461:             */
462:            public List findAddressBooks(final SecuritySession securitySession,
463:                    final boolean includePersonal) throws SystemException {
464:                return getAddressBook().findAddressBooks(securitySession,
465:                        includePersonal);
466:            }
467:
468:            /**
469:             * <p>Find all of the countries in the system.</p>
470:             *
471:             * @return all of the coutries in the system as a <code>List</code>
472:             * of {@link com.ivata.groupware.business.addressbook.address.country.CountryDO CountryDO}
473:             * instances.
474:             *
475:             * @ejb.interface-method
476:             *      view-type = "remote"
477:             */
478:            public List findAllCountries(final SecuritySession securitySession)
479:                    throws SystemException {
480:                return getAddressBook().findAllCountries(securitySession);
481:            }
482:
483:            /**
484:             * <p>Find All People in a specific address book.</p
485:             *
486:             * @see com.ivata.groupware.business.addressbook.AddressBook#findAllPeople(com.ivata.groupware.admin.security.server.SecuritySession, Integer, Integer, String)
487:             * @ejb.interface-method
488:             *      view-type = "remote"
489:             */
490:            public List findAllPeopleInGroup(
491:                    final SecuritySession securitySession, final GroupDO group,
492:                    final String initialLetter) throws SystemException {
493:                return getAddressBook().findAllPeopleInGroup(securitySession,
494:                        group, initialLetter);
495:            }
496:
497:            /**
498:             * <p>Find a single county identified by its two-letter country code.</p>
499:             *
500:             * @param countryCode two-letter internet country code.
501:             * @return details of the country as an instance of
502:             * {@link com.ivata.groupware.business.addressbook.address.country.CountryDO CountryDO),
503:             * or <code>null</code> if no such country exists.
504:             *
505:             * @ejb.interface-method
506:             *      view-type = "remote"
507:             */
508:            public CountryDO findCountryByCode(
509:                    final SecuritySession securitySession,
510:                    final String countryCode) throws SystemException {
511:                return getAddressBook().findCountryByCode(securitySession,
512:                        countryCode);
513:            }
514:
515:            /**
516:             * <p>Find a group in the address book by its unique identifier.</p>
517:             *
518:             * @param id the unique identifier of the group to find.
519:             * @return the data object of the group which matches this unique
520:             *      identifier.
521:             *
522:             * @ejb.interface-method
523:             *      view-type = "remote"
524:             */
525:            public GroupDO findGroupByPrimaryKey(
526:                    final SecuritySession securitySession, final Integer id)
527:                    throws SystemException {
528:                return getAddressBook().findGroupByPrimaryKey(securitySession,
529:                        id);
530:            }
531:
532:            /**
533:             * <p>
534:             * Find all groups which are siblings, identified by the parent group.
535:             * </p>
536:             * @see com.ivata.groupware.business.addressbook.AddressBook#findGroupsByParent(com.ivata.groupware.admin.security.server.SecuritySession, Integer)
537:             */
538:            public List findGroupsByParent(
539:                    final SecuritySession securitySession,
540:                    final Integer parentId) throws SystemException {
541:                return getAddressBook().findGroupsByParent(securitySession,
542:                        parentId);
543:            }
544:
545:            /**
546:             * <p>Find Id of personal AddressBook.</p>
547:             * @param userName
548:             * @return
549:             *
550:             * @ejb.interface-method
551:             *      view-type = "remote"
552:             */
553:            public GroupDO findPersonalAddressBook(
554:                    final SecuritySession securitySession)
555:                    throws SystemException {
556:                return getAddressBook()
557:                        .findPersonalAddressBook(securitySession);
558:            }
559:
560:            /**
561:             * <p>Find a person in the address book by their unique identifier.</p>
562:             *
563:             * @param id the unique identifier of the person to find.
564:             * @return the person data object which matches this id, with the
565:             *      details as they now are in the adressbook.
566:             *
567:             * @ejb.interface-method
568:             *      view-type = "remote"
569:             */
570:            public PersonDO findPersonByPrimaryKey(
571:                    final SecuritySession securitySession, final String id)
572:                    throws SystemException {
573:                return getAddressBook().findPersonByPrimaryKey(securitySession,
574:                        id);
575:            }
576:
577:            /**
578:             * <p>Find a person in the address book by their user name.</p>
579:             *
580:             * @param userName Name of the user to find.
581:             * @return the person data object which matches this user name.
582:             * @see com.ivata.groupware.business.addressbook.AddressBook#findPersonByUserName(com.ivata.groupware.admin.security.server.SecuritySession, String)
583:             */
584:            public PersonDO findPersonByUserName(
585:                    final SecuritySession securitySession, final String userName)
586:                    throws SystemException {
587:                return getAddressBook().findPersonByUserName(securitySession,
588:                        userName);
589:            }
590:
591:            /**
592:             * <p>get Map of all usergroup names which are allowed with specific access.</p>
593:             * @param userName
594:             * @param access
595:             * @return
596:             *
597:             * @ejb.interface-method
598:             *      view-type = "remote"
599:             */
600:            public List findUserGroups(final SecuritySession securitySession,
601:                    final boolean includeAdministrator) throws SystemException {
602:                return getAddressBook().findUserGroups(securitySession,
603:                        includeAdministrator);
604:            }
605:
606:            /**
607:             * Get the addressbook implementation from the <code>PicoContainer</code>.
608:             */
609:            private AddressBook getAddressBook() throws SystemException {
610:                PicoContainer container = PicoContainerFactory.getInstance()
611:                        .getGlobalContainer();
612:                return (AddressBook) container
613:                        .getComponentInstance(AddressBook.class);
614:            }
615:
616:            /**
617:             * <p>Remove a group from the public address book.</p>
618:             *
619:             * @param userName the name of the user who wants to remove the group. This
620:             *     is used to check user rights.
621:             * @param groupDO a data object containing all the details
622:             *     of the group to remove. The id of the group is used to identify which
623:             *      group to remove.
624:             * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
625:             *     provided is not entitled to remvoe this group.
626:             * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
627:             *     if the id of the group contains an invalid value.
628:             *
629:             * @ejb.interface-method
630:             *      view-type = "remote"
631:             */
632:            public void removeGroup(final SecuritySession securitySession,
633:                    final Integer id) throws SystemException {
634:                getAddressBook().removeGroup(securitySession, id);
635:            }
636:
637:            /**
638:             * <p>Remove a person from the address book.</p>
639:             *
640:             * @param personDO data object containing the details of the
641:             *     person you want to remove. The id is used to locate and remove the
642:             *     person.
643:             *
644:             * @ejb.interface-method
645:             *      view-type = "remote"
646:             */
647:            public void removePerson(final SecuritySession securitySession,
648:                    final Integer id) throws SystemException {
649:                getAddressBook().removePerson(securitySession, id);
650:            }
651:
652:            /**
653:             * <p>Set up the context for this entity object. The session bean stores the
654:             * context for later use.</p>
655:             *
656:             * @param sessionContext the new context which the session object should
657:             *     store.
658:             */
659:            public final void setSessionContext(
660:                    final SessionContext sessionContext) {
661:                this .sessionContext = sessionContext;
662:            }
663:
664:            /**
665:             * <p>Confirm all of the elements of the person are address and valid,
666:             * before the message is sent.</p>
667:             *
668:             * @param addressDO data object to check for consistency and
669:             *     completeness.
670:             * @return a collection of validation errors if any of the
671:             *     mandatory fields are missing, or if fields contain invalid values.
672:             *
673:             * @ejb.interface-method
674:             *      view-type = "remote"
675:             */
676:            public ValidationErrors validate(
677:                    final SecuritySession securitySession,
678:                    final AddressDO addressDO) throws SystemException {
679:                return getAddressBook().validate(securitySession, addressDO);
680:            }
681:
682:            /**
683:             * <p>Confirm all of the elements of the group are present and valid,
684:             * before the message is sent.</p>
685:             *
686:             * @param groupDO data object to check for consistency and
687:             *     completeness.
688:             * @return a collection of validation errors if any of the
689:             *     mandatory fields are missing, or if fields contain invalid values.
690:             *
691:             * @ejb.interface-method
692:             *      view-type = "remote"
693:             */
694:            public ValidationErrors validate(
695:                    final SecuritySession securitySession, final GroupDO groupDO)
696:                    throws SystemException {
697:                return getAddressBook().validate(securitySession, groupDO);
698:            }
699:
700:            /**
701:             * <p>Confirm all of the elements of the person are present and valid,
702:             * before the message is sent.</p>
703:             *
704:             * @param personDO data object to check for consistency and
705:             *     completeness.
706:             * @return a collection of validation errors if any of the
707:             *     mandatory fields are missing, or if fields contain invalid values.
708:             *
709:             * @ejb.interface-method
710:             *      view-type = "remote"
711:             */
712:            public ValidationErrors validate(
713:                    final SecuritySession securitySession,
714:                    final PersonDO personDO) throws SystemException {
715:                return getAddressBook().validate(securitySession, personDO);
716:            }
717:
718:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.