Changeset 476


Ignore:
Timestamp:
04/12/12 17:26:45 (12 years ago)
Author:
vmipsl
Message:

BO insertion données _ move files

Location:
ether_megapoli/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/persistence/implementation/com/ether/dao/JeuDAOImpl.java

    r474 r476  
    3030 
    3131        if( !isForCount ) 
    32             criteria.addOrder( Order.asc( filter.getSort() ) ); 
     32            if( !"categorieName".equals( filter.getSort() ) ) 
     33                criteria.addOrder( Order.asc( filter.getSort() ) ); 
     34            else 
     35            { 
     36                criteria.createCriteria( "categorie", "categorie" ); 
     37                criteria.addOrder( Order.asc( "categorie.categorieNom" ) ); 
     38            } 
    3339        return criteria; 
    3440    } 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java

    r475 r476  
    557557     * @param uploadDirectory 
    558558     */ 
    559     public void moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 
     559    public boolean moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 
    560560            throws ServiceException 
    561561    { 
     
    566566        final String uploadFilesPath = uploadDirectory + File.separatorChar + jeu.getCategorie().getCategorieNom() + File.separatorChar + jeu.getJeuNom(); 
    567567 
    568         final boolean success = EtherHelper.moveFiles( downloadFilesPath, uploadFilesPath ); 
    569         if( !success ) 
    570         { 
    571             // File was not successfully moved 
    572         } 
    573         final String bob = "bib"; 
     568        return EtherHelper.moveFiles( downloadFilesPath, uploadFilesPath ); 
    574569    } 
    575570 
  • ether_megapoli/trunk/service/interface/com/ether/EtherService.java

    r475 r476  
    144144            throws ServiceException; 
    145145 
    146     void moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 
     146    boolean moveFilesFromDownloadToUpload( @NotNull final Jeu jeu, @NotNull final String downloadDirectory, @NotNull final String uploadDirectory ) 
    147147            throws ServiceException; 
    148148} 
  • ether_megapoli/trunk/web/backoffice/dataInsertion-script.jsp

    r475 r476  
    9797        tdId.html( dataset.id ); 
    9898        tr.append( tdId ); 
     99        var tdCategory = $( document.createElement( "td" ) ); 
     100        tdCategory.html( dataset.categoryName ); 
     101        tr.append( tdCategory ); 
    99102        var tdName = $( document.createElement( "td" ) ); 
    100103        tdName.html( dataset.name ); 
     
    149152        this.selectSorts = new Select( paramSelect ); 
    150153        this.selectSorts.add( "jeuId", interfaceTexts["bo.id"] ); 
     154        this.selectSorts.add( "categorieName", interfaceTexts["bo.category"] ); 
    151155        this.selectSorts.add( "jeuNom", interfaceTexts["bo.name"] ); 
    152156        this.selectSorts.add( "jeuDateinser", interfaceTexts["bo.user.creationDate"] ); 
     
    218222        if( text ) 
    219223            context.containerErrors.html( interfaceTexts[result.responseText] + " " + text ); 
     224        else if( interfaceTexts[result.responseText] ) 
     225            context.containerErrors.html( interfaceTexts[result.responseText] ); 
    220226        else 
    221             context.containerErrors.html( interfaceTexts[result.responseText] ); 
     227            context.containerErrors.html( result.responseText ); 
    222228    }, 
    223229 
  • ether_megapoli/trunk/web/backoffice/dataInsertion.jsp

    r475 r476  
    1 <%@ page import="com.ether.WebException" %> 
    2 <%@ page import="com.ether.mco.McoState" %> 
    3 <%@ page import="com.ether.mco.McoType" %> 
    41<%@ page language="java" contentType="text/html; charset=UTF-8" %> 
    52<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 
     
    6259                <tr> 
    6360                    <th><bean:message key="bo.id"/></th> 
     61                    <th><bean:message key="bo.category"/></th> 
    6462                    <th><bean:message key="bo.name"/></th> 
    6563                    <th><bean:message key="bo.user.creationDate"/></th> 
     
    9088        <div class="title2">2nd <bean:message key="bo.step"/>. <bean:message key="bo.file.move"/> :</div> 
    9189        <BR/> 
     90 
    9291        <div id="containerFilesMove"></div> 
    9392        <div id="resultFilesMove"></div> 
     
    107106            interfaceTexts["bo.dataset.remove.confirm"] = '<bean:message key="bo.dataset.remove.confirm"/>'; 
    108107            interfaceTexts["bo.id"] = '<bean:message key="bo.id"/>'; 
     108            interfaceTexts["bo.category"] = '<bean:message key="bo.category"/>'; 
    109109            interfaceTexts["bo.name"] = '<bean:message key="bo.name"/>'; 
    110110            interfaceTexts["bo.user.creationDate"] = '<bean:message key="bo.user.creationDate"/>'; 
  • ether_megapoli/trunk/web/src/ApplicationResources_en.properties

    r475 r476  
    635635bo.dataset.list=List of datasets 
    636636bo.name=Name 
     637bo.category=Category 
    637638bo.file.move=Move files from download directory to upload directory 
    638639bo.noDataset=No dataset 
  • ether_megapoli/trunk/web/src/com/ether/ControllerBackoffice.java

    r475 r476  
    476476    } 
    477477 
    478     @ControllerMethod() 
    479     public void moveJeu( @NotNull @ParamName(ParameterConstants.PARAMETER_ID) final Integer jeuId ) 
     478    @ControllerMethod(jsonResult = true) 
     479    public JSONObject moveJeu( @NotNull @ParamName(ParameterConstants.PARAMETER_ID) final Integer jeuId ) 
    480480            throws WebException 
    481481    { 
     
    485485            final String downloadDirectory = (String) getServletContext().getAttribute( "accessDir" ); 
    486486            final String uploadDirectory = (String) getServletContext().getAttribute( "uploadDir" ); 
    487             getEtherService().moveFilesFromDownloadToUpload( jeu, downloadDirectory, uploadDirectory ); 
     487            final boolean success = getEtherService().moveFilesFromDownloadToUpload( jeu, downloadDirectory, uploadDirectory ); 
     488 
     489            final JSONObject result = new JSONObject(); 
     490            result.put( "success", success ); 
     491            return result; 
    488492        } 
    489493        catch( ServiceException e ) 
  • ether_megapoli/trunk/web/src/com/ether/ControllerEther.java

    r306 r476  
    164164        response.setStatus( WebHelper.STATUS_CODE_SERVICE_EXCEPTION ); 
    165165 
    166         if( exception.getCause().equals( WebException.getExceptionThrowable() ) ) 
     166        if( null != exception.getCause() && exception.getCause().equals( WebException.getExceptionThrowable() ) ) 
    167167            WebHelper.writeJsonToResponse( response, exception.getLocalizedMessage() ); 
    168168        else 
Note: See TracChangeset for help on using the changeset viewer.