Author: glandais Date: 2008-02-18 13:18:14 +0000 (Mon, 18 Feb 2008) New Revision: 1063 Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationService.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceImpl.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/MockAuthenticationServiceImpl.java trunk/simexplorer-is/src/site/fr/rst/todo.rst Log: Elements owned TODO list update Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java 2008-02-18 13:18:14 UTC (rev 1063) @@ -216,6 +216,15 @@ public List<Permission> getPermissions(Actor actor, String businessId); /** + * Gets the permissions. + * + * @param actor the actor + * + * @return the permissions + */ + public List<Permission> getPermissionsOwnedBy(Actor actor); + + /** * Save permission. * * @param p the p Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java 2008-02-18 13:18:14 UTC (rev 1063) @@ -278,6 +278,14 @@ return permissions; } + @Override + public List<Permission> getPermissionsOwnedBy(Actor actor) { + List<Permission> permissions = CollectionUtil.toGenericList(em.createQuery( + "select p from Permission p where p.actor=:actor and p.owner = true").setParameter("actor", actor) + .getResultList(), Permission.class); + return permissions; + } + /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#savePermission(fr.cemagref.simexplorer.is.security.entities.Permission) */ Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationService.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationService.java 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationService.java 2008-02-18 13:18:14 UTC (rev 1063) @@ -24,16 +24,20 @@ import javax.ejb.Remote; -/** The Interface AuthenticationService. */ +/** + * The Interface AuthenticationService. + */ @Remote public interface AuthenticationService { /** * Login user. - * - * @param login the login + * + * @param login the login * @param password the password + * * @return the string + * * @throws SimExplorerException the sim explorer service exception */ public String loginUser(String login, String password) @@ -41,9 +45,10 @@ /** * Request account. - * + * * @param login the login - * @param mail the mail + * @param mail the mail + * * @throws SimExplorerException the sim explorer service exception */ public void requestAccount(String login, String mail) @@ -51,11 +56,13 @@ /** * Save user. - * + * * @param token the token * @param login the login - * @param mail the mail + * @param mail the mail + * * @return the user + * * @throws SimExplorerException the sim explorer service exception */ public User saveUser(String token, String login, String mail) @@ -63,9 +70,10 @@ /** * Reset password. - * + * * @param token the token * @param login the login + * * @throws SimExplorerException the sim explorer service exception */ public void resetPassword(String token, String login) @@ -73,14 +81,13 @@ /** * Change password. - * - * @param token - * the token - * @param password - * the password - * - * @throws SimExplorerException - * the sim explorer service exception + * + * @param token the token + * @param id the id + * + * @return the user + * + * @throws SimExplorerException the sim explorer service exception */ // public void changePassword(String token, String password) // throws SimExplorerException; @@ -98,10 +105,12 @@ /** * Gets the user. - * + * * @param token the token * @param login the login + * * @return the user + * * @throws SimExplorerException the sim explorer service exception */ public User getUser(String token, String login) @@ -109,10 +118,12 @@ /** * Update user. - * + * * @param token the token - * @param user the user + * @param user the user + * * @return the user + * * @throws SimExplorerException the sim explorer service exception */ public User updateUser(String token, User user) @@ -120,9 +131,10 @@ /** * Delete user. - * + * * @param token the token - * @param id the id + * @param id the id + * * @throws SimExplorerException the sim explorer service exception */ public void deleteUser(String token, Integer id) @@ -130,19 +142,23 @@ /** * Gets the users. - * + * * @param token the token + * * @return the users + * * @throws SimExplorerException the sim explorer service exception */ public User[] getUsers(String token) throws SimExplorerException; /** * Gets the users of group. - * + * * @param token the token * @param group the group + * * @return the users of group + * * @throws SimExplorerException the sim explorer service exception */ public User[] getUsersOfGroup(String token, Group group) @@ -150,10 +166,11 @@ /** * Sets the users of group. - * - * @param token the token - * @param group the group + * + * @param token the token + * @param group the group * @param usersInGroup the users in group + * * @throws SimExplorerException the sim explorer service exception */ public void setUsersOfGroup(String token, Group group, @@ -161,10 +178,11 @@ /** * Sets the groups of group. - * - * @param token the token - * @param group the group + * + * @param token the token + * @param group the group * @param groupsIds the groups ids + * * @throws SimExplorerException the sim explorer service exception */ public void setGroupsOfGroup(String token, Group group, Integer[] groupsIds) @@ -172,10 +190,12 @@ /** * Gets the groups of user. - * + * * @param token the token - * @param user the user + * @param user the user + * * @return the groups of user + * * @throws SimExplorerException the sim explorer service exception */ public Group[] getGroupsOfUser(String token, User user) @@ -183,10 +203,12 @@ /** * Gets the groups of group. - * + * * @param token the token * @param group the group + * * @return the groups of group + * * @throws SimExplorerException the sim explorer service exception */ public Group[] getGroupsOfGroup(String token, Group group) @@ -194,10 +216,11 @@ /** * Sets the groups of user. - * - * @param token the token - * @param user the user + * + * @param token the token + * @param user the user * @param groupsIds the groups ids + * * @throws SimExplorerException the sim explorer service exception */ public void setGroupsOfUser(String token, User user, Integer[] groupsIds) @@ -205,10 +228,12 @@ /** * Save group. - * + * * @param token the token - * @param name the name + * @param name the name + * * @return the group + * * @throws SimExplorerException the sim explorer service exception */ public Group saveGroup(String token, String name) @@ -216,10 +241,12 @@ /** * Gets the group. - * + * * @param token the token - * @param id the id + * @param id the id + * * @return the group + * * @throws SimExplorerException the sim explorer service exception */ public Group getGroup(String token, Integer id) @@ -227,10 +254,12 @@ /** * Gets the group. - * + * * @param token the token - * @param name the name + * @param name the name + * * @return the group + * * @throws SimExplorerException the sim explorer service exception */ public Group getGroup(String token, String name) @@ -238,10 +267,12 @@ /** * Update group. - * + * * @param token the token * @param group the group + * * @return the group + * * @throws SimExplorerException the sim explorer service exception */ public Group updateGroup(String token, Group group) @@ -249,9 +280,10 @@ /** * Delete group. - * + * * @param token the token - * @param id the id + * @param id the id + * * @throws SimExplorerException the sim explorer service exception */ public void deleteGroup(String token, Integer id) @@ -259,19 +291,23 @@ /** * Gets the groups. - * + * * @param token the token + * * @return the groups + * * @throws SimExplorerException the sim explorer service exception */ public Group[] getGroups(String token) throws SimExplorerException; /** * Gets the groups owned by. - * + * * @param token the token - * @param user the user + * @param user the user + * * @return the groups owned by + * * @throws SimExplorerException the sim explorer service exception */ public Group[] getGroupsOwnedBy(String token, User user) @@ -279,27 +315,41 @@ /** * Gets the logged user. - * + * * @param token the token + * * @return the logged user + * * @throws SimExplorerException the sim explorer service exception */ public User getLoggedUser(String token) throws SimExplorerException; /** + * Gets the elements owned by. + * + * @param token the token + * @param user the user + * + * @return the elements owned by + */ + public String[] getElementsOwnedBy(String token, User user); + + /** * Gets the permissions. - * + * * @param uuid the uuid + * * @return the permissions */ public Permission[] getPermissions(String uuid); /** * Sets the permissions. - * - * @param uuid the uuid + * + * @param uuid the uuid * @param permissions the permissions */ public void setPermissions(String uuid, Permission[] permissions); + } Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceImpl.java 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceImpl.java 2008-02-18 13:18:14 UTC (rev 1063) @@ -747,4 +747,17 @@ dao.setPermissions(uuid, permissions); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getElementsOwnedBy(java.lang.String, fr.cemagref.simexplorer.is.security.entities.User) + */ + @Override + public String[] getElementsOwnedBy(String token, User user) { + List<String> uuids = new ArrayList<String>(); + List<Permission> permissions = dao.getPermissionsOwnedBy(user); + for (Permission permission : permissions) { + uuids.add(permission.getBusinessId()); + } + return uuids.toArray(new String[uuids.size()]); + } + } Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/MockAuthenticationServiceImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/MockAuthenticationServiceImpl.java 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/MockAuthenticationServiceImpl.java 2008-02-18 13:18:14 UTC (rev 1063) @@ -222,4 +222,10 @@ // TODO Auto-generated method stub } + + @Override + public String[] getElementsOwnedBy(String token, User user) { + checkImplemented(); + return null; + } } \ No newline at end of file Modified: trunk/simexplorer-is/src/site/fr/rst/todo.rst =================================================================== --- trunk/simexplorer-is/src/site/fr/rst/todo.rst 2008-02-18 13:16:49 UTC (rev 1062) +++ trunk/simexplorer-is/src/site/fr/rst/todo.rst 2008-02-18 13:18:14 UTC (rev 1063) @@ -5,6 +5,7 @@ Serveur central =============== + - Bug descripteurs - Règles de gestion pour la suppression d'élément (élément liés, etc) - Règles de gestion pour la suppression d'un groupe/utilisateur (affichage selon flag) @@ -22,4 +23,76 @@ - Synchronisation d'un élément avec le serveur - Communication avec le serveur via SSL - export, import - - configuration \ No newline at end of file + - configuration + + Fonctionnalités première réunion + ================================ + + - ( OK) Les administrateurs ne sont pas chargés de valider les AE soumises, contrairement à ce qui avait été compris dans un premier temps. + - ( OK) Choix de lucene comme système de stockage des méta données et d'indexation + - ( OK) Le serveur n'est pas chargé de lancer de simulation. Simexplorer SI s'occuper uniquement de stocker les données d'AE + + * (NOK) Une API permet à l'application SimExplorer de stocker ses données + + - ( OK) Les CE et les DE ne sont jamais soumis individuellement, mais via une AE + + - Gestion des droits : + + * ( OK) Les groupes ont des sous-groupes + * ( OK) Un utilisateur peut appartenir à plusieurs groupes + * ( OK) Une permission autorise un utilisateur/groupe la lecture/écriture/suppression d'un élément ainsi que la gestion des permissions de l'élément + * ( OK) Un élément peut avoir plusieurs permissions + * (NOK) [1] Un élément possède un unique propriétaire + * (NOK) [1] L'utilisateur mettant à jour un élément en devient le propriétaire + * ( OK) Toutes les versions d'un élément possède les mêmes permissions + * ( OK) Un utilisateur peut toujours modifier et créer des permissions sur ses éléments + * ( OK) Un utilisateur peut toujours ajouter une nouvelle AE + * ( OK) Un utilisateur peut créer un sous élément à un élément uniquement si il a les droits d'écriture sur cet élément (ex : création/ajout d'un CE dans une AE) + + - Application web + + * ( OK) Pas de création d'élément + * ( OK) Fonction d'export d'une AE + * (NOK) [2] Recherche sur différents critères + * ( OK) Import de librairie et d'AE, par deux champs distincts + * ( OK) Affichage des groupes de chaque utilisateur dans la liste des utilisateurs + * ( OK) Affichage des éléments dont l'utilisateur est propriétaire lors de l'édition d'un utilisateur + * ( OK) Gestion des groupes enfants dans la page d'un groupe + * ( OK) Gestion des utilisateurs d'un groupe dans la page d'un groupe + * (NOK) Création d'une page d'administration des droits : + + + Filtre sur le propriétaire via un utilisateur ou un groupe (pour les administrateurs) + + Affichage des éléments dont l'utilisateur est le propriétaire + + Édition des droits d'un élément (entités ayant le droit de lire/écrire/administrer l'élément) + + - Versionnement + + * ( OK) Chaque enregistrement incrémente la version mineure (1.4 -> 1.5) + * Exceptions : + + ( OK) Export sur le serveur : incrémentation de la version majeure (1.5 -> 2.0), renumérotation sur le client [3] + + (NOK) [3] Export sur le serveur, après l'export d'un autre utilisateur : création d'un nouvel élément, en conservant l'historique de l'élément + * ( OK) Export d'une AE sans parent : création d'une nouvelle AE sans historique + * ( OK) Un utilisateur peut créer une nouvelle version sur un élément si et seulement si il a les droits d'écriture sur cet élément + * ( OK) Soumission d'un élément par un utilisateur ne possédant pas les droits d'écriture (pour création d'une nouvelle version) : création d'un nouvel élément, en conservant l'historique de l'élément + * (NOK) Suppression d'un CE ou de DE : suppression des AE associées (avec message de confirmation...) + * (NOK) Suppression d'une AE : les CE et les DE orphelins (ie utilisés uniquement par cette AE) sont supprimés + * Un utilisateur soumet une AE : + + L'AE contient un CE qui devrait être soumis dans une nouvelle version (composant partagé par plusieurs AE) + + L'utilisateur n'a pas les droits d'écriture pour ce CE sur le serveur + + ( OK) -> un nouveau CE est créé et associé à cette AE + +Evolutions +---------- + + [1] Un élément peut avoir plusieurs propriétaires, une personne écrivant un nouvelle version est ajouté à cette liste + [2] Recherche full text sur tous les champs + [3] L'élément conserve son id si l'utilisateur a les droits d'écriture, sinon un nouvel élément est créé. + +Reste à faire +============= + + - Interface avec SimExplorer (API + appli swing comme plugin) + - Document référence XSD + format du fichier zip + - Types de fichiers joints (uniquement texte pour le moment), visualisation? + + \ No newline at end of file