r1465 - in trunk/simexplorer-is: simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/attachment simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/metadata simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/servi
Author: glandais Date: 2008-04-10 17:00:51 +0000 (Thu, 10 Apr 2008) New Revision: 1465 Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/metadata/Version.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoActorImpl.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoPermissionImpl.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceHelper.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/StorageServiceClient.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceHelper.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineSecuImpl.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/LoggableElementFactory.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/XMLStreamEncoder.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/AppModule.java Log: logs Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -22,7 +22,6 @@ import java.util.List; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.HashCodeBuilder; import org.codelutin.util.StringUtil; import fr.cemagref.simexplorer.is.entities.Leaf; Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/metadata/Version.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/metadata/Version.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/metadata/Version.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -62,12 +62,16 @@ */ private Version(String version) { // tokenize on dot - StringTokenizer st = new StringTokenizer(version, "."); - pointedVersion = new int[st.countTokens()]; - int i = 0; - while (st.hasMoreTokens()) { - pointedVersion[i] = Integer.valueOf(st.nextToken()); - i++; + if (version == null) { + pointedVersion = new int[0]; + } else { + StringTokenizer st = new StringTokenizer(version, "."); + pointedVersion = new int[st.countTokens()]; + int i = 0; + while (st.hasMoreTokens()) { + pointedVersion[i] = Integer.valueOf(st.nextToken()); + i++; + } } } Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -40,6 +40,7 @@ /** * The Class CredentialManagerImpl. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "CredentialManager") @@ -90,9 +91,14 @@ */ public Permission getPermission(String token, String businessId) { Permission p = null; + if (log.isDebugEnabled()) { + log.debug("getPermission for id " + businessId + " for token " + token); + } User user = daoActor.getLoggedUser(token); if (user == null) { + if (log.isDebugEnabled()) + log.debug("User is null"); p = new Permission(); p.setOwner(false); p.setCanAdmin(false); @@ -100,6 +106,8 @@ p.setCanWrite(false); } else { if (user.isSuperAdmin()) { + if (log.isDebugEnabled()) + log.debug("User is super admin"); p = new Permission(); p.setOwner(true); p.setCanAdmin(true); @@ -111,11 +119,15 @@ List<Permission> permissions = daoPermission.getPermissions(businessId); if (permissions.size() == 0) { + if (log.isDebugEnabled()) + log.debug("No permission exists"); p.setOwner(true); p.setCanAdmin(true); p.setCanRead(true); p.setCanWrite(true); } else { + if (log.isDebugEnabled()) + log.debug("Apply permissions got"); p.setOwner(false); p.setCanAdmin(false); p.setCanRead(false); @@ -154,6 +166,9 @@ * @see fr.cemagref.simexplorer.is.security.credentials.CredentialManager#saveElement(java.lang.String, java.lang.String) */ public void saveElement(String token, String businessId) { + if (log.isDebugEnabled()) { + log.debug("saveElement " + businessId + " by user token " + token); + } User user = daoActor.getLoggedUser(token); if (user != null) { if (!user.isSuperAdmin()) { @@ -164,9 +179,12 @@ p.setBusinessId(businessId); p.setOwner(true); daoPermission.savePermission(p); - log.debug("CREATED PERMISSION : " + p.toString()); + if (log.isDebugEnabled()) + log.debug("Created permission : " + p.toString()); } else { p.setOwner(true); + if (log.isDebugEnabled()) + log.debug("Updating permission : " + p.toString()); daoPermission.updatePermission(p); } } @@ -215,6 +233,8 @@ */ @Override public Collection<String> getElementsVisibleBy(String token) { + if (log.isDebugEnabled()) + log.debug("getElementsVisibleBy " + token); String userFilter = getUserFilter(token); List<String> businessIdsVisibleBy = null; Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoActorImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoActorImpl.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoActorImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -37,6 +37,7 @@ /** * The Class DaoActorImpl. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "DaoActor") @@ -90,6 +91,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#deleteGroup(java.lang.Integer) */ public void deleteGroup(Integer id) { + if (log.isDebugEnabled()) { + log.debug("deleteGroup"); + } Group g = getGroup(id); g.setVisible(false); em.merge(g); @@ -99,6 +103,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#deleteUser(java.lang.Integer) */ public void deleteUser(Integer id) { + if (log.isDebugEnabled()) { + log.debug("deleteUser"); + } User u = getUser(id); u.setVisible(false); em.merge(u); @@ -108,6 +115,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getGroup(java.lang.Integer) */ public Group getGroup(Integer id) { + if (log.isDebugEnabled()) { + log.debug("getGroup"); + } Group g = find(Group.class, id); return g; } @@ -116,6 +126,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getGroup(java.lang.String) */ public Group getGroup(String name) { + if (log.isDebugEnabled()) { + log.debug("getGroup"); + } Group g = (Group) getSingleResult(em.createQuery("select g from Group g where g.name=:name").setParameter( "name", name)); return g; @@ -125,6 +138,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getUser(java.lang.Integer) */ public User getUser(Integer id) { + if (log.isDebugEnabled()) { + log.debug("getUser"); + } User u = find(User.class, id); return u; } @@ -133,6 +149,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getActor(java.lang.Integer) */ public Actor getActor(Integer id) { + if (log.isDebugEnabled()) { + log.debug("getActor"); + } Actor a = find(Actor.class, id); return a; } @@ -147,11 +166,17 @@ } public void saveActor(Actor actor) { + if (log.isDebugEnabled()) { + log.debug("saveActor"); + } setActorVisible(actor); em.persist(actor); } public Actor updateActor(Actor actor) { + if (log.isDebugEnabled()) { + log.debug("updateActor"); + } setActorVisible(actor); return em.merge(actor); } @@ -160,6 +185,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getLoggedUser(java.lang.String) */ public User getLoggedUser(String token) { + if (log.isDebugEnabled()) { + log.debug("getLoggedUser"); + } User loggedUser = null; LoginAction loginAction = (LoginAction) getSingleResult(em.createQuery( "select la from LoginAction la where la.token=:token").setParameter("token", token)); @@ -175,6 +203,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#loginUser(java.lang.String, java.lang.String) */ public User loginUser(String login, String passwordHash) { + if (log.isDebugEnabled()) { + log.debug("loginUser"); + } User user = (User) getSingleResult(em.createQuery( "select u from User u where u.login=:login and u.passwordHash=:passwordHash and u.visible = true") .setParameter("login", login).setParameter("passwordHash", passwordHash)); @@ -185,6 +216,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#saveToken(fr.cemagref.simexplorer.is.security.entities.LoginAction) */ public void saveToken(LoginAction loginAction) { + if (log.isDebugEnabled()) { + log.debug("saveToken"); + } em.persist(loginAction); } @@ -192,6 +226,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#deleteTokens(java.lang.String, long) */ public void deleteTokens(Actor actor, long before) { + if (log.isDebugEnabled()) { + log.debug("deleteTokens"); + } Date now = new Date(); Date date = new Date(now.getTime() - before); long dateLimit = date.getTime(); @@ -203,6 +240,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getUser(java.lang.String) */ public User getUser(String login) { + if (log.isDebugEnabled()) { + log.debug("getUser"); + } User user = (User) getSingleResult(em.createQuery("select u from User u where u.login=:login").setParameter( "login", login)); return user; @@ -212,6 +252,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getGroups() */ public List<Group> getGroups() { + if (log.isDebugEnabled()) { + log.debug("getGroups"); + } List<Group> groups = CollectionUtil.toGenericList(em .createQuery("select g from Group g where g.visible = true").getResultList(), Group.class); return groups; @@ -221,6 +264,9 @@ * @see fr.cemagref.simexplorer.is.security.dao.DaoActor#getUsers() */ public Collection<User> getUsers() { + if (log.isDebugEnabled()) { + log.debug("getUsers"); + } List<User> users = CollectionUtil.toGenericList(em.createQuery("select u from User u where u.visible = true") .getResultList(), User.class); return users; Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoPermissionImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoPermissionImpl.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoPermissionImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -35,6 +35,7 @@ /** * The Class DaoPermissionImpl. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "DaoPermission") @@ -52,6 +53,9 @@ */ @Override public List<Permission> getPermissions(String businessId) { + if (log.isDebugEnabled()) { + log.debug("getPermissions"); + } List<Permission> permissions = CollectionUtil.toGenericList(em.createQuery( "select p from Permission p where p.businessId=:businessId").setParameter("businessId", businessId) .getResultList(), Permission.class); @@ -60,6 +64,9 @@ @Override public Permission getPermission(String businessId, Actor actor) { + if (log.isDebugEnabled()) { + log.debug("getPermission"); + } Permission permission; try { permission = (Permission) em.createQuery( @@ -77,6 +84,9 @@ */ @Override public List<Permission> getPermissionsOwnedBy(Actor actor, int indexStart, int count) { + if (log.isDebugEnabled()) { + log.debug("getPermissionsOwnedBy"); + } List<Permission> permissions = CollectionUtil.toGenericList(em.createQuery( "select p from Permission p where p.actor=:actor and p.isOwner = true").setParameter("actor", actor) .setFirstResult(indexStart).setMaxResults(count).getResultList(), Permission.class); @@ -84,6 +94,9 @@ } public int getPermissionsOwnedByCount(Actor actor) { + if (log.isDebugEnabled()) { + log.debug("getPermissionsOwnedByCount"); + } Object singleResult = em.createQuery( "select count(p) from Permission p where p.actor=:actor and p.isOwner = true").setParameter("actor", actor).getSingleResult(); @@ -96,6 +109,9 @@ */ @Override public void savePermission(Permission p) { + if (log.isDebugEnabled()) { + log.debug("savePermission"); + } em.persist(p); } @@ -104,6 +120,9 @@ */ @Override public void setPermissions(String uuid, Permission[] permissions) { + if (log.isDebugEnabled()) { + log.debug("setPermissions"); + } HashSet<Permission> permissionSet = new HashSet<Permission>(Arrays.asList(permissions)); List<Permission> existingPermissions = CollectionUtil.toGenericList(em.createQuery( "select p from Permission p where p.businessId=:businessId").setParameter("businessId", uuid) @@ -128,11 +147,17 @@ */ @Override public void updatePermission(Permission p) { + if (log.isDebugEnabled()) { + log.debug("updatePermission"); + } em.merge(p); } @Override public List<String> getBusinessIdsVisibleBy(Collection<Actor> actors) { + if (log.isDebugEnabled()) { + log.debug("getBusinessIdsVisibleBy"); + } StringBuffer query = new StringBuffer(); query.append("select distinct p.businessId from Permission p").append( " where (p.canRead = true or p.canWrite = true or p.canAdmin = true or p.isOwner = true)").append( Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -144,11 +144,6 @@ if (getClass() != obj.getClass()) return false; final Actor other = (Actor) obj; -// if (memberOf == null) { -// if (other.memberOf != null) -// return false; -// } else if (!equalsGroups(memberOf, other.memberOf)) -// return false; if (actorId == null) { if (other.actorId != null) return false; Modified: trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -99,35 +99,6 @@ return members; } - /** - * Adds the member. - * - * @param actor the actor - */ - /* - public void addMember(Actor actor) { - actor.getMemberOf().add(this); - members.add(actor); - } - */ - - /** - * Sets the members. - * - * @param newMembers the new members - */ - /* - public void setMembers(Collection<Actor> newMembers) { - for (Actor oldMember : getMembersReadOnly()) { - oldMember.getMemberOf().remove(this); - } - for (Actor newMember : newMembers) { - newMember.getMemberOf().add(this); - } - members = newMembers; - } - */ - /* (non-Javadoc) * @see java.lang.Object#toString() */ Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceHelper.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceHelper.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceHelper.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -32,7 +32,10 @@ */ public class AuthenticationServiceHelper { - + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(AuthenticationServiceHelper.class); + /** * Instantiates a new authentication service helper. */ @@ -50,6 +53,9 @@ * @throws SimExplorerException the sim explorer service exception */ public static String computeHash(char[] clearString) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("computeHash"); + } MessageDigest messageDigest; try { messageDigest = MessageDigest.getInstance("SHA-1"); 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-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/AuthenticationServiceImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -61,6 +61,7 @@ /** * The Class AuthenticationServiceImpl. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "AuthenticationService") @@ -93,6 +94,9 @@ * @return the mail content with password */ private String getMailContentWithPassword(String login, char[] password) { + if (log.isDebugEnabled()) { + log.debug("getMailContentWithPassword"); + } StringBuffer sb = new StringBuffer(""); sb.append(_("simexplorer.service.mail.header")).append("\n"); sb.append(_("simexplorer.service.mail.login")).append(" : ").append(login).append("\n"); @@ -114,6 +118,9 @@ * @return the mail content request accont */ private String getMailContentRequestAccount(String login, String mail) { + if (log.isDebugEnabled()) { + log.debug("getMailContentRequestAccount"); + } StringBuffer sb = new StringBuffer(""); sb.append(_("simexplorer.service.mail.requestheader")).append("\n"); sb.append(_("simexplorer.service.mail.login")).append(" : ").append(login).append("\n"); @@ -134,6 +141,9 @@ */ private void sendMail(String mailFrom, String mailRecipient, String subject, String content) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("sendMail"); + } try { javax.mail.Session mailSession = (javax.mail.Session) new InitialContext().lookup("java:/Mail"); javax.mail.Message msg = new MimeMessage(mailSession); @@ -158,6 +168,9 @@ * @return the string */ private char[] generatePassword() { + if (log.isDebugEnabled()) { + log.debug("generatePassword"); + } // TODO ne plus utiliser un String return RandomStringUtils.randomAlphanumeric(10).toCharArray(); } @@ -173,6 +186,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canAdminGroup(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canAdminGroup " + id); + } User loggedUser = getLoggedUser(token); if (loggedUser != null) { if (loggedUser.isSuperAdmin()) { @@ -217,6 +233,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canAdminUser(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canAdminUser " + id); + } User loggedUser = getLoggedUser(token); if (loggedUser != null) { if (loggedUser.isSuperAdmin()) { @@ -246,6 +265,9 @@ * @throws SimExplorerException the sim explorer exception */ private boolean canDeleteGroup(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canDeleteGroup " + id); + } return canAdminGroup(token, id); } @@ -253,6 +275,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#deleteGroup(java.lang.String, java.lang.Integer) */ public void deleteGroup(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " deleteGroup " + id); + } if (canDeleteGroup(token, id)) { daoActor.deleteGroup(id); } else { @@ -271,6 +296,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canDeleteUser(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canDeleteUser " + id); + } return canAdminUser(token, id); } @@ -278,6 +306,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#deleteUser(java.lang.String, java.lang.Integer) */ public void deleteUser(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " deleteUser " + id); + } if (canDeleteUser(token, id)) { daoActor.deleteUser(id); } else { @@ -293,6 +324,9 @@ * @throws SimExplorerException the sim explorer exception */ private void canViewElements(String token) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canViewElements"); + } User loggedUser = getLoggedUser(token); if (loggedUser == null) { throw new SimExplorerSecurityException(); @@ -303,6 +337,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getGroup(java.lang.String, java.lang.Integer) */ public Group getGroup(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getGroup " + id); + } canViewElements(token); return daoActor.getGroup(id); } @@ -311,6 +348,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getGroup(java.lang.String, java.lang.String) */ public Group getGroup(String token, String name) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getGroup " + name); + } canViewElements(token); return daoActor.getGroup(name); } @@ -319,6 +359,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getUser(java.lang.String, java.lang.Integer) */ public User getUser(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getUser " + id); + } canViewElements(token); return daoActor.getUser(id); } @@ -328,6 +371,9 @@ */ @Override public Actor getActor(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getActor " + id); + } canViewElements(token); return daoActor.getActor(id); } @@ -336,6 +382,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getUser(java.lang.String, java.lang.String) */ public User getUser(String token, String login) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getUser " + login); + } canViewElements(token); return daoActor.getUser(login); } @@ -344,6 +393,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getGroups(java.lang.String) */ public Group[] getGroups(String token) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getGroups"); + } canViewElements(token); Collection<Group> groups = daoActor.getGroups(); return groups.toArray(new Group[groups.size()]); @@ -353,6 +405,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getUsers(java.lang.String) */ public User[] getUsers(String token) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " getUsers"); + } canViewElements(token); Collection<User> users = daoActor.getUsers(); return users.toArray(new User[users.size()]); @@ -368,6 +423,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canSaveElement(String token) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canSaveElement"); + } User loggedUser = getLoggedUser(token); boolean canSave = loggedUser.isAdmin() || loggedUser.isSuperAdmin(); return canSave; @@ -377,6 +435,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#saveGroup(java.lang.String, java.lang.String) */ public Group saveGroup(String token, String name) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " saveGroup " + name); + } if (canSaveElement(token)) { Group oldGroup = daoActor.getGroup(name); // FIXME visible = false @@ -398,6 +459,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#saveUser(java.lang.String, java.lang.String, java.lang.String) */ public User saveUser(String token, String login, String mail) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " saveUser " + login + "/" + mail); + } if (canSaveElement(token)) { User oldUser = daoActor.getUser(login); // FIXME visible = false @@ -437,6 +501,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canUpdateGroup(String token, Integer id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("canUpdateGroup"); + } return canAdminGroup(token, id); } @@ -444,15 +511,18 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#updateGroup(java.lang.String, fr.cemagref.simexplorer.is.security.entities.Group) */ public Group updateGroup(String token, Group group, Collection<Actor> members) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("updateGroup"); + } if (canUpdateGroup(token, group.getActorId())) { Set<Actor> toUpdate = new HashSet<Actor>(); for (Actor oldMember : group.getMembersReadOnly()) { - + Set<Group> memberOf = oldMember.getMemberOf(); Set<Group> copy = new HashSet<Group>(memberOf); copy.remove(group); oldMember.setMemberOf(copy); - + toUpdate.add(oldMember); } for (Actor newMember : members) { @@ -480,6 +550,9 @@ * @throws SimExplorerException the sim explorer service exception */ private boolean canUpdateUser(String token, User user) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("canUpdateUser"); + } if (canAdminUser(token, user.getActorId())) { if (getLoggedUser(token).isSuperAdmin()) { return true; @@ -496,6 +569,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#updateUser(java.lang.String, fr.cemagref.simexplorer.is.security.entities.User) */ public User updateUser(String token, User user) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("updateUser"); + } if (canUpdateUser(token, user)) { return (User) daoActor.updateActor(user); } @@ -506,6 +582,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getLoggedUser(java.lang.String) */ public User getLoggedUser(String token) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getLoggedUser"); + } if (token == null || token.equals("")) { return null; } @@ -523,6 +602,9 @@ * @throws SimExplorerException the sim explorer service exception */ private void checkSuperAdmin() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("checkSuperAdmin"); + } if (daoActor.getUser("superadmin") == null) { User user = new User(); user.setLogin("superadmin"); @@ -540,6 +622,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#loginUser(java.lang.String, java.lang.String) */ public String loginUser(String login, String password) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("loginUser"); + } if (!superAdminCheck) { checkSuperAdmin(); superAdminCheck = true; @@ -564,6 +649,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#requestAccount(java.lang.String, java.lang.String) */ public void requestAccount(String login, String mail) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("requestAccount"); + } User superadmin = daoActor.getUser("superadmin"); sendMail(Config.getProperties().getProperty("simexplorer.adminmail"), superadmin.getMail(), _("simexplorer.service.mail.subject"), getMailContentRequestAccount(login, mail)); @@ -583,6 +671,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#resetPassword(java.lang.String, java.lang.String) */ public void resetPassword(String token, String login) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("resetPassword"); + } User user = getUser(token, login); if (canAdminUser(token, user.getActorId())) { char[] password = generatePassword(); @@ -628,6 +719,9 @@ * @throws SimExplorerException the sim explorer exception */ private void canAdminPermissions(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("canAdminPermissions"); + } Permission permission = credentialManager.getPermission(token, uuid); if (!permission.isCanAdmin()) { throw new SimExplorerSecurityException(); @@ -638,6 +732,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getPermissions(java.lang.String) */ public Permission[] getPermissions(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getPermissions"); + } canAdminPermissions(token, uuid); Permission[] permissions = credentialManager.getPermissions(uuid); return permissions; @@ -647,6 +744,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#setPermissions(java.lang.String, fr.cemagref.simexplorer.is.security.entities.Permission[]) */ public void setPermissions(String token, String uuid, Permission[] permissions) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("setPermissions"); + } canAdminPermissions(token, uuid); credentialManager.setPermissions(uuid, permissions); } @@ -656,6 +756,9 @@ */ @Override public String[] getElementsOwnedBy(String token, User user, int indexStart, int count) { + if (log.isDebugEnabled()) { + log.debug("getElementsOwnedBy"); + } // TODO security List<String> uuids = new ArrayList<String>(); List<Permission> permissions = credentialManager.getPermissionsOwnedBy(user, indexStart, count); @@ -669,6 +772,9 @@ * @see fr.cemagref.simexplorer.is.service.AuthenticationService#getElementsOwnedByCount(java.lang.String, fr.cemagref.simexplorer.is.security.entities.User) */ public int getElementsOwnedByCount(String token, User user) { + if (log.isDebugEnabled()) { + log.debug("getElementsOwnedByCount"); + } // TODO security return credentialManager.getPermissionsOwnedByCount(user); } @@ -680,7 +786,7 @@ */ { - //TODO This is really hardcore! + // TODO This is really hardcore! I18n.init("fr", "FR"); } } Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceClient.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -31,9 +31,13 @@ @org.codelutin.i18n.I18nable public class StorageServiceClient extends StorageServiceCommon { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(StorageServiceClient.class); + /** The storage engine. */ private StorageEngine storageEngine; - + /** * la localisation du fichier de configuration à lire, si null utilisera le fichier par défaut * (properties/config.properties) @@ -67,10 +71,8 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#loginUser(java.lang.String, * java.lang.String) */ - public String loginUser(String login, String password) - throws SimExplorerException { - throw new SimExplorerBusinessException( - _("simexplorer.service.nologonlocal")); + public String loginUser(String login, String password) throws SimExplorerException { + throw new SimExplorerBusinessException(_("simexplorer.service.nologonlocal")); } /* @@ -80,6 +82,9 @@ */ @Override protected StorageEngine getStorageEngine() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getStorageEngine"); + } if (storageEngine == null) { storageEngine = new StorageEngineImpl(configFile, prefixKey); storageEngine.open(); @@ -92,6 +97,9 @@ */ @Override protected Version incrementVersion(Version version) { + if (log.isDebugEnabled()) { + log.debug("incrementVersion"); + } Version result = version.increment(1); return result; } Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceCommon.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -58,6 +58,7 @@ /** * The Class StorageServiceCommon. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @org.codelutin.i18n.I18nable @@ -97,6 +98,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#getMetadata(java.lang.String, java.lang.String) */ public MetaData getMetadata(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadata"); + } return getStorageEngine().getMetadata(token, uuid); } @@ -104,6 +108,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#getMetadata(java.lang.String, java.lang.String, java.lang.String) */ public MetaData getMetadata(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadata"); + } return getStorageEngine().getMetadata(token, uuid, Version.valueOf(version)); } @@ -112,6 +119,9 @@ */ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsedBy"); + } return getStorageEngine().getMetadatasUsedBy(token, uuid, Version.valueOf(version)); } @@ -120,6 +130,9 @@ */ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsedBy"); + } return getStorageEngine().getMetadatasUsedBy(token, uuid); } @@ -128,6 +141,9 @@ */ @Override public MetaData[] getMetadatasUsing(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsing"); + } return getStorageEngine().getMetadatasUsing(token, uuid, Version.valueOf(version)); } @@ -136,6 +152,9 @@ */ @Override public MetaData[] getMetadatasUsing(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsing"); + } return getStorageEngine().getMetadatasUsing(token, uuid); } @@ -192,6 +211,9 @@ */ public MetaData[] findFullText(String token, String query, String queryColumn, boolean onlyLatest, int indexStart, int count, String column, boolean ascending) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findFullText"); + } return getStorageEngine().findFullText(token, query, getQueryColumn(queryColumn), onlyLatest, indexStart, count, getSortColumn(column), getOrder(ascending)); } @@ -201,6 +223,9 @@ */ public int findFullTextCount(String token, String query, String queryColumn, boolean onlyLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findFullTextCount"); + } return getStorageEngine().findFullTextCount(token, query, getQueryColumn(queryColumn), onlyLatest); } @@ -208,6 +233,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#findApplicationsCount(java.lang.String, boolean) */ public int findElementsCount(String token, String type, boolean onlyLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsCount"); + } return getStorageEngine().findElementsByTypeCount(token, type, onlyLatest); } @@ -216,6 +244,9 @@ */ public MetaData[] findElements(String token, String type, boolean onlyLatest, int start, int count, String column, boolean ascending) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElements"); + } return getStorageEngine().findElementsByType(token, type, onlyLatest, start, count, getSortColumn(column), getOrder(ascending)); } @@ -224,6 +255,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#getLoggableElement(java.lang.String, java.lang.String, java.lang.String) */ public LoggableElement getLoggableElement(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getLoggableElement"); + } MetaData mde = getMetadata(token, uuid, version); LoggableElement le = null; if (mde != null) { @@ -244,6 +278,9 @@ * @throws SimExplorerException the sim explorer service exception */ public LoggableElement saveElement(String token, SerializableInputStream zipStream) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("saveElement"); + } String xmlFile = null; Map<Attachment, String> attachments = new HashMap<Attachment, String>(); @@ -309,6 +346,9 @@ */ public LoggableElement saveElement(String token, SerializableInputStream xmlFile, Map<Attachment, SerializableInputStream> attachments) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("saveElement"); + } // Store temporary data String idxml = getStorageEngine().storeTempData(xmlFile).getUuid(); Map<Attachment, String> idsattachment = new HashMap<Attachment, String>(); @@ -344,6 +384,9 @@ */ public InputStream retrieveElementData(String token, String uuid, String version, Attachment attachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveElementData"); + } MetaData mde = getMetadata(token, uuid, version); InputStream stream = getStorageEngine().retrieveData(token, mde, attachment); @@ -368,6 +411,9 @@ * @throws SimExplorerException the sim explorer service exception */ public InputStream retrieveElementXML(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveElementXML"); + } MetaData mde = getMetadata(token, uuid, version); InputStream xmlStream = getStorageEngine().retrieveData(token, mde, getXMLAttachment()); SerializableInputStream serializableInputStream; @@ -391,6 +437,9 @@ * @throws SimExplorerException the sim explorer service exception */ public InputStream retrieveElementFull(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveElementFull"); + } LoggableElement loggableElement = getLoggableElement(token, uuid, version); PipedOutputStream pipedOut = new PipedOutputStream(); Map<String, InputStream> files = new HashMap<String, InputStream>(); @@ -429,6 +478,9 @@ */ public void update(String token, String uuid, Version version, MetaData updatedElement, boolean justRemoveLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("update"); + } Map<Attachment, InputStream> attachments = new HashMap<Attachment, InputStream>(); MetaData elementToUpdate; @@ -468,6 +520,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#getVersions(java.lang.String, java.lang.String) */ public Version[] getVersions(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getVersions"); + } List<MetaData> metas = getStorageEngine().getElementVersions(token, uuid); List<Version> versions = new ArrayList<Version>(metas.size()); for (MetaData metaData : metas) { @@ -489,6 +544,9 @@ * @throws SimExplorerException the sim explorer exception */ private boolean canBeDeleted(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("canBeDeleted"); + } MetaData metadata = getMetadata(token, uuid, version); // ExplorationApplication can always be deleted @@ -521,6 +579,9 @@ */ private void getDeletableChildren(String token, String uuid, String version, Set<MetaData> set) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getDeletableChildren"); + } // this item is an orphan only if it has one parent maximum MetaData[] metadatasUsedBy = getMetadatasUsedBy(token, uuid, version); if (metadatasUsedBy.length <= 1) { @@ -549,6 +610,9 @@ * @throws SimExplorerException the sim explorer exception */ private MetaData getDeletableParent(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getDeletableParent"); + } MetaData metadata = getMetadata(token, uuid, version); // ED and Components can be delete only if they are used at most by one EA @@ -573,6 +637,9 @@ * @throws SimExplorerException the sim explorer exception */ private void rawDeleteElement(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("rawDeleteElement"); + } LoggableElement loggableElement = getLoggableElement(token, uuid, version); List<Attachment> attachments = loggableElement.getAttachments(); for (Attachment attachment : attachments) { @@ -585,6 +652,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#deleteElement(java.lang.String, java.lang.String, java.lang.String) */ public void deleteElement(String token, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteElement"); + } if (!canBeDeleted(token, uuid, version)) { throw new SimExplorerBusinessException(_("simexplorer.service.business.notdeletable")); } @@ -609,6 +679,9 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#deleteElement(java.lang.String, java.lang.String) */ public void deleteElement(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteElement"); + } Version[] versions = getVersions(token, uuid); for (Version version : versions) { if (!canBeDeleted(token, uuid, version.toString())) { @@ -631,6 +704,9 @@ */ protected void processVersionRules(String token, MetaData metaData, LoggableElement element) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("processVersionRules"); + } // This one will always be the latest metaData.setLatest(true); @@ -687,6 +763,9 @@ * @throws SimExplorerException the exception */ private boolean notExists(String token, LoggableElement element) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("notExists"); + } MetaData metaData = element.getMetaData(); MetaData previousVersion = getStorageEngine().getMetadata(token, metaData.getUuid()); @@ -743,6 +822,9 @@ * @param loggableElement the loggable element */ private void updateMetaData(MetaData metaData, LoggableElement loggableElement) { + if (log.isDebugEnabled()) { + log.debug("updateMetaData"); + } metaData.setElementClass(loggableElement.getClass()); metaData.setDescription(loggableElement.getDescription()); metaData.setName(loggableElement.getName()); @@ -761,6 +843,9 @@ */ private void recursiveSaveElement(String token, Entity element, Map<Attachment, String> idsattachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("recursiveSaveElement"); + } List<Entity> children = element.getChildren(); for (Entity child : children) { if (child instanceof LoggableElement) { @@ -787,6 +872,9 @@ */ private LoggableElement saveElement(String token, LoggableElement element, Map<Attachment, String> idsattachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("saveElement"); + } MetaData metaData = element.getMetaData(); if (metaData == null) { metaData = new MetaData(); Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceHelper.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceHelper.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceHelper.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -28,10 +28,15 @@ /** * The Class StorageServiceHelper. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ public class StorageServiceHelper { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(StorageServiceHelper.class); + /** * Export element to another service. * @@ -47,6 +52,9 @@ */ public static MetaData exportElementTo(String token, StorageService fromService, StorageService toService, String uuid, String version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("exportElementTo"); + } String currentUuid = uuid; String currentVersion = version; Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageServiceServer.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -28,6 +28,7 @@ /** * The Class StorageServiceServer. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "StorageService") @@ -35,6 +36,10 @@ @RemoteBinding(jndiBinding = "StorageService") public class StorageServiceServer extends StorageServiceCommon { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(StorageServiceServer.class); + /** The authentication service. */ @EJB private AuthenticationService authenticationService; @@ -49,8 +54,10 @@ * @see fr.cemagref.simexplorer.is.service.StorageService#loginUser(java.lang.String, * java.lang.String) */ - public String loginUser(String login, String password) - throws SimExplorerException { + public String loginUser(String login, String password) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("loginUser"); + } String token = authenticationService.loginUser(login, password); return token; } @@ -68,6 +75,9 @@ @Override protected Version incrementVersion(Version version) { + if (log.isDebugEnabled()) { + log.debug("incrementVersion"); + } Version result = version.increment(0); return result; } Modified: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineSecuImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineSecuImpl.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineSecuImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -17,7 +17,6 @@ package fr.cemagref.simexplorer.is.storage.engine; import java.io.InputStream; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -40,17 +39,33 @@ /** * The Class StorageEngineSecuImpl. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ @Stateless(name = "StorageEngine") @Local(StorageEngine.class) -public class StorageEngineSecuImpl extends StorageEngineImpl { +public class StorageEngineSecuImpl implements StorageEngine { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(StorageEngineSecuImpl.class); + /** The credential manager. */ @EJB private CredentialManager credentialManager; + /** The storage engine for delegation. */ + private StorageEngineImpl storageEngineDelegating; + /** + * Instantiates a new storage engine secu impl. + */ + public StorageEngineSecuImpl() { + super(); + storageEngineDelegating = new StorageEngineImpl(); + } + + /** * Gets the user filter. * * @param token the token @@ -60,12 +75,16 @@ * @throws SimExplorerTechnicalException the sim explorer technical exception */ private String getUserFilter(String token) throws SimExplorerTechnicalException { + if (log.isDebugEnabled()) { + log.debug("getUserFilter for " + token); + } // unique id for user logged String userFilter = credentialManager.getUserFilter(token); // check if filter should be updated if (!credentialManager.isCacheValidFor(userFilter)) { // update filter in database - database.updateFilter(userFilter, credentialManager.getElementsVisibleBy(token)); + storageEngineDelegating.getDatabase().updateFilter(userFilter, + credentialManager.getElementsVisibleBy(token)); } return userFilter; } @@ -79,6 +98,9 @@ * @throws SimExplorerException the sim explorer exception */ private void canDelete(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canDelete " + uuid); + } Permission permission = credentialManager.getPermission(token, uuid); if (!permission.isCanAdmin()) { throw new SimExplorerSecurityException(); @@ -94,6 +116,9 @@ * @throws SimExplorerException the sim explorer exception */ private void canRead(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canRead " + uuid); + } Permission permission = credentialManager.getPermission(token, uuid); if (!permission.isCanRead()) { throw new SimExplorerSecurityException(); @@ -109,6 +134,9 @@ * @throws SimExplorerException the sim explorer exception */ private void canWrite(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug(token + " canWrite " + uuid); + } Permission permission = credentialManager.getPermission(token, uuid); if (!permission.isCanWrite()) { throw new SimExplorerSecurityException(); @@ -121,7 +149,7 @@ @Override public void deleteElement(String token, String uuid, Version version) throws SimExplorerException { canDelete(token, uuid); - super.deleteElement(token, uuid, version); + storageEngineDelegating.deleteElement(token, uuid, version); } /* (non-Javadoc) @@ -130,7 +158,7 @@ @Override public void deleteData(String token, MetaData entity, Attachment attachment) throws SimExplorerException { canDelete(token, entity.getUuid()); - super.deleteData(token, entity, attachment); + storageEngineDelegating.deleteData(token, entity, attachment); } /* (non-Javadoc) @@ -140,9 +168,9 @@ public MetaData[] findElementsByType(String token, String type, boolean onlyLatest, int start, int count, SortColumn column, SortOrder sortOrder) throws SimExplorerException { String userFilter = getUserFilter(token); - List<MetaData> elements = database.findElementsByType(type, onlyLatest, start, count, column, sortOrder, - userFilter); - return convertList(elements); + List<MetaData> elements = storageEngineDelegating.getDatabase().findElementsByType(type, onlyLatest, start, + count, column, sortOrder, userFilter); + return storageEngineDelegating.convertList(elements); } /* (non-Javadoc) @@ -151,7 +179,7 @@ @Override public int findElementsByTypeCount(String token, String type, boolean onlyLatest) throws SimExplorerException { String userFilter = getUserFilter(token); - return database.findElementsByTypeCount(type, onlyLatest, userFilter); + return storageEngineDelegating.getDatabase().findElementsByTypeCount(type, onlyLatest, userFilter); } /* (non-Javadoc) @@ -161,9 +189,9 @@ public MetaData[] findFullText(String token, String query, SearchColumn searchColumn, boolean onlyLatest, int indexStart, int count, SortColumn column, SortOrder sortOrder) throws SimExplorerException { String userFilter = getUserFilter(token); - List<MetaData> elements = database.findElementsByContentSearch(query, searchColumn, onlyLatest, indexStart, - count, column, sortOrder, userFilter); - return convertList(elements); + List<MetaData> elements = storageEngineDelegating.getDatabase().findElementsByContentSearch(query, + searchColumn, onlyLatest, indexStart, count, column, sortOrder, userFilter); + return storageEngineDelegating.convertList(elements); } /* (non-Javadoc) @@ -173,7 +201,8 @@ public int findFullTextCount(String token, String query, SearchColumn searchColumn, boolean onlyLatest) throws SimExplorerException { String userFilter = getUserFilter(token); - return database.findElementsByContentSearchCount(query, searchColumn, onlyLatest, userFilter); + return storageEngineDelegating.getDatabase().findElementsByContentSearchCount(query, searchColumn, onlyLatest, + userFilter); } /* (non-Javadoc) @@ -182,7 +211,7 @@ @Override public MetaData getMetadata(String token, String uuid, Version version) throws SimExplorerException { canRead(token, uuid); - return super.getMetadata(token, uuid, version); + return storageEngineDelegating.getMetadata(token, uuid, version); } /* (non-Javadoc) @@ -191,7 +220,7 @@ @Override public MetaData getMetadata(String token, String uuid) throws SimExplorerException { canRead(token, uuid); - return super.getMetadata(token, uuid); + return storageEngineDelegating.getMetadata(token, uuid); } /* (non-Javadoc) @@ -200,7 +229,7 @@ @Override public List<Version> getVersions(String token, String uuid) throws SimExplorerException { canRead(token, uuid); - return super.getVersions(token, uuid); + return storageEngineDelegating.getVersions(token, uuid); } /* (non-Javadoc) @@ -209,7 +238,7 @@ @Override public InputStream retrieveData(String token, MetaData entity, Attachment attachment) throws SimExplorerException { canRead(token, entity.getUuid()); - return super.retrieveData(token, entity, attachment); + return storageEngineDelegating.retrieveData(token, entity, attachment); } /* (non-Javadoc) @@ -217,6 +246,9 @@ */ @Override public boolean canCreateSubVersion(String token, String uuid) { + if (log.isDebugEnabled()) { + log.debug(token + " canCreateSubVersion " + uuid); + } Permission permission = credentialManager.getPermission(token, uuid); return permission.isCanWrite(); } @@ -229,6 +261,7 @@ throws SimExplorerException { canWrite(token, element.getMetaData().getUuid()); credentialManager.saveElement(token, element.getMetaData().getUuid()); + storageEngineDelegating.saveElement(token, element, attachments); } /* (non-Javadoc) @@ -237,7 +270,7 @@ @Override public void close() throws SimExplorerException { // nothing to check - super.close(); + storageEngineDelegating.close(); } /* (non-Javadoc) @@ -246,25 +279,16 @@ @Override public void commit() throws SimExplorerException { // nothing to check - super.commit(); + storageEngineDelegating.commit(); } /* (non-Javadoc) - * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngineImpl#convertList(java.util.Collection) - */ - @Override - protected MetaData[] convertList(Collection<MetaData> metadatas) { - // nothing to check - return super.convertList(metadatas); - } - - /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngineImpl#deleteTempData(java.lang.String) */ @Override public void deleteTempData(String id) throws SimExplorerException { // nothing to check - super.deleteTempData(id); + storageEngineDelegating.deleteTempData(id); } /* (non-Javadoc) @@ -275,7 +299,7 @@ throws SimExplorerException { canRead(token, fromElement.getUuid()); canWrite(token, toElement.getUuid()); - super.duplicateElementHierarchy(token, fromElement, toElement); + storageEngineDelegating.duplicateElementHierarchy(token, fromElement, toElement); } /* (non-Javadoc) @@ -284,7 +308,7 @@ @Override public List<MetaData> getElementVersions(String token, String uuid) throws SimExplorerException { canRead(token, uuid); - return super.getElementVersions(token, uuid); + return storageEngineDelegating.getElementVersions(token, uuid); } /* (non-Javadoc) @@ -293,7 +317,7 @@ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid, Version version) throws SimExplorerException { canRead(token, uuid); - return super.getMetadatasUsedBy(token, uuid, version); + return storageEngineDelegating.getMetadatasUsedBy(token, uuid, version); } /* (non-Javadoc) @@ -302,7 +326,7 @@ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid) throws SimExplorerException { canRead(token, uuid); - return super.getMetadatasUsedBy(token, uuid); + return storageEngineDelegating.getMetadatasUsedBy(token, uuid); } /* (non-Javadoc) @@ -311,7 +335,7 @@ @Override public MetaData[] getMetadatasUsing(String token, String uuid, Version version) throws SimExplorerException { canRead(token, uuid); - return super.getMetadatasUsing(token, uuid, version); + return storageEngineDelegating.getMetadatasUsing(token, uuid, version); } /* (non-Javadoc) @@ -320,7 +344,7 @@ @Override public MetaData[] getMetadatasUsing(String token, String uuid) throws SimExplorerException { canRead(token, uuid); - return super.getMetadatasUsing(token, uuid); + return storageEngineDelegating.getMetadatasUsing(token, uuid); } /* (non-Javadoc) @@ -329,7 +353,7 @@ @Override public void open() throws SimExplorerException { // nothing to check - super.open(); + storageEngineDelegating.open(); } /* (non-Javadoc) @@ -338,7 +362,7 @@ @Override public InputStream retrieveTempData(String id) throws SimExplorerException { // nothing to check - return super.retrieveTempData(id); + return storageEngineDelegating.retrieveTempData(id); } /* (non-Javadoc) @@ -347,7 +371,7 @@ @Override public void saveElementHierarchy(String token, MetaData parent, MetaData child) throws SimExplorerException { canWrite(token, parent.getUuid()); - super.saveElementHierarchy(token, parent, child); + storageEngineDelegating.saveElementHierarchy(token, parent, child); } /* (non-Javadoc) @@ -356,7 +380,7 @@ @Override public StreamInfo storeTempData(InputStream stream) throws SimExplorerException { // nothing to check - return super.storeTempData(stream); + return storageEngineDelegating.storeTempData(stream); } } Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -28,6 +28,10 @@ */ public class ContentTypeFactory { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(ContentTypeFactory.class); + /** Content type cache. */ private static Map<String, ContentType> contentTypes = null; @@ -45,6 +49,9 @@ * @throws IllegalArgumentException if could not found the class or has problem while instanciation */ public static ContentType getContentTypeInstance(String contentTypeClassSimpleName) throws IllegalArgumentException { + if (log.isDebugEnabled()) { + log.debug("getContentTypeInstance " + contentTypeClassSimpleName); + } if (contentTypes == null) { contentTypes = new HashMap<String, ContentType>(); } @@ -71,7 +78,7 @@ /** * Instantiates a new content type factory. */ - protected ContentTypeFactory() { + private ContentTypeFactory() { // no instance } } Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/LoggableElementFactory.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/LoggableElementFactory.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/LoggableElementFactory.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -33,6 +33,10 @@ */ public abstract class LoggableElementFactory { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(LoggableElementFactory.class); + /** The xstream. */ private static XStream xstream = new XStream(); @@ -44,7 +48,7 @@ public static XStream getXstream() { return xstream; } - + /** * Parses the stream. * @@ -53,6 +57,9 @@ * @return the loggable element */ public static LoggableElement parseStream(InputStream xmlData) { + if (log.isDebugEnabled()) { + log.debug("parseStream"); + } return (LoggableElement) getXstream().fromXML(xmlData); } @@ -65,7 +72,10 @@ * * @throws SimExplorerTechnicalException the sim explorer technical exception */ - public static InputStream getStream(LoggableElement element) throws SimExplorerTechnicalException { + public static InputStream getStream(LoggableElement element) throws SimExplorerTechnicalException { + if (log.isDebugEnabled()) { + log.debug("getStream"); + } PipedOutputStream os = new PipedOutputStream(); PipedInputStream is; try { Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/XMLStreamEncoder.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/XMLStreamEncoder.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/XMLStreamEncoder.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -25,10 +25,15 @@ /** * The Class XMLStreamEncoder. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ public class XMLStreamEncoder extends Thread { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(XMLStreamEncoder.class); + /** The object source. */ private Object source; @@ -47,6 +52,9 @@ */ public XMLStreamEncoder(Object source, PipedOutputStream os) { super(); + if (log.isDebugEnabled()) { + log.debug("XMLStreamEncoder"); + } this.source = source; this.os = os; @@ -59,7 +67,13 @@ @Override public void run() { try { + if (log.isDebugEnabled()) { + log.debug("toXML"); + } xStream.toXML(source, os); + if (log.isDebugEnabled()) { + log.debug("os.close"); + } os.close(); } catch (IOException e) { throw new SimExplorerRuntimeException(e); Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -42,6 +42,10 @@ */ public class FileSystemAttachmentHandler extends AttachmentHandler { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(FileSystemAttachmentHandler.class); + /** Base folder. */ protected String baseFolder; @@ -96,6 +100,9 @@ */ @Override public InputStream retrieveData(MetaData entity, Attachment attachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveData " + entity + "/" + attachment); + } // Simple stream on file FileInputStream fis; try { @@ -104,13 +111,16 @@ throw new SimExplorerTechnicalException(e); } return fis; - } + } /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.storage.attachment.AttachmentHandler#storeData(fr.cemagref.simexplorer.is.entities.metadata.MetaData, java.lang.String, java.io.InputStream) */ @Override public void storeData(MetaData entity, Attachment attachment, InputStream is) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("storeData " + entity + "/" + attachment); + } BufferedOutputStream bout = null; // Simple stream on file @@ -132,7 +142,7 @@ } bout.flush(); - + attachment.setDataHash(MD5.asHex(md5is.hash())); attachment.setDataSize(md5is.getStreamLength()); @@ -153,6 +163,9 @@ * @throws SimExplorerException the sim explorer exception */ protected void closeStream(OutputStream fos) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("closeStream"); + } if (fos != null) { // Close file try { @@ -168,6 +181,9 @@ */ @Override public void deleteData(MetaData entity, Attachment attachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteData " + entity + "/" + attachment); + } try { // Simple delete on file getFile(entity, attachment, false).delete(); Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -103,7 +103,7 @@ * @param fromElement the from element * @param toElement the to element * - * @throws SimExplorerException TODO + * @throws SimExplorerException the sim explorer exception */ public abstract void duplicateElementHierarchy(MetaData fromElement, MetaData toElement) throws SimExplorerException; @@ -141,7 +141,7 @@ * * @return the elements used by * - * @throws SimExplorerException TODO + * @throws SimExplorerException the sim explorer exception */ public abstract List<MetaData> getElementsUsedBy(MetaData mde) throws SimExplorerException; @@ -152,7 +152,7 @@ * * @return the elements using * - * @throws SimExplorerException TODO + * @throws SimExplorerException the sim explorer exception */ public abstract List<MetaData> getElementsUsing(MetaData mde) throws SimExplorerException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -128,7 +128,9 @@ Properties config = Config.getProperties(); this.dbFolder = String.valueOf(config.getProperty(Config.DB_FOLDER_PROPERTY)); this.optimizePeriod = Integer.valueOf(config.getProperty(Config.OPTIMIZE_PERIOD_PROPERTY)); - log.info(this); + if (log.isDebugEnabled()) { + log.debug("LuceneDatabase"); + } } /* (non-Javadoc) @@ -229,6 +231,9 @@ * @throws IOException Signals that an I/O exception has occurred. */ private Hits filterSearch(Searcher searcher, Query query, String userFilter, Sort sorting) throws IOException { + if (log.isDebugEnabled()) { + log.debug("filterSearch"); + } Hits result = null; Filter filter = null; // Retrieve filter of user @@ -259,8 +264,7 @@ } /** - * Creates a query for a security filter. - * This query is a big OR on all elements on UUIDs + * Creates a query for a security filter. This query is a big OR on all elements on UUIDs * * @param visibleItems the visible items for the user * @@ -272,9 +276,9 @@ int i = 0; // does the current query has not maxTerms éléments boolean subQueryIsQuery = true; - + BooleanQuery query = new BooleanQuery(); - + // sub query with maxTerms elements BooleanQuery subQuery = new BooleanQuery(); for (String string : visibleItems) { @@ -289,14 +293,14 @@ } i++; } - + // sub query is the main query? if (subQueryIsQuery) { return subQuery; } - return query; + return query; } - + /** * Creates the filter corresponding to a list of visible items. * @@ -306,16 +310,19 @@ * */ private Filter createFilter(Collection<String> visibleItems) { - // wrap the query as a filter and cache it + // wrap the query as a filter and cache it Filter filter = new CachingWrapperFilter(new QueryWrapperFilter(createQuery(visibleItems))); return filter; } - + /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.storage.database.Database#open(boolean) */ @Override public void open(boolean create) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("open"); + } if (writer == null) { // Create an analyzer SimpleAnalyzer simpleAnalyzer = new SimpleAnalyzer(); @@ -324,7 +331,7 @@ PerFieldAnalyzerWrapper perFieldAnalyzerWrapper = (PerFieldAnalyzerWrapper) analyzer; KeywordAnalyzer keywordAnalyzer = new KeywordAnalyzer(); // all these fields are stored as a single keyword - // other fields use default analyzer : simpleAnalyzer + // other fields use default analyzer : simpleAnalyzer perFieldAnalyzerWrapper.addAnalyzer(KEY_UUID, keywordAnalyzer); perFieldAnalyzerWrapper.addAnalyzer(KEY_UUID_VERSION, keywordAnalyzer); perFieldAnalyzerWrapper.addAnalyzer(KEY_UUID_VERSION_PARENT, keywordAnalyzer); @@ -372,6 +379,9 @@ */ @Override public void close() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("close"); + } try { synchronized (writerSynchronizer) { // Close writer and invalidate reader @@ -412,6 +422,9 @@ */ @Override public void commit() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("commit"); + } try { // Allows concurent access synchedCommit(); @@ -426,6 +439,9 @@ @Override public void insertElement(MetaData element, List<Reader> attachmentsContent, List<Attachment> attachments, List<Descriptor> descriptors) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("insertElement"); + } // Save element to a Lucene document Document document = saveLuceneElement(element, attachmentsContent, attachments, descriptors); @@ -444,6 +460,9 @@ */ @Override public void saveElementHierarchy(MetaData parent, MetaData child) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("saveElementHierarchy"); + } // Save element to a Lucene document Document document = saveLuceneElementHierarchy(parent, child); @@ -462,6 +481,9 @@ */ @Override public MetaData getElement(String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getElement"); + } MetaData result = null; try { @@ -498,6 +520,9 @@ * @throws IOException Signals that an I/O exception has occurred. */ private Hits getHitsByIdVersion(String uuid, Version version, Searcher searcher) throws IOException { + if (log.isDebugEnabled()) { + log.debug("getHitsByIdVersion"); + } // Retrieve element with id/version Map<String, String> properties = new HashMap<String, String>(); properties.put(KEY_UUID, uuid); @@ -514,6 +539,9 @@ */ @Override public List<Version> getVersions(String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getVersions"); + } // Retrieve all document corresponding to id Map<String, String> properties = new HashMap<String, String>(); properties.put(KEY_UUID, uuid); @@ -550,6 +578,9 @@ */ @Override public List<MetaData> findElementsById(String uuid, boolean onlyLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsById"); + } // Create hash map with id Map<String, String> properties = new HashMap<String, String>(); properties.put(KEY_UUID, uuid); @@ -585,6 +616,9 @@ @Override public int findElementsByPropertiesCount(Map<String, String> properties, String userFilter) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByPropertiesCount"); + } int result = 0; try { @@ -611,6 +645,10 @@ @Override public List<MetaData> findElementsByProperties(Map<String, String> properties, int start, int count, SortColumn column, SortOrder sortOrder, String userFilter) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByProperties"); + } + List<MetaData> result = null; try { @@ -639,6 +677,9 @@ @Override public int findElementsByContentSearchCount(String queryText, SearchColumn column, boolean onlyLatest, String userFilter) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByContentSearchCount"); + } Query query; try { query = getQueryByContentSearch(queryText, column, onlyLatest); @@ -674,6 +715,9 @@ public List<MetaData> findElementsByContentSearch(String queryText, SearchColumn searchColumn, boolean onlyLatest, int start, int count, SortColumn sortColumn, SortOrder sortOrder, String userFilter) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByContentSearch"); + } Query query; try { query = getQueryByContentSearch(queryText, searchColumn, onlyLatest); @@ -713,6 +757,9 @@ * @return null if no sort */ private Sort getSort(SortColumn column, SortOrder sortOrder) { + if (log.isDebugEnabled()) { + log.debug("getSort"); + } Sort sort; if (column != SortColumn.None) { SortField[] fields = new SortField[3]; @@ -744,6 +791,9 @@ */ private Query getQueryByContentSearch(String queryText, SearchColumn column, boolean onlyLatest) throws ParseException { + if (log.isDebugEnabled()) { + log.debug("getQueryByContentSearch"); + } Query query; Query searchQuery = null; @@ -783,6 +833,9 @@ * @throws ParseException the parse exception */ private Query getQueryByContentSearchForColumn(String queryText, String column) throws ParseException { + if (log.isDebugEnabled()) { + log.debug("getQueryByContentSearchForColumn"); + } // Create an parser to handle query QueryParser parser; parser = new QueryParser(column, analyzer); @@ -796,6 +849,9 @@ */ @Override public void deleteElement(String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteElement"); + } // Delete element in db with term search Term term = new Term(KEY_UUID_VERSION, getUuidVersion(uuid, version)); @@ -824,6 +880,9 @@ */ private Hits findHits(Map<String, String> properties, Searcher searcher, SortColumn column, SortOrder sortOrder, String userFilter) throws IOException { + if (log.isDebugEnabled()) { + log.debug("findHits"); + } // Create a query with all parameters BooleanQuery query = new BooleanQuery(); for (Entry<String, String> kv : properties.entrySet()) { @@ -847,6 +906,9 @@ * @throws SimExplorerException the exception */ private List<MetaData> convertHitsToElements(Hits hits, int start, int count) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("convertHitsToElements"); + } List<MetaData> elements = new ArrayList<MetaData>(); try { if (hits != null) { @@ -876,6 +938,9 @@ */ @SuppressWarnings( { "unchecked" }) private MetaData loadLuceneElement(Document document) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("loadLuceneElement"); + } MetaData element = new MetaData(); // Fill element with Lucene document @@ -946,6 +1011,9 @@ * @return the document */ private Document saveLuceneElementHierarchy(MetaData parent, MetaData child) { + if (log.isDebugEnabled()) { + log.debug("saveLuceneElementHierarchy"); + } Document document = new Document(); addSimpleField(document, KEY_UUID_VERSION_PARENT, getUuidVersion(parent.getUuid(), parent.getVersion())); @@ -966,6 +1034,9 @@ */ private Document saveLuceneElement(MetaData element, List<Reader> attachmentsContent, List<Attachment> attachments, List<Descriptor> descriptors) { + if (log.isDebugEnabled()) { + log.debug("saveLuceneElement"); + } Document document = new Document(); // Store all element properties in Lucene document @@ -1025,6 +1096,9 @@ */ protected List<MetaData> getAssociatedElements(MetaData mde, String fromField, String toField) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getAssociatedElements"); + } List<MetaData> result = new ArrayList<MetaData>(); try { Query query; @@ -1076,6 +1150,9 @@ */ @Override public List<MetaData> getElementsUsedBy(MetaData mde) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getElementsUsedBy"); + } return getAssociatedElements(mde, KEY_UUID_VERSION_CHILD, KEY_UUID_VERSION_PARENT); } @@ -1084,6 +1161,9 @@ */ @Override public List<MetaData> getElementsUsing(MetaData mde) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getElementsUsing"); + } return getAssociatedElements(mde, KEY_UUID_VERSION_PARENT, KEY_UUID_VERSION_CHILD); } @@ -1092,6 +1172,9 @@ */ @Override public void duplicateElementHierarchy(MetaData fromElement, MetaData toElement) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("duplicateElementHierarchy"); + } // Delete element in db with term search Term term = new Term(KEY_UUID_VERSION_PARENT, getUuidVersion(toElement.getUuid(), toElement.getVersion())); try { @@ -1114,6 +1197,9 @@ */ @Override public void updateFilter(String userFilter, Collection<String> visibleItems) { + if (log.isDebugEnabled()) { + log.debug("updateFilter for " + userFilter); + } if (visibleItems != null) { Filter filter = createFilter(visibleItems); synchronized (filterSynchronizer) { Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -48,6 +48,10 @@ */ public class StorageEngineImpl implements StorageEngine { + /** The Constant log. */ + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(StorageEngineImpl.class); + /** Indexing. */ protected Database database; @@ -56,7 +60,8 @@ /** The opened. */ private boolean opened = false; - + + /** The Constant uuidTmpData. */ private static final String uuidTmpData = UUID.randomUUID().toString(); /** @@ -85,6 +90,9 @@ */ public StorageEngineImpl(String configFile, String prefixKey) { super(); + if (log.isDebugEnabled()) { + log.debug("StorageEngineImpl"); + } if (configFile != null) { Config.init(configFile, prefixKey); } @@ -95,6 +103,11 @@ } + /** + * Gets the tmp meta data. + * + * @return the tmp meta data + */ private MetaData getTmpMetaData() { // Storing tmp data MetaData mdTmp = new MetaData(); @@ -107,6 +120,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#open() */ public void open() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("open"); + } if (!opened) { database.open(); opened = true; @@ -117,6 +133,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#close() */ public void close() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("close"); + } database.close(); } @@ -124,18 +143,40 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#commit() */ public void commit() throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("commit"); + } database.commit(); } + /** + * Gets the database. + * + * @return the database + */ + public Database getDatabase() { + return database; + } + + /** + * Gets the attachment handler. + * + * @return the attachment handler + */ + public AttachmentHandler getAttachmentHandler() { + return attachmentHandler; + } + // Create / update /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#saveElement(fr.cemagref.simexplorer.is.entities.metadata.MetaData, java.util.Map) */ - public void saveElement(String token, LoggableElement loggableElement, Map<Attachment, InputStream> attachments) throws SimExplorerException { - + if (log.isDebugEnabled()) { + log.debug("saveElement"); + } // Save all attachments in system for (Map.Entry<Attachment, InputStream> entry : attachments.entrySet()) { attachmentHandler.storeData(loggableElement.getMetaData(), entry.getKey(), entry.getValue()); @@ -168,6 +209,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#saveElementHierarchy(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.MetaData, fr.cemagref.simexplorer.is.entities.metadata.MetaData) */ public void saveElementHierarchy(String token, MetaData parent, MetaData child) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("saveElementHierarchy"); + } database.saveElementHierarchy(parent, child); } @@ -177,6 +221,9 @@ @Override public void duplicateElementHierarchy(String token, MetaData fromElement, MetaData toElement) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("duplicateElementHierarchy"); + } database.duplicateElementHierarchy(fromElement, toElement); } @@ -187,6 +234,9 @@ */ public MetaData getMetadata(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadata"); + } MetaData mde = null; List<MetaData> set = database.findElementsById(uuid, true); if (!set.isEmpty()) { @@ -199,6 +249,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#getVersions(java.lang.String) */ public List<Version> getVersions(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getVersions"); + } return database.getVersions(uuid); } @@ -206,6 +259,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#getMetadata(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.Version) */ public MetaData getMetadata(String token, String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadata"); + } MetaData mde; mde = database.getElement(uuid, version); return mde; @@ -216,6 +272,9 @@ */ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsedBy"); + } MetaData mde = database.getElement(uuid, version); return convertList(database.getElementsUsedBy(mde)); } @@ -225,6 +284,9 @@ */ @Override public MetaData[] getMetadatasUsedBy(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsedBy"); + } Set<MetaData> metadatasUsedBy = new HashSet<MetaData>(); List<Version> versions = database.getVersions(uuid); @@ -243,6 +305,9 @@ */ @Override public MetaData[] getMetadatasUsing(String token, String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsing"); + } MetaData mde = database.getElement(uuid, version); return convertList(database.getElementsUsing(mde)); } @@ -252,6 +317,9 @@ */ @Override public MetaData[] getMetadatasUsing(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getMetadatasUsing"); + } Set<MetaData> metadatasUsing = new HashSet<MetaData>(); List<Version> versions = database.getVersions(uuid); @@ -269,6 +337,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#retrieveData(fr.cemagref.simexplorer.is.entities.metadata.MetaData, java.lang.String) */ public InputStream retrieveData(String token, MetaData entity, Attachment attachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveData"); + } InputStream result; result = attachmentHandler.retrieveData(entity, attachment); return result; @@ -278,6 +349,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#deleteData(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.MetaData, fr.cemagref.simexplorer.is.entities.attachment.Attachment) */ public void deleteData(String token, MetaData entity, Attachment attachment) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteData"); + } attachmentHandler.deleteData(entity, attachment); } @@ -286,6 +360,9 @@ */ public int findFullTextCount(String token, String query, SearchColumn searchColumn, boolean onlyLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findFullTextCount"); + } return database.findElementsByContentSearchCount(query, searchColumn, onlyLatest); } @@ -294,6 +371,9 @@ */ public MetaData[] findFullText(String token, String query, SearchColumn searchColumn, boolean onlyLatest, int indexStart, int count, SortColumn column, SortOrder sortOrder) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findFullText"); + } List<MetaData> elements = database.findElementsByContentSearch(query, searchColumn, onlyLatest, indexStart, count, column, sortOrder); return convertList(elements); @@ -304,6 +384,9 @@ */ public MetaData[] findElementsByType(String token, String type, boolean onlyLatest, int start, int count, SortColumn column, SortOrder sortOrder) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByType"); + } List<MetaData> elements = database.findElementsByType(type, onlyLatest, start, count, column, sortOrder); return convertList(elements); } @@ -312,6 +395,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#findElementsByTypeCount(java.lang.String, boolean) */ public int findElementsByTypeCount(String token, String type, boolean onlyLatest) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("findElementsByTypeCount"); + } return database.findElementsByTypeCount(type, onlyLatest); } @@ -321,6 +407,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#deleteElement(java.lang.String, fr.cemagref.simexplorer.is.entities.metadata.Version) */ public void deleteElement(String token, String uuid, Version version) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteElement"); + } MetaData element = getMetadata(token, uuid, version); database.deleteElement(element); } @@ -345,14 +434,17 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#storeTempData(java.io.InputStream) */ public StreamInfo storeTempData(InputStream stream) throws SimExplorerException { - String id = UUID.randomUUID().toString(); + if (log.isDebugEnabled()) { + log.debug("storeTempData"); + } + String id = UUID.randomUUID().toString(); StreamInfo streamInfo = new StreamInfo(); MetaData tmpMetaData = getTmpMetaData(); Attachment tmpAttachment = getTmpAttachment(id); attachmentHandler.storeData(tmpMetaData, tmpAttachment, stream); streamInfo.setUuid(id); streamInfo.setHash(tmpAttachment.getDataHash()); - streamInfo.setLength(tmpAttachment.getDataSize()); + streamInfo.setLength(tmpAttachment.getDataSize()); return streamInfo; } @@ -360,6 +452,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#retrieveTempData(java.lang.String) */ public InputStream retrieveTempData(String id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("retrieveTempData"); + } InputStream is; is = attachmentHandler.retrieveData(getTmpMetaData(), getTmpAttachment(id)); return is; @@ -369,6 +464,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#deleteTempData(java.lang.String) */ public void deleteTempData(String id) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("deleteTempData"); + } attachmentHandler.deleteData(getTmpMetaData(), getTmpAttachment(id)); } @@ -376,6 +474,9 @@ * @see fr.cemagref.simexplorer.is.storage.engine.StorageEngine#getElementVersions(java.lang.String, java.lang.String) */ public List<MetaData> getElementVersions(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("getElementVersions"); + } return database.findElementsById(uuid, false); } @@ -384,6 +485,9 @@ */ @Override public boolean canCreateSubVersion(String token, String uuid) throws SimExplorerException { + if (log.isDebugEnabled()) { + log.debug("canCreateSubVersion"); + } // by default return true; } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -30,7 +30,6 @@ import org.apache.tapestry.services.PersistentLocale; import org.apache.tapestry.services.RequestGlobals; -import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.storage.SearchColumn; import fr.cemagref.simexplorer.is.ui.web.pages.ElementList; import fr.cemagref.simexplorer.is.ui.web.pages.Login; @@ -168,9 +167,8 @@ * * @return the logged * - * @throws SimExplorerException the sim explorer exception */ - public boolean getLogged() throws SimExplorerException { + public boolean getLogged() { return (applicationState.getUser() != null); } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -51,7 +51,7 @@ public Object onActionFromGenerateData() throws Exception { StorageServiceGenerator storageServiceGenerator = new StorageServiceGenerator(); storageServiceGenerator.generateLotsExplorationApplication(RemoteStorageService.getStorageService(), - getToken(), 20); + getToken(), 1); return elementList; } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -31,6 +31,7 @@ /** * The Class ProtectedPage. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ public abstract class ProtectedPage { @@ -62,10 +63,12 @@ /** The resources. */ @Inject private ComponentResources resources; - + /** * On activate. * + * @param pageContext the page context + * * @return the object * * @throws SimExplorerException the sim explorer exception @@ -85,9 +88,8 @@ /** * Gets the user rights. * - * @throws SimExplorerException the sim explorer exception */ - public void getUserRights() throws SimExplorerException { + public void getUserRights() { user = computeUserLogged(); if (user != null) { userLogged = true; @@ -114,13 +116,12 @@ * * @return the user * - * @throws SimExplorerException the sim explorer exception */ - private User computeUserLogged() throws SimExplorerException { + private User computeUserLogged() { User loggedUser = null; if (getToken() != null) { try { - loggedUser = RemoteSecurityService.getAuthentificationService().getLoggedUser(getToken()); + loggedUser = RemoteSecurityService.getAuthentificationService().getLoggedUser(getToken()); } catch (Exception e) { loggedUser = null; } @@ -186,7 +187,7 @@ public Messages getMessages() { return messages; } - + /** * Gets the resources. * @@ -201,6 +202,4 @@ I18n.init("fr", "FR"); } - - } \ No newline at end of file Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/AppModule.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/AppModule.java 2008-04-10 17:00:24 UTC (rev 1464) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/AppModule.java 2008-04-10 17:00:51 UTC (rev 1465) @@ -33,6 +33,7 @@ /** * The Class AppModule. + * * @author Code Lutin, Landais Gabriel, Chemit Tony */ public class AppModule { @@ -40,8 +41,7 @@ /** * Bind. * - * @param binder - * the binder + * @param binder the binder */ public static void bind(ServiceBinder binder) { /* @@ -58,8 +58,7 @@ /** * Contribute application defaults. * - * @param configuration - * the configuration + * @param configuration the configuration */ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration) { configuration.add("tapestry.supported-locales", "en,fr"); @@ -69,8 +68,7 @@ /** * Contribute default data type analyzer. * - * @param configuration - * the configuration + * @param configuration the configuration */ public static void contributeDefaultDataTypeAnalyzer(MappedConfiguration<Class<?>, String> configuration) { configuration.add(Version.class, "text"); @@ -91,8 +89,7 @@ * "RequestFilter". Since Tapestry already defines a service named "RequestFilter" we use an explicit service id * that we can reference inside the contribution method. * - * @param log - * the log + * @param log the log * * @return the request filter */ @@ -118,19 +115,21 @@ }; } - public void contributeApplicationStateManager(MappedConfiguration<Class, ApplicationStateContribution> configuration) - { - configuration.add(SimExplorerState.class, new ApplicationStateContribution("session")); + /** + * Contribute application state manager. + * + * @param configuration the configuration + */ + public void contributeApplicationStateManager(MappedConfiguration<Class, ApplicationStateContribution> configuration) { + configuration.add(SimExplorerState.class, new ApplicationStateContribution("session")); } - + /** * This is a contribution to the RequestHandler service configuration. This is how we extend Tapestry using the * timing filter. A common use for this kind of filter is transaction management or security. * - * @param configuration - * the configuration - * @param filter - * the filter + * @param configuration the configuration + * @param filter the filter */ public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, @InjectService("TimingFilter")
participants (1)
-
glandais@users.labs.libre-entreprise.org