Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
naomod
Software Construction and Evolution (SCE)
GTD Server
Commits
02e0d8ee
Commit
02e0d8ee
authored
Feb 04, 2021
by
sunye
Browse files
Several refactorings
parent
bc6f10bf
Changes
202
Expand all
Hide whitespace changes
Inline
Side-by-side
JBoss/src/main/java/fr/alma/gtd/commande/CommandeCreerContexte.java
deleted
100644 → 0
View file @
bc6f10bf
package
fr.alma.gtd.commande
;
import
fr.alma.gtd.donneespartagees.IContexte
;
import
fr.alma.gtd.donneesserveur.Utilisateur
;
import
fr.alma.gtd.interfacedistante.CallBack
;
import
fr.alma.gtd.isessions.IContexteServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.Properties
;
import
javax.naming.Context
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
/**
* Commande de creation d'un contexte.
* author Nobody
* @version 1.0.0
*/
public
final
class
CommandeCreerContexte
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
private
final
String
identification
;
/**
* Le contexte.
*/
private
final
IContexte
contexte
;
/**
* Le callback.
*/
private
final
CallBack
<
IContexte
>
callback
;
/**
* Le service de gestion des contextes.
*/
private
IContexteServiceRemote
contexteServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
private
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param co Le contexte.
* @param ca Le callback.
*/
public
CommandeCreerContexte
(
final
String
i
,
final
IContexte
co
,
final
CallBack
<
IContexte
>
ca
)
{
super
();
this
.
identification
=
i
;
this
.
contexte
=
co
;
this
.
callback
=
ca
;
final
Properties
env
=
new
Properties
();
env
.
setProperty
(
"java.naming.factory.initial"
,
"org.jnp.interfaces.NamingContextFactory"
);
env
.
setProperty
(
"java.naming.provider.url"
,
"localhost:1099"
);
env
.
setProperty
(
"java.naming.factory.url.pkgs"
,
"org.jboss.naming"
);
try
{
final
Context
context
=
new
InitialContext
(
env
);
this
.
contexteServiceRemote
=
(
IContexteServiceRemote
)
context
.
lookup
(
"ContexteService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
throws
RemoteException
{
final
IContexte
ctx
=
this
.
contexteServiceRemote
.
getContexteById
(
this
.
contexte
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
contexte
.
getCreateur
().
getIdentifiantServeur
());
if
((
ctx
==
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
uti
.
getIdentifiantServeur
())))
{
this
.
callback
.
onSucces
(
this
.
contexteServiceRemote
.
creerContexte
(
this
.
contexte
));
}
else
{
if
(
ctx
!=
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Contexte deja existant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
}
JBoss/src/main/java/fr/alma/gtd/commande/CommandeTelechargeContextes.java
deleted
100644 → 0
View file @
bc6f10bf
package
fr.alma.gtd.commande
;
import
fr.alma.gtd.donneespartagees.IContexte
;
import
fr.alma.gtd.donneesserveur.Utilisateur
;
import
fr.alma.gtd.interfacedistante.CallBack
;
import
fr.alma.gtd.isessions.IContexteServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.List
;
/**
* Commande de telechargement d'un contexte.
* author Nobody
* @version 1.0.0
*/
public
final
class
CommandeTelechargeContextes
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
private
final
String
identification
;
/**
* Le nom d'utilisateur.
*/
private
final
String
username
;
/**
* Le callback.
*/
private
final
CallBack
<
List
<
IContexte
>>
callback
;
/**
* Le service de gestion de contexte.
*/
private
IContexteServiceRemote
contexteServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
private
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param c Le callback.
*/
public
CommandeTelechargeContextes
(
final
String
i
,
final
CallBack
<
List
<
IContexte
>>
c
)
{
super
();
this
.
identification
=
i
;
this
.
callback
=
c
;
this
.
username
=
""
;
}
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param u Le nom d'utilisateur.
* @param c Le callback.
*/
public
CommandeTelechargeContextes
(
final
String
i
,
final
String
u
,
final
CallBack
<
List
<
IContexte
>>
c
)
{
super
();
this
.
identification
=
i
;
this
.
username
=
u
;
this
.
callback
=
c
;
}
@Override
public
void
execute
()
throws
RemoteException
{
if
(
""
.
equalsIgnoreCase
(
this
.
username
))
{
//TODO
}
else
{
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
identification
);
if
(
uti
!=
null
)
{
this
.
callback
.
onSucces
(
this
.
contexteServiceRemote
.
getContexteByCreateur
(
uti
.
getIdentifiantServeur
()));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
}
JBoss/src/main/java/fr/alma/gtd/donneesserveur/Projet.java
deleted
100644 → 0
View file @
bc6f10bf
package
fr.alma.gtd.donneesserveur
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
javax.persistence.Basic
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
org.hibernate.annotations.GenericGenerator
;
import
fr.alma.gtd.donneespartagees.AbstractProjet
;
import
fr.alma.gtd.donneespartagees.Avancement
;
import
fr.alma.gtd.donneespartagees.IContact
;
import
fr.alma.gtd.donneespartagees.IContexte
;
import
fr.alma.gtd.donneespartagees.IParticipant
;
import
fr.alma.gtd.donneespartagees.IProjet
;
import
fr.alma.gtd.donneespartagees.ITache
;
/**
* Bean Entite representant un Projet et charge de gerer sa persistance.
* author Nobody
* @version 1.0.0
*/
@Entity
@Table
(
name
=
"PROJET"
)
public
final
class
Projet
extends
AbstractProjet
{
/**
* L'ID.
*/
private
static
final
long
serialVersionUID
=
4820282979269181082L
;
/**
* Le constructeur par defaut.
*/
public
Projet
()
{
super
();
}
/**
* Le constructeur avec initialisation du nom, du contexte par defaut et du createur.
* @param n Le nom choisi.
* @param contexte Le contexte choisi.
* @param c Le createur du projet.
*/
public
Projet
(
final
String
n
,
final
IContexte
contexte
,
final
IParticipant
c
)
{
super
(
n
,
contexte
,
c
);
}
/**
* Constructeur de recopie d'un projet.
* @param p Projet a recopier
*/
public
Projet
(
final
IProjet
p
)
{
super
(
p
);
this
.
avancement
=
p
.
getAvancement
();
this
.
contacts
=
p
.
getListeContacts
();
this
.
contexteParDefaut
=
p
.
getContexteParDefaut
();
this
.
createur
=
p
.
getCreateur
();
this
.
dateDeDerniereModification
=
p
.
getDateDeDerniereModification
();
this
.
nom
=
p
.
getNom
();
this
.
dansArchive
=
p
.
isDansArchive
();
this
.
dansLaPoubelle
=
p
.
isDansLaPoubelle
();
this
.
listeDesParticipants
=
p
.
getListeDeParticipants
();
this
.
listeDesSousProjets
=
p
.
getListeDeSousProjets
();
this
.
listeDesTaches
=
p
.
getListeDeTaches
();
}
@Id
@GeneratedValue
(
generator
=
"system-uuid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"uuid"
)
@Override
public
String
getIdentifiantServeur
()
{
return
this
.
identifiantServeur
;
}
@Override
@ManyToOne
public
Participant
getCreateur
()
{
return
(
Participant
)
this
.
createur
;
}
@Override
@Basic
public
Date
getDateDeDerniereModification
()
{
return
this
.
dateDeDerniereModification
;
}
@Override
@Basic
public
String
getNom
()
{
return
this
.
nom
;
}
@Override
@Basic
public
Avancement
getAvancement
()
{
return
this
.
avancement
;
}
@Override
@ManyToOne
public
Contexte
getContexteParDefaut
()
{
return
(
Contexte
)
this
.
contexteParDefaut
;
}
@Transient
@Override
public
List
<
IParticipant
>
getListeDeParticipants
()
{
return
this
.
listeDesParticipants
;
}
@Transient
@Override
public
List
<
ITache
>
getListeDeTaches
()
{
return
this
.
listeDesTaches
;
}
@Override
@Basic
public
boolean
isDansLaPoubelle
()
{
return
dansLaPoubelle
;
}
@Override
@Basic
public
boolean
isDansArchive
()
{
return
this
.
dansArchive
;
}
@Transient
@Override
public
List
<
IContact
>
getListeContacts
()
{
return
contacts
;
}
@Transient
@Override
public
List
<
IProjet
>
getListeDeSousProjets
()
{
return
this
.
listeDesSousProjets
;
}
/*
* Methodes privees appelees uniquement par Hibernate :
* getters et setters permettant d'assurer la persistance des listes :
* - de Sous-Projets
* - de Participants
* - de Tags
*/
@ManyToMany
(
fetch
=
FetchType
.
EAGER
,
cascade
=
CascadeType
.
ALL
)
private
Set
<
Projet
>
getListeDesSousProjets
()
{
Set
<
Projet
>
listeElem
=
new
HashSet
<
Projet
>();
for
(
IProjet
iElem
:
listeDesSousProjets
){
listeElem
.
add
((
Projet
)
iElem
);
}
return
listeElem
;
}
private
void
setListeDesSousProjets
(
Set
<
Projet
>
ssprojets
)
{
listeDesSousProjets
.
clear
();
for
(
IProjet
t
:
ssprojets
){
listeDesSousProjets
.
add
(
t
);
}
}
@ManyToMany
(
fetch
=
FetchType
.
EAGER
)
private
Set
<
Participant
>
getListeDesParticipants
()
{
Set
<
Participant
>
listeElem
=
new
HashSet
<
Participant
>();
for
(
IParticipant
iElem
:
listeDesParticipants
){
listeElem
.
add
((
Participant
)
iElem
);
}
return
listeElem
;
}
private
void
setListeDesParticipants
(
Set
<
Participant
>
Participants
)
{
listeDesParticipants
.
clear
();
for
(
Participant
t
:
Participants
){
listeDesParticipants
.
add
(
t
);
}
}
@OneToMany
(
mappedBy
=
"projetConteneur"
,
fetch
=
FetchType
.
EAGER
,
cascade
=
CascadeType
.
ALL
)
private
Set
<
Tache
>
getListeDesTaches
()
{
Set
<
Tache
>
listeElem
=
new
HashSet
<
Tache
>();
for
(
ITache
iElem
:
listeDesTaches
){
listeElem
.
add
((
Tache
)
iElem
);
}
return
listeElem
;
}
private
void
setListeDesTaches
(
Set
<
Tache
>
listedesTaches
)
{
listeDesTaches
.
clear
();
for
(
Tache
t
:
listedesTaches
){
listeDesTaches
.
add
(
t
);
t
.
setProjetConteneur
(
this
);
}
}
@OneToMany
(
fetch
=
FetchType
.
EAGER
,
cascade
=
CascadeType
.
ALL
)
private
Set
<
Contact
>
getContacts
()
{
Set
<
Contact
>
listeElem
=
new
HashSet
<
Contact
>();
for
(
IContact
iElem
:
contacts
){
listeElem
.
add
((
Contact
)
iElem
);
}
return
listeElem
;
}
private
void
setContacts
(
Set
<
Contact
>
listedescontacts
)
{
contacts
.
clear
();
for
(
Contact
t
:
listedescontacts
){
contacts
.
add
(
t
);
}
}
}
JBoss/src/main/java/fr/alma/gtd/donneesserveur/Tag.java
deleted
100644 → 0
View file @
bc6f10bf
package
fr.alma.gtd.donneesserveur
;
import
java.util.Date
;
import
javax.persistence.Basic
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
org.hibernate.annotations.GenericGenerator
;
import
fr.alma.gtd.donneespartagees.AbstractTag
;
import
fr.alma.gtd.donneespartagees.IParticipant
;
import
fr.alma.gtd.donneespartagees.ITag
;
/**
* Bean Entite representant un Tag et charge de gerer sa persistance.
* author Nobody
* @version 1.0.0
*/
@Entity
@Table
(
name
=
"TAG"
)
public
final
class
Tag
extends
AbstractTag
{
/**
* Identifiant de serialisation.
*/
private
static
final
long
serialVersionUID
=
636415771384651280L
;
/**
* Le constructeur par defaut.
*/
public
Tag
()
{
super
();
}
/**
* Constructeur d'un Tag (prend simplement le nom correspondant au Tag).
* @param name Nom correspondant au Tag
* @param p Le createur du tag.
*/
public
Tag
(
final
String
name
,
final
IParticipant
p
)
{
super
(
name
,
p
);
}
/**
* Constructeur de recopie d'un Tag.
* @param tag Tag a recopier
*/
public
Tag
(
final
ITag
tag
)
{
super
(
tag
);
}
@Id
@GeneratedValue
(
generator
=
"system-uuid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"uuid"
)
@Override
public
String
getIdentifiantServeur
()
{
return
this
.
identifiantServeur
;
}
@ManyToOne
@Override
public
Participant
getCreateur
()
{
return
(
Participant
)
this
.
createur
;
}
@Basic
@Override
public
Date
getDateDeDerniereModification
()
{
return
this
.
dateDeDerniereModification
;
}
@Basic
@Override
public
String
getNom
()
{
return
this
.
nom
;
}
}
JBoss/src/main/model/serveur.uml
deleted
100644 → 0
View file @
bc6f10bf
This diff is collapsed.
Click to expand it.
JBoss/src/main/model/serveur.umldi
deleted
100644 → 0
View file @
bc6f10bf
This diff is collapsed.
Click to expand it.
JBoss/src/main/model/serveurgtd.uml
deleted
100644 → 0
View file @
bc6f10bf
<?xml version="1.0" encoding="UTF-8"?>
<uml:Model
xmi:version=
"2.1"
xmlns:xmi=
"http://schema.omg.org/spec/XMI/2.1"
xmlns:uml=
"http://www.eclipse.org/uml2/3.0.0/UML"
xmi:id=
"_qb8akM37EdqwVrslYOdUDA"
name=
"serveurgtd"
>
<packagedElement
xmi:type=
"uml:Package"
xmi:id=
"_w8IxIM37EdqwVrslYOdUDA"
name=
"Use Case View"
/>
<packagedElement
xmi:type=
"uml:Package"
xmi:id=
"_wSRJAHFzEduxYLkhQoh7Ag"
name=
"Logical View"
/>
<packagedElement
xmi:type=
"uml:Package"
xmi:id=
"_ypXjQHFzEduxYLkhQoh7Ag"
name=
"Component View"
>
<packagedElement
xmi:type=
"uml:Component"
xmi:id=
"_zwUu0HF0EduxYLkhQoh7Ag"
name=
"Main"
/>
</packagedElement>
<packagedElement
xmi:type=
"uml:Package"
xmi:id=
"_1coVEHFzEduxYLkhQoh7Ag"
name=
"Deployment View"
/>
</uml:Model>
JBoss/src/main/model/serveurgtd.umldi
deleted
100644 → 0
View file @
bc6f10bf
<?xml version="1.0" encoding="UTF-8"?>
<diagrams:Diagrams
xmi:version=
"2.0"
xmlns:xmi=
"http://www.omg.org/XMI"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:di=
"http://www.topcased.org/DI/1.0"
xmlns:diagrams=
"http://www.topcased.org/Diagrams/0.11"
activeDiagram=
"//@subdiagrams.1/@diagrams.0"
>
<model
href=
"serveurgtd.uml#_qb8akM37EdqwVrslYOdUDA"
/>
<subdiagrams>
<model
href=
"serveurgtd.uml#_w8IxIM37EdqwVrslYOdUDA"
/>
<diagrams
position=
"0,0"
size=
"100,100"
name=
"Main"
viewport=
"0,0"
>
<property
key=
"pageFormatName"
value=
"A2"
/>
<property
key=
"diagramWidth"
value=
"1680"
/>
<property
key=
"diagramHeight"
value=
"2376"
/>
<property
key=
"pageMarginName"
value=
"Small Margin"
/>
<property
key=
"diagramTopMargin"
value=
"20"
/>
<property
key=
"diagramBottomMargin"
value=
"20"
/>
<property
key=
"diagramLeftMargin"
value=
"20"
/>
<property
key=
"diagramRightMargin"
value=
"20"
/>
<property
key=
"orientation"
value=
"portrait"
/>
<semanticModel
xsi:type=
"di:EMFSemanticModelBridge"
presentation=
"org.topcased.modeler.uml.usecasediagram"
>
<element
href=
"serveurgtd.uml#_w8IxIM37EdqwVrslYOdUDA"
/>
</semanticModel>
</diagrams>
</subdiagrams>
<subdiagrams>
<model
href=
"serveurgtd.uml#_wSRJAHFzEduxYLkhQoh7Ag"
/>
<diagrams
position=
"0,0"
size=
"100,100"
name=
"Main"
viewport=
"0,0"
>
<property
key=
"pageFormatName"
value=
"A2"
/>
<property
key=
"diagramWidth"
value=
"1680"
/>
<property
key=
"diagramHeight"
value=
"2376"
/>
<property
key=
"pageMarginName"
value=
"Small Margin"
/>
<property
key=
"diagramTopMargin"
value=
"20"
/>
<property
key=
"diagramBottomMargin"
value=
"20"
/>
<property
key=
"diagramLeftMargin"
value=
"20"
/>
<property
key=
"diagramRightMargin"
value=
"20"
/>
<property
key=
"orientation"
value=
"portrait"
/>
<semanticModel
xsi:type=
"di:EMFSemanticModelBridge"
presentation=
"org.topcased.modeler.uml.classdiagram"
>
<element
href=
"serveurgtd.uml#_wSRJAHFzEduxYLkhQoh7Ag"
/>
</semanticModel>
</diagrams>
</subdiagrams>
<subdiagrams>
<model
href=
"serveurgtd.uml#_zwUu0HF0EduxYLkhQoh7Ag"
/>
<diagrams
position=
"0,0"
size=
"100,100"
name=
"Main"
viewport=
"0,0"
>
<property
key=
"pageFormatName"
value=
"A2"
/>
<property
key=
"diagramWidth"
value=
"1680"
/>
<property
key=
"diagramHeight"
value=
"2376"
/>
<property
key=
"pageMarginName"
value=
"Small Margin"
/>
<property
key=
"diagramTopMargin"
value=
"20"
/>
<property
key=
"diagramBottomMargin"
value=
"20"
/>
<property
key=
"diagramLeftMargin"
value=
"20"
/>
<property
key=
"diagramRightMargin"
value=
"20"
/>
<property
key=
"orientation"
value=
"portrait"
/>
<semanticModel
xsi:type=
"di:EMFSemanticModelBridge"
presentation=
"org.topcased.modeler.uml.componentdiagram"
>
<element
href=
"serveurgtd.uml#_zwUu0HF0EduxYLkhQoh7Ag"
/>
</semanticModel>
</diagrams>
</subdiagrams>
<subdiagrams>
<model
href=
"serveurgtd.uml#_1coVEHFzEduxYLkhQoh7Ag"
/>
<diagrams
position=
"0,0"
size=
"100,100"
name=
"Main"
viewport=
"0,0"
>
<property
key=
"pageFormatName"
value=
"A2"
/>
<property
key=
"diagramWidth"
value=
"1680"
/>
<property
key=
"diagramHeight"
value=
"2376"
/>
<property
key=
"pageMarginName"
value=
"Small Margin"
/>
<property
key=
"diagramTopMargin"
value=
"20"
/>
<property
key=
"diagramBottomMargin"
value=
"20"
/>
<property
key=
"diagramLeftMargin"
value=
"20"
/>
<property
key=
"diagramRightMargin"
value=
"20"
/>
<property
key=
"orientation"
value=
"portrait"
/>
<semanticModel
xsi:type=
"di:EMFSemanticModelBridge"
presentation=
"org.topcased.modeler.uml.deploymentdiagram"
>
<element
href=
"serveurgtd.uml#_1coVEHFzEduxYLkhQoh7Ag"
/>
</semanticModel>
</diagrams>
</subdiagrams>
</diagrams:Diagrams>
JBoss/src/main/resources/META-INF/MANIFEST.MF
deleted
100644 → 0
View file @
bc6f10bf
Manifest-Version: 1.0
Class-Path:
JBoss/src/main/resources/META-INF/persistence.xml
deleted
100644 → 0
View file @
bc6f10bf
<?xml version="1.0" encoding="UTF-8"?>
<persistence
version=