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
da8cc7b4
Commit
da8cc7b4
authored
Feb 11, 2021
by
sunye
Browse files
Simplify command behavior for Tag creation
parent
1a750cbb
Changes
20
Hide whitespace changes
Inline
Side-by-side
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeCreerTag.java
View file @
da8cc7b4
package
fr.alma.gtd.server.main.commande
;
import
fr.alma.gtd.server.main.donnees.Tag
;
import
fr.alma.gtd.server.persistence.data.Utilisateur
;
import
fr.alma.gtd.server.persistence.sessions.ITagServiceRemote
;
import
fr.alma.gtd.server.persistence.sessions.IUtilisateurServiceRemote
;
...
...
@@ -54,23 +55,11 @@ public final class CommandeCreerTag implements Commande {
this
.
identification
=
i
;
this
.
tag
=
t
;
this
.
callback
=
c
;
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
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
Tag
newTag
=
new
Tag
(
tag
);
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeEnvoyerContexte.java
View file @
da8cc7b4
...
...
@@ -63,23 +63,11 @@ public final class CommandeEnvoyerContexte implements Commande {
this
.
contexte
=
c
;
this
.
mode
=
m
;
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
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeEnvoyerIdee.java
View file @
da8cc7b4
...
...
@@ -63,24 +63,12 @@ public final class CommandeEnvoyerIdee implements Commande {
this
.
idee
=
i
;
this
.
mode
=
m
;
this
.
callback
=
c
;
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
.
ideeServiceRemote
=
(
IIdeeServiceRemote
)
context
.
lookup
(
"IdeeService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeEnvoyerProjet.java
View file @
da8cc7b4
...
...
@@ -63,23 +63,12 @@ public final class CommandeEnvoyerProjet implements Commande {
this
.
projet
=
p
;
this
.
mode
=
m
;
this
.
callback
=
c
;
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
.
projetServiceRemote
=
(
IProjetServiceRemote
)
context
.
lookup
(
"ProjetService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeEnvoyerTache.java
View file @
da8cc7b4
...
...
@@ -63,23 +63,12 @@ public final class CommandeEnvoyerTache implements Commande {
this
.
tache
=
t
;
this
.
mode
=
m
;
this
.
callback
=
c
;
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
.
tacheServiceRemote
=
(
ITacheServiceRemote
)
context
.
lookup
(
"TacheService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeEnvoyerTag.java
View file @
da8cc7b4
...
...
@@ -62,23 +62,12 @@ public final class CommandeEnvoyerTag implements Commande {
this
.
tag
=
t
;
this
.
mode
=
m
;
this
.
callback
=
c
;
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
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerCompte.java
View file @
da8cc7b4
...
...
@@ -8,7 +8,8 @@ public class CommandeSupprimerCompte implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerContexte.java
View file @
da8cc7b4
...
...
@@ -56,22 +56,12 @@ public final class CommandeSupprimerContexte implements Commande {
this
.
contexte
=
c
;
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
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerIdee.java
View file @
da8cc7b4
...
...
@@ -56,23 +56,12 @@ public final class CommandeSupprimerIdee implements Commande {
this
.
identification
=
ii
;
this
.
idee
=
i
;
this
.
callback
=
c
;
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
.
ideeServiceRemote
=
(
IIdeeServiceRemote
)
context
.
lookup
(
"IdeeService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerProjet.java
View file @
da8cc7b4
...
...
@@ -54,23 +54,12 @@ public final class CommandeSupprimerProjet implements Commande {
this
.
identification
=
i
;
this
.
projet
=
p
;
this
.
callback
=
c
;
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
.
projetServiceRemote
=
(
IProjetServiceRemote
)
context
.
lookup
(
"ProjetService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerTache.java
View file @
da8cc7b4
...
...
@@ -55,22 +55,12 @@ public final class CommandeSupprimerTache implements Commande {
this
.
tache
=
t
;
this
.
callback
=
c
;
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
.
tacheServiceRemote
=
(
ITacheServiceRemote
)
context
.
lookup
(
"TacheService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeSupprimerTag.java
View file @
da8cc7b4
...
...
@@ -56,22 +56,12 @@ public final class CommandeSupprimerTag implements Commande {
this
.
tag
=
t
;
this
.
callback
=
c
;
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
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeArchive.java
View file @
da8cc7b4
...
...
@@ -18,7 +18,8 @@ public class CommandeTelechargeArchive implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeCalendrier.java
View file @
da8cc7b4
...
...
@@ -18,7 +18,8 @@ public class CommandeTelechargeCalendrier implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeContextes.java
View file @
da8cc7b4
...
...
@@ -70,6 +70,7 @@ public final class CommandeTelechargeContextes implements Commande {
@Override
public
void
execute
()
{
// TODO
}
...
...
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeIdees.java
View file @
da8cc7b4
...
...
@@ -16,7 +16,8 @@ public class CommandeTelechargeIdees implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeInbox.java
View file @
da8cc7b4
...
...
@@ -17,7 +17,8 @@ public class CommandeTelechargeInbox implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/commande/CommandeTelechargeLog.java
View file @
da8cc7b4
...
...
@@ -19,7 +19,8 @@ public class CommandeTelechargeLog implements Commande {
@Override
public
void
execute
()
{
// TODO
}
}
gtd-server-main/src/main/java/fr/alma/gtd/server/main/donnees/Tag.java
0 → 100644
View file @
da8cc7b4
package
fr.alma.gtd.server.main.donnees
;
import
fr.alma.gtd.server.core.IParticipant
;
import
fr.alma.gtd.server.core.ITag
;
import
java.util.Date
;
public
class
Tag
implements
ITag
{
private
String
id
;
private
char
[]
nom
;
public
Tag
()
{}
public
Tag
(
ITag
autre
)
{
id
=
autre
.
getIdentifiantServeur
();
nom
=
autre
.
getNom
().
toCharArray
();
}
@Override
public
String
getIdentifiantServeur
()
{
return
id
;
}
@Override
public
void
setIdentifiantServeur
(
String
idServeur
)
{
id
=
idServeur
;
}
@Override
public
Date
getDateDeDerniereModification
()
{
return
null
;
}
@Override
public
void
setDateDeDerniereModification
(
Date
dateDerniereModification
)
{
}
@Override
public
String
getNom
()
{
return
String
.
valueOf
(
nom
);
}
@Override
public
void
setNom
(
String
n
)
{
nom
=
n
.
toCharArray
();
}
@Override
public
IParticipant
getCreateur
()
{
return
null
;
}
@Override
public
void
setCreateur
(
IParticipant
c
)
{
}
}
gtd-server-main/src/test/java/fr/alma/gtd/server/main/donnees/TagTest.java
0 → 100644
View file @
da8cc7b4
package
fr.alma.gtd.server.main.donnees
;
import
junit.framework.TestCase
;
public
class
TagTest
extends
TestCase
{
public
void
testGetNom
()
{
Tag
tag
=
new
Tag
();
tag
.
setNom
(
"Un nom"
);
assert
"Un nom"
.
equals
(
tag
.
getNom
());
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment