Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5456

Show
Ignore:
Timestamp:
09/07/08 19:03:06 (3 months ago)
Author:
bwolfe
Message:

remoteformentrymodule: fixed pending queue items not being deleted upon return of data

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/remoteformentry/metadata/config.xml

    r5128 r5456  
    77        <id>remoteformentry</id> 
    88        <name>Remote FormEntry</name> 
    9         <version>1.9</version> 
     9        <version>2.0</version> 
    1010        <package>org.openmrs.module.@MODULE_ID@</package> 
    1111        <author>Ben Wolfe</author> 
  • openmrs-modules/remoteformentry/src/org/openmrs/module/remoteformentry/impl/RemoteFormEntryServiceImpl.java

    r5128 r5456  
    4949import org.openmrs.scheduler.TaskDefinition; 
    5050import org.openmrs.util.OpenmrsUtil; 
     51import org.openmrs.web.WebUtil; 
    5152import org.w3c.dom.Document; 
    5253 
     
    8687                RemoteFormEntryPendingQueue pendingQueue) { 
    8788                File queueDir = RemoteFormEntryUtil.getPendingQueueDir(); 
    88  
    89                 File outFile = OpenmrsUtil.getOutFile(queueDir, 
    90                                                         null, 
    91                                                         pendingQueue.getCreator()); 
     89                 
     90                String fileSystemUrl = pendingQueue.getFileSystemUrl(); 
     91                 
     92                File outFile = null; 
     93                 
     94                if (fileSystemUrl != null) { 
     95                        // get just the file name out of the full path 
     96                        String filename = WebUtil.stripFilename(fileSystemUrl); 
     97                        // create the file with the same name as the filename in the current pending queue's url 
     98                        outFile = new File(queueDir, filename); 
     99                } 
     100                else  
     101                        outFile = OpenmrsUtil.getOutFile(queueDir, 
     102                                                     null, 
     103                                                     pendingQueue.getCreator()); 
    92104 
    93105                // write the queue's data to the file 
     
    547559                                for (RemoteFormEntryPendingQueue queue : pendingQueueItems) { 
    548560                                        // if this filename matches the pending queue filename 
    549                                         if (queue.getFileSystemUrl().equals(filename)) { 
     561                                        String fileSystemUrl = queue.getFileSystemUrl(); 
     562                                        String fileSystemName = WebUtil.stripFilename(fileSystemUrl); 
     563                                        if (fileSystemName.equals(filename)) { 
    550564                                                // create and save formentry archive 
    551565                                                FormEntryArchive archive = new FormEntryArchive(); 
     
    574588                // change the extension to 'ack' 
    575589                String filename = filenames.get(0); 
    576                 Integer period = filename.lastIndexOf("0"); 
     590                Integer period = filename.lastIndexOf("."); 
    577591                if (period != -1) 
    578592                        filename = filename.substring(0, period) + ".ack"; 
  • openmrs-modules/remoteformentry/web/module/generateReturnDataForm.jsp

    r2718 r5456  
    1 i<%@ include file="/WEB-INF/template/include.jsp"%> 
     1<%@ include file="/WEB-INF/template/include.jsp"%> 
    22 
    33<openmrs:require privilege="Remote Form Entry Return To Remote" otherwise="/login.htm" redirect="/module/remoteformentry/generateReturnData.form" /> 
  • openmrs-modules/remoteformentry/web/module/returnDataToRemoteForm.jsp

    r2443 r5456  
    1 i<%@ include file="/WEB-INF/template/include.jsp"%> 
     1<%@ include file="/WEB-INF/template/include.jsp"%> 
    22 
    33<openmrs:require privilege="Remote Form Entry Return To Remote" otherwise="/login.htm" redirect="/module/remoteformentry/returnDataToRemote.form" /> 
  • openmrs-modules/remoteformentry/web/src/org/openmrs/module/remoteformentry/web/QueueDownloadServlet.java

    r5087 r5456  
    172172                                pendingQueue.setCreator(queueItem.getCreator()); 
    173173                                pendingQueue.setDateCreated(queueItem.getDateCreated()); 
     174                                pendingQueue.setFileSystemUrl(queueItem.getFileSystemUrl()); // so that when creating it, it uses the same filename as was passed to central 
    174175                                remoteService.createRemoteFormEntryPendingQueue(pendingQueue); 
    175176                                log.debug("Done creating remote pending queue item: " + pendingQueue.getFileSystemUrl());