Changeset 409
- Timestamp:
- 03/14/12 14:52:29 (12 years ago)
- Location:
- tapas
- Files:
-
- 26 added
- 18 edited
- 23 copied
Legend:
- Unmodified
- Added
- Removed
-
tapas/common/implementation/com/ether/ParameterConstants.java
r376 r409 9 9 public static final String PARAMETER_DATE_BEGIN = "dateBegin"; 10 10 public static final String PARAMETER_DATE_END = "dateEnd"; 11 public static final String PARAMETER_LOGIN = "login"; 12 public static final String PARAMETER_PWD = "pwd"; 13 public static final String PARAMETER_FIRST_NAME = "firstName"; 14 public static final String PARAMETER_EMAIL = "email"; 15 public static final String PARAMETER_ROLE = "role"; 16 public static final String PARAMETER_STATE = "state"; 17 public static final String PARAMETER_HAS_ACCESS = "hasAccess"; 18 public static final String PARAMETER_KEEP_SAME_PASSWORD = "keepSamePassword"; 19 public static final String PARAMETER_MAX_RESULTS = "maxResults"; 20 public static final String PARAMETER_PAGE = "page"; 11 21 } -
tapas/domain/interface/com/ether/user/User.java
r278 r409 16 16 } 17 17 18 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String password, @Nullable final UserRole role, @NotNull final UserState state,final boolean hasAccessToBO, @NotNull final Date creationDate )18 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String password, @Nullable final UserRole role, final boolean hasAccessToBO, @NotNull final Date creationDate ) 19 19 { 20 20 _lastName = lastName; … … 23 23 _password = password; 24 24 _role = role; 25 _state = state;26 25 _accessToBO = hasAccessToBO; 27 26 _creationDate = creationDate; 28 27 } 29 28 30 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String pwd, @Nullable final String role, @NotNull final String state,final Boolean hasAccessToBO, @NotNull final Date date )29 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String pwd, @Nullable final String role, final Boolean hasAccessToBO, @NotNull final Date date ) 31 30 { 32 this( lastName, firstName, email, pwd, UserRole.valueOf( role ), UserState.valueOf( state ),hasAccessToBO, date );31 this( lastName, firstName, email, pwd, UserRole.valueOf( role ), hasAccessToBO, date ); 33 32 } 34 33 … … 98 97 } 99 98 100 @NotNull101 public UserState getState()102 {103 return _state;104 }105 106 public void setState( @NotNull final UserState state )107 {108 _state = state;109 }110 111 99 public boolean isAccessToBO() 112 100 { … … 141 129 @Nullable 142 130 private UserRole _role; 143 @NotNull144 private UserState _state;145 131 private boolean _accessToBO; 146 132 @NotNull -
tapas/domain/interface/com/ether/user/UserFilter.java
r308 r409 41 41 42 42 @Nullable 43 public UserState getSortState()44 {45 return _sortState;46 }47 48 public void setSortState( @Nullable final UserState sortState )49 {50 _sortState = sortState;51 }52 53 @Nullable54 43 public String getSearchText() 55 44 { … … 87 76 private UserRole _sortRole; 88 77 @Nullable 89 private UserState _sortState;90 @Nullable91 78 private String _searchText; 92 79 private boolean _sortAccessBoFalse; -
tapas/domain/interface/com/ether/user/UserRole.java
r281 r409 3 3 /** 4 4 * User: vmipsl 5 * Date: 25 nov. 20115 * Date: 12 march 2012 6 6 */ 7 7 public enum UserRole 8 8 { 9 COORDINATOR,9 USER, 10 10 ADMINISTRATOR, 11 TECHNICIEN,12 11 } -
tapas/persistence/implementation/com/ether/dao/DomainAccessObjectImpl.java
r376 r409 1 1 package com.ether.dao; 2 2 3 import static com.ether.PersistenceHelper.convert; 4 import static com.ether.PersistenceHelper.uniqueResult; 3 import com.ether.LikeExpression; 4 import com.ether.PersistenceException; 5 import com.ether.PersistenceHelper; 6 import org.hibernate.Criteria; 7 import org.hibernate.Session; 8 import org.hibernate.SessionFactory; 9 import org.hibernate.criterion.Criterion; 10 import org.hibernate.criterion.DetachedCriteria; 11 import org.hibernate.criterion.Example; 12 import org.hibernate.criterion.MatchMode; 13 import org.hibernate.criterion.Projections; 14 import org.jetbrains.annotations.NotNull; 15 import org.jetbrains.annotations.Nullable; 16 import org.springframework.dao.DataAccessException; 17 import org.springframework.transaction.annotation.Propagation; 18 import org.springframework.transaction.annotation.Transactional; 5 19 6 20 import java.io.Serializable; … … 10 24 import java.util.List; 11 25 12 import org.hibernate.Criteria; 13 import org.hibernate.Session; 14 import org.hibernate.SessionFactory; 15 import org.hibernate.criterion.DetachedCriteria; 16 import org.hibernate.criterion.Example; 17 import org.hibernate.criterion.Projections; 18 import org.jetbrains.annotations.NotNull; 19 import org.jetbrains.annotations.Nullable; 20 import org.springframework.dao.DataAccessException; 21 22 import com.ether.PersistenceException; 26 import static com.ether.PersistenceHelper.convert; 27 import static com.ether.PersistenceHelper.uniqueResult; 23 28 24 29 public class DomainAccessObjectImpl<DO, PK extends Serializable> 25 30 implements DomainAccessObject<DO, PK> 26 31 { 27 public DomainAccessObjectImpl(final Class<DO> domainObjectClass) { 28 _domainObjectClass = domainObjectClass; 32 public DomainAccessObjectImpl( final Class<DO> domainObjectClass ) 33 { 34 _domainObjectClass = domainObjectClass; 35 } 36 37 public DomainAccessObjectImpl( final Class<DO> domainObjectClass, final Class<PK> primaryKeyClass ) 38 { 39 _domainObjectClass = domainObjectClass; 40 _primaryKeyClass = primaryKeyClass; 29 41 } 30 42 … … 33 45 // ************************************************************************** // 34 46 35 // ******************************* SELECT BY CRITERIA **// 47 // ******************************* SELECT BY CRITERIA **// 36 48 @Nullable 37 public final DO selectByCriteria( final DetachedCriteria criteria)38 39 { 40 return selectByCriteria(getDomainObjectClass(), criteria);49 public final DO selectByCriteria( final DetachedCriteria criteria ) 50 throws PersistenceException 51 { 52 return selectByCriteria( getDomainObjectClass(), criteria ); 41 53 } 42 54 43 55 @Nullable 44 public final <O> O selectByCriteria(final Class<O> objectClass, final DetachedCriteria criteria) throws PersistenceException 45 { 46 return (O) criteria.getExecutableCriteria(_sessionFactory.getCurrentSession()).uniqueResult(); 56 public final <O> O selectByCriteria( final Class<O> objectClass, final DetachedCriteria criteria ) 57 throws PersistenceException 58 { 59 return (O) criteria.getExecutableCriteria( _sessionFactory.getCurrentSession() ).uniqueResult(); 47 60 } 48 61 49 62 @NotNull 50 public final <O> List<O> selectAllByCriteria(final Class<O> objectClass, final DetachedCriteria criteria) throws PersistenceException 51 { 52 final List<O> result = (List<O>) criteria.getExecutableCriteria(_sessionFactory.getCurrentSession()).list(); 53 return null != result ? result : new ArrayList<O>(); 63 public final <O> List<O> selectAllByCriteria( final Class<O> objectClass, final DetachedCriteria criteria ) 64 throws PersistenceException 65 { 66 final List<O> result = (List<O>) criteria.getExecutableCriteria( _sessionFactory.getCurrentSession() ).list(); 67 return null != result ? result : new ArrayList<O>(); 54 68 } 55 69 56 70 @NotNull 57 public final List<DO> selectAllByCriteria(final DetachedCriteria criteria) 58 throws PersistenceException 59 { 60 return selectAllByCriteria(getDomainObjectClass(), criteria); 61 } 62 63 64 // ******************************* INSERT **// 71 public final List<DO> selectAllByCriteria( final DetachedCriteria criteria ) 72 throws PersistenceException 73 { 74 return selectAllByCriteria( getDomainObjectClass(), criteria ); 75 } 76 77 @Transactional(propagation = Propagation.MANDATORY) 78 public final <O> O execute( final PersistenceHelper.Operation<O> operation ) 79 throws PersistenceException 80 { 81 return PersistenceHelper.execute( operation, _sessionFactory ); 82 } 83 84 // ******************************* INSERT **// 65 85 @NotNull 66 public final PK insert(final DO domainObject) throws PersistenceException 67 { 68 try 69 { 70 final Session session = _sessionFactory.getCurrentSession(); 71 final PK primaryKey = (PK) session.save(domainObject); 72 session.flush(); 73 return primaryKey; 74 } 75 catch (DataAccessException e) 76 { 77 throw convert(e); 78 } 79 } 80 81 public final void insertAll(@NotNull final Collection<DO> domainObjects) 82 throws PersistenceException 83 { 84 try 85 { 86 final Session session = _sessionFactory.getCurrentSession(); 87 int i = 0; 88 for (final DO domainObject : domainObjects) 89 { 90 session.save(domainObject); 91 // Avoid OutOfMemoryError 92 if (i >= 500) 93 { 94 session.flush(); 95 session.clear(); 96 i = 0; 97 } 98 } 99 session.flush(); 100 } 101 catch (DataAccessException e) 102 { 103 throw convert(e); 104 } 105 } 106 107 // ******************************* UPDATE **// 108 public void update(@NotNull final DO domainObject) 109 throws PersistenceException 110 { 111 try 112 { 113 final Session session = _sessionFactory.getCurrentSession(); 114 session.update(domainObject); 115 session.flush(); 116 } 117 catch (DataAccessException e) 118 { 119 throw convert(e); 120 } 121 } 122 123 public final void updateAll(final Collection<? extends DO> domainObjects) 124 throws PersistenceException 125 { 126 try 127 { 128 final Session session = _sessionFactory.getCurrentSession(); 129 for (final DO domainObject : domainObjects) 130 session.saveOrUpdate(domainObject); 131 session.flush(); 132 } 133 catch (DataAccessException e) 134 { 135 throw convert(e); 136 } 137 } 138 139 // ******************************* UPGRADE **// 140 public final void upgrade(final DO domainObject) 141 throws PersistenceException 142 { 143 try 144 { 145 final Session session = _sessionFactory.getCurrentSession(); 146 session.refresh(domainObject); 147 session.flush(); 148 } 149 catch (DataAccessException e) 150 { 151 throw convert(e); 152 } 153 } 154 155 public final void upgradeAll(final Collection<DO> domainObjects) 156 throws PersistenceException 157 { 158 try 159 { 160 final Session session = _sessionFactory.getCurrentSession(); 161 for (final DO domainObject : domainObjects) 162 { 163 session.refresh(domainObject); 164 } 165 session.flush(); 166 } 167 catch (DataAccessException e) 168 { 169 throw convert(e); 170 } 171 } 172 173 // ******************************* DELETE **// 174 public void deleteByPrimaryKey(final PK primaryKey) 175 throws PersistenceException 176 { 177 try 178 { 179 final Session session = _sessionFactory.getCurrentSession(); 180 final Object domainObject = session.get(getDomainObjectClass(), primaryKey); 181 if(null != domainObject) 182 session.delete(domainObject); 183 else 184 throw new PersistenceException(PersistenceException.PersistenceCode.OBJECT_TO_DELETE_NOT_FOUND); 185 session.flush(); 186 } 187 catch (DataAccessException e) 188 { 189 throw convert(e); 190 } 191 } 192 193 public final void delete(@NotNull final DO domainObject) 194 throws PersistenceException 195 { 196 try 197 { 198 final Session session = _sessionFactory.getCurrentSession(); 199 session.delete(domainObject); 200 session.flush(); 201 } 202 catch (DataAccessException e) 203 { 204 throw convert(e); 205 } 206 } 207 208 public final void deleteAll(final Collection<DO> domainObjects) 209 throws PersistenceException 210 { 211 try 212 { 213 final Session session = _sessionFactory.getCurrentSession(); 214 for (final DO domainObject : domainObjects) 215 session.delete(domainObject); 216 session.flush(); 217 } 218 catch (DataAccessException e) 219 { 220 throw convert(e); 221 } 222 } 223 224 // ******************************* SELECT **// 225 public final DO selectByPrimaryKey(@NotNull final PK primaryKey) 226 throws PersistenceException 227 { 228 try 229 { 230 final Session session = _sessionFactory.getCurrentSession(); 231 return (DO) session.get(getDomainObjectClass(), primaryKey); 232 } 233 catch (DataAccessException e) 234 { 235 throw convert(e); 236 } 237 } 238 239 public final DO selectByExample(final DO domainObject) 240 throws PersistenceException 241 { 242 final Session session = _sessionFactory.getCurrentSession(); 243 final Criteria executableCriteria = session.createCriteria(domainObject.getClass()); 244 executableCriteria.add(Example.create(domainObject)); 245 return uniqueResult((Collection<DO>) executableCriteria.list()); 246 } 247 248 public final List<DO> selectAllByExample(final DO domainObject) 249 throws PersistenceException 250 { 251 final Session session = _sessionFactory.getCurrentSession(); 252 final Criteria executableCriteria = session.createCriteria(domainObject.getClass()); 253 executableCriteria.add(Example.create(domainObject)); 254 return (List<DO>) executableCriteria.list(); 255 } 256 257 public final List<DO> selectAll() throws PersistenceException 258 { 259 try 260 { 261 final Session session = _sessionFactory.getCurrentSession(); 262 final Criteria executableCriteria = session.createCriteria(getDomainObjectClass()); 263 return (List<DO>) executableCriteria.list(); 264 } 265 catch (DataAccessException e) 266 { 267 throw convert(e); 268 } 86 public final PK insert( final DO domainObject ) 87 throws PersistenceException 88 { 89 try 90 { 91 final Session session = _sessionFactory.getCurrentSession(); 92 final PK primaryKey = (PK) session.save( domainObject ); 93 session.flush(); 94 return primaryKey; 95 } 96 catch( DataAccessException e ) 97 { 98 throw convert( e ); 99 } 100 } 101 102 public final void insertAll( @NotNull final Collection<DO> domainObjects ) 103 throws PersistenceException 104 { 105 try 106 { 107 final Session session = _sessionFactory.getCurrentSession(); 108 int i = 0; 109 for( final DO domainObject : domainObjects ) 110 { 111 session.save( domainObject ); 112 // Avoid OutOfMemoryError 113 if( i >= 500 ) 114 { 115 session.flush(); 116 session.clear(); 117 i = 0; 118 } 119 } 120 session.flush(); 121 } 122 catch( DataAccessException e ) 123 { 124 throw convert( e ); 125 } 126 } 127 128 // ******************************* UPDATE **// 129 public void update( @NotNull final DO domainObject ) 130 throws PersistenceException 131 { 132 try 133 { 134 final Session session = _sessionFactory.getCurrentSession(); 135 session.update( domainObject ); 136 session.flush(); 137 } 138 catch( DataAccessException e ) 139 { 140 throw convert( e ); 141 } 142 } 143 144 public final void updateAll( final Collection<? extends DO> domainObjects ) 145 throws PersistenceException 146 { 147 try 148 { 149 final Session session = _sessionFactory.getCurrentSession(); 150 for( final DO domainObject : domainObjects ) 151 session.saveOrUpdate( domainObject ); 152 session.flush(); 153 } 154 catch( DataAccessException e ) 155 { 156 throw convert( e ); 157 } 158 } 159 160 // ******************************* UPGRADE **// 161 public final void upgrade( final DO domainObject ) 162 throws PersistenceException 163 { 164 try 165 { 166 final Session session = _sessionFactory.getCurrentSession(); 167 session.refresh( domainObject ); 168 session.flush(); 169 } 170 catch( DataAccessException e ) 171 { 172 throw convert( e ); 173 } 174 } 175 176 public final void upgradeAll( final Collection<DO> domainObjects ) 177 throws PersistenceException 178 { 179 try 180 { 181 final Session session = _sessionFactory.getCurrentSession(); 182 for( final DO domainObject : domainObjects ) 183 { 184 session.refresh( domainObject ); 185 } 186 session.flush(); 187 } 188 catch( DataAccessException e ) 189 { 190 throw convert( e ); 191 } 192 } 193 194 // ******************************* DELETE **// 195 public void deleteByPrimaryKey( final PK primaryKey ) 196 throws PersistenceException 197 { 198 try 199 { 200 final Session session = _sessionFactory.getCurrentSession(); 201 final Object domainObject = session.get( getDomainObjectClass(), primaryKey ); 202 if( null != domainObject ) 203 session.delete( domainObject ); 204 else 205 throw new PersistenceException( PersistenceException.PersistenceCode.OBJECT_TO_DELETE_NOT_FOUND ); 206 session.flush(); 207 } 208 catch( DataAccessException e ) 209 { 210 throw convert( e ); 211 } 212 } 213 214 public final void delete( @NotNull final DO domainObject ) 215 throws PersistenceException 216 { 217 try 218 { 219 final Session session = _sessionFactory.getCurrentSession(); 220 session.delete( domainObject ); 221 session.flush(); 222 } 223 catch( DataAccessException e ) 224 { 225 throw convert( e ); 226 } 227 } 228 229 public final void deleteAll( final Collection<DO> domainObjects ) 230 throws PersistenceException 231 { 232 try 233 { 234 final Session session = _sessionFactory.getCurrentSession(); 235 for( final DO domainObject : domainObjects ) 236 session.delete( domainObject ); 237 session.flush(); 238 } 239 catch( DataAccessException e ) 240 { 241 throw convert( e ); 242 } 243 } 244 245 // ******************************* SELECT **// 246 public final DO selectByPrimaryKey( @NotNull final PK primaryKey ) 247 throws PersistenceException 248 { 249 try 250 { 251 final Session session = _sessionFactory.getCurrentSession(); 252 return (DO) session.get( getDomainObjectClass(), primaryKey ); 253 } 254 catch( DataAccessException e ) 255 { 256 throw convert( e ); 257 } 258 } 259 260 public final DO selectByExample( final DO domainObject ) 261 throws PersistenceException 262 { 263 final Session session = _sessionFactory.getCurrentSession(); 264 final Criteria executableCriteria = session.createCriteria( domainObject.getClass() ); 265 executableCriteria.add( Example.create( domainObject ) ); 266 return uniqueResult( (Collection<DO>) executableCriteria.list() ); 267 } 268 269 public final List<DO> selectAllByExample( final DO domainObject ) 270 throws PersistenceException 271 { 272 final Session session = _sessionFactory.getCurrentSession(); 273 final Criteria executableCriteria = session.createCriteria( domainObject.getClass() ); 274 executableCriteria.add( Example.create( domainObject ) ); 275 return (List<DO>) executableCriteria.list(); 276 } 277 278 public final List<DO> selectAll() 279 throws PersistenceException 280 { 281 try 282 { 283 final Session session = _sessionFactory.getCurrentSession(); 284 final Criteria executableCriteria = session.createCriteria( getDomainObjectClass() ); 285 return (List<DO>) executableCriteria.list(); 286 } 287 catch( DataAccessException e ) 288 { 289 throw convert( e ); 290 } 269 291 } 270 292 271 293 // ******************************* PAGINATE **// 272 protected <T> List<T> selectPage(@Nullable final Integer firstResult, @Nullable final Integer maxResults, final DetachedCriteria detachedCriteria) 273 throws PersistenceException 274 { 275 final Session session = _sessionFactory.getCurrentSession(); 276 final Criteria criteria = detachedCriteria.getExecutableCriteria(session); 277 278 if (null != maxResults) 279 { 280 criteria.setMaxResults(maxResults); 281 if (null != firstResult) 282 criteria.setFirstResult(firstResult); 283 } 284 return (List<T>) criteria.list(); 285 } 286 287 protected Integer count(final DetachedCriteria detachedCriteria) 288 throws PersistenceException 289 { 290 final Session session = _sessionFactory.getCurrentSession(); 291 final Criteria executableCriteria = detachedCriteria.getExecutableCriteria(session); 292 executableCriteria.setProjection(Projections.rowCount()); 293 return (Integer) executableCriteria.uniqueResult(); 294 } 294 protected <T> List<T> selectPage( @Nullable final Integer firstResult, @Nullable final Integer maxResults, final DetachedCriteria detachedCriteria ) 295 throws PersistenceException 296 { 297 final Session session = _sessionFactory.getCurrentSession(); 298 final Criteria criteria = detachedCriteria.getExecutableCriteria( session ); 299 300 if( null != maxResults ) 301 { 302 criteria.setMaxResults( maxResults ); 303 if( null != firstResult ) 304 criteria.setFirstResult( firstResult ); 305 } 306 return (List<T>) criteria.list(); 307 } 308 309 protected Integer count( final DetachedCriteria detachedCriteria ) 310 throws PersistenceException 311 { 312 final Session session = _sessionFactory.getCurrentSession(); 313 final Criteria executableCriteria = detachedCriteria.getExecutableCriteria( session ); 314 executableCriteria.setProjection( Projections.rowCount() ); 315 if( executableCriteria.uniqueResult() instanceof Long ) 316 return ( (Long) executableCriteria.uniqueResult() ).intValue(); 317 else 318 return (Integer) executableCriteria.uniqueResult(); 319 320 } 321 322 // ******************************* SELECT **// 323 public static Criterion escapedLike( final String fieldName, final String value ) 324 { 325 return new LikeExpression( fieldName, value, MatchMode.ANYWHERE, null, true ); 326 } 327 295 328 // ************************************************************************** // 296 329 // ************************************************************************** // 297 330 298 331 @SuppressWarnings("unchecked") 299 332 public final Class<DO> getDomainObjectClass() 300 333 { 301 if (_domainObjectClass == null) 302 { 303 if (getClass().getGenericSuperclass() instanceof ParameterizedType) 304 _domainObjectClass = (Class<DO>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; 305 else 306 throw new IllegalArgumentException("domain class is not null and DAO is not parameterized !"); 307 } 308 309 return _domainObjectClass; 310 } 311 312 public final void setDomainObjectClass(final Class<DO> domainObjectClass) 313 { 314 _domainObjectClass = domainObjectClass; 315 } 316 317 public final void setSessionFactory(final SessionFactory sessionFactory) 318 { 319 _sessionFactory = sessionFactory; 334 if( _domainObjectClass == null ) 335 { 336 if( getClass().getGenericSuperclass() instanceof ParameterizedType ) 337 _domainObjectClass = (Class<DO>) ( (ParameterizedType) getClass().getGenericSuperclass() ).getActualTypeArguments()[0]; 338 else 339 throw new IllegalArgumentException( "domain class is not null and DAO is not parameterized !" ); 340 } 341 342 return _domainObjectClass; 343 } 344 345 public final void setDomainObjectClass( final Class<DO> domainObjectClass ) 346 { 347 _domainObjectClass = domainObjectClass; 348 } 349 350 public final Class<PK> getPrimaryKeyClass() 351 { 352 if( _primaryKeyClass == null ) 353 { 354 if( getClass().getGenericSuperclass() instanceof ParameterizedType ) 355 _primaryKeyClass = (Class<PK>) ( (ParameterizedType) getClass().getGenericSuperclass() ).getActualTypeArguments()[1]; 356 else 357 throw new IllegalArgumentException( "primary key class is not null and DAO is not parameterized !" ); 358 } 359 360 return _primaryKeyClass; 361 } 362 363 public final void setPrimaryKeyClass( final Class<PK> primaryKeyClass ) 364 { 365 _primaryKeyClass = primaryKeyClass; 366 } 367 368 public final void setSessionFactory( final SessionFactory sessionFactory ) 369 { 370 _sessionFactory = sessionFactory; 320 371 } 321 372 322 373 public final SessionFactory getSessionFactory() 323 374 { 324 375 return _sessionFactory; 325 376 } 326 377 … … 329 380 private SessionFactory _sessionFactory; 330 381 private Class<DO> _domainObjectClass; 382 private Class<PK> _primaryKeyClass; 331 383 } -
tapas/persistence/implementation/dao-context.xml
r378 r409 4 4 <!-- Application context DAO layer --> 5 5 <beans> 6 7 8 <ref bean="sessionFactory"/>9 10 6 <bean id="refPlateformDAO" class="com.ether.dao.PlateformDAOImpl"> 7 <property name="sessionFactory"> 8 <ref bean="sessionFactory"/> 9 </property> 10 </bean> 11 11 12 12 <bean id="refParameterDAO" class="com.ether.dao.ParameterDAOImpl"> 13 13 <property name="sessionFactory"> 14 <ref bean="sessionFactory" /> 14 <ref bean="sessionFactory"/> 15 </property> 16 </bean> 17 18 <bean id="refUserDAO" class="com.ether.dao.user.UserDAOImpl"> 19 <property name="sessionFactory"> 20 <ref bean="sessionFactory"/> 15 21 </property> 16 22 </bean> -
tapas/persistence/implementation/hibernate-domain.cfg.xml
r378 r409 6 6 <hibernate-configuration> 7 7 <session-factory> 8 <mapping resource="com/ether/dao/Plateform.hbm.xml"/> 9 <mapping resource="com/ether/dao/Parameter.hbm.xml"/> 8 <mapping resource="com/ether/dao/user/User.hbm.xml"/> 10 9 </session-factory> 11 10 </hibernate-configuration> -
tapas/persistence/implementation/hibernate.cfg.xml
r378 r409 17 17 <prop key="hibernate.bytecode.use_reflection_optimizer">false</prop> 18 18 <prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop> 19 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/ PROJECT_SOURCE</prop>19 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/tapas_bdd</prop> 20 20 <prop key="hibernate.connection.username">postgres</prop> 21 21 <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> -
tapas/persistence/interface/com/ether/PersistenceHelper.java
r376 r409 1 1 package com.ether; 2 3 import java.util.Collection;4 import com.ether.PersistenceException;5 2 6 3 import org.apache.commons.logging.Log; 7 4 import org.apache.commons.logging.LogFactory; 5 import org.hibernate.HibernateException; 6 import org.hibernate.Session; 7 import org.hibernate.SessionFactory; 8 8 import org.springframework.dao.CleanupFailureDataAccessException; 9 9 import org.springframework.dao.DataAccessException; 10 import org.springframework.transaction.annotation.Propagation; 11 import org.springframework.transaction.annotation.Transactional; 12 13 import java.util.Collection; 10 14 11 15 public final class PersistenceHelper … … 13 17 /** 14 18 * Returns an unique result from a collection of results. 15 * 19 * 16 20 * @throws PersistenceException : if more than one result is contained in the collection an exception is thrown. 17 21 */ 18 public static <O> O uniqueResult( final Collection<O> results)19 22 public static <O> O uniqueResult( final Collection<O> results ) 23 throws PersistenceException 20 24 { 21 if (results == null || results.isEmpty())22 23 else if (results.size() > 1)24 throw new PersistenceException(PersistenceException.PersistenceCode.INVALID_API_USAGE, "unique result expected !");25 26 25 if( results == null || results.isEmpty() ) 26 return null; 27 else if( results.size() > 1 ) 28 throw new PersistenceException( PersistenceException.PersistenceCode.INVALID_API_USAGE, "unique result expected !" ); 29 else 30 return results.iterator().next(); 27 31 } 28 32 29 public static <O> O firstResult( final Collection<O> results)33 public static <O> O firstResult( final Collection<O> results ) 30 34 { 31 if (results == null || results.isEmpty()) return null;32 35 if( results == null || results.isEmpty() ) return null; 36 return results.iterator().next(); 33 37 } 34 38 35 39 /** 36 40 * Converts an exception to a DAO exception. 37 * 41 * 38 42 * @param exception : the exception. 39 43 * @return the DAO exception. 40 44 */ 41 public static PersistenceException convert( final Exception exception)45 public static PersistenceException convert( final Exception exception ) 42 46 { 43 44 if (exception instanceof PersistenceException)45 47 // Propagates the exception if exception is persistence exception 48 if( exception instanceof PersistenceException ) 49 return (PersistenceException) exception; 46 50 47 48 51 // Rewraps exception if data access exception 52 final PersistenceException.PersistenceCode code; 49 53 50 if (exception instanceof DataAccessException)51 52 if (exception instanceof CleanupFailureDataAccessException)53 54 55 56 else if (exception instanceof org.springframework.dao.ConcurrencyFailureException)57 58 59 60 else if (exception instanceof org.springframework.dao.DataAccessResourceFailureException)61 62 63 64 else if (exception instanceof org.springframework.dao.DataIntegrityViolationException)65 66 67 68 else if (exception instanceof org.springframework.dao.DataRetrievalFailureException)69 70 71 72 else if (exception instanceof org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException)73 74 75 76 else if (exception instanceof org.springframework.dao.InvalidDataAccessApiUsageException)77 78 79 80 else if (exception instanceof org.springframework.dao.PermissionDeniedDataAccessException)81 82 83 84 85 86 87 88 89 90 91 92 54 if( exception instanceof DataAccessException ) 55 { 56 if( exception instanceof CleanupFailureDataAccessException ) 57 { 58 code = PersistenceException.PersistenceCode.CLEANUP_FAILURE; 59 } 60 else if( exception instanceof org.springframework.dao.ConcurrencyFailureException ) 61 { 62 code = PersistenceException.PersistenceCode.CONCURRENCY_FAILURE; 63 } 64 else if( exception instanceof org.springframework.dao.DataAccessResourceFailureException ) 65 { 66 code = PersistenceException.PersistenceCode.RESOURCE_FAILURE; 67 } 68 else if( exception instanceof org.springframework.dao.DataIntegrityViolationException ) 69 { 70 code = PersistenceException.PersistenceCode.INTEGRITY_VIOLATION; 71 } 72 else if( exception instanceof org.springframework.dao.DataRetrievalFailureException ) 73 { 74 code = PersistenceException.PersistenceCode.RETRIEVAL_FAILURE; 75 } 76 else if( exception instanceof org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException ) 77 { 78 code = PersistenceException.PersistenceCode.DATA_SOURCE_LOOKUP_FAILURE; 79 } 80 else if( exception instanceof org.springframework.dao.InvalidDataAccessApiUsageException ) 81 { 82 code = PersistenceException.PersistenceCode.INVALID_API_USAGE; 83 } 84 else if( exception instanceof org.springframework.dao.PermissionDeniedDataAccessException ) 85 { 86 code = PersistenceException.PersistenceCode.PERMISSION_DENIED; 87 } 88 else 89 { 90 code = PersistenceException.PersistenceCode.UNKNOWN_FAILURE; 91 } 92 } 93 else 94 { 95 code = PersistenceException.PersistenceCode.UNKNOWN_FAILURE; 96 } 93 97 94 95 message.append(exception.getMessage());98 final StringBuilder message = new StringBuilder(); 99 message.append( exception.getMessage() ); 96 100 97 98 if (null != cause)99 100 message.append(" : ").append(cause.getMessage());101 101 final Throwable cause = exception.getCause(); 102 if( null != cause ) 103 { 104 message.append( " : " ).append( cause.getMessage() ); 105 } 102 106 103 return new PersistenceException(code, message.toString(),104 exception);107 return new PersistenceException( code, message.toString(), 108 exception ); 105 109 } 106 110 107 private static final Log LOGGER = LogFactory.getLog(PersistenceHelper.class); 111 @Transactional(propagation = Propagation.MANDATORY) 112 public static <O> O execute( final Operation<O> operation, final SessionFactory sessionFactory ) 113 throws PersistenceException 114 { 115 try 116 { 117 final Session session = sessionFactory.getCurrentSession(); 118 return operation.operate( session ); 119 } 120 catch( org.hibernate.exception.LockAcquisitionException e ) 121 { 122 LOGGER.fatal( e.getMessage(), e ); 123 throw convert( e ); 124 } 125 catch( DataAccessException e ) 126 { 127 throw convert( e ); 128 } 129 catch( HibernateException e ) 130 { 131 throw convert( e ); 132 } 133 } 134 135 public interface Operation<O> 136 { 137 /** 138 * Executes an operation on a session (delete, update, ...) with no return statement. 139 * 140 * @param session the session. 141 * @return the operation result. 142 * @throws org.hibernate.HibernateException 143 * if an hibernate exception occurs. 144 * @throws java.sql.SQLException if an SQL exception occurs. 145 * @throws PersistenceException if a DAO exception is thrown. 146 */ 147 O operate( Session session ) 148 throws PersistenceException; 149 } 150 151 private static final Log LOGGER = LogFactory.getLog( PersistenceHelper.class ); 108 152 } -
tapas/persistence/interface/com/ether/dao/UserDAO.java
r287 r409 4 4 import com.ether.user.User; 5 5 import com.ether.user.UserFilter; 6 import com.ether.user.UserState;7 6 import org.jetbrains.annotations.NotNull; 8 7 import org.jetbrains.annotations.Nullable; … … 22 21 23 22 @NotNull 24 List<User> getUsersByState( @NotNull final UserState userState )25 throws PersistenceException;26 27 @NotNull28 23 List<User> getAllUsersByNameOrder() 29 24 throws PersistenceException; -
tapas/service/implementation/com/ether/BackofficeServiceImpl.java
r402 r409 1 1 package com.ether; 2 2 3 import com.ether.dao. ParameterDAO;4 import com.ether. dao.PlateformDAO;5 import com.ether. tapas.Tapas;3 import com.ether.dao.UserDAO; 4 import com.ether.user.User; 5 import com.ether.user.UserFilter; 6 6 import org.apache.commons.logging.Log; 7 7 import org.apache.commons.logging.LogFactory; 8 import org.jdom.Attribute;9 import org.jdom.Document;10 import org.jdom.Element;11 import org.jdom.output.Format;12 import org.jdom.output.XMLOutputter;13 8 import org.jetbrains.annotations.NotNull; 14 9 import org.jetbrains.annotations.Nullable; 15 import org.springframework.beans.factory.annotation.Required;16 10 import org.springframework.transaction.annotation.Transactional; 17 11 18 import java.io.FileOutputStream;19 12 import java.util.List; 20 13 21 14 /** 22 * @author rboipsl23 * @date 2 mars201215 * @author vmipsl 16 * @date 12 march 2012 24 17 */ 25 public class TapasServiceImpl26 implements TapasService18 public class BackofficeServiceImpl 19 implements BackofficeService 27 20 { 28 29 public void createXMLRequest( @NotNull final Tapas tapas )30 {31 String idF = "Ether_TAPAS_0000001";32 String idRF = "1";33 String validFF = "ASCII";34 String validRF = "YES";35 36 String xvalidFF = "ASCII,FITS,NETCDF";37 String xvalidRF = "YES,NO";38 String fichier = "request1.xml";39 40 final Element racine = new Element( "tapas" );41 final Element request = new Element( "request" );42 final Element preferences = new Element( "preferences" );43 final Element format = new Element( "format" );44 final Element rayleighExtinction = new Element( "rayleigh_extinction" );45 46 //On crée un nouveau Document JDOM basé sur la racine que l'on vient de créer47 final Document document = new Document( racine );48 49 final Attribute id = new Attribute( "Id", idF );50 racine.setAttribute( id );51 52 final Attribute idR = new Attribute( "Id", idRF );53 request.setAttribute( idR );54 55 racine.addContent( request );56 request.addContent( preferences );57 58 final Attribute validF = new Attribute( "valid", xvalidFF );59 format.setAttribute( validF );60 format.setText( validFF );61 62 final Attribute validR = new Attribute( "valid", xvalidRF );63 rayleighExtinction.setAttribute( validR );64 rayleighExtinction.setText( validRF );65 66 createXMLFile( fichier, document );67 }68 69 public void createXMLFile( final String fichier, final Document document )70 {71 try72 {73 //On utilise ici un affichage classique avec getPrettyFormat()74 final XMLOutputter sortie = new XMLOutputter( Format.getPrettyFormat() );75 //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream76 //avec en argument le nom du fichier pour effectuer la sérialisation.77 sortie.output( document, new FileOutputStream( fichier ) );78 }79 catch( java.io.IOException ignored )80 {81 }82 }83 84 85 // TODO : supprimer cette méthode --> EXEMPLE86 21 @Nullable 87 22 @Transactional(readOnly = true) 88 public List<Plateform> getAllPlateforms()23 public User getUserById( @NotNull final Integer userId ) 89 24 throws ServiceException 90 25 { 91 26 try 92 27 { 93 return _ plateformDAO.getAllPlateforms();28 return _userDAO.selectByPrimaryKey( userId ); 94 29 } 95 30 catch( PersistenceException e ) 96 31 { 97 throw new ServiceException( ServiceException.ServiceCode. PLATEFORM_NOT_FOUND, e );32 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 98 33 } 99 34 } 100 35 101 // TODO : supprimer cette méthode --> EXEMPLE102 36 @Nullable 103 37 @Transactional(readOnly = true) 104 public Plateform getPlateformById( @Nullable final Integer plateformId ) 105 throws ServiceException 106 { 107 if( null == plateformId ) 108 return null; 109 try 110 { 111 return _plateformDAO.getPlateformById( plateformId ); 112 } 113 catch( PersistenceException e ) 114 { 115 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e ); 116 } 117 } 118 119 // TODO : supprimer cette méthode --> EXEMPLE 120 @Nullable 121 @Transactional(readOnly = true) 122 public List<Parameter> getAllParametersByPlateformId( @NotNull final Integer plateformId ) 38 public User getUserByEmail( @NotNull final String userEmail ) 123 39 throws ServiceException 124 40 { 125 41 try 126 42 { 127 return _ parameterDAO.getAllParametersByPlateformId( plateformId);43 return _userDAO.getUserByEmail( userEmail ); 128 44 } 129 45 catch( PersistenceException e ) 130 46 { 131 throw new ServiceException( ServiceException.ServiceCode. PARAMETER_NOT_FOUND, e );47 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 132 48 } 133 49 } 134 50 135 // TODO : supprimer cette méthode --> EXEMPLE 136 @Required 137 public void setPlateformDAO( final PlateformDAO plateformDAO ) 51 @NotNull 52 @Transactional(rollbackFor = Exception.class) 53 public Integer createUser( @NotNull final User user ) 54 throws ServiceException 138 55 { 139 _plateformDAO = plateformDAO; 56 try 57 { 58 return _userDAO.insert( user ); 59 } 60 catch( PersistenceException e ) 61 { 62 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 63 } 140 64 } 141 65 142 // TODO : supprimer cette méthode --> EXEMPLE 143 @Required 144 public void setParameterDAO( final ParameterDAO parameterDAO ) 66 @NotNull 67 @Transactional(readOnly = true) 68 public List<User> getAllUsers() 69 throws ServiceException 145 70 { 146 _parameterDAO = parameterDAO; 71 try 72 { 73 return _userDAO.selectAll(); 74 } 75 catch( PersistenceException e ) 76 { 77 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 78 } 147 79 } 148 80 149 private static final Log LOGGER = LogFactory.getLog( TapasServiceImpl.class ); 81 @NotNull 82 @Transactional(readOnly = true) 83 public List<User> getAllUsersByNameOrder() 84 throws ServiceException 85 { 86 try 87 { 88 return _userDAO.getAllUsersByNameOrder(); 89 } 90 catch( PersistenceException e ) 91 { 92 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 93 } 94 } 150 95 151 // TODO : supprimer ces DAO --> EXEMPLES 152 private PlateformDAO _plateformDAO; 153 private ParameterDAO _parameterDAO; 96 @Transactional(rollbackFor = Exception.class) 97 public void removeUserById( @NotNull final Integer userId ) 98 throws ServiceException 99 { 100 try 101 { 102 _userDAO.deleteByPrimaryKey( userId ); 103 } 104 catch( PersistenceException e ) 105 { 106 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 107 } 108 } 154 109 110 @Transactional(rollbackFor = Exception.class) 111 public void updateUser( @NotNull final User user ) 112 throws ServiceException 113 { 114 try 115 { 116 _userDAO.update( user ); 117 } 118 catch( PersistenceException e ) 119 { 120 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 121 } 122 } 123 124 @Transactional(readOnly = true) 125 public PaginatedResult<User> searchUsers( final UserFilter filter ) 126 throws ServiceException 127 { 128 try 129 { 130 return _userDAO.search( filter ); 131 } 132 catch( PersistenceException e ) 133 { 134 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 135 } 136 } 137 138 public void setUserDAO( final UserDAO userDAO ) 139 { 140 _userDAO = userDAO; 141 } 142 143 private static final Log LOGGER = LogFactory.getLog( BackofficeServiceImpl.class ); 144 145 private UserDAO _userDAO; 155 146 } -
tapas/service/implementation/com/ether/TapasServiceImpl.java
r402 r409 82 82 } 83 83 84 85 84 // TODO : supprimer cette méthode --> EXEMPLE 86 85 @Nullable … … 118 117 119 118 // TODO : supprimer cette méthode --> EXEMPLE 120 @Nullable121 @Transactional(readOnly = true)122 public List<Parameter> getAllParametersByPlateformId( @NotNull final Integer plateformId )123 throws ServiceException124 {125 try126 {127 return _parameterDAO.getAllParametersByPlateformId( plateformId );128 }129 catch( PersistenceException e )130 {131 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e );132 }133 }134 135 // TODO : supprimer cette méthode --> EXEMPLE136 119 @Required 137 120 public void setPlateformDAO( final PlateformDAO plateformDAO ) … … 152 135 private PlateformDAO _plateformDAO; 153 136 private ParameterDAO _parameterDAO; 154 155 137 } -
tapas/service/implementation/service-context.xml
r389 r409 3 3 4 4 <beans> 5 6 7 8 5 <bean id="tapasServiceTarget" class="com.ether.TapasServiceImpl"> 6 <!--<property name="plateformDAO" ref="refPlateformDAO" /> 7 <property name="parameterDAO" ref="refParameterDAO" />--> 8 </bean> 9 9 10 <bean id="tapasService" parent="transactionProxy"> 11 <property name="target"> 12 <ref bean="tapasServiceTarget" /> 13 </property> 14 <property name="transactionAttributeSource"> 15 <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource" /> 16 </property> 17 </bean> 10 <bean id="tapasService" parent="transactionProxy"> 11 <property name="target"> 12 <ref bean="tapasServiceTarget"/> 13 </property> 14 <property name="transactionAttributeSource"> 15 <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> 16 </property> 17 </bean> 18 19 <bean id="backofficeServiceTarget" class="com.ether.BackofficeServiceImpl"> 20 <property name="userDAO" ref="refUserDAO"/> 21 </bean> 22 23 <bean id="backofficeService" parent="transactionProxy"> 24 <property name="target"> 25 <ref bean="backofficeServiceTarget"/> 26 </property> 27 <property name="transactionAttributeSource"> 28 <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> 29 </property> 30 </bean> 18 31 19 32 </beans> -
tapas/service/interface/com/ether/BackofficeService.java
r402 r409 2 2 3 3 import com.ether.tapas.Tapas; 4 import com.ether.user.User; 5 import com.ether.user.UserFilter; 4 6 import org.jdom.Document; 5 7 import org.jetbrains.annotations.NotNull; … … 9 11 10 12 /** 11 * @author rboipsl12 * @date 02 march 201213 * @author vmipsl 14 * @date 12 march 2012 13 15 */ 14 public interface TapasService16 public interface BackofficeService 15 17 extends Service 16 18 { 17 public void createXMLRequest( @NotNull final Tapas tapas ); 19 @Nullable 20 User getUserById( @NotNull final Integer userId ) 21 throws ServiceException; 18 22 19 public void createXMLFile( final String fichier, final Document document ); 23 @Nullable 24 User getUserByEmail( @NotNull final String userEmail ) 25 throws ServiceException; 26 27 @NotNull 28 Integer createUser( @NotNull User user ) 29 throws ServiceException; 30 31 @NotNull 32 List<User> getAllUsers() 33 throws ServiceException; 34 35 @NotNull 36 List<User> getAllUsersByNameOrder() 37 throws ServiceException; 38 39 void removeUserById( @NotNull final Integer userId ) 40 throws ServiceException; 41 42 void updateUser( @NotNull final User user ) 43 throws ServiceException; 44 45 PaginatedResult<User> searchUsers( UserFilter filter ) 46 throws ServiceException; 20 47 } -
tapas/service/interface/com/ether/ServiceException.java
r376 r409 25 25 PLATEFORM_NOT_FOUND, 26 26 PARAMETER_NOT_FOUND, 27 USER_NOT_FOUND, 27 28 } 28 29 } -
tapas/web/WEB-INF/servlet-context.xml
r384 r409 39 39 <props> 40 40 <prop key="/project">controller</prop> 41 <prop key="/backoffice">controllerBackoffice</prop> 41 42 </props> 42 43 </property> … … 57 58 <property name="jsonHelper" ref="jsonHelper"/> 58 59 <property name="methodNameResolver" ref="myMethodNameResolver"/> 59 </bean>60 61 <bean id="controller" class="com.ether.Controller" parent="controllerEther">62 60 <property name="tapasService" ref="tapasService"/> 63 61 </bean> 64 62 63 <bean id="controller" class="com.ether.Controller" parent="controllerEther"/> 64 <bean id="controllerBackoffice" class="com.ether.ControllerBackoffice" parent="controllerEther"> 65 <property name="backofficeService" ref="backofficeService"/> 66 </bean> 65 67 </beans> -
tapas/web/resources/css/backoffice.css
r308 r409 16 16 17 17 .containerTitle { 18 color: # 778899;18 color: #be0026; 19 19 padding-left: 236px; 20 20 } … … 38 38 .containerTitleContent { 39 39 background-image: none; 40 color: # 778899;40 color: #be0026; 41 41 } 42 42 -
tapas/web/resources/css/tapas.css
r388 r409 16 16 /** ********************** CONTAINER ******************** **/ 17 17 /** ***************************************************** **/ 18 .containerLinkLogoEther { 19 position: absolute; 20 top: 0; 21 left: 127px; 22 width: 10px; 23 height: 99px; 24 background-image: url("../images/link_logo_Ether.png"); 25 background-repeat: repeat-y; 26 } 27 28 .containerLogoEther { 29 position: absolute; 30 top: 100px; 31 left: 50px; 32 -moz-border-radius: 4px 4px 4px 4px; 33 -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); 34 -webkit-border-radius: 4px 4px 4px 4px; 35 -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); 36 box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); 37 width: 80px; 38 height: 80px; 39 padding: 15px; 40 } 41 18 42 .containerTapas { 19 43 -moz-border-radius: 4px 4px 4px 4px; … … 170 194 /** ************************ OTHER ********************** **/ 171 195 /** ***************************************************** **/ 196 #tools .complexButton { 197 float: right; 198 } 199 172 200 .roundTable { 173 201 -moz-border-radius: 4px; … … 209 237 } 210 238 239 .loading-classic { 240 background-image: url(../../resources/icons/transparent_loading.gif); 241 height: 16px; 242 width: 16px; 243 } 244 211 245 /** ***************************************************** **/ 212 246 /** ************************ PAGES ********************** **/ -
tapas/web/resources/templates/templateBackoffice.jsp
r366 r409 1 <%@ page language="java" import="com.medias.Context" %>1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 2 <%@ page import="com.ether.user.UserRole" %> 3 <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 4 <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> 5 <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> 6 <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> 3 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 4 <%@ taglib prefix="tiles" uri="/WEB-INF/tlds/struts-tiles.tld" %> 7 5 <%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 6 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 8 7 9 8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> … … 15 14 16 15 <title><tiles:getAsString name="title"/></title> 17 <link rel="shortcut icon" href=" <html:rewrite page='/resources/images/megapoli/favicon.ico'/>">16 <link rel="shortcut icon" href=""> 18 17 19 <ether:htmlCss cssFile="apycom.com-4-steel-blue/menu"/>20 18 <ether:htmlCss cssFile="button"/> 21 19 <ether:htmlCss cssFile="complexButton"/> 22 20 <ether:htmlCss cssFile="TwitterLogin/front"/> 23 <ether:htmlCss cssFile=" ether"/>24 <ether:htmlCss cssFile=" megapoli"/>21 <ether:htmlCss cssFile="mainEther"/> 22 <ether:htmlCss cssFile="tapas"/> 25 23 <ether:htmlCss cssFile="backoffice"/> 26 24 … … 32 30 <ether:htmlJs jsFile="classesForJQuery/ComplexButton"/> 33 31 <ether:htmlJs jsFile="classesForJQuery/LoginButton"/> 34 <ether:htmlJs jsFile="apycom.com-4-steel-blue/menu"/>35 32 <ether:htmlJs jsFile="TwitterLogin/javascripts/jquery.tipsy"/> 36 33 … … 49 46 50 47 <div id="logoEther" class="containerLogoEther"> 51 < html:link href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="80px" height="80px"/></html:link>48 <a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="80px" height="80px"/></a> 52 49 </div> 53 50 … … 59 56 60 57 <%-- ****************** TITLE & TOOLS ****************** --%> 61 <div id="title_tools" class="container Megapoli">58 <div id="title_tools" class="containerTapas"> 62 59 <div id="title"></div> 63 60 … … 70 67 <%-- ****************** LOGO ****************** --%> 71 68 <div id="logo" class="containerLogo"> 72 <html:link href="http://megapoli.dmi.dk/" target="help" titleKey="app.linkmegapoli"> 73 <html:img page="/resources/images/logo_Megapoli_white.png" height="110px" width="110px" altKey="app.home"/> 74 </html:link> 69 <a href="#"><img src="resources/images/logo_tapas.jpg" height="110px" width="110px"></a> 75 70 </div> 76 71 … … 84 79 85 80 <%-- ****************** CONTENT ****************** --%> 86 <div id="containerCenter" class="container MegapolicontainerCenter">81 <div id="containerCenter" class="containerTapas containerCenter"> 87 82 <tiles:insert attribute="body"/> 88 83 </div> 89 84 90 85 <%-- ****************** BOTTOM ****************** --%> 91 <div id="containerBottom" class="container MegapolicontainerBottom" align="right">92 © 201 0-2011 <html:link href="http://ether.ipsl.jussieu.fr" target="help">ETHER </html:link>/ CNRS86 <div id="containerBottom" class="containerTapas containerBottom" align="right"> 87 © 2012 <a href="http://ether.ipsl.jussieu.fr" target="help">ETHER </a>/ CNRS 93 88 </div> 94 89 … … 97 92 <script type="text/javascript"> 98 93 var templateTexts = $A( "" ); 99 templateTexts["app.home"] = '<bean:message key="app.home"/>'; 100 templateTexts["bo.fulltitle"] = '<bean:message key="bo.fulltitle"/>'; 101 templateTexts["app.en"] = '<bean:message key="app.en"/>'; 102 templateTexts["app.fr"] = '<bean:message key="app.fr"/>'; 103 templateTexts["data.upload.metadata.contact.mail"] = '<bean:message key="data.upload.metadata.contact.mail"/>'; 104 templateTexts["bo.user"] = '<bean:message key="bo.user"/>'; 105 templateTexts["bo.site"] = '<bean:message key="bo.site"/>'; 94 templateTexts["app.home"] = '<spring:message code="label.home"/>'; 95 templateTexts["bo.fulltitle"] = '<spring:message code="bo.fulltitle"/>'; 96 templateTexts["bo.user"] = '<spring:message code="bo.user"/>'; 97 templateTexts["bo.site"] = '<spring:message code="bo.site"/>'; 106 98 107 99 // Needed texts if you use the library LoginButton.js 108 100 var loginTexts = $A( "" ); 109 loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 110 loginTexts["login"] = '<bean:message key="login"/>'; 111 loginTexts["login.password"] = '<bean:message key="login.password"/>'; 112 loginTexts["login.sign"] = '<bean:message key="login.sign"/>'; 113 loginTexts["login.pwdForget"] = '<bean:message key="login.pwdForget"/>'; 114 loginTexts["login.loginForget.help"] = '<bean:message key="login.loginForget.help"/>'; 115 loginTexts["login.loginForget"] = '<bean:message key="login.loginForget"/>'; 116 loginTexts["login.error.notFound"] = "<bean:message key='login.error.notFound' arg0="<%=Context.getWebmaster( request )%>"/>"; 117 loginTexts["login.error.wrongPassword"] = "<bean:message key='login.error.wrongPassword'/>"; 118 loginTexts["login.error.failed"] = "<bean:message key='login.error.failed' arg0="<%=Context.getWebmaster( request )%>"/>"; 119 loginTexts["login.error.notAccepted"] = "<bean:message key='login.error.notAccepted'/>"; 120 loginTexts["<%=UserRole.ADMINISTRATOR%>"] = '<bean:message key="app.administrator"/>'; 121 loginTexts["<%=UserRole.TECHNICIEN%>"] = '<bean:message key="app.technician"/>'; 122 loginTexts["<%=UserRole.COORDINATOR%>"] = '<bean:message key="app.coordinator"/>'; 101 loginTexts["app.connexion"] = '<spring:message code="app.connexion"/>'; 102 loginTexts["login"] = '<spring:message code="login"/>'; 103 loginTexts["login.password"] = '<spring:message code="login.password"/>'; 104 loginTexts["login.sign"] = '<spring:message code="login.sign"/>'; 105 loginTexts["login.pwdForget"] = '<spring:message code="login.pwdForget"/>'; 106 loginTexts["login.loginForget.help"] = '<spring:message code="login.loginForget.help"/>'; 107 loginTexts["login.loginForget"] = '<spring:message code="login.loginForget"/>'; 108 loginTexts["login.error.notFound"] = "<spring:message code='login.error.notFound'/>"; 109 loginTexts["login.error.wrongPassword"] = "<spring:message code='login.error.wrongPassword'/>"; 110 loginTexts["login.error.failed"] = "<spring:message code='login.error.failed'/>"; 111 loginTexts["login.error.notAccepted"] = "<spring:message code='login.error.notAccepted'/>"; 112 loginTexts["<%=UserRole.ADMINISTRATOR%>"] = '<spring:message code="app.administrator"/>'; 123 113 124 114 var interfaceTemplate = new InterfaceTemplate(); -
tapas/web/resources/templates/templateBackoffice_script.jsp
r366 r409 1 <%@ page import="com.medias.Context" %>2 3 1 <script type="text/javascript"> 4 2 var InterfaceTemplate = Class.create( { … … 13 11 14 12 /** *********** VARIABLES *********** **/ 15 this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>;13 <%--this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>;--%> 16 14 this.path = "<%=request.getContextPath()%>"; 17 this.webmaster = "<%=Context.getWebmaster(request)%>"; 18 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; 19 this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false; 20 this.screenWidthLimit = 1336; 15 <%--this.webmaster = "<%=Context.getWebmaster(request)%>";--%> 16 <%--this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>";--%> 17 <%--this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false;--%> 21 18 22 19 /** ************ CREATE ************ **/ … … 35 32 var interfaceButton = new Button( {value:templateTexts["bo.site"], parent:this.containerTools, id:"button_interface", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickMegapoli} ); 36 33 var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickHome} ); 37 38 var divSmallLogoEther = $( document.createElement( "div" ) );39 divSmallLogoEther.attr( {id:"smallLogoEther", class:"containerSmallLogoEther"} );40 divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' );41 this.containerTools.append( divSmallLogoEther );42 $( "#smallLogoEther" ).show();43 44 this.updateLogoEther();45 34 }, 46 35 … … 71 60 { 72 61 document.location.href = "backoffice?methodName=viewUser"; 73 },74 75 /**76 * This method display a small Ether logo if the screen is too small to contain the big one77 */78 updateLogoEther: function()79 {80 if( this.screenWidthLimit > innerWidth )81 {82 $( "#logoEther" ).hide();83 $( "#linkLogoEther" ).hide();84 $( "#smallLogoEther" ).show();85 }86 else87 {88 $( "#logoEther" ).show();89 $( "#linkLogoEther" ).show();90 $( "#smallLogoEther" ).hide();91 }92 62 } 93 63 -
tapas/web/resources/templates/templateEther.jsp
r406 r409 128 128 templateTexts["label.mail"] = '<spring:message code="label.mail"/>'; 129 129 templateTexts["label.map"] = '<spring:message code="label.map"/>'; 130 130 templateTexts["label.backoffice"] = '<spring:message code="label.backoffice"/>'; 131 131 132 132 var interfaceTemplate = new InterfaceTemplate(); -
tapas/web/resources/templates/templateEther_script.jsp
r407 r409 20 20 createTools: function() 21 21 { 22 var backofficeButton = new Button( {value:templateTexts["label.backoffice"], parent:this.containerTools, id:"button_bo", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickBO, this )} ); 23 22 24 var mailButton = new Button( {value:templateTexts["label.mail"], parent:this.containerTools, id:"button_mail", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickMail, this )} ); 23 25 var languageButton = new Button( {value:templateTexts["label.language.to.switch"], parent:this.containerTools, id:"button_language", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} ); … … 40 42 41 43 // EVENTS ******************************************************** 44 onClickBO: function() 45 { 46 document.location.href = "backoffice?methodName=home"; 47 }, 48 42 49 onClickHome: function() 43 50 { -
tapas/web/src/com/ether/Controller.java
r406 r409 26 26 /** *********************** VIEWS ***************************** **/ 27 27 /** *********************************************************** **/ 28 @ControllerMethod(view = VIEW_INIT) 29 public Map<String, Object> home() 28 @ControllerMethod(view = VIEW_INIT)public Map<String, Object> home() 30 29 throws WebException 31 30 { … … 50 49 51 50 //appel a createxml 52 _tapasService.createXMLRequest( jsonTapas );51 getTapasService().createXMLRequest( jsonTapas ); 53 52 54 53 final JSONObject result = new JSONObject(); … … 57 56 } 58 57 59 60 @Required61 public void setTapasService( @NotNull final TapasService tapasService )62 {63 _tapasService = tapasService;64 }65 66 58 private static final Log LOGGER = LogFactory.getLog( Controller.class ); 67 59 68 60 private static final String VIEW_INIT = "init"; 69 61 private static final String VIEW_FORM_TAPAS = "project/formTapas"; 70 71 private TapasService _tapasService;72 62 } -
tapas/web/src/com/ether/ControllerBackoffice.java
r308 r409 6 6 import com.ether.user.UserFilter; 7 7 import com.ether.user.UserRole; 8 import com.ether.user.UserState;9 import com.medias.mail.Mail;10 import com.medias.mail.MailFactory;11 8 import net.sf.json.JSONObject; 12 9 import org.apache.commons.logging.Log; … … 14 11 import org.jetbrains.annotations.NotNull; 15 12 import org.jetbrains.annotations.Nullable; 16 17 import javax.mail.MessagingException; 13 import org.springframework.beans.factory.annotation.Required; 14 18 15 import java.security.DigestException; 19 16 import java.security.NoSuchAlgorithmException; … … 45 42 throws ServiceException, WebException 46 43 { 47 final JSONObject jsonObject = sortUser( "lastName", null, "ALL", "ALL", true, true, 5, 1 ); 48 jsonObject.put( "jSonUserStates", getJSONUserStates() ); 44 final JSONObject jsonObject = sortUser( "lastName", null, "ALL", true, true, 5, 1 ); 49 45 jsonObject.put( "jSonUserRoles", getJSONUserRoles() ); 50 46 return jsonObject; … … 60 56 @NotNull @ParamName(ParameterConstants.PARAMETER_PWD) final String pwd, 61 57 @Nullable @ParamName(ParameterConstants.PARAMETER_ROLE) final String role, 62 @NotNull @ParamName(ParameterConstants.PARAMETER_STATE) final String state,63 58 @NotNull @ParamName(ParameterConstants.PARAMETER_HAS_ACCESS) final Boolean hasAccessToBO ) 64 59 throws WebException, ServiceException … … 66 61 try 67 62 { 68 final User existingUser = getEtherService().getUserByEmail( email );63 final User existingUser = _backofficeService.getUserByEmail( email ); 69 64 if( null == existingUser ) 70 65 { 71 66 final Date creationDate = new Date(); 72 67 final String encryptedPassword = EtherHelper.encryptPassword( pwd ); 73 final User user = new User( lastName, firstName, email, encryptedPassword, role, state,hasAccessToBO, creationDate );74 75 getEtherService().createUser( user );68 final User user = new User( lastName, firstName, email, encryptedPassword, role, hasAccessToBO, creationDate ); 69 70 _backofficeService.createUser( user ); 76 71 } 77 72 else … … 88 83 } 89 84 90 return getAll AndWaitingUsers();85 return getAllUsers(); 91 86 } 92 87 … … 95 90 throws WebException, ServiceException 96 91 { 97 getEtherService().removeUserById( userId );98 99 return getAll AndWaitingUsers();92 _backofficeService.removeUserById( userId ); 93 94 return getAllUsers(); 100 95 } 101 96 … … 107 102 @Nullable @ParamName(ParameterConstants.PARAMETER_PWD) final String pwd, 108 103 @Nullable @ParamName(ParameterConstants.PARAMETER_ROLE) final String role, 109 @NotNull @ParamName(ParameterConstants.PARAMETER_STATE) final String state,110 104 @NotNull @ParamName(ParameterConstants.PARAMETER_HAS_ACCESS) final Boolean hasAccessToBO, 111 105 @NotNull @ParamName(ParameterConstants.PARAMETER_KEEP_SAME_PASSWORD) final Boolean keepSamePassword ) … … 114 108 try 115 109 { 116 final User existingUser = getEtherService().getUserByEmail( email );110 final User existingUser = _backofficeService.getUserByEmail( email ); 117 111 if( null == existingUser || userId.equals( existingUser.getId() ) ) 118 112 { 119 final User user = getEtherService().getUserById( userId );113 final User user = _backofficeService.getUserById( userId ); 120 114 user.setLastName( lastName ); 121 115 user.setFirstName( firstName ); … … 127 121 } 128 122 user.setRole( UserRole.valueOf( role ) ); 129 user.setState( UserState.valueOf( state ) );130 123 user.setAccessToBO( hasAccessToBO ); 131 124 132 getEtherService().updateUser( user );125 _backofficeService.updateUser( user ); 133 126 } 134 127 else … … 144 137 } 145 138 146 return getAllAndWaitingUsers(); 147 } 148 149 /** 150 * This method changes the state user and sends an email to inform of the administrator decision. 151 * If the email can't be sent, the state will be not changed 152 * 153 * @param userId 154 * @param isAccepted 155 * @return 156 * @throws WebException 157 * @throws ServiceException 158 */ 159 @ControllerMethod(jsonResult = true) 160 public JSONObject acceptOrRefuseUser( @NotNull @ParamName(ParameterConstants.PARAMETER_ID) final Integer userId, 161 @ParamName(ParameterConstants.PARAMETER_OK) final boolean isAccepted ) 162 throws WebException, ServiceException 163 { 164 final User user = getEtherService().getUserById( userId ); 165 try 166 { 167 sendEmailToUser( user, isAccepted ); 168 getEtherService().acceptOrRefuseUser( userId, isAccepted ); 169 } 170 catch( MessagingException e ) 171 { 172 throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the user : " + user.getEmail(), WebException.getExceptionThrowable() ); 173 } 174 175 return getAllAndWaitingUsers(); 139 return getAllUsers(); 176 140 } 177 141 … … 180 144 @Nullable @ParamName("searchText") final String searchText, 181 145 @NotNull @ParamName("sortRole") final String sortRole, 182 @NotNull @ParamName("sortState") final String sortState,183 146 @NotNull @ParamName("sortAccessBoTrue") final Boolean sortAccessBoTrue, 184 147 @NotNull @ParamName("sortAccessBoFalse") final Boolean sortAccessBoFalse, … … 191 154 filter.setSortRole( UserRole.valueOf( sortRole ) ); 192 155 193 if( !"ALL".equals( sortState ) ) 194 filter.setSortState( UserState.valueOf( sortState ) ); 195 196 final List<User> waitingUsers = getEtherService().getUsersByState( UserState.WAITING ); 197 final PaginatedResult<User> users = getEtherService().searchUsers( filter ); 156 final PaginatedResult<User> users = _backofficeService.searchUsers( filter ); 198 157 199 158 final JSONObject result = new JSONObject(); 200 result.put( "jSonWaitingUsers", getJsonHelper().toJSON( waitingUsers ) );201 159 result.put( "jSonUsers", getJsonHelper().toJSON( users.getPaginatedResults() ) ); 202 160 result.put( "usersNumber", users.getTotalCount() ); … … 204 162 } 205 163 206 /** 207 * This method create and send an email to the user to inform of the administrator decision 208 * 209 * @param user 210 * @param isAccepted 211 * @throws WebException 212 */ 213 private void sendEmailToUser( @NotNull final User user, final boolean isAccepted ) 214 throws MessagingException 215 { 216 final MailFactory mailFactory = (MailFactory) getServletContext().getAttribute( "APP_MAILFACTORY" ); 217 final String from = (String) getServletContext().getAttribute( "APP_WEBMASTER" ); 218 final String subject = "[MEGAPOLI] User inscription"; 219 String content = "Dear user, \n\nThe Megapoli administrator has "; 220 if( isAccepted ) 221 content += "accepted your inscription. You can now access to data with you login (" + user.getEmail() + ") and the password you gave during inscription.\n"; 222 else 223 content += "refused your inscription. You can reply to this email if you want more information.\n"; 224 225 content += "\nBest regards,\nMegapoli administrator"; 226 227 final Mail mail = new Mail( from, user.getEmail(), null, content, subject ); 228 mailFactory.sendMail( mail ); 229 } 230 231 232 private JSONObject getAllAndWaitingUsers() 164 private JSONObject getAllUsers() 233 165 throws ServiceException 234 166 { 235 final List<User> waitingUsers = getEtherService().getUsersByState( UserState.WAITING ); 236 final List<User> users = getEtherService().getAllUsersByNameOrder(); 167 final List<User> users = _backofficeService.getAllUsersByNameOrder(); 237 168 238 169 final JSONObject result = new JSONObject(); 239 result.put( "jSonWaitingUsers", getJsonHelper().toJSON( waitingUsers ) );240 170 result.put( "jSonUsers", getJsonHelper().toJSON( users ) ); 241 171 return result; 242 }243 244 private List<JSONObject> getJSONUserStates()245 {246 final UserState[] userStates = UserState.values();247 248 final List<JSONObject> jsonUserStates = new ArrayList<JSONObject>( userStates.length );249 250 for( final UserState userState : userStates )251 {252 final JSONObject jsonUserState = new JSONObject();253 jsonUserState.put( "text", userState.name() );254 jsonUserState.put( "value", userState.name() );255 jsonUserStates.add( jsonUserState );256 }257 return jsonUserStates;258 172 } 259 173 … … 274 188 } 275 189 190 @Required 191 public void setBackofficeService( final BackofficeService backofficeService ) 192 { 193 _backofficeService = backofficeService; 194 } 195 276 196 private static final Log LOGGER = LogFactory.getLog( ControllerBackoffice.class ); 277 197 278 198 private static final String VIEW_BO_INDEX = "backoffice/index"; 279 199 private static final String VIEW_BO_USER = "backoffice/user"; 200 201 private BackofficeService _backofficeService; 280 202 } -
tapas/web/src/com/ether/ControllerEther.java
r406 r409 289 289 } 290 290 291 @Required 292 public void setTapasService( @NotNull final TapasService tapasService ) 293 { 294 _tapasService = tapasService; 295 } 296 297 public TapasService getTapasService() 298 { 299 return _tapasService; 300 } 301 291 302 private static final Log LOGGER = LogFactory.getLog( ControllerEther.class ); 292 303 … … 295 306 private Map<String, MethodDescription> _methods = new HashMap<String, MethodDescription>(); 296 307 private boolean _initialized; /*=false*/ 308 309 private TapasService _tapasService; 297 310 } -
tapas/web/src/com/ether/WebException.java
r402 r409 44 44 ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, 45 45 ERROR_JSON_TAPAS_IS_NULL, 46 USER_ALREADY_EXISTS, 47 ERROR_ENCRYPT_PASSWORD, 48 ERROR_EMAIL_CANNOT_BE_SEND 46 49 } 47 50 -
tapas/web/src/messages_en.properties
r406 r409 6 6 app.title=Tapas 7 7 app.fulltitle=Full title de Tapas 8 app.connexion=Connection 9 app.administrator=Administrator 10 app.yes=Yes 11 app.no=No 8 12 9 13 title.home=Tapas data … … 12 16 label.map=Map 13 17 label.mail=Email 18 label.backoffice=Backoffice 14 19 15 20 error.ERROR_JSON_TAPAS_IS_NULL=Error to create the form 16 21 17 22 label.submitButton=RUN 23 24 ################################################################ 25 ####################### LOGIN ################################## 26 ################################################################ 27 login.authentification=Authentification 28 login.intro=Please login to access the protected areas of this website. 29 login=Login 30 login.password=Password 31 login.sign=Sign in 32 login.loginForget=Forgot your username ? 33 login.loginForget.help=If you remember your password, try logging in with your email 34 login.pwdForget=Forgot your password ? 35 login.inscription=New inscription 36 login.text=Please login to access the protected areas of this website. 37 38 login.dataProtocolAccept=You have to accept the data protocol to ask for an account 39 login.dataProtocolFields=Fields 'LastName', 'Email' and 'Password' must be filled 40 login.dataProtocol.account=Your account is waiting for administrator validation. You will receive an email when it will be activated. 41 login.dataProtocol.alreadyExist=This email is already used, you have to give another one 42 43 login.error.notAccepted=You are not allowed to access to protected areas. 44 login.error.bo.notAccepted=You are not authorized to access to backoffice. 45 login.error.notFound=Unknown login.<br> To register and access the protected areas of this site, please click on 'New inscription'.<br> 46 login.error.wrongPassword=Wrong password. 47 login.error.failed=The logon transaction failed. Please contact the <a href\='mailto\:{0}?subject\=[TAPAS]'>webmaster</a> to report this problem.<br> 48 login.error.unknown=You are not authentified or you lost your session, please register. 49 50 51 52 ################################################################ 53 ##################### BACKOFFICE ############################### 54 ################################################################ 55 bo.fulltitle=TAPAS Backoffice 56 bo.site=Tapas 57 bo.id=Id 58 bo.action=Action 59 bo.actions=Actions 60 bo.modify=Modify 61 bo.remove=Remove 62 bo.add=Add 63 bo.accept=Accept 64 bo.refuse=Refuse 65 bo.init=Init 66 bo.go=Go 67 bo.all=All 68 bo.total.number=Total number 69 bo.previous=Previous 70 bo.next=Next 71 bo.sortBy=Sort by 72 bo.viewBy=View by 73 bo.sort.asc=Sort asc by 74 bo.user=Users 75 bo.user.waitinglist=List of users waiting to have an access to data 76 bo.user.waitinglist.help=(an email will be sent to the user with your choice (accept or refuse)) 77 bo.user.list=List of users 78 bo.noUser=No user 79 bo.user.lastName=Lastname 80 bo.user.firstName=Firstname 81 bo.user.email=Email 82 bo.user.password=Password 83 bo.user.password.same=Keep same password 84 bo.user.password.same.help=(only to modify a password) 85 bo.user.role=Role 86 bo.user.creationDate=Creation date 87 bo.user.state=State 88 bo.user.state.help=Inscription state (can be removed, unactif, refused, ...) 89 bo.user.boAccess=BO 90 bo.user.boAccess.help=Access to the backoffice 91 bo.user.add=Add a new user 92 bo.user.modify=Modify the user 93 bo.user.remove.confirm=Do you really want to remove the user 94 95 bo.user.accepted=Accepted 96 bo.user.refused=Refused 97 bo.user.waiting=Waiting 98 bo.user.administrator=Administrator 99 bo.user.user=User 100 101 bo.field.lastName=The field lastName must be filled 102 bo.field.email=The field email must be filled 103 bo.field.password=The field password must be filled 104 105 bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid : -
tapas/web/src/messages_fr.properties
r406 r409 6 6 app.title=Tapas 7 7 app.fulltitle=Titre complet de Tapas 8 app.connexion=Connexion 9 app.administrator=Administrateur 10 app.yes=Oui 11 app.no=Non 8 12 9 13 title.home=Les données Tapas … … 12 16 label.map=Plan 13 17 label.mail=Email 18 label.backoffice=Backoffice 14 19 15 20 error.ERROR_JSON_TAPAS_IS_NULL=Erreur de création du formulaire Tapas 16 21 17 22 label.submitButton=COURIR 23 24 ################################################################ 25 ####################### LOGIN ################################## 26 ################################################################ 27 login.authentification=Authentification 28 login.intro=Veuillez vous identifier afin d'acc\u00E9der aux zones prot\u00E9g\u00E9es de ce site. 29 login=Login 30 login.password=Mot de passe 31 login.sign=Connection 32 login.loginForget=Oubli du login ? 33 login.loginForget.help=Si vous vous souvenez de votre mot de passe, essayez de vous connecter avec votre email 34 login.pwdForget=Oubli du mot de passe ? 35 login.inscription=Nouvelle inscription 36 login.text=Veuillez vous identifier afin d'acc\u00E9der aux zones prot\u00E9g\u00E9es de ce site. 37 38 login.dataProtocolAccept=Vous devez accepter le protocole d'utilisation des donn\u00E9es pour demander un compte 39 login.dataProtocolFields=Les champs 'Nom', 'Email' et 'Mot de passe' sont incomplets 40 login.dataProtocol.account=Votre compte est en attente de validation par l'administrateur. Vous recevrez un email lors de son activation. 41 login.dataProtocol.alreadyExist=Cette email est d\u00E9j\u00E0 utilis\u00E9 par un compte, veuillez en fournir un autre. 42 43 login.error.notAccepted=Vous n'\u00EAtes pas autoris\u00E9 \u00E0 acc\u00E9der aux zones prot\u00E9g\u00E9s. 44 login.error.bo.notAccepted=Vous n'\u00EAtes pas autoris\u00E9 \u00E0 acc\u00E9der au backoffice. 45 login.error.notFound=Ce login est inconnu.<br> Si vous voulez vous enregistrer pour obtenir l'acc\u00E8s aux zones prot\u00E9g\u00E9es du site, veuillez cliquez sur 'Nouvelle inscription'. <br> 46 login.error.wrongPassword=Ce mot de passe est incorrect. 47 login.error.failed=Echec de l\'op\u00E9ration d'authentification.<br> Veuillez contacter le <a href\='mailto\:{0}?subject\=[TAPAS]'>webmaster</a> pour lui signaler le probl\u00E8me.<br> 48 login.error.unknown=Vous n'\u00EAtes pas identifi\u00E9 ou vous avez perdu votre session, veuillez vous connecter. 49 50 51 ################################################################ 52 ##################### BACKOFFICE ############################### 53 ################################################################ 54 bo.fulltitle=TAPAS Backoffice 55 bo.site=Tapas 56 bo.id=Id 57 bo.action=Action 58 bo.actions=Actions 59 bo.modify=Modify 60 bo.remove=Remove 61 bo.add=Add 62 bo.accept=Accept 63 bo.refuse=Refuse 64 bo.init=Init 65 bo.go=Go 66 bo.all=All 67 bo.total.number=Total number 68 bo.previous=Previous 69 bo.next=Next 70 bo.sortBy=Sort by 71 bo.viewBy=View by 72 bo.sort.asc=Sort asc by 73 bo.user=Users 74 #bo.user.waitinglist=List of users waiting to have an access to data 75 #bo.user.waitinglist.help=(an email will be sent to the user with your choice (accept or refuse)) 76 bo.user.list=List of users 77 bo.noUser=No user 78 bo.user.lastName=Lastname 79 bo.user.firstName=Firstname 80 bo.user.email=Email 81 bo.user.password=Password 82 bo.user.password.same=Keep same password 83 bo.user.password.same.help=(only to modify a password) 84 bo.user.role=Role 85 bo.user.creationDate=Creation date 86 bo.user.state=State 87 bo.user.state.help=Inscription state (can be removed, unactif, refused, ...) 88 bo.user.boAccess=BO 89 bo.user.boAccess.help=Access to the backoffice 90 bo.user.add=Add a new user 91 bo.user.modify=Modify the user 92 bo.user.remove.confirm=Do you really want to remove the user 93 94 bo.user.accepted=Accepted 95 bo.user.refused=Refused 96 bo.user.waiting=Waiting 97 bo.user.administrator=Administrator 98 bo.user.user=User 99 100 bo.field.lastName=The field lastName must be filled 101 bo.field.email=The field email must be filled 102 bo.field.password=The field password must be filled 103 104 bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid :
Note: See TracChangeset
for help on using the changeset viewer.