Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(284) |
Dec
(252) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(374) |
Feb
(326) |
Mar
(161) |
Apr
(129) |
May
(293) |
Jun
(297) |
Jul
(324) |
Aug
(515) |
Sep
(376) |
Oct
(407) |
Nov
(294) |
Dec
(172) |
2003 |
Jan
(487) |
Feb
(422) |
Mar
(244) |
Apr
(284) |
May
(347) |
Jun
(317) |
Jul
(298) |
Aug
(299) |
Sep
(249) |
Oct
(384) |
Nov
(207) |
Dec
(264) |
2004 |
Jan
(201) |
Feb
(490) |
Mar
(202) |
Apr
(705) |
May
(358) |
Jun
(188) |
Jul
(157) |
Aug
(215) |
Sep
(168) |
Oct
(266) |
Nov
(280) |
Dec
(142) |
2005 |
Jan
(403) |
Feb
(541) |
Mar
(231) |
Apr
(168) |
May
(179) |
Jun
(42) |
Jul
(105) |
Aug
(72) |
Sep
(304) |
Oct
(231) |
Nov
(166) |
Dec
(178) |
2006 |
Jan
(137) |
Feb
(98) |
Mar
(148) |
Apr
(5) |
May
(3) |
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
(5) |
Oct
(29) |
Nov
(12) |
Dec
(7) |
2007 |
Jan
(14) |
Feb
(41) |
Mar
(10) |
Apr
(7) |
May
(1) |
Jun
(8) |
Jul
(8) |
Aug
(6) |
Sep
(2) |
Oct
(2) |
Nov
(3) |
Dec
(2) |
2008 |
Jan
(1) |
Feb
(5) |
Mar
(2) |
Apr
(17) |
May
(13) |
Jun
(16) |
Jul
(24) |
Aug
(7) |
Sep
(18) |
Oct
(22) |
Nov
(37) |
Dec
(32) |
2009 |
Jan
(11) |
Feb
(13) |
Mar
(17) |
Apr
(36) |
May
(40) |
Jun
(92) |
Jul
(66) |
Aug
(23) |
Sep
(31) |
Oct
(34) |
Nov
(13) |
Dec
(19) |
2010 |
Jan
(9) |
Feb
(6) |
Mar
(65) |
Apr
(55) |
May
(63) |
Jun
(76) |
Jul
(31) |
Aug
(52) |
Sep
(21) |
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(6) |
2
|
3
|
4
|
5
(1) |
6
(6) |
7
(1) |
8
(12) |
9
|
10
|
11
(1) |
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
(1) |
20
|
21
|
22
(1) |
23
|
24
|
25
|
26
(11) |
27
(1) |
28
|
|
|
|
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 16:59:52
|
Update of /cvsroot/compiere/serverApps/src/main/servlet/org/compiere/wstore In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28517/src/main/servlet/org/compiere/wstore Modified Files: Tag: pbs_payment SiteEnv.java Log Message: Index: SiteEnv.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/servlet/org/compiere/wstore/Attic/SiteEnv.java,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** SiteEnv.java 26 Feb 2005 23:45:13 -0000 1.1.2.14 --- SiteEnv.java 6 Feb 2007 16:59:39 -0000 1.1.2.15 *************** *** 133,137 **** // Finish ! session.setMaxInactiveInterval(1800); // 30 Min HARDCODED String info = (String)ctx.get(HDR_INFOMESSAGE); if (info != null) --- 133,137 ---- // Finish ! //session.setMaxInactiveInterval(1800); // 30 Min HARDCODED String info = (String)ctx.get(HDR_INFOMESSAGE); if (info != null) |
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 14:19:24
|
Update of /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3957/src/main/applet/org/compiere/ifm/filetransfer/monitor Modified Files: Tag: pbs_payment FileCommander.java Log Message: Index: FileCommander.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/FileCommander.java,v retrieving revision 1.1.2.37 retrieving revision 1.1.2.38 diff -C2 -d -r1.1.2.37 -r1.1.2.38 *** FileCommander.java 6 Feb 2007 09:35:45 -0000 1.1.2.37 --- FileCommander.java 6 Feb 2007 14:19:21 -0000 1.1.2.38 *************** *** 546,551 **** //It seems soffice unlocks the file for a short moment when saving so just to make sure we try again!! long lockstart=System.currentTimeMillis(); ! Log.info(tmpFile.getName() + ": looping for up to 3 secs checking lock again!"); ! while(unlockFile && System.currentTimeMillis()<lockstart+3000){ Thread.sleep(500); unlockFile=!isFileLocked(tmpFile); --- 546,552 ---- //It seems soffice unlocks the file for a short moment when saving so just to make sure we try again!! long lockstart=System.currentTimeMillis(); ! Log.info(tmpFile.getName() + ": looping for up to 1,5 secs checking lock again!"); ! ! while(unlockFile && System.currentTimeMillis()<lockstart+1500){ Thread.sleep(500); unlockFile=!isFileLocked(tmpFile); |
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 14:02:42
|
Update of /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29895/src/main/applet/org/compiere/ifm/filetransfer/monitor Modified Files: Tag: pbs_payment FileMonitorDaemon.java Log Message: Index: FileMonitorDaemon.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/FileMonitorDaemon.java,v retrieving revision 1.1.2.21 retrieving revision 1.1.2.22 diff -C2 -d -r1.1.2.21 -r1.1.2.22 *** FileMonitorDaemon.java 6 Feb 2007 09:35:45 -0000 1.1.2.21 --- FileMonitorDaemon.java 6 Feb 2007 14:02:34 -0000 1.1.2.22 *************** *** 283,287 **** /** ! * Scan driectory for new files to monitor */ protected void scanForUnmonitoredFilesToBackup() { --- 283,287 ---- /** ! * Scan unmonitored files to be deleted */ protected void scanForUnmonitoredFilesToBackup() { *************** *** 298,302 **** for (int i = 0; i < files.length; i++) { ! if (!isFileAlreadyMonitored(files[i].getAbsolutePath()) && !files[i].getAbsolutePath().endsWith("tmp")){ if (potentiallyUnmonitoredFilesToBeBackedUp.get(files[i].getAbsoluteFile())==null){ //The file was not on the list of suspect files. For now we just add it to the list. Next time it will be deleted --- 298,303 ---- for (int i = 0; i < files.length; i++) { ! if (!isFileAlreadyMonitored(files[i].getAbsolutePath()) && ! !(files[i].getAbsolutePath().endsWith("tmp") || files[i].getAbsolutePath().startsWith("L_DATA"))){ if (potentiallyUnmonitoredFilesToBeBackedUp.get(files[i].getAbsoluteFile())==null){ //The file was not on the list of suspect files. For now we just add it to the list. Next time it will be deleted |
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 09:36:22
|
Update of /cvsroot/compiere/extend/src/com/compiere/PharmaNord In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28692/src/com/compiere/PharmaNord Modified Files: Tag: pbs_payment IFM_Accces.java Log Message: Index: IFM_Accces.java =================================================================== RCS file: /cvsroot/compiere/extend/src/com/compiere/PharmaNord/Attic/IFM_Accces.java,v retrieving revision 1.1.2.42 retrieving revision 1.1.2.43 diff -C2 -d -r1.1.2.42 -r1.1.2.43 *** IFM_Accces.java 29 Jan 2007 08:19:04 -0000 1.1.2.42 --- IFM_Accces.java 6 Feb 2007 09:36:14 -0000 1.1.2.43 *************** *** 1810,1813 **** --- 1810,1822 ---- } sql+=" WHERE IFM_LETTER_ID = ?"; + + if (!newLock){ + /* + * Make sure we so not update the lostlockvalidation time if the EDITEDBYUSER_ID field is not set + * This will cause all sorts of problems!! + */ + sql+=" AND EDITEDBYUSER_ID>0"; + } + ps = DB.prepareStatement(sql); int pos = 1; |
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 09:35:54
|
Update of /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28297/src/main/applet/org/compiere/ifm/filetransfer Modified Files: Tag: pbs_payment DownloadStatusFrame.java Log Message: Index: DownloadStatusFrame.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/Attic/DownloadStatusFrame.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** DownloadStatusFrame.java 25 Oct 2005 06:34:54 -0000 1.1.2.6 --- DownloadStatusFrame.java 6 Feb 2007 09:35:45 -0000 1.1.2.7 *************** *** 53,57 **** setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE); ! setTitle("IFM File downloading"); uploadPanel.setLayout(new java.awt.GridBagLayout()); --- 53,57 ---- setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE); ! setTitle("IFM File downloading!!"); uploadPanel.setLayout(new java.awt.GridBagLayout()); *************** *** 68,72 **** //uploadPanel.add(jProgressBar1, gridBagConstraints); ! waitMessage.setText("Please wait ..."); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; --- 68,72 ---- //uploadPanel.add(jProgressBar1, gridBagConstraints); ! waitMessage.setText("Please wait a moment..."); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; *************** *** 139,143 **** public void run() { infoMessage ! .setText("Downloading file ... "); errors.removeAll(); uploadPanel.setVisible(true); --- 139,143 ---- public void run() { infoMessage ! .setText("Downloading file ... "); errors.removeAll(); uploadPanel.setVisible(true); |
From: Jacob Pedersen <jpedersen@us...> - 2007-02-06 09:35:54
|
Update of /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28297/src/main/applet/org/compiere/ifm/filetransfer/monitor Modified Files: Tag: pbs_payment FileMonitorDaemon.java UserInterface.java FileCommander.java UploadStatusFrame.java Log Message: Index: FileMonitorDaemon.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/FileMonitorDaemon.java,v retrieving revision 1.1.2.20 retrieving revision 1.1.2.21 diff -C2 -d -r1.1.2.20 -r1.1.2.21 *** FileMonitorDaemon.java 1 Feb 2007 08:32:46 -0000 1.1.2.20 --- FileMonitorDaemon.java 6 Feb 2007 09:35:45 -0000 1.1.2.21 *************** *** 11,14 **** --- 11,15 ---- import java.net.UnknownHostException; import java.nio.channels.FileLock; + import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; *************** *** 20,23 **** --- 21,25 ---- import javax.swing.JOptionPane; + import org.apache.tools.ant.taskdefs.condition.IsFalse; import org.compiere.ifm.filetransfer.FileTransferApplet; import org.compiere.ifm.filetransfer.Log; *************** *** 50,53 **** --- 52,57 ---- UserInterface ui = null; + private HashMap potentiallyUnmonitoredFilesToBeBackedUp = new HashMap(); + public static void main(String a[]) { if (a!=null){ *************** *** 57,61 **** --- 61,70 ---- } + //We import the file specified + String importStatus = ""; + FileMonitorDaemon daemon = new FileMonitorDaemon(); + boolean showUI = false; + String debugPort = System.getProperty("DEBUGPORT"); *************** *** 69,80 **** } ! JOptionPane.showMessageDialog(null, "Now connect your debugger tool to " + localhost + ":" + debugPort , "Debugging mode", JOptionPane.INFORMATION_MESSAGE, null); } ! //We import the file specified ! String importStatus = ""; ! FileMonitorDaemon daemon = new FileMonitorDaemon(); ! boolean showUI = false; if (a!=null && a.length>0){ importStatus = FileMonitorDaemon.importFile(a[0]); --- 78,86 ---- } ! JOptionPane.showMessageDialog(null, "Now connect debugger tool to " + localhost + ":" + debugPort + "\nAnother Daemon running=" + !daemon.isFirstInstance() , "Debugging mode", JOptionPane.INFORMATION_MESSAGE, null); } ! if (a!=null && a.length>0){ importStatus = FileMonitorDaemon.importFile(a[0]); *************** *** 142,145 **** --- 148,152 ---- scanForFileChanges(); getMessages(); + scanForUnmonitoredFilesToBackup(); Thread.sleep(3000); scanForNewFiles(); *************** *** 214,221 **** */ private void scanForFileChanges() { Iterator filesIter = monitoredFiles.values().iterator(); while (filesIter.hasNext()) { try { ! MonitoredFileInfo file = (MonitoredFileInfo) filesIter.next(); FileCommander.checkFile(file, monitoredFiles, getUploadStatusFrame(), this); --- 221,230 ---- */ private void scanForFileChanges() { + Log.info("Scanning for file changes..."); Iterator filesIter = monitoredFiles.values().iterator(); while (filesIter.hasNext()) { try { ! MonitoredFileInfo file = (MonitoredFileInfo) filesIter.next(); ! Log.info("Checking " + file.getDocumentFileName() + ", last modified:" + file.getLastModified()); FileCommander.checkFile(file, monitoredFiles, getUploadStatusFrame(), this); *************** *** 255,262 **** */ protected void scanForNewFiles() { ! String filesDir = getIFMFilesDir(); ! Log.info("Scanning " + filesDir + " for new files..."); File dir = new File(filesDir); String[] files = dir.list(); for (int i = 0; i < files.length; i++) { String fileName = files[i]; --- 264,271 ---- */ protected void scanForNewFiles() { ! String filesDir = getIFMFilesDir(); File dir = new File(filesDir); String[] files = dir.list(); + Log.info("Scanning " + filesDir + " for new files... (looping through " + files.length + " files)"); for (int i = 0; i < files.length; i++) { String fileName = files[i]; *************** *** 264,268 **** if (fileName.endsWith(".properties") ! && !monitoredFiles.containsKey(fileName)) { enquequeFile(fileName); } --- 273,278 ---- if (fileName.endsWith(".properties") ! && !monitoredFiles.containsKey(fileName)) { ! Log.info("Checking in file " + fileName); enquequeFile(fileName); } *************** *** 270,273 **** --- 280,317 ---- } + + + /** + * Scan driectory for new files to monitor + */ + protected void scanForUnmonitoredFilesToBackup() { + String filesDir = getIFMFilesDir(); + File dir = new File(filesDir); + File[] files = dir.listFiles(); + for (int i = 0; i < files.length; i++) { + if (files[i].getAbsolutePath().endsWith("properties")){ + return; //Dont move anything if a propertyfile exists, since there is probably a file about to be checked in + } + } + + + for (int i = 0; i < files.length; i++) { + + if (!isFileAlreadyMonitored(files[i].getAbsolutePath()) && !files[i].getAbsolutePath().endsWith("tmp")){ + if (potentiallyUnmonitoredFilesToBeBackedUp.get(files[i].getAbsoluteFile())==null){ + //The file was not on the list of suspect files. For now we just add it to the list. Next time it will be deleted + potentiallyUnmonitoredFilesToBeBackedUp.put(files[i].getAbsoluteFile(), files[i].getAbsoluteFile()); + } else { + //The file was previously added to the suspect list - now we move it to the backup directory + Log.info("Backing up file " + files[i].getAbsolutePath() + " since it was not being monitored"); + FileCommander.backupFile(files[i]); + } + + } + + } + + } + /** *************** *** 279,288 **** MonitoredFileInfo file = null; try { ! file = MonitoredFileInfo.load(fileName); if (!file.isImportOnly()){ Log.info("Opening " + file.getDocumentFileName() + "(" + file.getDesc() + ") using " + file.getCommand()); FileCommander.openFile(file); } if(!file.isOpenOnly()&&!file.isReadOnly()){ Log.info("Starting to monitor " + file.getDocumentFileName() --- 323,353 ---- MonitoredFileInfo file = null; try { ! file = MonitoredFileInfo.load(fileName); ! ! if (isFileAlreadyMonitored(file.getDocumentFileName())){ ! Log.info("The file " + file.getDesc()+ " is already monitored and is being ignored"); ! new File(file.getPropertiesFileName()).delete(); ! return; ! } ! ! ! ! if (!file.isImportOnly()){ Log.info("Opening " + file.getDocumentFileName() + "(" + file.getDesc() + ") using " + file.getCommand()); + + /* + * Check if the file to open actually exixts + */ + + if (!new File(file.getDocumentFileName()).exists()){ + JOptionPane.showMessageDialog(null, "The file " + file.getDocumentFileName() + " does not exist in your local folder.\nTry opening it again from the server\nThis error most likely occurred because you tried to re-open the file before it was saved on the server.", "File Monitor Deamon", JOptionPane.INFORMATION_MESSAGE); + new File(file.getPropertiesFileName()).delete(); + return; + } FileCommander.openFile(file); } + if(!file.isOpenOnly()&&!file.isReadOnly()){ Log.info("Starting to monitor " + file.getDocumentFileName() *************** *** 325,328 **** --- 390,394 ---- uploadStatus.markExit(); } else { + Log.info("Daemon is exiting normally via FileMonitorDaemon"); System.exit(0); } *************** *** 337,341 **** * @return */ ! public boolean isFirstInstance() { String fileName = System.getProperty("user.home") + File.separator + ".ifm" + File.separator + "ifm.lock"; --- 403,407 ---- * @return */ ! public static boolean isFirstInstance() { String fileName = System.getProperty("user.home") + File.separator + ".ifm" + File.separator + "ifm.lock"; *************** *** 451,453 **** --- 517,538 ---- return retValue; } + + + private boolean isFileAlreadyMonitored(String fileName) + { + if (fileName==null) + return false; + + Iterator filesIter = monitoredFiles.values().iterator(); + while (filesIter.hasNext()) { + MonitoredFileInfo file = (MonitoredFileInfo) filesIter.next(); + if (fileName.equals(file.getDocumentFileName())) + return true; + } + + return false; + + + }//isFileAlreadyMonitored + } \ No newline at end of file Index: UserInterface.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/UserInterface.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** UserInterface.java 25 Oct 2005 06:34:55 -0000 1.1.2.7 --- UserInterface.java 6 Feb 2007 09:35:45 -0000 1.1.2.8 *************** *** 762,765 **** --- 762,766 ---- doLogout(); } else if (e.getSource().equals(killButton)){ + Log.info("Daemon is exiting normally via Userinterface.actionPerformed"); System.exit(0); } *************** *** 1252,1255 **** --- 1253,1257 ---- public void windowClosing(WindowEvent e) { if (!isMonitorActive()){ + Log.info("Daemon is exiting normally via UserInterface.windowClosing"); System.exit(0); } else if (m_currentPromptFile!=null){ Index: FileCommander.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/FileCommander.java,v retrieving revision 1.1.2.36 retrieving revision 1.1.2.37 diff -C2 -d -r1.1.2.36 -r1.1.2.37 *** FileCommander.java 1 Feb 2007 08:32:46 -0000 1.1.2.36 --- FileCommander.java 6 Feb 2007 09:35:45 -0000 1.1.2.37 *************** *** 16,19 **** --- 16,20 ---- import java.net.UnknownHostException; import java.nio.channels.FileLock; + import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; *************** *** 23,27 **** --- 24,30 ---- import java.util.Random; + import javax.swing.JFrame; import javax.swing.JOptionPane; + import javax.swing.SwingUtilities; import org.compiere.ifm.filetransfer.FileTransferApplet; *************** *** 107,110 **** --- 110,114 ---- private static void uploadIfNecessery(MonitoredFileInfo file, boolean unlock, UploadStatusFrame uploadStatus) throws Exception { + Log.info(file.getDocumentFileName() + ": checking if it is time to upload"); boolean upload = false; int serverResponse; *************** *** 122,136 **** } if (file.getLastModified() < tmpFile.lastModified() || unlock) { ! uploadStatus.startFile(tmpFile); //file was alredy send in its current form but so want to unlock if (file.getLastModified() >= tmpFile.lastModified()) { uploadURL += "&noUpload=true"; doGet(uploadURL,file.getCookies()); //unlock only; } else { serverResponse = HttpFileTransfer.sendFileViaHttp(tmpFile, uploadURL, file.getCookies(), uploadStatus); if (serverResponse == HttpURLConnection.HTTP_CONFLICT) { throw new Exception("File is already locked by another user"); } --- 126,143 ---- } if (file.getLastModified() < tmpFile.lastModified() || unlock) { ! Log.info(file.getDocumentFileName() + ": Yes it is time to upload: unlock=" + unlock + ", previously lastmodified=" + file.getLastModified() + ", currently last modified=" + tmpFile.lastModified() ); uploadStatus.startFile(tmpFile); //file was alredy send in its current form but so want to unlock if (file.getLastModified() >= tmpFile.lastModified()) { + Log.info(file.getDocumentFileName() + ": file was already uploaded - just unlocking on server"); uploadURL += "&noUpload=true"; doGet(uploadURL,file.getCookies()); //unlock only; } else { + Log.info(file.getDocumentFileName() + ": uploading..."); serverResponse = HttpFileTransfer.sendFileViaHttp(tmpFile, uploadURL, file.getCookies(), uploadStatus); if (serverResponse == HttpURLConnection.HTTP_CONFLICT) { + Log.info(file.getDocumentFileName() + ": Error - File is already locked by another user "); throw new Exception("File is already locked by another user"); } *************** *** 181,185 **** } //create file in temp dir ! //download file HttpFileTransfer transferer = new HttpFileTransfer(); --- 188,192 ---- } //create file in temp dir ! //download file HttpFileTransfer transferer = new HttpFileTransfer(); *************** *** 188,196 **** int result = transferer.getFileFromURL(downloadURL+ file.getDownloadURLParams(), tmpFile,file.getCookies()); String filename = transferer.getFileName(); ! //if(transferer.isReadOnly()){ //add timestamp to avoid duplicates ! // int pos = filename.indexOf('.'); ! // filename=filename.substring(0,pos)+"_"+new Date().getTime()+filename.substring(pos); ! //} ! if(!ensureNotOpen(tmpFile,new File(FileMonitorDaemon.getIFMFilesDir(),filename))){ return false; } --- 195,232 ---- int result = transferer.getFileFromURL(downloadURL+ file.getDownloadURLParams(), tmpFile,file.getCookies()); String filename = transferer.getFileName(); ! File fileToCheckExistanceOf = new File(FileMonitorDaemon.getIFMFilesDir(), filename); ! ! //Check if the file already exists in the users local directory and give time for it to be uploaded before requesting it ! ! if (fileToCheckExistanceOf.exists() && !isFileLocked(fileToCheckExistanceOf)){ ! Log.info("The file " + filename + " currently being downloaded already exists in the users local directory and it not locked. Waiting for 5 seconds and then trying again!"); ! try { ! Log.info("Sleeping for 5 seconds waiting for file to be unlocked"); ! Thread.sleep(5000); ! Log.info("Done waiting"); ! } catch (InterruptedException e) { ! ! } ! ! ! if(fileToCheckExistanceOf.exists() && !isFileLocked(fileToCheckExistanceOf)){ ! //The file still exists even after giving 5 seconds - we back it up ! JOptionPane.showMessageDialog(null, "File already exists in your user directory\nThe system will make a backup copy.\nPlease call the IT department if the file you are currently opening does not contain the expected data\nThey will be able to restore your data", "File Monitor Daemon", JOptionPane.INFORMATION_MESSAGE); ! backupFile(new File(FileMonitorDaemon.getIFMFilesDir(), filename)); ! } else if (!isFileLocked(fileToCheckExistanceOf)) { ! //It seems the file was in the process of being uploaded - we download a fresh version ! //JOptionPane.showMessageDialog(null,"Redownloading"); ! result = transferer.getFileFromURL(downloadURL+ file.getDownloadURLParams(), tmpFile,file.getCookies()); ! filename = transferer.getFileName(); ! } ! ! ! }// ! ! ! ! ! ! if(!ensureNotOpen(tmpFile,new File(FileMonitorDaemon.getIFMFilesDir(), filename))){ return false; } *************** *** 241,249 **** */ private static boolean ensureNotOpen(File tmpFile, File file) { ! boolean result; if(isFileLocked(file)){ SwingRunner.invoke(new Runnable(){ public void run(){ ! JOptionPane.showMessageDialog(null, "Can not open file. File is already open." , "Error", JOptionPane.ERROR_MESSAGE); } --- 277,285 ---- */ private static boolean ensureNotOpen(File tmpFile, File file) { ! boolean result=true; if(isFileLocked(file)){ SwingRunner.invoke(new Runnable(){ public void run(){ ! JOptionPane.showMessageDialog(null, "Can not open file. File is already open!!" , "Error", JOptionPane.ERROR_MESSAGE); } *************** *** 251,263 **** result = false; ! }else{ ! //if(file.exists()){ ! // int answer = JOptionPane.showConfirmDialog(null, "File "+file.getAbsolutePath()+" already exists. Do You want to override it ?" ! // , "File exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); ! // result = (answer == JOptionPane.YES_OPTION); ! //}else{ ! result = true; ! //} } if(!result){ tmpFile.delete(); --- 287,296 ---- result = false; ! }else if(file.exists()){ ! ! ! } + if(!result){ tmpFile.delete(); *************** *** 442,455 **** */ if(isFileLocked(tmpFile)){ ! if(file.isPreviouslyLocked()==false) file.setPreviouslyLocked(true); } - //this is new file we have to have time to - //start editing program ! if(file.getCommand().indexOf("soffice") <0){ if (now - file.getDownloadTime() < 20000) { //file is to young to make checks return; } --- 475,495 ---- */ if(isFileLocked(tmpFile)){ ! Log.info("File " + tmpFile.getName() + " is locked"); ! if(file.isPreviouslyLocked()==false){ ! Log.info("File " + tmpFile.getName() + " was not previously locked - setting previously locked flag"); file.setPreviouslyLocked(true); + } + } ! if(file.getCommand().indexOf("soffice") <0){ ! /* ! * This is not an OpenOffice file - we give the application 20 seconds to open ! * the file before we do anymore checks. After 20 seconds we release the file. ! */ if (now - file.getDownloadTime() < 20000) { //file is to young to make checks + Log.info("File " + tmpFile.getName() + " is less than 20 secs old and not controlled by StarOffice - to early to do anything"); return; } *************** *** 460,467 **** --- 500,532 ---- + /* + * If OpenOffice does not lock the file after 20 seconds ask the user + */ + if (file.getCommand().indexOf("soffice")>=0 && file.isPreviouslyLocked()==false && now - file.getDownloadTime() > 20000){ + //q1String=tmpFile.getName() ; + //SwingUtilities.invokeAndWait(new Runnable() { + // public void run() { + int answer = JOptionPane.showOptionDialog(null, + "File " + tmpFile.getName() + + " has been locked for 20 seconds on the server\nbut apparently never opened by OpenOffice.\n" + + "Most likely this is because you closed the file very quickly or tried to re-open the file before it was saved on the server.\n\nIs it OK to release the server log? ", + "Infomanager Filemonitor Daemon", + JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); + + // } + //}); + + if ( JOptionPane.YES_OPTION==answer){ + unlockFile= true; + } + + + } + //notify server that file is open timeDiff += System.currentTimeMillis() - now; if (notificationInterval > 0 && System.currentTimeMillis()>file.gettimeOfLastPing()+notificationInterval) { //ping servlet tha we still edit this file + Log.info("Pinging server for " + tmpFile.getName()); ping(file); file.settimeOfLastPing(System.currentTimeMillis()); *************** *** 476,482 **** --- 541,571 ---- //If staroffice or openoffice is running we rely fully on the file lock unlockFile = !isFileLocked(tmpFile); + Log.info(tmpFile.getName() + ": (soffice) unlockFile=" + unlockFile); + + if (unlockFile){ + //It seems soffice unlocks the file for a short moment when saving so just to make sure we try again!! + long lockstart=System.currentTimeMillis(); + Log.info(tmpFile.getName() + ": looping for up to 3 secs checking lock again!"); + while(unlockFile && System.currentTimeMillis()<lockstart+3000){ + Thread.sleep(500); + unlockFile=!isFileLocked(tmpFile); + } + + unlockFile = !isFileLocked(tmpFile); + Log.info(tmpFile.getName() + ": unlockFile=" + unlockFile); + + if (!unlockFile){ + Log.info(tmpFile.getName() + ": ***************File was only momentarily unlocked*************************"); + } + + } + + + + } else { unlockFile = ! isFileLocked(tmpFile)&& !MonitoredFileInfo.isProcessRunning(allFiles,file); + Log.info(tmpFile.getName() + ": unlockFile=" + unlockFile); } } *************** *** 497,501 **** */ boolean error = false; ! try { uploadIfNecessery(file, unlockFile, uploadStatus); } catch (Exception e) { --- 586,590 ---- */ boolean error = false; ! try { uploadIfNecessery(file, unlockFile, uploadStatus); } catch (Exception e) { *************** *** 560,562 **** --- 649,672 ---- return locked; } + + public static void backupFile(File fileToBackup){ + SimpleDateFormat df = new SimpleDateFormat("ddMMyy_hhmmss"); + Log.info("Backing up " + fileToBackup.getName()); + if (fileToBackup.exists() && fileToBackup.canRead() && fileToBackup.canWrite()) { + String newName = FileMonitorDaemon.getIFMFilesBackDir()+File.separator+ df.format(new Date(System.currentTimeMillis())) + fileToBackup.getName(); + fileToBackup.renameTo(new File(newName)); + Log.info("File " + fileToBackup.getName() + " was backed up as " + newName); + } + } + + + public static void main(String a[]) { + File testfile = new File("/home/jpedersen/test.doc"); + isFileLocked(testfile); + }//main + + + + + } \ No newline at end of file Index: UploadStatusFrame.java =================================================================== RCS file: /cvsroot/compiere/serverApps/src/main/applet/org/compiere/ifm/filetransfer/monitor/Attic/UploadStatusFrame.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** UploadStatusFrame.java 25 Oct 2005 06:34:55 -0000 1.1.2.6 --- UploadStatusFrame.java 6 Feb 2007 09:35:45 -0000 1.1.2.7 *************** *** 19,22 **** --- 19,24 ---- import javax.swing.SwingUtilities; + import org.compiere.ifm.filetransfer.Log; + /** * @author Marek *************** *** 277,280 **** --- 279,283 ---- } } else if ("kill".equals(e.getActionCommand())) { + Log.info("Daemon is exiting normally via UploadStatusFrame.actionPerformed"); System.exit(0); } *************** *** 284,287 **** --- 287,291 ---- hide(); if (markExit) { //if all files downloaded exit + Log.info("Daemon is exiting normally via UploadStatusFrame.actionPerformed becuse markExit=true"); System.exit(0); } *************** *** 317,321 **** public void markExit() { markExit = true; ! if (!hasError || !isVisible()) { System.exit(0); } --- 321,326 ---- public void markExit() { markExit = true; ! if (!hasError || !isVisible()) { ! Log.info("Daemon is exiting normally via UploadStatusFrame"); System.exit(0); } |