--- /dev/null
+/*****************************************************************************
+ * Copyright Igor Barma, Eric Brun, Alexandre Desoubeaux, Christian Martel,
+ * (2 décembre 2008)
+ *
+ * Ce logiciel est un programme informatique servant à l'évaluation des
+ * compétences.
+ *
+ * Ce logiciel est régi par la licence CeCILL soumise au droit français et
+ * respectant les principes de diffusion des logiciels libres. Vous pouvez
+ * utiliser, modifier et/ou redistribuer ce programme sous les conditions
+ * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
+ * sur le site "http://www.cecill.info".
+ *
+ * En contrepartie de l'accessibilité au code source et des droits de copie,
+ * de modification et de redistribution accordés par cette licence, il n'est
+ * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
+ * seule une responsabilité restreinte pèse sur l'auteur du programme, le
+ * titulaire des droits patrimoniaux et les concédants successifs.
+ *
+ * A cet égard l'attention de l'utilisateur est attirée sur les risques
+ * associés au chargement, à l'utilisation, à la modification et/ou au
+ * développement et à la reproduction du logiciel par l'utilisateur étant
+ * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+ * manipuler et qui le réserve donc à des développeurs et des professionnels
+ * avertis possédant des connaissances informatiques approfondies. Les
+ * utilisateurs sont donc invités à charger et tester l'adéquation du
+ * logiciel à leurs besoins dans des conditions permettant d'assurer la
+ * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
+ * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
+ *
+ * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
+ * pris connaissance de la licence CeCILL, et que vous en avez accepté les
+ * termes.
+ *******************************************************************************/
+package com.pentila.evalcomp.domain;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import net.sf.gilead.annotations.ServerOnly;
+
+import com.pentila.evalcomp.domain.certification.UserCertInstance;
+import com.pentila.evalcomp.domain.certification.UserValidationInstance;
+import com.pentila.evalcomp.domain.definition.EvaluationDefinition;
+import com.pentila.evalcomp.domain.definition.Property;
+import com.pentila.evalcomp.domain.examen.Examen;
+import com.pentila.evalcomp.domain.examen.ExamenInstance;
+import com.pentila.evalcomp.domain.examen.Question;
+import com.pentila.evalcomp.domain.instance.CompetenceInstance;
+
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class User.
+ */
+
+public class User extends Entity {
+
+ /** The competence instances. */
+ Set<CompetenceInstance> competenceInstances;
+
+ /** The competence instances eval. */
+ Set<CompetenceInstance> competenceInstancesEval;
+
+ /** The email. */
+ String email;
+
+ /** The evaluation definitions. */
+ Set<EvaluationDefinition> evaluationDefinitions;
+
+ /** The firstname. */
+ String firstname;
+
+ /** Set og User groups *. */
+ /* This is just for deletation : do not Use it */
+ Set<Group> groups = new HashSet<Group>();
+
+ /** The lastname. */
+ String lastname;
+
+ /** The message recipients. */
+ Set<MessageRecipient> messageRecipients;
+
+ /** The messages. */
+ Set<Message> messages;
+
+ /** The password. */
+ private String password;
+
+ /** The properties. */
+ Set<Property> properties;
+
+ /** The ressource definitions. */
+ Set<RessourceDefinition> ressourceDefinitions;
+
+ /** The ressources. */
+ Set<Ressource> ressources;
+
+ /** The uid. */
+ String uid;
+
+ /** The preferences. */
+ Set<Preference> preferences;
+
+ /** The notifications. */
+ @ServerOnly
+ Set<Notification> notifications;
+
+ /** The events. */
+ @ServerOnly
+ Set<Event> events;
+
+ /** The events issuer. */
+ @ServerOnly
+ Set<Event> eventsIssuer;
+
+ /** The owner validation instances. */
+ Set<UserValidationInstance> ownerValidationInstances;
+
+ /** The officer validation instances. */
+ Set<UserValidationInstance> officerValidationInstances;
+
+ /** The owner cert instances. */
+ Set<UserCertInstance> ownerCertInstances;
+
+ /** The officer cert instances. */
+ Set<UserCertInstance> officerCertInstances;
+
+ @ServerOnly
+ Set<Examen> examens;
+
+ @ServerOnly
+ Set<Question> questions;
+
+ @ServerOnly
+ Set<ExamenInstance> examenInstances;
+
+ public User(){
+ super();
+ }
+
+
+ /**
+ * Gets the competence instances.
+ *
+ * @return the competence instances
+ */
+ public Set<CompetenceInstance> getCompetenceInstances() {
+ return competenceInstances;
+ }
+
+ /**
+ * Gets the email.
+ *
+ * @return the email
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * Gets the evaluation definitions.
+ *
+ * @return the evaluation definitions
+ */
+ public Set<EvaluationDefinition> getEvaluationDefinitions() {
+ return evaluationDefinitions;
+ }
+
+ /**
+ * Gets the firstname.
+ *
+ * @return the firstname
+ */
+ public String getFirstname() {
+ return firstname;
+ }
+
+ /**
+ * Gets the groups.
+ *
+ * @return the groups
+ */
+ public Set<Group> getGroups() {
+ return groups;
+ }
+
+ /**
+ * Gets the lastname.
+ *
+ * @return the lastname
+ */
+ public String getLastname() {
+ return lastname;
+ }
+
+ /**
+ * Gets the message recipients.
+ *
+ * @return the message recipients
+ */
+ public Set<MessageRecipient> getMessageRecipients() {
+ return messageRecipients;
+ }
+
+ /**
+ * Gets the messages.
+ *
+ * @return the messages
+ */
+ public Set<Message> getMessages() {
+ return messages;
+ }
+
+ /**
+ * Gets the password.
+ *
+ * @return the password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Gets the properties. Properties are additional parameters of Web
+ * interface Application for the user like:
+ *
+ * UL server ropository etc ...
+ *
+ * @return the properties
+ */
+ public Set<Property> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Gets the property value.
+ *
+ * @param propkey
+ * the propkey
+ *
+ * @return the property value
+ */
+ public String getPropertyValue(String propkey) {
+ if (properties != null) {
+ for (Property p : properties) {
+ if (p.getName().equals(propkey)) {
+ return p.getValue();
+ }
+ }
+ }
+ return "";
+ }
+
+ /**
+ * Gets the ressource definitions.
+ *
+ * @return the ressource definitions
+ */
+ public Set<RessourceDefinition> getRessourceDefinitions() {
+ return ressourceDefinitions;
+ }
+
+ /**
+ * Gets the ressources.
+ *
+ * @return the ressources
+ */
+ public Set<Ressource> getRessources() {
+ return ressources;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.pentila.evalcomp.domain.Entity#getUid()
+ */
+ @Override
+ public String getUid() {
+ return uid;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.pentila.evalcomp.domain.Entity#getUsers()
+ */
+ @Override
+ public Set<User> getUsers() {
+ Set<User> su = new HashSet<User>();
+ su.add(this);
+ return su;
+ }
+
+ /**
+ * Sets the competence instances.
+ *
+ * @param competenceInstances
+ * the new competence instances
+ */
+ public void setCompetenceInstances(
+ Set<CompetenceInstance> competenceInstances) {
+ this.competenceInstances = competenceInstances;
+ }
+
+ /**
+ * Sets the email.
+ *
+ * @param email
+ * the new email
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ /**
+ * Sets the evaluation definitions.
+ *
+ * @param evaluationDefinitions
+ * the new evaluation definitions
+ */
+ public void setEvaluationDefinitions(
+ Set<EvaluationDefinition> evaluationDefinitions) {
+ this.evaluationDefinitions = evaluationDefinitions;
+ }
+
+ /**
+ * Sets the firstname.
+ *
+ * @param firstname
+ * the new firstname
+ */
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ /**
+ * Sets the groups.
+ *
+ * @param groups
+ * the new groups
+ */
+ public void setGroups(Set<Group> groups) {
+ this.groups = groups;
+ }
+
+ /**
+ * Sets the lastname.
+ *
+ * @param lastname
+ * the new lastname
+ */
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ /**
+ * Sets the message recipients.
+ *
+ * @param messageRecipients
+ * the new message recipients
+ */
+ public void setMessageRecipients(Set<MessageRecipient> messageRecipients) {
+ this.messageRecipients = messageRecipients;
+ }
+
+ /**
+ * Sets the messages.
+ *
+ * @param messages
+ * the new messages
+ */
+ public void setMessages(Set<Message> messages) {
+ this.messages = messages;
+ }
+
+ /**
+ * Sets the password.
+ *
+ * @param password
+ * the new password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param properties
+ * the new properties
+ */
+ public void setProperties(Set<Property> properties) {
+ this.properties = properties;
+ }
+
+ /**
+ * Sets the ressource definitions.
+ *
+ * @param ressourceDefinitions
+ * the new ressource definitions
+ */
+ public void setRessourceDefinitions(
+ Set<RessourceDefinition> ressourceDefinitions) {
+ this.ressourceDefinitions = ressourceDefinitions;
+ }
+
+ /**
+ * Sets the ressources.
+ *
+ * @param ressources
+ * the new ressources
+ */
+ public void setRessources(Set<Ressource> ressources) {
+ this.ressources = ressources;
+ }
+
+ /**
+ * Sets the uid.
+ *
+ * @param uid
+ * the new uid
+ */
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * Gets the preferences.
+ *
+ * @return the preferences
+ */
+ public Set<Preference> getPreferences() {
+ return preferences;
+ }
+
+ /**
+ * Sets the preferences.
+ *
+ * @param preferences the new preferences
+ */
+ public void setPreferences(Set<Preference> preferences) {
+ this.preferences = preferences;
+ }
+
+ /**
+ * Gets the preference by name.
+ *
+ * @param name the name
+ * @return the preference by name
+ */
+ public Preference getPreferenceByName(String name){
+
+ if (preferences != null){
+
+ for (Preference p : preferences){
+ if (p.getName().equals(name)){
+ return p;
+
+ }
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Gets the notifications.
+ *
+ * @return the notifications
+ */
+ public Set<Notification> getNotifications() {
+ return notifications;
+ }
+
+ /**
+ * Sets the notifications.
+ *
+ * @param notifications the new notifications
+ */
+ public void setNotifications(Set<Notification> notifications) {
+ this.notifications = notifications;
+ }
+
+ /**
+ * Gets the competence instances eval.
+ *
+ * @return the competence instances eval
+ */
+ public Set<CompetenceInstance> getCompetenceInstancesEval() {
+ return competenceInstancesEval;
+ }
+
+ /**
+ * Sets the competence instances eval.
+ *
+ * @param competenceInstancesEval the new competence instances eval
+ */
+ public void setCompetenceInstancesEval(
+ Set<CompetenceInstance> competenceInstancesEval) {
+ this.competenceInstancesEval = competenceInstancesEval;
+ }
+
+ /**
+ * Gets the events.
+ *
+ * @return the events
+ */
+ public Set<Event> getEvents() {
+ return events;
+ }
+
+ /**
+ * Sets the events.
+ *
+ * @param events the new events
+ */
+ public void setEvents(Set<Event> events) {
+ this.events = events;
+ }
+
+ /**
+ * Gets the events issuer.
+ *
+ * @return the events issuer
+ */
+ public Set<Event> getEventsIssuer() {
+ return eventsIssuer;
+ }
+
+ /**
+ * Sets the events issuer.
+ *
+ * @param eventsIssuer the new events issuer
+ */
+ public void setEventsIssuer(Set<Event> eventsIssuer) {
+ this.eventsIssuer = eventsIssuer;
+ }
+
+ /**
+ * Gets the owner validation instances.
+ *
+ * @return the owner validation instances
+ */
+ public Set<UserValidationInstance> getOwnerValidationInstances() {
+ return ownerValidationInstances;
+ }
+
+ /**
+ * Sets the owner validation instances.
+ *
+ * @param ownerValidationInstances the new owner validation instances
+ */
+ public void setOwnerValidationInstances(
+ Set<UserValidationInstance> ownerValidationInstances) {
+ this.ownerValidationInstances = ownerValidationInstances;
+ }
+
+ /**
+ * Gets the officer validation instances.
+ *
+ * @return the officer validation instances
+ */
+ public Set<UserValidationInstance> getOfficerValidationInstances() {
+ return officerValidationInstances;
+ }
+
+ /**
+ * Sets the officer validation instances.
+ *
+ * @param officerValidationInstances the new officer validation instances
+ */
+ public void setOfficerValidationInstances(
+ Set<UserValidationInstance> officerValidationInstances) {
+ this.officerValidationInstances = officerValidationInstances;
+ }
+
+ /**
+ * Gets the owner cert instances.
+ *
+ * @return the owner cert instances
+ */
+ public Set<UserCertInstance> getOwnerCertInstances() {
+ return ownerCertInstances;
+ }
+
+ /**
+ * Sets the owner cert instances.
+ *
+ * @param ownerCertInstances the new owner cert instances
+ */
+ public void setOwnerCertInstances(Set<UserCertInstance> ownerCertInstances) {
+ this.ownerCertInstances = ownerCertInstances;
+ }
+
+
+
+
+
+
+ /**
+ * Gets the officer cert instances.
+ *
+ * @return the officer cert instances
+ */
+ public Set<UserCertInstance> getOfficerCertInstances() {
+ return officerCertInstances;
+ }
+
+ /**
+ * Sets the officer cert instances.
+ *
+ * @param officerCertInstances the new officer cert instances
+ */
+ public void setOfficerCertInstances(Set<UserCertInstance> officerCertInstances) {
+ this.officerCertInstances = officerCertInstances;
+ }
+
+
+ public Set<Question> getQuestions() {
+ return questions;
+ }
+
+
+ public void setQuestions(Set<Question> questions) {
+ this.questions = questions;
+ }
+
+
+ public Set<Examen> getExamens() {
+ return examens;
+ }
+
+
+ public void setExamens(Set<Examen> examens) {
+ this.examens = examens;
+ }
+
+
+ public Set<ExamenInstance> getExamenInstances() {
+ return examenInstances;
+ }
+
+
+ public void setExamenInstances(Set<ExamenInstance> examenInstances) {
+ this.examenInstances = examenInstances;
+ }
+
+
+
+
+
+
+
+}