Changeset 475
- Timestamp:
- 04/12/12 16:56:04 (12 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/common/implementation/com/ether/EtherHelper.java
r279 r475 6 6 7 7 import java.io.BufferedWriter; 8 import java.io.File; 8 9 import java.io.FileWriter; 9 10 import java.io.IOException; … … 12 13 import java.security.NoSuchAlgorithmException; 13 14 import java.util.ArrayList; 15 import java.util.Calendar; 14 16 import java.util.List; 15 17 import java.util.Random; … … 196 198 } 197 199 200 201 /** 202 * This method move all files from fromDirectory to toDirectory 203 * The toDirectory DOESN'T MUST exist ! 204 * (otherwise it is renamed with date) 205 * 206 * @param fromDirectory 207 * @param toDirectory 208 * @return 209 */ 210 public static boolean moveFiles( @NotNull final String fromDirectory, @NotNull final String toDirectory ) 211 { 212 final File fromDirectoryFiles = new File( fromDirectory ); 213 final File toDirectoryFiles = new File( toDirectory ); 214 215 if( toDirectoryFiles.exists() ) 216 toDirectoryFiles.renameTo( new File( toDirectory + "_" + Calendar.getInstance().getTimeInMillis() ) ); 217 218 return fromDirectoryFiles.renameTo( toDirectoryFiles ); 219 } 220 198 221 } -
ether_megapoli/trunk/common/implementation/com/medias/Context.java
r282 r475 96 96 97 97 /** 98 * This method returns from the servletContext the property initialized during the init() of MegapoliInitialisation.java 99 * 100 * @param request 101 * @param property 102 * @return 103 */ 104 public static String getProperty( @NotNull final HttpServletRequest request, @NotNull final String property ) 105 { 106 return (String) request.getSession().getServletContext().getAttribute( property ); 107 } 108 109 /** 98 110 * Permet de définir le nom de la racine à partir de laquelle les paths sont calculés. 99 111 * -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r474 r475 25 25 import org.springframework.transaction.annotation.Transactional; 26 26 27 import java.io.File; 27 28 import java.util.ArrayList; 28 29 import java.util.Date; … … 505 506 @Nullable 506 507 @Transactional(readOnly = true) 507 public PaginatedResult<Jeu> search Datasets( @NotNull final JeuFilter filter )508 public PaginatedResult<Jeu> searchJeux( @NotNull final JeuFilter filter ) 508 509 throws ServiceException 509 510 { … … 514 515 catch( PersistenceException e ) 515 516 { 516 throw new ServiceException( ServiceException.ServiceCode.DATASET_NOT_FOUND, e ); 517 } 517 throw new ServiceException( ServiceException.ServiceCode.JEU_NOT_FOUND, e ); 518 } 519 } 520 521 @Transactional(rollbackFor = Exception.class) 522 public void removeJeuById( @NotNull final Integer jeuId ) 523 throws ServiceException 524 { 525 // TODO lancer moulinette à VP 526 final String bob = "bib"; 527 // try 528 // { 529 // _jeuDAO.deleteByPrimaryKey( jeuId ); 530 // } 531 // catch( PersistenceException e ) 532 // { 533 // throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 534 // } 535 } 536 537 @Nullable 538 @Transactional(readOnly = true) 539 public Jeu getJeuById( @NotNull final Integer jeuId ) 540 throws ServiceException 541 { 542 try 543 { 544 return _jeuDAO.selectByPrimaryKey( jeuId ); 545 } 546 catch( PersistenceException e ) 547 { 548 throw new ServiceException( ServiceException.ServiceCode.JEU_NOT_FOUND, e ); 549 } 550 } 551 552 /** 553 * This method moves all dataset's files from download directory to upload directory 554 * 555 * @param jeu 556 * @param downloadDirectory 557 * @param uploadDirectory 558 */ 559 public void moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 560 throws ServiceException 561 { 562 if( null == jeu.getCategorie() || null == jeu.getCategorie().getCategorieNom() ) 563 throw new ServiceException( ServiceException.ServiceCode.JEU_NOT_CORRECT, "ERROR to move jeu to download directory to upload directory" + jeu ); 564 565 final String downloadFilesPath = downloadDirectory + File.separatorChar + jeu.getCategorie().getCategorieNom() + File.separatorChar + jeu.getJeuNom(); 566 final String uploadFilesPath = uploadDirectory + File.separatorChar + jeu.getCategorie().getCategorieNom() + File.separatorChar + jeu.getJeuNom(); 567 568 final boolean success = EtherHelper.moveFiles( downloadFilesPath, uploadFilesPath ); 569 if( !success ) 570 { 571 // File was not successfully moved 572 } 573 final String bob = "bib"; 518 574 } 519 575 -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r474 r475 135 135 throws ServiceException; 136 136 137 PaginatedResult<Jeu> searchDatasets( @NotNull final JeuFilter filter ) 137 PaginatedResult<Jeu> searchJeux( @NotNull final JeuFilter filter ) 138 throws ServiceException; 139 140 void removeJeuById( @NotNull final Integer jeuId ) 141 throws ServiceException; 142 143 Jeu getJeuById( @NotNull final Integer jeuId ) 144 throws ServiceException; 145 146 void moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 138 147 throws ServiceException; 139 148 } -
ether_megapoli/trunk/service/interface/com/ether/ServiceException.java
r473 r475 20 20 } 21 21 22 public ServiceException( final Enum<? extends Code> code, final String message ) 23 { 24 super( code, message ); 25 } 26 22 27 public static enum ServiceCode 23 28 implements Code … … 38 43 PERSON_NOT_FOUND, 39 44 REQUEST_NOT_FOUND, 40 DATASET_NOT_FOUND 45 JEU_NOT_FOUND, 46 JEU_NOT_CORRECT 41 47 } 42 48 } -
ether_megapoli/trunk/web/backoffice/dataInsertion-script.jsp
r474 r475 1 <%@ page import="com.medias.Context" %> 2 <%@ page import="java.io.File" %> 1 3 <script type="text/javascript"> 2 var interfaceBO Mco= Class.create( {3 4 initialize: function( requestNumber, jSonRequests, jSonRequestStates, jSonRequestTypes )4 var interfaceBODataInsertion = Class.create( { 5 6 initialize: function( datasetNumber, jSonDatasets ) 5 7 { 6 8 // Values 7 this.jSon Requests = jSonRequests || null;8 this. jSonRequestStates = jSonRequestStates || null;9 this. jSonRequestTypes = jSonRequestTypes || null;10 this. request = false;11 this. nbRequests = requestNumber || false;9 this.jSonDatasets = jSonDatasets || null; 10 this.dataset = false; 11 this.nbDatasets = datasetNumber || false; 12 this.downloadDirectory = '<%=Context.getProperty(request, "accessDir")%>'; 13 this.uploadDirectory = '<%=Context.getProperty(request, "uploadDir")%>'; 12 14 13 15 // Containers 14 this.generalContainerRequests = $( "#generalContainerRequests" ); 15 this.containerRequests = $( "#containerRequests" ); 16 this.containerAddOrModifyTitle = $( "#addOrModifyTitle" ); 16 this.generalContainerDatasets = $( "#generalContainerDatasets" ); 17 this.containerDatasets = $( "#containerDataSets" ); 17 18 this.containerErrors = $( "#errors" ); 18 this.containerRequestsNumber = $( "#nbResults" ); 19 this.containerDatasetsNumber = $( "#nbResults" ); 20 this.containerFilesMove = $( "#containerFilesMove" ); 21 this.containerResultFilesMove = $( "#resultFilesMove" ); 19 22 20 23 this.containerSorts = $( "#containerSorts" ); 21 this.containerSortsStates = $( "#containerSorts_states" );22 this.containerSortsTypes = $( "#containerSorts_types" );23 24 this.containerSortsDisplay = $( "#containerSorts_display" ); 24 25 this.containerPage = $( "#page" ); … … 28 29 // Create loading object for users 29 30 var param = new Object(); 30 param.id = "loadingFor Request";31 param.parent = this.generalContainer Requests;32 this.loading Request = new Loading( param );33 this.loading Request.display();31 param.id = "loadingForDataset"; 32 param.parent = this.generalContainerDatasets; 33 this.loadingDataset = new Loading( param ); 34 this.loadingDataset.display(); 34 35 35 36 this.containerErrors.hide(); 36 this.updateAddRequestButtonAndTitle();37 37 this.displaySorts(); 38 this.managePartAddOrModify();39 38 this.managePagination(); 40 this.display Requests();39 this.displayDatasets(); 41 40 }, 42 41 43 42 // REQUESTS ******************************************************** 44 requestAddRequest: function() 45 { 46 if( !this.verifyFields() ) 47 { 48 var parametersUrl = "code=" + stripVowelAccent( $( "#code" ).val() ) + "&email=" + $( "#email" ).val() + "&state=" + this.selectStates.getValue() + "&type=" + this.selectTypes.getValue() + 49 "&title=" + stripVowelAccent( $( "#titleRequest" ).val() ) + "&informations=" + stripVowelAccent( $( "#informations" ).val() ); 50 var request = $.ajax( { 51 url: "backoffice?methodName=addRequest&" + parametersUrl, 52 success:jQuery.proxy( this.handleRequest, this ), 53 error: jQuery.proxy( this.showErrors, [this] ) 54 } ); 55 } 56 }, 57 58 requestCloseRequest: function() 59 { 60 if( this.request ) 43 requestRemoveRequest: function() 44 { 45 if( this.dataset ) 61 46 $.ajax( { 62 url: "backoffice?methodName= closeRequest&id=" + this.request.id,47 url: "backoffice?methodName=removeJeu&id=" + this.dataset.id, 63 48 success:jQuery.proxy( this.handleRequest, this ) 64 49 } ); 65 50 }, 66 51 67 requestRemoveRequest: function() 68 { 69 if( this.request ) 70 $.ajax( { 71 url: "backoffice?methodName=removeRequest&id=" + this.request.id, 72 success:jQuery.proxy( this.handleRequest, this ) 73 } ); 74 }, 75 76 requestModifyRequest: function() 77 { 78 if( this.request && !this.verifyFields() ) 79 { 80 var parametersUrl = "id=" + this.request.id + "&code=" + stripVowelAccent( $( "#code" ).val() ) + "&email=" + $( "#email" ).val() + 81 "&type=" + this.selectTypes.getValue() + "&state=" + this.selectStates.getValue() + "&title=" + stripVowelAccent( $( "#titleRequest" ).val() ) + "&informations=" + stripVowelAccent( $( "#informations" ).val() ); 82 $.ajax( { 83 url: "backoffice?methodName=modifyRequest&" + parametersUrl, 84 success:jQuery.proxy( this.handleRequest, this ), 85 error: jQuery.proxy( this.showErrors, [this] ) 86 } ); 87 } 88 }, 89 90 requestSortRequest: function() 91 { 92 var parametersUrl = "sort=" + this.selectSorts.getValue() + "&sortState=" + this.selectSortsStates.getValue() + "&sortType=" + this.selectSortsTypes.getValue() + 52 requestSortDataset: function() 53 { 54 var parametersUrl = "sort=" + this.selectSorts.getValue() + 93 55 "&searchText=" + $( "#search_text" ).val() + 94 56 "&maxResults=" + this.selectSortsDisplay.getValue() + "&page=" + this.containerPage.html(); 95 57 var request = $.ajax( { 96 url: "backoffice?methodName=sort Request&" + parametersUrl,58 url: "backoffice?methodName=sortJeu&" + parametersUrl, 97 59 success:jQuery.proxy( this.handleSortRequest, this ), 98 60 error: jQuery.proxy( this.showErrors, [this] ) … … 100 62 }, 101 63 64 requestFilesMove: function() 65 { 66 if( this.dataset ) 67 $.ajax( { 68 url: "backoffice?methodName=moveJeu&id=" + this.dataset.id, 69 success:jQuery.proxy( this.handleFilesMove, this ) 70 } ); 71 }, 72 102 73 // HANDLES ******************************************************** 103 74 handleRequest: function() 104 75 { 105 this.requestSort Request();76 this.requestSortDataset(); 106 77 }, 107 78 108 79 handleSortRequest: function( result ) 109 80 { 110 this.jSonRequests = jQuery.parseJSON( result ).jSonRequests; 111 this.nbRequests = jQuery.parseJSON( result ).requestNumber; 112 this.displayRequests(); 113 this.clearAddOrModifyRequestFields(); 114 this.updateAddRequestButtonAndTitle(); 81 this.jSonDatasets = jQuery.parseJSON( result ).jSonDatasets; 82 this.nbDatasets = jQuery.parseJSON( result ).datasetNumber; 83 this.displayDatasets(); 84 this.displayFilesMove(); 85 }, 86 87 handleFilesMove: function( result ) 88 { 89 this.containerResultFilesMove.html( "OK" ); 115 90 }, 116 91 117 92 // DISPLAYS ******************************************************** 118 displayTRFor Request: function( request )93 displayTRForDataset: function( dataset ) 119 94 { 120 95 var tr = $( document.createElement( "tr" ) ); 121 96 var tdId = $( document.createElement( "td" ) ); 122 tdId.html( request.id );97 tdId.html( dataset.id ); 123 98 tr.append( tdId ); 124 var tdType = $( document.createElement( "td" ) ); 125 tdType.html( interfaceTexts[request.type] ); 126 tr.append( tdType ); 127 var tdCode = $( document.createElement( "td" ) ); 128 tdCode.html( request.code ); 129 tr.append( tdCode ); 99 var tdName = $( document.createElement( "td" ) ); 100 tdName.html( dataset.name ); 101 tr.append( tdName ); 130 102 var tdCreationDate = $( document.createElement( "td" ) ); 131 tdCreationDate.html( formatDate( new Date( request.creationDate.time ) ) );103 tdCreationDate.html( formatDate( new Date( dataset.creationDate.time ) ) ); 132 104 tr.append( tdCreationDate ); 133 var tdEmail = $( document.createElement( "td" ) );134 tdEmail.html( request.emailUser );135 tr.append( tdEmail );136 var tdState = $( document.createElement( "td" ) );137 tdState.html( interfaceTexts[request.state] );138 tr.append( tdState );139 var tdClosingDate = $( document.createElement( "td" ) );140 // if( request.closingDate )141 // tdClosingDate.html( formatDate( new Date( request.closingDate.time ) ) );142 // tr.append( tdClosingDate );143 105 return tr; 144 106 }, 145 107 146 display Requests: function()147 { 148 this.container Requests.empty();149 150 if( this.jSon Requests && 0 < this.jSonRequests.length )108 displayDatasets: function() 109 { 110 this.containerDatasets.empty(); 111 112 if( this.jSonDatasets && 0 < this.jSonDatasets.length ) 151 113 { 152 jQuery.each( this.jSon Requests, jQuery.proxy( function( i, request )114 jQuery.each( this.jSonDatasets, jQuery.proxy( function( i, request ) 153 115 { 154 var tr = this.displayTRFor Request( request );116 var tr = this.displayTRForDataset( request ); 155 117 156 118 // Buttons 157 var tdModify = $( document.createElement( "td" ) );158 new Button( {value:interfaceTexts["bo.modify"], parent:tdModify, id:"button_modify", className: "small positive action_button", contextToSave: request, onClick:jQuery.proxy( this.onClickModify, this )} );159 tr.append( tdModify );160 161 var tdClose = $( document.createElement( "td" ) );162 new Button( {value:interfaceTexts["bo.close"], parent:tdClose, id:"button_close", className: "small action_button", contextToSave: request, onClick:jQuery.proxy( this.onClickClose, this )} );163 tr.append( tdClose );164 165 119 var tdRemove = $( document.createElement( "td" ) ); 166 120 new Button( {value:interfaceTexts["bo.remove"], parent:tdRemove, id:"button_remove", className: "small negative action_button", contextToSave: request, onClick:jQuery.proxy( this.onClickRemove, this )} ); 167 121 tr.append( tdRemove ); 168 122 169 this.container Requests.append( tr );123 this.containerDatasets.append( tr ); 170 124 171 125 }, this ) ); … … 175 129 var tr = $( document.createElement( "tr" ) ); 176 130 var td = $( document.createElement( "td" ) ); 177 td.attr( {colspan:" 11"} );178 td.html( "<center><BR/>" + interfaceTexts["bo.no Request"] + "<BR/><BR/></center>" );131 td.attr( {colspan:"4"} ); 132 td.html( "<center><BR/>" + interfaceTexts["bo.noDataset"] + "<BR/><BR/></center>" ); 179 133 tr.append( td ); 180 this.container Requests.append( tr );134 this.containerDatasets.append( tr ); 181 135 } 182 136 183 137 // Update number of users and max pages 184 this.container RequestsNumber.html( this.nbRequests );185 this.containerMaxPage.html( Math.ceil( this.nb Requests / this.selectSortsDisplay.getValue() ) );186 this.loading Request.hide();138 this.containerDatasetsNumber.html( this.nbDatasets ); 139 this.containerMaxPage.html( Math.ceil( this.nbDatasets / this.selectSortsDisplay.getValue() ) ); 140 this.loadingDataset.hide(); 187 141 }, 188 142 … … 195 149 this.selectSorts = new Select( paramSelect ); 196 150 this.selectSorts.add( "jeuId", interfaceTexts["bo.id"] ); 151 this.selectSorts.add( "jeuNom", interfaceTexts["bo.name"] ); 197 152 this.selectSorts.add( "jeuDateinser", interfaceTexts["bo.user.creationDate"] ); 198 153 this.selectSorts.selectFirst( false ); 199 200 // Sort by state201 var paramSelect = new Object();202 paramSelect.id = "select_sorts_states";203 paramSelect.parent = this.containerSortsStates;204 this.selectSortsStates = new Select( paramSelect );205 this.selectSortsStates.add( "ALL", interfaceTexts["bo.all"] );206 jQuery.each( this.jSonRequestStates, jQuery.proxy( function ( i, jSonRequestState )207 {208 this.selectSortsStates.add( jSonRequestState.value, interfaceTexts[jSonRequestState.text] );209 }, this ) );210 this.selectSortsStates.selectFirst( false );211 212 // Sort by type213 var paramSelect = new Object();214 paramSelect.id = "select_sorts_types";215 paramSelect.parent = this.containerSortsTypes;216 this.selectSortsTypes = new Select( paramSelect );217 this.selectSortsTypes.add( "ALL", interfaceTexts["bo.all"] );218 jQuery.each( this.jSonRequestTypes, jQuery.proxy( function ( i, jSonRequestType )219 {220 this.selectSortsTypes.add( jSonRequestType.value, interfaceTexts[jSonRequestType.text] );221 }, this ) );222 this.selectSortsTypes.selectFirst( false );223 154 224 155 // Number of displays … … 237 168 }, 238 169 170 displayFilesMove: function() 171 { 172 if( this.dataset && this.dataset.categoryName ) 173 { 174 this.containerFilesMove.html( "MOVE <span style='color:#FBE3E4'>" + this.downloadDirectory + "<%=File.separatorChar%>" + this.dataset.categoryName + "<%=File.separatorChar%>" + this.dataset.name + "<%=File.separatorChar%>* </span> <BR/>" + 175 "TO <span style='color:#FBE3E4'>" + this.uploadDirectory + "<%=File.separatorChar%>" + this.dataset.categoryName + "<%=File.separatorChar%>" + this.dataset.name + "<%=File.separatorChar%>* </span>" ); 176 177 new Button( {value:interfaceTexts["bo.move"], parent:this.containerFilesMove, id:"button_move", className: "small negative action_button", onClick:jQuery.proxy( this.onClickMove, this )} ); 178 } 179 }, 180 239 181 // EVENTS ******************************************************** 240 onClickModify: function( request ) 241 { 242 this.request = request; 243 $( "#code" ).val( request.code ); 244 $( "#creationDate" ).val( formatDate( new Date( request.creationDate.time ) ) ); 245 if( request.closingDate ) 246 $( "#closingDate" ).val( formatDate( new Date( request.closingDate.time ) ) ); 247 $( "#email" ).val( request.emailUser ); 248 $( "#titleRequest" ).val( request.title ); 249 $( "#informations" ).val( request.informations ); 250 this.selectTypes.select( request.type, false ); 251 this.selectStates.select( request.state, false ); 252 253 this.updateModifyRequestButtonAndTitle( request.id ); 254 }, 255 256 onClickClose: function( request ) 257 { 258 this.request = request; 259 jQuery.proxy( this.requestCloseRequest(), this ); 260 }, 261 262 onClickRemove: function( request ) 263 { 264 this.request = request; 265 if( window.confirm( interfaceTexts["bo.mco.remove.confirm"] + " " + request.code + " ?" ) ) 266 jQuery.proxy( this.requestRemoveRequest(), this ); 267 }, 268 269 onClickInit: function() 270 { 271 this.updateAddRequestButtonAndTitle(); 272 this.clearAddOrModifyRequestFields(); 182 onClickRemove: function( dataset ) 183 { 184 this.dataset = dataset; 185 // if( window.confirm( interfaceTexts["bo.dataset.remove.confirm"] + " " + dataset.name + " ?" ) ) 186 jQuery.proxy( this.requestRemoveRequest(), this ); 273 187 }, 274 188 … … 276 190 { 277 191 this.containerPage.html( 1 ); 278 this.requestSort Request();192 this.requestSortDataset(); 279 193 }, 280 194 … … 282 196 { 283 197 decrementPage( this.containerPage, this.containerMaxPage ); 284 this.requestSort Request();198 this.requestSortDataset(); 285 199 }, 286 200 … … 288 202 { 289 203 incrementPage( this.containerPage, this.containerMaxPage ); 290 this.requestSortRequest(); 204 this.requestSortDataset(); 205 }, 206 207 onClickMove: function() 208 { 209 this.requestFilesMove(); 291 210 }, 292 211 -
ether_megapoli/trunk/web/backoffice/dataInsertion.jsp
r473 r475 30 30 <tiles:put name="body" type="string"> 31 31 <%-- ****************** DATASETS REMOVE ****************** --%> 32 <div class="title2"> <bean:message key="bo.dataset.remove"/> :</div>32 <div class="title2">1st <bean:message key="bo.step"/>. <bean:message key="bo.dataset.remove"/> :</div> 33 33 <BR/> 34 34 … … 87 87 <BR/> 88 88 <HR width="50%"> 89 <%-- ****************** FILES MOVE ****************** --%> 90 <div class="title2">2nd <bean:message key="bo.step"/>. <bean:message key="bo.file.move"/> :</div> 91 <BR/> 92 <div id="containerFilesMove"></div> 93 <div id="resultFilesMove"></div> 94 <BR/> 95 <HR width="50%"> 89 96 90 97 <%-- ****************** DATASETS INSERTION ****************** --%> 91 <div class="title2"> <bean:message key="bo.dataset.remove"/> :</div>98 <div class="title2">3rd <bean:message key="bo.step"/>.<bean:message key="bo.dataset.remove"/> :</div> 92 99 <BR/> 93 100 … … 96 103 <script type="text/javascript"> 97 104 var interfaceTexts = $A( "" ); 98 interfaceTexts["bo.noRequest"] = '<bean:message key="bo.noRequest"/>'; 99 interfaceTexts["bo.add"] = '<bean:message key="bo.add"/>'; 100 interfaceTexts["bo.modify"] = '<bean:message key="bo.modify"/>'; 105 interfaceTexts["bo.noDataset"] = '<bean:message key="bo.noDataset"/>'; 101 106 interfaceTexts["bo.remove"] = '<bean:message key="bo.remove"/>'; 102 interfaceTexts["bo.close"] = '<bean:message key="bo.close"/>'; 103 interfaceTexts["bo.mco.remove.confirm"] = '<bean:message key="bo.mco.remove.confirm"/>'; 107 interfaceTexts["bo.dataset.remove.confirm"] = '<bean:message key="bo.dataset.remove.confirm"/>'; 104 108 interfaceTexts["bo.id"] = '<bean:message key="bo.id"/>'; 105 interfaceTexts["bo.mco.add"] = '<bean:message key="bo.mco.add"/>'; 106 interfaceTexts["bo.mco.modify"] = '<bean:message key="bo.mco.modify"/>'; 107 interfaceTexts["bo.user.email"] = '<bean:message key="bo.user.email"/>'; 109 interfaceTexts["bo.name"] = '<bean:message key="bo.name"/>'; 108 110 interfaceTexts["bo.user.creationDate"] = '<bean:message key="bo.user.creationDate"/>'; 109 interfaceTexts["bo.closingDate"] = '<bean:message key="bo.closingDate"/>';110 111 interfaceTexts["bo.all"] = '<bean:message key="bo.all"/>'; 111 interfaceTexts["bo. field.code"] = '<bean:message key="bo.field.code"/>';112 interfaceTexts["bo. field.email"] = '<bean:message key="bo.field.email"/>';112 interfaceTexts["bo.go"] = '<bean:message key="bo.go"/>'; 113 interfaceTexts["bo.move"] = '<bean:message key="bo.move"/>'; 113 114 114 interfaceTexts["<%=McoState.A_OPENED%>"] = "<bean:message key="bo.opened"/>"; 115 interfaceTexts["<%=McoState.C_REFUSED%>"] = "<bean:message key="bo.user.refused"/>"; 116 interfaceTexts["<%=McoState.D_CLOSED%>"] = "<bean:message key="bo.closed"/>"; 117 interfaceTexts["<%=McoState.B_IN_WORK%>"] = "<bean:message key="bo.inWork"/>"; 118 119 interfaceTexts["<%=McoType.NEW_ACCOUNT%>"] = "<bean:message key="bo.new.account"/>"; 120 interfaceTexts["<%=McoType.EMAIL_LOGIN%>"] = "<bean:message key="bo.email.login"/>"; 121 interfaceTexts["<%=McoType.NO_ACCESS%>"] = "<bean:message key="bo.no.access"/>"; 122 interfaceTexts["<%=McoType.PROBLEM%>"] = "<bean:message key="bo.problem"/>"; 123 interfaceTexts["<%=McoType.PROBLEM_DATA%>"] = "<bean:message key="bo.problem.data"/>"; 124 interfaceTexts["<%=McoType.PROBLEM_DATE%>"] = "<bean:message key="bo.problem.date"/>"; 125 interfaceTexts["<%=McoType.BETA_TEST%>"] = "<bean:message key="bo.beta.test"/>"; 126 interfaceTexts["<%=McoType.OTHER%>"] = "<bean:message key="bo.other"/>"; 127 128 interfaceTexts["<%=WebException.WebCode.MCO_ALREADY_EXISTS%>"] = "<bean:message key="bo.mco.already.exist"/>"; 129 130 new interfaceBOMco( ${requestNumber}, ${jSonRequests}, ${jSonRequestStates}, ${jSonRequestTypes} ); 115 new interfaceBODataInsertion( ${datasetNumber}, ${jSonDatasets} ); 131 116 </script> 132 117 -
ether_megapoli/trunk/web/resources/css/backoffice.css
r463 r475 73 73 /** ************************ OTHER ********************** **/ 74 74 /** ***************************************************** **/ 75 #loadingForUser, #loadingForWaitingUser, #loadingForRequest {75 #loadingForUser, #loadingForWaitingUser, #loadingForRequest, #loadingForDataset { 76 76 margin: auto; 77 77 } … … 81 81 font-weight: bold; 82 82 } 83 84 #button_move { 85 float: right; 86 margin-right: 11px; 87 } -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r473 r475 630 630 bo.other=Other 631 631 632 bo.step=step 632 633 bo.data.insertion=Data insertion 633 634 bo.dataset.remove=Dataset remove 634 635 bo.dataset.list=List of datasets 635 636 bo.name=Name 637 bo.file.move=Move files from download directory to upload directory 638 bo.noDataset=No dataset 639 bo.dataset.remove.confirm=Do you really want to remove the dataset 640 bo.move=Move -
ether_megapoli/trunk/web/src/com/ether/ControllerBackoffice.java
r474 r475 76 76 throws WebException 77 77 { 78 return sort DataSet( "jeuId", null, 5, 1 );78 return sortJeu( "jeuId", null, 5, 1 ); 79 79 } 80 80 … … 439 439 */ 440 440 @ControllerMethod(jsonResult = true) 441 public JSONObject sort DataSet( @NotNull @ParamName("sort") final String sort,442 443 444 441 public JSONObject sortJeu( @NotNull @ParamName("sort") final String sort, 442 @Nullable @ParamName("searchText") final String searchText, 443 @ParamName(ParameterConstants.PARAMETER_MAX_RESULTS) final Integer maxResults, 444 @ParamName(ParameterConstants.PARAMETER_PAGE) final Integer page ) 445 445 throws WebException 446 446 { … … 449 449 final JeuFilter filter = new JeuFilter( sort, searchText, maxResults, page ); 450 450 451 final PaginatedResult<Jeu> datasets = getEtherService().search Datasets( filter );451 final PaginatedResult<Jeu> datasets = getEtherService().searchJeux( filter ); 452 452 453 453 final JSONObject result = new JSONObject(); … … 459 459 { 460 460 throw new WebException( WebException.WebCode.ERROR_NO_REQUEST_FOUND, e ); 461 } 462 } 463 464 @ControllerMethod() 465 public void removeJeu( @NotNull @ParamName(ParameterConstants.PARAMETER_ID) final Integer jeuId ) 466 throws WebException 467 { 468 try 469 { 470 getEtherService().removeJeuById( jeuId ); 471 } 472 catch( ServiceException e ) 473 { 474 throw new WebException( WebException.WebCode.ERROR_NO_JEU_FOUND, e ); 475 } 476 } 477 478 @ControllerMethod() 479 public void moveJeu( @NotNull @ParamName(ParameterConstants.PARAMETER_ID) final Integer jeuId ) 480 throws WebException 481 { 482 try 483 { 484 final Jeu jeu = getEtherService().getJeuById( jeuId ); 485 final String downloadDirectory = (String) getServletContext().getAttribute( "accessDir" ); 486 final String uploadDirectory = (String) getServletContext().getAttribute( "uploadDir" ); 487 getEtherService().moveFilesFromDownloadToUpload( jeu, downloadDirectory, uploadDirectory ); 488 } 489 catch( ServiceException e ) 490 { 491 throw new WebException( WebException.WebCode.ERROR_NO_JEU_FOUND, e ); 461 492 } 462 493 } -
ether_megapoli/trunk/web/src/com/ether/WebException.java
r463 r475 49 49 MCO_ALREADY_EXISTS, 50 50 ERROR_NO_USER_FOUND, 51 ERROR_NO_REQUEST_FOUND 51 ERROR_NO_REQUEST_FOUND, 52 ERROR_NO_JEU_FOUND 52 53 } 53 54 -
ether_megapoli/trunk/web/src/json/serializers/JeuJsonSerializer.java
r474 r475 15 15 serialize( result, "name", jeu.getJeuNom(), jsonConfig ); 16 16 serialize( result, "creationDate", jeu.getJeuDateinser(), jsonConfig ); 17 if( null != jeu.getCategorie() ) 18 serialize( result, "categoryName", jeu.getCategorie().getCategorieNom(), jsonConfig ); 17 19 18 20 return result;
Note: See TracChangeset
for help on using the changeset viewer.