01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
04: *
05: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
06: * General Public License as published by the Free Software Foundation; either version 2 of the License,
07: * or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with this program; if not,
14: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15: */
16:
17: package wilos.business.webservices.transfertobject;
18:
19: import java.io.Serializable;
20: import java.util.HashSet;
21: import java.util.Set;
22:
23: import wilos.model.misc.concreterole.ConcreteRoleDescriptor;
24: import wilos.model.misc.concreteworkproduct.ConcreteWorkProductDescriptor;
25: import wilos.model.misc.wilosuser.Participant;
26:
27: /**
28: *
29: * @author toine
30: */
31: public class ParticipantTO extends Participant implements Serializable {
32:
33: /**
34: *
35: */
36: private static final long serialVersionUID = -175514417997688236L;
37:
38: /** Creates a new instance of ParticipantTO */
39: public ParticipantTO() {
40:
41: }
42:
43: public ParticipantTO(Participant myParticipant) {
44: this .setName(myParticipant.getName());
45: this .setLogin(myParticipant.getLogin());
46: this .setPassword(myParticipant.getPassword());
47: this .setFirstname(myParticipant.getFirstname());
48: this .setEmailAddress(myParticipant.getEmailAddress());
49:
50: Set<ConcreteRoleDescriptor> concreteRoleDescriptors = new HashSet<ConcreteRoleDescriptor>();
51: for (ConcreteRoleDescriptor crd : myParticipant
52: .getConcreteRoleDescriptors()) {
53: concreteRoleDescriptors.add(new ConcreteRoleDescriptorTO(
54: crd));
55: }
56: this .setConcreteRoleDescriptors(concreteRoleDescriptors);
57:
58: Set<ConcreteWorkProductDescriptor> concreteWorkProductDescriptors = new HashSet<ConcreteWorkProductDescriptor>();
59: for (ConcreteWorkProductDescriptor cwpd : myParticipant
60: .getConcreteWorkProductDescriptors()) {
61: concreteWorkProductDescriptors
62: .add(new ConcreteWorkProductDescriptorTO(cwpd));
63: }
64: this
65: .setConcreteWorkProductDescriptors(concreteWorkProductDescriptors);
66:
67: }
68:
69: }
|