Changeset 268 for ether_megapoli/trunk
- Timestamp:
- 11/29/11 17:07:52 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/common/implementation/com/ether/annotation/ControllerMethod.java
r249 r268 19 19 20 20 boolean requestMandatory() default false; 21 22 boolean backofficeMethod() default false; 21 23 } -
ether_megapoli/trunk/persistence/implementation/dao-context.xml
r220 r268 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 13 14 <ref bean="sessionFactory"/>15 16 12 <bean id="refParameterDAO" class="com.ether.dao.ParameterDAOImpl"> 13 <property name="sessionFactory"> 14 <ref bean="sessionFactory"/> 15 </property> 16 </bean> 17 17 18 19 20 <ref bean="sessionFactory"/>21 22 18 <bean id="refValueDAO" class="com.ether.dao.ValueDAOImpl"> 19 <property name="sessionFactory"> 20 <ref bean="sessionFactory"/> 21 </property> 22 </bean> 23 23 24 24 <bean id="refMeasureDAO" class="com.ether.dao.MeasureDAOImpl"> 25 25 <property name="sessionFactory"> 26 <ref bean="sessionFactory" /> 26 <ref bean="sessionFactory"/> 27 </property> 28 </bean> 29 30 <bean id="refUserDAO" class="com.ether.dao.user.UserDAOImpl"> 31 <property name="sessionFactory"> 32 <ref bean="sessionFactory"/> 27 33 </property> 28 34 </bean> -
ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml
r199 r268 34 34 <mapping resource="com/medias/objects/Zone.hbm.xml"/> 35 35 36 <mapping resource="com/ether/dao/user/User.hbm.xml"/> 36 37 </session-factory> 37 38 </hibernate-configuration> -
ether_megapoli/trunk/persistence/implementation/hibernate.cfg.xml
r199 r268 18 18 <prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop> 19 19 <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/megapoli_2</prop>--> 20 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.private.ipsl.fr:5432/ megapoli_2</prop>20 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.private.ipsl.fr:5432/MEGAPOLI_VM4</prop> 21 21 <prop key="hibernate.connection.username">postgres</prop> 22 22 <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> -
ether_megapoli/trunk/persistence/implementation/hibernate.properties
r199 r268 1 1 hibernate.connection.driver_class = org.postgresql.Driver 2 hibernate.connection.url=jdbc:postgresql://darkstar.private.ipsl.fr:5432/ megapoli_22 hibernate.connection.url=jdbc:postgresql://darkstar.private.ipsl.fr:5432/MEGAPOLI_VM4 3 3 hibernate.connection.username=postgres 4 4 #hibernate.c3p0.min_size=5 -
ether_megapoli/trunk/persistence/implementation/hibernate_local.cfg.xml
r200 r268 18 18 <prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop> 19 19 <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/megapoli_2</prop>--> 20 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.private.ipsl.fr:5432/ megapoli_2</prop>20 <prop key="hibernate.connection.url">jdbc:postgresql://darkstar.private.ipsl.fr:5432/MEGAPOLI_VM4</prop> 21 21 <prop key="hibernate.connection.username">postgres</prop> 22 22 <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> -
ether_megapoli/trunk/persistence/implementation/hibernate_local.properties
r199 r268 1 1 hibernate.connection.driver_class = org.postgresql.Driver 2 hibernate.connection.url=jdbc:postgresql://darkstar.private.ipsl.fr:5432/ megapoli_22 hibernate.connection.url=jdbc:postgresql://darkstar.private.ipsl.fr:5432/MEGAPOLI_VM4 3 3 hibernate.connection.username=postgres 4 4 #hibernate.c3p0.min_size=5 -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r244 r268 4 4 import com.ether.dao.ParameterDAO; 5 5 import com.ether.dao.PlateformDAO; 6 import com.ether.dao.UserDAO; 6 7 import com.ether.dao.ValueDAO; 8 import com.ether.user.User; 9 import com.ether.user.UserState; 7 10 import com.medias.database.objects.Parametre; 8 11 import com.medias.database.objects.Plateforme; … … 182 185 } 183 186 187 @Nullable 188 @Transactional(readOnly = true) 189 public User getUserById( @NotNull final Integer userId ) 190 throws ServiceException 191 { 192 try 193 { 194 return _userDAO.getUserById( userId ); 195 } 196 catch( PersistenceException e ) 197 { 198 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 199 } 200 } 201 202 @Nullable 203 @Transactional(readOnly = true) 204 public User getUserByEmail( @NotNull final String userEmail ) 205 throws ServiceException 206 { 207 try 208 { 209 return _userDAO.getUserByEmail( userEmail ); 210 } 211 catch( PersistenceException e ) 212 { 213 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 214 } 215 } 216 217 @NotNull 218 @Transactional(rollbackFor = Exception.class) 219 public Integer createUser( @NotNull final User user ) 220 throws ServiceException 221 { 222 try 223 { 224 return _userDAO.insert( user ); 225 } 226 catch( PersistenceException e ) 227 { 228 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 229 } 230 } 231 232 @NotNull 233 @Transactional(readOnly = true) 234 public List<User> getAllUsers() 235 throws ServiceException 236 { 237 try 238 { 239 return _userDAO.selectAll(); 240 } 241 catch( PersistenceException e ) 242 { 243 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 244 } 245 } 246 247 @NotNull 248 @Transactional(readOnly = true) 249 public List<User> getUsersByState( @NotNull final UserState userState ) 250 throws ServiceException 251 { 252 try 253 { 254 return _userDAO.getUsersByState( userState ); 255 } 256 catch( PersistenceException e ) 257 { 258 throw new ServiceException( ServiceException.ServiceCode.WAITING_USER_NOT_FOUND, e ); 259 } 260 } 261 184 262 @Required 185 263 public void setPlateformDAO( final PlateformDAO plateformDAO ) … … 204 282 { 205 283 _measureDAO = measureDAO; 284 } 285 286 @Required 287 public void setUserDAO( final UserDAO userDAO ) 288 { 289 _userDAO = userDAO; 206 290 } 207 291 … … 212 296 private ValueDAO _valueDAO; 213 297 private MeasureDAO _measureDAO; 298 private UserDAO _userDAO; 214 299 } -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r244 r268 1 1 package com.ether; 2 2 3 import com.ether.user.User; 4 import com.ether.user.UserState; 3 5 import com.medias.database.objects.Parametre; 4 6 import com.medias.database.objects.Plateforme; … … 55 57 Date getLastDate() 56 58 throws ServiceException; 59 60 @Nullable 61 User getUserById( @NotNull final Integer userId ) 62 throws ServiceException; 63 64 @Nullable 65 User getUserByEmail( @NotNull final String userEmail ) 66 throws ServiceException; 67 68 @NotNull 69 Integer createUser( @NotNull User user ) 70 throws ServiceException; 71 72 @NotNull 73 List<User> getAllUsers() 74 throws ServiceException; 75 76 @NotNull 77 List<User> getUsersByState( @NotNull UserState userState ) 78 throws ServiceException; 57 79 } -
ether_megapoli/trunk/web/resources/js/classesForJQuery/etherHelper.js
r234 r268 13 13 return (-1 == index); 14 14 } 15 16 function getJSONUser() 17 { 18 return getLoginModule().getJSONUser(); 19 } 20 21 function getPath() 22 { 23 return InterfaceTemplate.path; 24 } 25 26 function setPath( path ) 27 { 28 InterfaceTemplate.path = path; 29 } 30 31 function getLoginModule() 32 { 33 return InterfaceTemplate.loginModule; 34 } 35 36 function setLoginModule( loginModule ) 37 { 38 InterfaceTemplate.loginModule = loginModule; 39 } 40 41 function neededLogin( href ) 42 { 43 $( "#signin_menu" ).ready( function() 44 { 45 if( !getJSONUser() ) 46 getLoginModule().showLogin( loginTexts["data.authentification.text"] ); 47 else 48 document.location.href = getPath() + href; 49 } ); 50 } 51 52 // Need to import javascript librairy "calendar/anytime.js" 53 function formatDate( date, formatDate ) 54 { 55 var format = formatDate ? formatDate : "%Y-%m-%d %H:%i"; 56 var calendarConverter = new AnyTime.Converter( { format: format } ); 57 return calendarConverter.format( date ); 58 } -
ether_megapoli/trunk/web/src/com/ether/ControllerEther.java
r252 r268 13 13 import org.apache.commons.logging.Log; 14 14 import org.apache.commons.logging.LogFactory; 15 import org.apache.struts.Globals; 15 16 import org.jetbrains.annotations.NotNull; 16 17 import org.jetbrains.annotations.Nullable; … … 32 33 import java.util.HashMap; 33 34 import java.util.List; 35 import java.util.Locale; 34 36 import java.util.Map; 35 37 … … 93 95 if( methodDescription.isRequestMandatory() ) 94 96 params[params.length - 1] = request; 97 98 if( methodDescription.isBackofficeMethod() ) 99 request.getSession().setAttribute( Globals.LOCALE_KEY, Locale.ENGLISH ); 95 100 96 101 // Invoke method (go to controller)
Note: See TracChangeset
for help on using the changeset viewer.