gpas-developers Mailing List for GPAS
Brought to you by:
martinalderson,
paulspink
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(56) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mar...@us...> - 2011-06-08 15:36:50
|
Revision: 97 http://gpas.svn.sourceforge.net/gpas/?rev=97&view=rev Author: martinalderson Date: 2011-06-08 15:36:43 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Print jobs with a CN@MacAddress owner name as generated by windows clients without NWClient are now retrieved for username DN's with matching CN. Modified Paths: -------------- trunk/osnative/doc/changelog.txt trunk/osnative/etc/release/osnative trunk/osnative/osnative.manifest trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java trunk/osnative/src/salford/gpas/util/osnative/OSNative.java Modified: trunk/osnative/doc/changelog.txt =================================================================== --- trunk/osnative/doc/changelog.txt 2011-05-10 10:10:18 UTC (rev 96) +++ trunk/osnative/doc/changelog.txt 2011-06-08 15:36:43 UTC (rev 97) @@ -4,6 +4,10 @@ Current release 4.4.0 (03/06/2009) +08/06/2011: + Print jobs with a CN@MacAddress owner name as generated by windows clients without NWClient are now retrieved for username DN's with matching CN. + + -------------------------------------------------------------------------------------------------------- Release 4.4.0 (03/06/2009) - GPAS 4.4 Release Modified: trunk/osnative/etc/release/osnative =================================================================== --- trunk/osnative/etc/release/osnative 2011-05-10 10:10:18 UTC (rev 96) +++ trunk/osnative/etc/release/osnative 2011-06-08 15:36:43 UTC (rev 97) @@ -1 +1 @@ -4.4.0.5 \ No newline at end of file +4.4.0.7 \ No newline at end of file Modified: trunk/osnative/osnative.manifest =================================================================== --- trunk/osnative/osnative.manifest 2011-05-10 10:10:18 UTC (rev 96) +++ trunk/osnative/osnative.manifest 2011-06-08 15:36:43 UTC (rev 97) @@ -2,5 +2,5 @@ Main-Class: salford.gpas.util.osnative.OSNative Class-Path: ../lib/gpasadmodcache-4.4.0.2.jar ../lib/gpasutil-4.4.0.jar ../lib/gpasrmiutil-4.4.0.jar ../lib/gpassecutil-4.4.0.jar ../lib/novell/ldap-2006.06.22.jar ../lib/novell/njclv2r-2006.02.22.jar ../lib/novell/ndps-2006.02.22.jar ../lib/emory/backport-util-concurrent-2.2.jar ../lib/samba/jcifs-1.2.13.jar Implementation-Title: GPAS OS-Native -Implementation-Version: 4.4.0.5 +Implementation-Version: 4.4.0.7 Implementation-Vendor: Salford Software Ltd. Modified: trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java 2011-05-10 10:10:18 UTC (rev 96) +++ trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java 2011-06-08 15:36:43 UTC (rev 97) @@ -964,6 +964,7 @@ */ public synchronized Vector getUserPrintJobs(String agent, String user, long purgeAge, String tree, String admin, String password) { try { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs agent:" + agent + ", user:" + user + ", purgeAge:" + purgeAge + ", tree:" + tree + ", admin:" + admin); if (this.getAuthenticatedConnection(tree, admin, password, false)) { NDPSObjectFactory factory = new NDPSObjectFactory(this.getSessionManager().getSession(tree)); if (factory == null) { @@ -971,11 +972,13 @@ } PrinterAgent pagent = factory.createPrinterAgent(agent); if (pagent == null) { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs unable to create printer agent reference"); return null; } JobInfo[] ji = null; ji = pagent.getJobs(false); if (ji.length == 0) { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs no jobs found"); return null; } Vector vecUserPrintJobs = new Vector(); @@ -989,6 +992,7 @@ long nowTime = now.getTimeInMillis(); if ((submitTime + purgeAge) < nowTime) { try { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs purging job " + ji[i].getId()); JobObject jo = factory.createJobObject(pagent, ji[i].getId()); jo.cancel(0); continue; @@ -1007,22 +1011,30 @@ userMatch = true; } else { String owner = ji[i].getOwner(); - String currenUser = user; + String currentUser = user; +// m_DebugLog.log(Level.INFO, "getUserPrintJobs job:" + ji[i].getId() + ", owner:" + owner + ", currentUser:" + currenUser); // Trim off the leading dots if present. if (owner.charAt(0) == '.') { owner = owner.substring(1); } - if (currenUser.charAt(0) == '.') { - currenUser = currenUser.substring(1); + if (currentUser.charAt(0) == '.') { + currentUser = currentUser.substring(1); } // If the owner is just a CN then only use the CN of the user. if (owner.indexOf('.') == -1) { - int userDotIndex = currenUser.indexOf('.'); + int userDotIndex = currentUser.indexOf('.'); if (userDotIndex != -1) { - currenUser = currenUser.substring(0, userDotIndex); + currentUser = currentUser.substring(0, userDotIndex); } + + // Jobs from windows clients without NWClient installed apparently have owner in <cn>@<mac_address> format. Just use the CN. + int atIndex = owner.indexOf('@'); + if (atIndex != -1) { + owner = owner.substring(0, atIndex); + } } - if (currenUser.equalsIgnoreCase(owner)) { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs job:" + ji[i].getId() + ", owner:" + owner + ", currentUser:" + currenUser); + if (currentUser.equalsIgnoreCase(owner)) { userMatch = true; } } @@ -1034,6 +1046,7 @@ printJob.byteSize = ji[i].getSize(); printJob.submitTime = ji[i].getSubmitTime() * 1000L; printJob.status = (new OidUtil()).interpret(ji[i].getStatus()); +// m_DebugLog.log(Level.INFO, "getUserPrintJobs matched job:" + printJob.jobID + ", owner:" + printJob.ownerName + ", byteSize:" + printJob.byteSize + ", submitTime:" + printJob.submitTime + ", status:" + printJob.status + ", documentName:" + printJob.documentName); vecUserPrintJobs.add(printJob); } } @@ -1043,6 +1056,7 @@ return null; } } else { +// m_DebugLog.log(Level.INFO, "getUserPrintJobs failed to get authenticated connection"); return null; } } catch (Throwable e) { Modified: trunk/osnative/src/salford/gpas/util/osnative/OSNative.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/OSNative.java 2011-05-10 10:10:18 UTC (rev 96) +++ trunk/osnative/src/salford/gpas/util/osnative/OSNative.java 2011-06-08 15:36:43 UTC (rev 97) @@ -416,7 +416,7 @@ /* Set the RMI Security Manager */ System.setSecurityManager(new RMISecurityManager()); - System.out.println("[GPAS OS-Native Service (v4.4.0.5), Copyright (C) Salford Software Ltd 2009]"); + System.out.println("[GPAS OS-Native Service (v4.4.0.7), Copyright (C) Salford Software Ltd 2011]"); System.out.println(); System.out.println("Running from: " + System.getProperty("gpas_home")); System.out.println(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-05-10 10:10:25
|
Revision: 96 http://gpas.svn.sourceforge.net/gpas/?rev=96&view=rev Author: martinalderson Date: 2011-05-10 10:10:18 +0000 (Tue, 10 May 2011) Log Message: ----------- * Fixed printing of user credit receipts. * Extra debug trace statements to help diagnose coin acceptance issues. Modified Paths: -------------- trunk/kiosk/gui/CashMech/AbstractCashMech.cs trunk/kiosk/gui/CashMech/Netshift.cs trunk/kiosk/gui/KioskAPI.cs trunk/kiosk/gui/KioskConfig.cs trunk/kiosk/gui/KioskWindow.xaml.cs trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs trunk/kiosk/gui/Panels/ErrorPanel.xaml.cs trunk/kiosk/gui/Properties/AssemblyInfo.cs Modified: trunk/kiosk/gui/CashMech/AbstractCashMech.cs =================================================================== --- trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -107,6 +107,7 @@ if (kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() > 0 && this.getTotalDeposited() >= kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 100) { + App.writeEventLogEntry("Init: Cash mechanism is full (total: " + this.getTotalDeposited() + ", max: " + (kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 100) + ")", EventLogEntryType.Information); SetNetshiftCoinEnable(false); SetNetshiftNoteEnable(false); this.setCoinMechFull(true); @@ -115,12 +116,14 @@ if (kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() > 0 && this.getCoinsTotal() >= kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 100) { + App.writeEventLogEntry("Init: Coin container is full (total: " + this.getCoinsTotal() + ", max: " + (kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); SetNetshiftCoinEnable(false); this.setCoinMechFull(true); } if (kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() > 0 && this.getNoteTotal() >= kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 100) { + App.writeEventLogEntry("Init: Note container is full (total: " + this.getNoteTotal() + ", max: " + (kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); SetNetshiftNoteEnable(false); this.setNoteMechFull(true); } @@ -260,7 +263,9 @@ App.writeEventLogEntry("Initialising ICS Netshift", EventLogEntryType.Information); netshiftInstance = new Netshift(); + netshiftInstance.CoinInsertedEvent += new Netshift.CoinInsertedEventHandler(NetshiftCoinInsertedCallback); netshiftInstance.CoinAcceptedEvent += new Netshift.CoinAcceptedEventHandler(NetshiftCoinAcceptedCallback); + netshiftInstance.CoinRejectedEvent += new Netshift.CoinRejectedEventHandler(NetshiftCoinRejectedCallback); netshiftInstance.NoteAcceptedEvent += new Netshift.NoteAcceptedEventHandler(NetshiftNoteAcceptedCallback); netshiftInstance.ErrorEvent += new Netshift.ErrorEventHandler(NetshiftErrorCallback); } @@ -269,6 +274,7 @@ { if (enable) { + App.writeEventLogEntry("Enabling netshift coins", EventLogEntryType.Information); if (!netshiftInstance.EnableCoin()) { App.writeEventLogEntry("Netshift Mechanism - Error Enabling Coin Mechanism", EventLogEntryType.Error); @@ -277,6 +283,7 @@ } else { + App.writeEventLogEntry("Disabling netshift coins", EventLogEntryType.Information); if (!netshiftInstance.DisableCoin()) { App.writeEventLogEntry("Netshift Mechanism - Error Disabling Coin Mechanism", EventLogEntryType.Error); @@ -475,6 +482,11 @@ App.writeEventLogEntry("Netshift Mechanism - Error Message Received: " + errorEventArgs.Code, EventLogEntryType.Error); } + private void NetshiftCoinInsertedCallback(object sender, Netshift.CashInputEventArgs cashInputEventArgs) + { + App.writeEventLogEntry("CoinInserted: " + (cashInputEventArgs.InputValue * 100).ToString(), EventLogEntryType.Information); + } + private void NetshiftCoinAcceptedCallback(object sender, Netshift.CashInputEventArgs cashInputEventArgs) { int[] channelValues = theApp.getKioskConfig().getCashMechanismSettings().getCashChannelValues(); @@ -506,6 +518,11 @@ } } + private void NetshiftCoinRejectedCallback(object sender, Netshift.CashInputEventArgs cashInputEventArgs) + { + App.writeEventLogEntry("CoinRejected: " + (cashInputEventArgs.InputValue * 100).ToString(), EventLogEntryType.Information); + } + private void CoinsDeposited(CreditAccountPanel creditAccountPanel, int channel) { creditAccountPanel.CoinsDeposited(channel); @@ -606,6 +623,7 @@ kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() > 0 && totalDeposited >= kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 100) { + App.writeEventLogEntry("Updating total: Cash mechanism is full (total: " + totalDeposited + ", max: " + (kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 100) + ")", EventLogEntryType.Information); this.setCoinConnected(false); this.setCoinsAccepted(false, 0); this.setNotesAccepted(false); @@ -636,6 +654,7 @@ kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() > 0 && totalDeposited >= kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 80) { + App.writeEventLogEntry("Updating total: Cash mechanism is 80% full (total: " + totalDeposited + ", max: " + (kioskConfig.getEmailSettings().getCashMechanismFullNotificationValue() * 100) + ")", EventLogEntryType.Information); String emailBody = kioskConfig.getEmailSettings().getCashMechanismFullNotificationMessage(); emailBody = emailBody.Replace("%c", string.Format("{0:c}", totalDeposited / 100)); emailBody = emailBody.Replace("%C", string.Format("{0:c}", totalDeposited / 100)); @@ -659,6 +678,7 @@ kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() > 0 && coinsTotal >= kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 100) { + App.writeEventLogEntry("Updating total: Coin container is full (total: " + coinsTotal + ", max: " + (kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); this.setCoinConnected(false); this.setCoinsAccepted(false, 0); this.setCoinMechFull(true); @@ -684,6 +704,7 @@ kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() > 0 && coinsTotal >= kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 80) { + App.writeEventLogEntry("Updating total: Coin container is 80% full (total: " + coinsTotal + ", max: " + (kioskConfig.getEmailSettings().getCoinContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); String emailBody = kioskConfig.getEmailSettings().getCoinContainerFullNotificationMessage(); emailBody = emailBody.Replace("%p", string.Format("{0:c}", coinsTotal / 100)); emailBody = emailBody.Replace("%P", string.Format("{0:c}", coinsTotal / 100)); @@ -705,6 +726,7 @@ kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() > 0 && notesTotal >= kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 100) { + App.writeEventLogEntry("Updating total: Note container is full (total: " + notesTotal + ", max: " + (kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); this.setNotesAccepted(false); this.setNoteConnected(false); this.setNoteMechFull(true); @@ -730,6 +752,7 @@ kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() > 0 && notesTotal >= kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 80) { + App.writeEventLogEntry("Updating total: Note container is 80% full (total: " + notesTotal + ", max: " + (kioskConfig.getEmailSettings().getNoteContainerFullNotificationValue() * 100) + ")", EventLogEntryType.Information); String emailBody = kioskConfig.getEmailSettings().getNoteContainerFullNotificationMessage(); emailBody = emailBody.Replace("%o", string.Format("{0:c}", notesTotal / 100)); emailBody = emailBody.Replace("%O", string.Format("{0:c}", notesTotal / 100)); Modified: trunk/kiosk/gui/CashMech/Netshift.cs =================================================================== --- trunk/kiosk/gui/CashMech/Netshift.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/CashMech/Netshift.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -57,9 +57,15 @@ private NetshiftPaymentLib.NSPayment nsPayment = new NetshiftPaymentLib.NSPayment(); + public delegate void CoinInsertedEventHandler(object sender, CashInputEventArgs e); + public event CoinInsertedEventHandler CoinInsertedEvent; + public delegate void CoinAcceptedEventHandler(object sender, CashInputEventArgs e); public event CoinAcceptedEventHandler CoinAcceptedEvent; + public delegate void CoinRejectedEventHandler(object sender, CashInputEventArgs e); + public event CoinRejectedEventHandler CoinRejectedEvent; + public delegate void NoteAcceptedEventHandler(object sender, CashInputEventArgs e); public event NoteAcceptedEventHandler NoteAcceptedEvent; @@ -69,12 +75,22 @@ public Netshift() { + nsPayment.OnCoinInserted += new _INSPaymentEvents_OnCoinInsertedEventHandler(nsPayment_OnCoinInserted); nsPayment.OnCoinAccepted += new _INSPaymentEvents_OnCoinAcceptedEventHandler(nsPayment_OnCoinAccepted); + nsPayment.OnCoinRejected += new _INSPaymentEvents_OnCoinRejectedEventHandler(nsPayment_OnCoinRejected); nsPayment.OnNoteInserted += new _INSPaymentEvents_OnNoteInsertedEventHandler(nsPayment_OnNoteInserted); nsPayment.OnNoteAccepted += new _INSPaymentEvents_OnNoteAcceptedEventHandler(nsPayment_OnNoteAccepted); nsPayment.OnError += new _INSPaymentEvents_OnErrorEventHandler(nsPayment_OnError); } + void nsPayment_OnCoinInserted(string targetApp, double value) + { + if (this.CoinInsertedEvent != null) + { + this.CoinInsertedEvent(this, new CashInputEventArgs(value)); + } + } + void nsPayment_OnCoinAccepted(string targetApp, double value) { if (this.CoinAcceptedEvent != null) @@ -83,6 +99,14 @@ } } + void nsPayment_OnCoinRejected(string targetApp, double value) + { + if (this.CoinRejectedEvent != null) + { + this.CoinRejectedEvent(this, new CashInputEventArgs(value)); + } + } + void nsPayment_OnNoteInserted(string targetApp, double value) { System.Threading.Thread.Sleep(1000); Modified: trunk/kiosk/gui/KioskAPI.cs =================================================================== --- trunk/kiosk/gui/KioskAPI.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/KioskAPI.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -935,7 +935,7 @@ public static UpdatedAccountBalance updateAccountBalance(string transactionID, string userDN, string paymentReason, int creditAmount, bool printReceipt) { - App.writeEventLogEntry("Updating Account Balance (" + userDN + "): " + string.Format("{0:c}", (float)creditAmount / 100), EventLogEntryType.Information); + App.writeEventLogEntry("Updating Account Balance (" + userDN + "): " + string.Format("{0:c}", (float)creditAmount / 100) + ", printReceipt:" + printReceipt, EventLogEntryType.Information); creditAmount = creditAmount * (App.BalanceScalingFactor / 100); Modified: trunk/kiosk/gui/KioskConfig.cs =================================================================== --- trunk/kiosk/gui/KioskConfig.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/KioskConfig.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -24,6 +24,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Xml; +using System.Diagnostics; namespace Salford.GPAS.Kiosk { @@ -167,6 +168,7 @@ tmpValue = attributes.GetNamedItem("EnablePrinter").Value; enablePrinter = tmpValue.ToString().ToLower().Equals("true") ? true : false; + App.writeEventLogEntry("ReceiptPrinterSettings: EnablePrinter:" + enablePrinter + " :: " + tmpValue, EventLogEntryType.Information); tmpValue = attributes.GetNamedItem("UserCreditReceipt").Value; userCreditReceipt = tmpValue.ToString().Replace('|', '\n'); @@ -622,6 +624,7 @@ XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(g4KioskConfig); + App.writeEventLogEntry("KioskConfig: loading from " + g4KioskConfig, EventLogEntryType.Information); generalSettings = new GeneralSettings(xmlDocument.GetElementsByTagName("GeneralSettings").Item(0)); networkSettings = new NetWorkSettings(xmlDocument.GetElementsByTagName("NetworkSettings").Item(0)); cashMechanismSettings = new CashMechanismSettings(xmlDocument.GetElementsByTagName("CashMechanismSettings").Item(0)); Modified: trunk/kiosk/gui/KioskWindow.xaml.cs =================================================================== --- trunk/kiosk/gui/KioskWindow.xaml.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/KioskWindow.xaml.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -128,8 +128,10 @@ if (App.DebugMode) { - this.WindowStyle = WindowStyle.ThreeDBorderWindow; +// this.WindowStyle = WindowStyle.ThreeDBorderWindow; this.WindowState = WindowState.Normal; + this.WindowStyle = WindowStyle.None; +// this.WindowState = WindowState.Maximized; this.Topmost = false; } else Modified: trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -82,6 +82,7 @@ private System.Windows.Forms.Timer finishTimer = new System.Windows.Forms.Timer(); private Boolean finishing = false; + private bool printReceipt = true; public CreditAccountPanel(KioskWindow theApp, KioskAPI.ValidatedUser validatedUser) { @@ -127,36 +128,38 @@ KioskConfig kioskConfig = theApp.getKioskConfig(); cashMech = theApp.getCashMech(); - if (!cashMech.isCoinMechFull() && !cashMech.setCoinConnected(true)) + App.writeEventLogEntry("Starting credit screen" + (cashMech.isCoinMechFull() ? " (coin mech full)" : "") + (cashMech.isNoteMechFull() ? " (note mech full)" : ""), EventLogEntryType.Information); + + if (!cashMech.isCoinMechFull()) { - textBlock_CreditLine1.Text = "The kiosk cannot accept COINS at this time."; + if (!cashMech.setCoinConnected(true)) + { + textBlock_CreditLine1.Text = "The kiosk cannot accept COINS at this time."; + } + else + { + cashMech.enableCoinsDepositCallback(true); + acceptCoins = true; + } } - else if (!cashMech.isCoinMechFull()) + + if (!cashMech.isNoteMechFull()) { - cashMech.enableCoinsDepositCallback(true); - acceptCoins = true; + if (!cashMech.setNotesAccepted(true)) + { + textBlock_CreditLine1.Text = "The kiosk cannot accept NOTES at this time."; + } + else if (!cashMech.isNoteMechFull()) + { + cashMech.enableNotesEnteredCallback(true); + acceptNotes = true; + } } - else - { - acceptCoins = false; - } - if (!cashMech.isNoteMechFull() && !cashMech.setNotesAccepted(true)) - { - textBlock_CreditLine1.Text = "The kiosk cannot accept NOTES at this time."; - } - else if (!cashMech.isNoteMechFull()) - { - cashMech.enableNotesEnteredCallback(true); - acceptNotes = true; - } - else - { - acceptNotes = false; - } } public void page_Loaded(Object sender, RoutedEventArgs args) { + printReceipt = true; try { KioskAPI.TestServantResult testServantResult = KioskAPI.testServant(); @@ -272,6 +275,26 @@ public void OnClick_ButtonFinish(Object sender, RoutedEventArgs args) { + if (sender == button_Print) + { + printReceipt = true; + } + else if (theApp.getKioskConfig().getReceiptPrinterSettings().isPrinterEnabled() && + theApp.getKioskConfig().getReceiptPrinterSettings().isReceiptsOptional() && sender == button_Finish) + { + //App.writeEventLogEntry("FinishTimer_Tick: receipts enabled and optional but clicked finish button - not printing receipt"); + printReceipt = false; + } + else if (theApp.getKioskConfig().getReceiptPrinterSettings().isPrinterEnabled() && sender == button_Finish) + { + printReceipt = true; + } + else + { + //App.writeEventLogEntry("FinishTimer_Tick: not printing receipt"); + printReceipt = false; + } + Finish("You are being logged out"); } @@ -282,6 +305,7 @@ private void Finish(string message) { + App.writeEventLogEntry("CreditAccountPanel.Finish: \"" + message + "\"" + (finishing ? "(already finishing)" : ""), EventLogEntryType.Information); if (finishing) { return; @@ -329,28 +353,9 @@ if (cashDeposited > 0) { - bool printReceipt = true; - - if (sender == button_Print) - { - printReceipt = true; - } - else if (theApp.getKioskConfig().getReceiptPrinterSettings().isPrinterEnabled() && - theApp.getKioskConfig().getReceiptPrinterSettings().isReceiptsOptional() && sender == button_Finish) - { - printReceipt = false; - } - else if (theApp.getKioskConfig().getReceiptPrinterSettings().isPrinterEnabled() && sender == button_Finish) - { - printReceipt = true; - } - else - { - printReceipt = false; - } - try { + App.writeEventLogEntry("FinishTimer_Tick: printReceipt:" + printReceipt + ", printerEnabled:" + theApp.getKioskConfig().getReceiptPrinterSettings().isPrinterEnabled() + ", receiptsOptional:" + theApp.getKioskConfig().getReceiptPrinterSettings().isReceiptsOptional(), EventLogEntryType.Information); KioskAPI.UpdatedAccountBalance updatedAccountBalance = KioskAPI.updateAccountBalance(transactionID, validatedUser.dn, "GPAS Kiosk deposit", (int)cashDeposited, printReceipt); if (updatedAccountBalance == null) @@ -453,6 +458,7 @@ textBlock_CreditLine3.Margin = new Thickness(0, 15, 0, 0); textBlock_CashDeposited.Margin = new Thickness(0, 20, 0, 0); + App.writeEventLogEntry("checkWithinMaximumCredit: Disabling coins as predicted balance (" + predictedBalance + ") exceeds maximum (" + maximumBalance + ")", EventLogEntryType.Information); theApp.getCashMech().setCoinConnected(false); acceptCoins = false; theApp.getCashMech().setNotesAccepted(false); @@ -471,6 +477,7 @@ textBlock_CreditLine3.Margin = new Thickness(0, 15, 0, 0); textBlock_CashDeposited.Margin = new Thickness(0, 20, 0, 0); + App.writeEventLogEntry("checkWithinMaximumCredit: Disabling coins and notes as the containers are full", EventLogEntryType.Information); theApp.getCashMech().setCoinConnected(false); acceptCoins = false; theApp.getCashMech().setNotesAccepted(false); @@ -486,6 +493,7 @@ textBlock_CreditLine3.Text = ""; stackPanel_CreditPage.InvalidateVisual(); + App.writeEventLogEntry("checkWithinMaximumCredit: Disabling coins as coin container is full", EventLogEntryType.Information); theApp.getCashMech().setCoinConnected(false); acceptCoins = false; })); Modified: trunk/kiosk/gui/Panels/ErrorPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/ErrorPanel.xaml.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/Panels/ErrorPanel.xaml.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -68,6 +68,7 @@ public void page_Loaded(Object sender, RoutedEventArgs args) { + App.writeEventLogEntry("Disabling coins and notes due to error", EventLogEntryType.Information); theApp.getCashMech().setCoinConnected(false); theApp.getCashMech().setNotesAccepted(false); Modified: trunk/kiosk/gui/Properties/AssemblyInfo.cs =================================================================== --- trunk/kiosk/gui/Properties/AssemblyInfo.cs 2011-05-04 10:59:15 UTC (rev 95) +++ trunk/kiosk/gui/Properties/AssemblyInfo.cs 2011-05-10 10:10:18 UTC (rev 96) @@ -39,7 +39,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Salford Software Ltd.")] [assembly: AssemblyProduct("GPAS Kiosk")] -[assembly: AssemblyCopyright("Copyright @ Salford Software Ltd. 2009")] +[assembly: AssemblyCopyright("Copyright @ Salford Software Ltd. 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] @@ -81,5 +81,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.4.2.1")] -[assembly: AssemblyFileVersionAttribute("4.4.2.1")] +[assembly: AssemblyVersion("4.4.2.4")] +[assembly: AssemblyFileVersionAttribute("4.4.2.4")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-05-04 10:59:22
|
Revision: 95 http://gpas.svn.sourceforge.net/gpas/?rev=95&view=rev Author: martinalderson Date: 2011-05-04 10:59:15 +0000 (Wed, 04 May 2011) Log Message: ----------- Force note and coin totals to be shown on the operator receipt if the %o and %p formats haven't been used. Modified Paths: -------------- trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java trunk/kiosk/test/salford/gpas/kiosk/KioskReceiptTest.java Modified: trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java =================================================================== --- trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java 2011-05-04 09:29:37 UTC (rev 94) +++ trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java 2011-05-04 10:59:15 UTC (rev 95) @@ -596,6 +596,8 @@ m_MailClient.setSubject("Operator Reset Cash Totals"); m_MailClient.setRecipient(m_KioskConfig.getEmailSettings().getCashMechanismResetUsersToNotify()); emailBody = m_KioskConfig.getEmailSettings().getCashMechanismResetNotificationMessage().replaceAll("%c", m_TransactionServer.getAccountType().formatAmount(cashTotal)); + boolean coinsTotalIncluded = emailBody.contains("%p"); + boolean notesTotalIncluded = emailBody.contains("%o"); emailBody = emailBody.replaceAll("%o", m_TransactionServer.getAccountType().formatAmount(noteTotal)); emailBody = emailBody.replaceAll("%p", m_TransactionServer.getAccountType().formatAmount(coinTotal)); @@ -611,9 +613,14 @@ if (cashChannelValues.length >= 7) { emailBody = emailBody.concat(" " + m_TransactionServer.getAccountType().formatAmount(cashChannelValues[6]) + " \t| " + cashChannelTotals[6] + "\n"); } - emailBody = emailBody.concat(" \t| \n"); - emailBody = emailBody.concat(" \t| Total: " + m_TransactionServer.getAccountType().formatAmount(coinTotal) + "\n\n\n"); - + if (!coinsTotalIncluded) { + emailBody = emailBody.concat(" Total coins: " + m_TransactionServer.getAccountType().formatAmount(coinTotal) + "\n"); + } + if (!notesTotalIncluded) { + emailBody = emailBody.concat(" Total notes: " + m_TransactionServer.getAccountType().formatAmount(noteTotal) + "\n"); + } + + emailBody = emailBody.concat("\n\n"); m_MailClient.setMessage(this.formatEmailOrPrintReceipt(emailBody)); } @@ -627,6 +634,8 @@ ReceiptPrinterSettings receiptPrinterSettings = m_KioskConfig.getReceiptPrinterSettings(); if (receiptPrinterSettings.getOperatorResetReceipt().length() > 0) { String printJobBody = GKiosk_Service.this.formatEmailOrPrintReceipt(receiptPrinterSettings.getOperatorResetReceipt()); + boolean coinsTotalIncluded = printJobBody.contains("%p"); + boolean notesTotalIncluded = printJobBody.contains("%o"); printJobBody = printJobBody.replaceAll("%C", m_TransactionServer.getAccountType().formatAmount(cashTotal)); printJobBody = printJobBody.replaceAll("%c", m_TransactionServer.getAccountType().formatAmount(cashTotal)); printJobBody = printJobBody.replaceAll("%o", m_TransactionServer.getAccountType().formatAmount(noteTotal)); @@ -645,8 +654,15 @@ if (cashChannelValues.length >= 7) { printJobBody = printJobBody.concat(" " + m_TransactionServer.getAccountType().formatAmount(cashChannelValues[6]) + " \t| " + cashChannelTotals[6] + "\n"); } - printJobBody = printJobBody.concat(" \t| \n"); - printJobBody = printJobBody.concat(" \t| " + m_TransactionServer.getAccountType().formatAmount(coinTotal) + "\n\n\n"); + printJobBody = printJobBody.concat("\n"); + if (!coinsTotalIncluded) { + printJobBody = printJobBody.concat(" Total coins: " + m_TransactionServer.getAccountType().formatAmount(coinTotal) + "\n"); + } + if (!notesTotalIncluded && !resetType.equalsIgnoreCase("Operator reset coins totals")) { + printJobBody = printJobBody.concat(" Total notes: " + m_TransactionServer.getAccountType().formatAmount(noteTotal) + "\n"); + } + + printJobBody = printJobBody.concat("\n\n"); } this.printReceipt(true, printJobBody, receiptPrinterSettings.getEnableAdvancedPrinter(), userDN, cashTotal); Modified: trunk/kiosk/test/salford/gpas/kiosk/KioskReceiptTest.java =================================================================== --- trunk/kiosk/test/salford/gpas/kiosk/KioskReceiptTest.java 2011-05-04 09:29:37 UTC (rev 94) +++ trunk/kiosk/test/salford/gpas/kiosk/KioskReceiptTest.java 2011-05-04 10:59:15 UTC (rev 95) @@ -71,8 +71,37 @@ GKiosk_Receipt kioskReceipt = new GKiosk_Receipt(accountType, null); - String formattedPrintJobBody = "%c removed from\nCash DepositStation %v\nat %t\non %d"; - kioskReceipt.print(true, "Unit Testing", formattedPrintJobBody, false, "OPERATOR", 100); + String printJobBody = "%c removed from\nCash DepositStation %v\nat %t\non %d"; + String resetType = "Operator reset cash totals"; + + boolean coinsTotalIncluded = printJobBody.contains("%p"); + boolean notesTotalIncluded = printJobBody.contains("%o"); + printJobBody = printJobBody.replaceAll("%C", "\xA30.01"); + printJobBody = printJobBody.replaceAll("%c", "\xA30.01"); + printJobBody = printJobBody.replaceAll("%o", "\xA30.01"); + printJobBody = printJobBody.replaceAll("%p", "\xA30.01"); + + if (!resetType.equalsIgnoreCase("Operator reset note totals")) { + printJobBody = printJobBody.concat("\n\n"); + printJobBody = printJobBody.concat(" Value\t| Coins\n"); + printJobBody = printJobBody.concat(" \t| \n"); + printJobBody = printJobBody.concat(" " + "\xA30.01" + " \t| " + "1" + "\n"); + printJobBody = printJobBody.concat(" " + "\xA30.01" + " \t| " + "1" + "\n"); + printJobBody = printJobBody.concat(" " + "\xA30.01" + " \t| " + "1" + "\n"); + printJobBody = printJobBody.concat(" " + "\xA30.01" + " \t| " + "1" + "\n"); + printJobBody = printJobBody.concat(" " + "\xA30.01" + " \t| " + "1" + "\n"); + printJobBody = printJobBody.concat("\n"); + if (!coinsTotalIncluded) { + printJobBody = printJobBody.concat(" Total coins: " + "\xA30.01" + "\n"); + } + if (!notesTotalIncluded && !resetType.equalsIgnoreCase("Operator reset coins totals")) { + printJobBody = printJobBody.concat(" Total notes: " + "\xA30.01" + "\n"); + } + + printJobBody = printJobBody.concat("\n\n"); + } + + kioskReceipt.print(true, "Unit Testing", printJobBody, false, "OPERATOR", 100); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-05-04 09:29:43
|
Revision: 94 http://gpas.svn.sourceforge.net/gpas/?rev=94&view=rev Author: martinalderson Date: 2011-05-04 09:29:37 +0000 (Wed, 04 May 2011) Log Message: ----------- Added support for %o and %p formats in the operator receipts for the note and coin totals, respectively. Modified Paths: -------------- trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java trunk/kiosk/src/salford/gpas/kiosk/kiosk.manifest Modified: trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java =================================================================== --- trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java 2011-03-17 16:20:17 UTC (rev 93) +++ trunk/kiosk/src/salford/gpas/kiosk/GKiosk_Service.java 2011-05-04 09:29:37 UTC (rev 94) @@ -168,7 +168,7 @@ public static void main(String[] args) { int port = 10096; - System.out.println("[GPAS Kiosk Service v4.4.0.1 (c) 2009 Salford Software Ltd]"); + System.out.println("[GPAS Kiosk Service v4.4.0.2 (c) 2011 Salford Software Ltd]"); System.out.println(); /* Check that a port number has been specified on the Command Line */ @@ -596,6 +596,8 @@ m_MailClient.setSubject("Operator Reset Cash Totals"); m_MailClient.setRecipient(m_KioskConfig.getEmailSettings().getCashMechanismResetUsersToNotify()); emailBody = m_KioskConfig.getEmailSettings().getCashMechanismResetNotificationMessage().replaceAll("%c", m_TransactionServer.getAccountType().formatAmount(cashTotal)); + emailBody = emailBody.replaceAll("%o", m_TransactionServer.getAccountType().formatAmount(noteTotal)); + emailBody = emailBody.replaceAll("%p", m_TransactionServer.getAccountType().formatAmount(coinTotal)); String[] cashChannelTotals = splitInfo[1].split(","); emailBody = emailBody.concat("\n\n"); @@ -627,6 +629,8 @@ String printJobBody = GKiosk_Service.this.formatEmailOrPrintReceipt(receiptPrinterSettings.getOperatorResetReceipt()); printJobBody = printJobBody.replaceAll("%C", m_TransactionServer.getAccountType().formatAmount(cashTotal)); printJobBody = printJobBody.replaceAll("%c", m_TransactionServer.getAccountType().formatAmount(cashTotal)); + printJobBody = printJobBody.replaceAll("%o", m_TransactionServer.getAccountType().formatAmount(noteTotal)); + printJobBody = printJobBody.replaceAll("%p", m_TransactionServer.getAccountType().formatAmount(coinTotal)); if (!resetType.equalsIgnoreCase("Operator reset note totals")) { String[] cashChannelTotals = splitInfo[1].split(","); Modified: trunk/kiosk/src/salford/gpas/kiosk/kiosk.manifest =================================================================== --- trunk/kiosk/src/salford/gpas/kiosk/kiosk.manifest 2011-03-17 16:20:17 UTC (rev 93) +++ trunk/kiosk/src/salford/gpas/kiosk/kiosk.manifest 2011-05-04 09:29:37 UTC (rev 94) @@ -3,5 +3,5 @@ Main-Class: salford.gpas.kiosk.GKiosk_Service Class-Path: ../lib/gpasutil-4.4.0.jar ../lib/gpassecutil-4.4.0.jar ../lib/gpasrmiutil-4.4.0.jar ../lib/novell/ldap-2006.06.22.jar ../lib/emory/backport-util-concurrent-2.2.jar ../lib/ini4j/ini4j-0.2.6.jar ../lib/sun/mail-1.3.2.jar ../lib/sun/activation-1.0.2.jar Implementation-Title: GPAS Kiosk Service -Implementation-Version: 4.4.0.1 +Implementation-Version: 4.4.0.2 Implementation-Vendor: Salford Software Ltd. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2011-03-17 16:20:24
|
Revision: 93 http://gpas.svn.sourceforge.net/gpas/?rev=93&view=rev Author: martinalderson Date: 2011-03-17 16:20:17 +0000 (Thu, 17 Mar 2011) Log Message: ----------- * Truncated ID column to be a maximum of 254 characters, some library fine payments were generating very long ID's. * Close DB statement on error. Modified Paths: -------------- trunk/logdaemon/doc/changelog.txt trunk/logdaemon/etc/release/g4logd trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDDredger.java trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDMain.java Modified: trunk/logdaemon/doc/changelog.txt =================================================================== --- trunk/logdaemon/doc/changelog.txt 2010-10-21 17:02:12 UTC (rev 92) +++ trunk/logdaemon/doc/changelog.txt 2011-03-17 16:20:17 UTC (rev 93) @@ -4,6 +4,9 @@ Current release 4.4.0 (03/06/2009) +16/03/2011: + Truncated ID column to be a maximum of 254 characters, some library fine payments were generating very long ID's. + 10/07/2009: Added ALTER SESSION commands for Oracle 10gR2 for case insensitive searching. Modified: trunk/logdaemon/etc/release/g4logd =================================================================== --- trunk/logdaemon/etc/release/g4logd 2010-10-21 17:02:12 UTC (rev 92) +++ trunk/logdaemon/etc/release/g4logd 2011-03-17 16:20:17 UTC (rev 93) @@ -1 +1 @@ -4.4.0.2 \ No newline at end of file +4.4.0.3 \ No newline at end of file Modified: trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDDredger.java =================================================================== --- trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDDredger.java 2010-10-21 17:02:12 UTC (rev 92) +++ trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDDredger.java 2011-03-17 16:20:17 UTC (rev 93) @@ -471,7 +471,7 @@ /* Create the SQL command to import the GPAS Log Entry */ sqlInsert = sqlInsert.concat("(TransactionID, UserDN, TransactionSource, TransactionType, Time, " + "Description, Amount, Balance, AccountType, CostCentre) VALUES ('" + - GSQLUtil.sqlEscape(logFileEntry.getLogEntryID()) + "', '" + + GSQLUtil.sqlEscape(logFileEntry.getLogEntryID().substring(0, Math.min(254, logFileEntry.getLogEntryID().length()))) + "', '" + GSQLUtil.sqlEscape(logFileEntry.getUserDN()) + "', '" + GSQLUtil.sqlEscape(logFileEntry.getTransactionSource()) + "', '" + GSQLUtil.sqlEscape(logFileEntry.getTransactionType()) + "', " + @@ -493,7 +493,7 @@ m_ConfigDetails.jdbcDriver == GSQLLogDaemonSettings.ORACLE ? "JobSize" : "Size") + ", JobLanguage, Pages, Printed, Charges, TimeSubmitted, Time, Status, Banners, Duplex, " + "PaperSize, WorkstationIP, Information, CostCentre) VALUES ('" + - GSQLUtil.sqlEscape(printJobLogFileEntry.getLogEntryID()) + "', '" + + GSQLUtil.sqlEscape(printJobLogFileEntry.getLogEntryID().substring(0, Math.min(254, printJobLogFileEntry.getLogEntryID().length()))) + "', '" + GSQLUtil.sqlEscape(printJobLogFileEntry.getUserDN()) + "', '" + GSQLUtil.sqlEscape(printJobLogFileEntry.getPrintQueue()) + "', '" + GSQLUtil.sqlEscape(printJobLogFileEntry.getPrintServer()) + "', '" + @@ -586,26 +586,28 @@ /* Execute SQL insert */ m_SuperDebugLog.log(Level.FINER, "Preparing the insert statement"); PreparedStatement statement = sqlConnection.prepareStatement(sqlInsert, Statement.RETURN_GENERATED_KEYS); - statement.execute(); - try { - generatedKeys = statement.getGeneratedKeys(); - } catch (SQLException e) { - if (m_ConfigDetails.jdbcDriver == GSQLLogDaemonSettings.SQLSERVER) { - statement.close(); - statement = sqlConnection.prepareStatement("SELECT TOP 1 ID FROM " + tableName.toLowerCase() + " ORDER BY ID DESC"); - statement.execute(); - generatedKeys = statement.getResultSet(); - } - else { - m_DebugLog.log(Level.WARNING, "Error retrieving Generated Keys", e); - m_G4LogDMain.println("Error retrieving Generated Keys:"); - m_G4LogDMain.println(" " + e.getLocalizedMessage()); - } + statement.execute(); + + try { + generatedKeys = statement.getGeneratedKeys(); + } catch (SQLException e) { + if (m_ConfigDetails.jdbcDriver == GSQLLogDaemonSettings.SQLSERVER) { + statement.close(); + statement = sqlConnection.prepareStatement("SELECT TOP 1 ID FROM " + tableName.toLowerCase() + " ORDER BY ID DESC"); + statement.execute(); + generatedKeys = statement.getResultSet(); + } + else { + m_DebugLog.log(Level.WARNING, "Error retrieving Generated Keys", e); + m_G4LogDMain.println("Error retrieving Generated Keys:"); + m_G4LogDMain.println(" " + e.getLocalizedMessage()); + } + } + } finally { + statement.close(); + m_SuperDebugLog.log(Level.FINER, "Closed the insert statement"); } - - statement.close(); - m_SuperDebugLog.log(Level.FINER, "Closed the insert statement"); } } catch (SQLException e) { m_DebugLog.log(Level.SEVERE, "Error adding SQL log entry", e); Modified: trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDMain.java =================================================================== --- trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDMain.java 2010-10-21 17:02:12 UTC (rev 92) +++ trunk/logdaemon/src/salford/gpas/logdaemon/G4LogDMain.java 2011-03-17 16:20:17 UTC (rev 93) @@ -740,7 +740,7 @@ * @see salford.gpas.logdaemon.LogDaemonAdminInterface#getVersion() */ public String getVersion() throws RemoteException { - return "[GPAS Log Daemon, v4.4.0.2 Copyright (C) Salford Software Ltd 2009]"; + return "[GPAS Log Daemon, v4.4.0.3 Copyright (C) Salford Software Ltd 2009]"; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-10-21 17:02:21
|
Revision: 92 http://gpas.svn.sourceforge.net/gpas/?rev=92&view=rev Author: martinalderson Date: 2010-10-21 17:02:12 +0000 (Thu, 21 Oct 2010) Log Message: ----------- Initial import of the job processing test tool. Added Paths: ----------- trunk/spooler/jobtest/ trunk/spooler/jobtest/About.cpp trunk/spooler/jobtest/About.dfm trunk/spooler/jobtest/About.h trunk/spooler/jobtest/Ascii.h trunk/spooler/jobtest/DebugClasses.cpp trunk/spooler/jobtest/DebugClasses.h trunk/spooler/jobtest/Find.cpp trunk/spooler/jobtest/Find.dfm trunk/spooler/jobtest/Find.h trunk/spooler/jobtest/JobTest.bpr trunk/spooler/jobtest/JobTest.cpp trunk/spooler/jobtest/JpAsciiFormatter.cpp trunk/spooler/jobtest/JpTcpIpSocket.h trunk/spooler/jobtest/Main.cpp trunk/spooler/jobtest/Main.dfm trunk/spooler/jobtest/Main.h trunk/spooler/jobtest/ban.ini Added: trunk/spooler/jobtest/About.cpp =================================================================== --- trunk/spooler/jobtest/About.cpp (rev 0) +++ trunk/spooler/jobtest/About.cpp 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,43 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 8/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#include <vcl.h> +#pragma hdrstop + +#include "About.h" + +#pragma resource "*.dfm" +TfAbout *fAbout; + + Added: trunk/spooler/jobtest/About.dfm =================================================================== (Binary files differ) Property changes on: trunk/spooler/jobtest/About.dfm ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/spooler/jobtest/About.h =================================================================== --- trunk/spooler/jobtest/About.h (rev 0) +++ trunk/spooler/jobtest/About.h 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,72 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 8/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#ifndef AboutH +#define AboutH + +#include <ExtCtrls.hpp> +#include <Buttons.hpp> +#include <StdCtrls.hpp> +#include <Controls.hpp> +#include <Forms.hpp> +#include <Graphics.hpp> +#include <Classes.hpp> +#include <Windows.hpp> +#include <System.hpp> + +/* +------------------------------------------------------------------------- +*/ +class TfAbout : public TForm +{ + __published: + + TPanel *panAbout; + TButton *btnOK; + TImage *icoAbout; + TLabel *labProduct; + TLabel *labVersion; + TLabel *labCopyright; + TLabel *Label1; + + private: + public: + + virtual __fastcall TfAbout(TComponent *Owner) + : TForm(Owner) {} +}; + +extern TfAbout *fAbout; + +#endif Added: trunk/spooler/jobtest/Ascii.h =================================================================== --- trunk/spooler/jobtest/Ascii.h (rev 0) +++ trunk/spooler/jobtest/Ascii.h 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,67 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +// ---------------------------------------------------------------------------- +// ASCII Defines +// Geomica Ltd (c) 1997-8 +// ---------------------------------------------------------------------------- + +#ifndef __GASCII_H +#define __GASCII_H + +#define NUL 0 +#define SOH 1 +#define STX 2 +#define ETX 3 +#define EOT 4 +#define ENQ 5 +#define ACK 6 +#define BEL 7 +#define BS 8 +#define HT 9 +#define LF 10 +#define VT 11 +#define FF 12 +#define CR 13 +#define SO 14 +#define SI 15 +#define DLE 16 +#define DC1 17 +#define DC2 18 +#define DC3 19 +#define DC4 20 +#define NAK 21 +#define SYN 22 +#define ETB 23 +#define CAN 24 +#define EM 25 +#define SUB 26 +#define ESC 27 +#define FS 28 +#define GS 29 +#define RS 30 +#define US 31 +#define SP 32 +#define DEL 127 + +#endif Added: trunk/spooler/jobtest/DebugClasses.cpp =================================================================== --- trunk/spooler/jobtest/DebugClasses.cpp (rev 0) +++ trunk/spooler/jobtest/DebugClasses.cpp 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,682 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 14/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#include <vcl.h> +#pragma hdrstop + +#include "DebugClasses.h" +#include "JpPjlCommandParser.h" +#include "JpPclParser.h" +#include "JpPsParser.h" +#include "JpPjlDriver.h" +#include "JpTcpIpPrinter.h" +#include "JpLpdPrinter.h" +#include "JpPjlResponseParser.h" +#include "Main.h" + +/* +------------------------------------------------------------------------- + Utility +*/ +const char* DataAsString(const char* pData_, int nLen) +{ + // Put results in static buffer + static char szBuf[65536]; + //MGA// 3/6/2005: the data buffer needs to be treated as unsigned. + const unsigned char* pData = (unsigned char*)pData_; + + // Scan input chars + int i, j; + for (i = 0, j = 0; i < nLen && j < sizeof(szBuf) - 3; i++) + { + if (pData[i] == '\\') + { + // Show backslash as escaped + szBuf[j++] = '\\'; + szBuf[j++] = '\\'; + } + else if (isprint(pData[i]) || pData[i] == '\n') + { + // Copy printable chars and newlines (NB: not tabs, FFs etc) + szBuf[j++] = pData[i]; + } + else + { + // Otherwise show char as escaped octal + sprintf(szBuf + j, "\\%03o", int(pData[i])); + j += 4; + } + } + + // Valid until next call + szBuf[j] = 0; + return szBuf; +} + +/* +------------------------------------------------------------------------- +*/ +CDebugFileInput::CDebugFileInput(LPCSTR szName, TMemo* pMemo) +{ + strcpy(m_szName, szName); + + // Log window + m_pMemo = pMemo; + pMemo->Text = ""; + m_sData = ""; + + // Open file + m_hFile = _lopen(szName, OF_READ); +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugFileInput::GetBuffer(BOOL bBlock) +{ + // Abort if file already closed + if (m_hFile == HFILE_ERROR) + return CIO_EOF; + + // Read data from file to buffer + int cb = _lread(m_hFile, m_pBuf, sizeof(m_pBuf)); + if (cb > 0) + { + // Show data in input window + if (m_sData.Length() < 1000000) m_sData += DataAsString(m_pBuf, cb); + AddBuffer(m_pBuf, cb, FALSE); + return CIO_OK; + } + else + { + // Close file when finished + _lclose(m_hFile); + m_hFile = HFILE_ERROR; + + // Copy data to log window + if (m_sData.Length() < 1000000) + m_pMemo->Lines->Text = m_sData; + else + m_pMemo->Lines->Text = "*** TOO MUCH DATA ***"; + + return CIO_EOF; + } +} + +/* +------------------------------------------------------------------------- +*/ +void CDebugFileInput::ResetJob() +{ + ClearBuffer(); + + // May have been closed if all read before + if (m_hFile == HFILE_ERROR) + m_hFile = _lopen(m_szName, OF_READ); + else + _llseek(m_hFile, 0, SEEK_SET); + + m_sData = ""; +} + +/* +------------------------------------------------------------------------- +*/ +CDebugPrinter::CDebugPrinter( + LPCSTR szIPAddr, + int nIPPort, + TMemo* pWriteMemo, + TMemo* pReadMemo) + : CjpTcpIpPrinter(szIPAddr, nIPPort, FALSE) +{ + m_pWriteMemo = pWriteMemo; + m_pReadMemo = pReadMemo; + m_sWriteData = ""; + m_pReadMemo->Text = ""; + m_pWriteMemo->Text = ""; +} + + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugPrinter::Write(const char* pBuf, ULONG* pcbBuf, BOOL bBlock) +{ + // Show sent data in window (send only in comms mode) + int nCode = CIO_OK; + if (m_pReadMemo) + nCode = CjpTcpIpPrinter::Write(pBuf, pcbBuf, bBlock); + m_sWriteData += DataAsString(pBuf, *pcbBuf); + return nCode; +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugPrinter::Read(char* pBuf, ULONG* pcbBuf, BOOL bBlock) +{ + // Irrelevant if not sending to printer + if (!m_pReadMemo) + { + // So spoof lack of input + *pcbBuf = 0; + return CIO_OK; + } + + // Read data + UINT nCode = CjpTcpIpPrinter::Read(pBuf, pcbBuf, bBlock); + if (nCode == CIO_OK && *pcbBuf > 0) + { + // Append received data to window and scroll to bottom + m_pReadMemo->Lines->Text = m_pReadMemo->Lines->Text + DataAsString(pBuf, *pcbBuf); + m_pReadMemo->Perform(EM_LINESCROLL, 0, 2000000000L); + } + return nCode; +} + +/* +------------------------------------------------------------------------- + Sent data is not written to memo on the fly as this is slow - instead it's + saved in a string and shown once all spooled +*/ +UINT CDebugPrinter::Flush(BOOL b) +{ + if (m_sWriteData.Length() < 1000000) + m_pWriteMemo->Lines->Text = m_sWriteData; + else + m_pWriteMemo->Lines->Text = "*** TOO MUCH DATA ***"; + return CjpTcpIpPrinter::Flush(b); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugPrinter::Open() +{ + // Open printer connection only if wanting to send + m_sWriteData = ""; + return (m_pReadMemo? CjpTcpIpPrinter::Open() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugPrinter::IsOpen() +{ + // Check printer connection only if wanting to send + return (m_pReadMemo? CjpTcpIpPrinter::IsOpen() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugPrinter::Close() +{ + // Closes printer connection + return (m_pReadMemo? CjpTcpIpPrinter::Close() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +CDebugLpdPrinter::CDebugLpdPrinter( + LPCSTR szIPAddr, + LPCSTR szLprQueue, + TMemo* pWriteMemo, + TMemo* pReadMemo) + : CjpLpdPrinter(szIPAddr, szLprQueue, FALSE) +{ + m_pWriteMemo = pWriteMemo; + m_pReadMemo = pReadMemo; + m_sWriteData = ""; + m_pReadMemo->Text = ""; + m_pWriteMemo->Text = ""; +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugLpdPrinter::Write(const char* pBuf, ULONG* pcbBuf, BOOL bBlock) +{ + // Show sent data in window (send only in comms mode) + int nCode = CIO_OK; + if (m_pReadMemo) + nCode = CjpLpdPrinter::Write(pBuf, pcbBuf, bBlock); + m_sWriteData += DataAsString(pBuf, *pcbBuf); + return nCode; +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugLpdPrinter::Read(char* pBuf, ULONG* pcbBuf, BOOL bBlock) +{ + // Irrelevant if not sending to printer + if (!m_pReadMemo) + { + // So spoof lack of input + *pcbBuf = 0; + return CIO_OK; + } + + // Read data + UINT nCode = CjpLpdPrinter::Read(pBuf, pcbBuf, bBlock); + if (nCode == CIO_OK && *pcbBuf > 0) + { + // Append received data to window and scroll to bottom + m_pReadMemo->Lines->Text = m_pReadMemo->Lines->Text + DataAsString(pBuf, *pcbBuf); + m_pReadMemo->Perform(EM_LINESCROLL, 0, 2000000000L); + } + return nCode; +} + +/* +------------------------------------------------------------------------- + Sent data is not written to memo on the fly as this is slow - instead it's + saved in a string and you must periodically call this to get it shown + in the memo +*/ +UINT CDebugLpdPrinter::Flush(BOOL b) +{ + if (m_sWriteData.Length() < 1000000) + m_pWriteMemo->Lines->Text = m_sWriteData; + else + m_pWriteMemo->Lines->Text = "*** TOO MUCH DATA ***"; + + return CjpLpdPrinter::Flush(b); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugLpdPrinter::Open() +{ + // Open printer connection only if wanting to send + m_sWriteData = ""; + return (m_pReadMemo? CjpLpdPrinter::Open() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugLpdPrinter::IsOpen() +{ + // Check printer connection only if wanting to send + return (m_pReadMemo? CjpLpdPrinter::IsOpen() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugLpdPrinter::Close() +{ + // Closes printer connection + return (m_pReadMemo? CjpLpdPrinter::Close() : TRUE); +} + +/* +------------------------------------------------------------------------- +*/ +CDebugBidiPjlDriver::CDebugBidiPjlDriver( + CjpPrinter* pPrinter, + CgoPrinter* pConfig, + CjpPclBanner* pBanner, + TMemo* pMemo, + TLabel* pLabDisplay, + TLabel* pLabProgress, + TLabel* pLabOther) + : CjpDriver(pPrinter, pConfig, pBanner, TRUE), + CjpBidiPjlDriver(pPrinter, pConfig, pBanner) +{ + m_pMemo = pMemo; + if (m_pMemo) + { + m_pMemo->Text = ""; + m_pLabDisplay = pLabDisplay; + m_pLabProgress = pLabProgress; + m_pLabOther = pLabOther; + m_pLabDisplay->Caption = ""; + m_pLabProgress->Caption = ""; + m_pLabOther->Caption = ""; + } + + // Stops status query getting corrupted + m_bJobEndSeen = FALSE; + m_nLastPage = -1; +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugBidiPjlDriver::Check(BOOL bBlock) +{ + // Base class - don't block unless genuinely reading + UINT nCode = CjpBidiPjlDriver::Check(bBlock && m_pMemo); + + // If not reading, finish when all pending data sent + return (m_pMemo || IsDataInBuffer())? nCode : CIO_EOF; // !!! Changed by James +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPjlDriver::HandleJobReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPjlDriver::HandleJobReply(pReply); + HandleAnyReply(pReply); + return b; +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPjlDriver::HandleStatusReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPjlDriver::HandleStatusReply(pReply); + HandleAnyReply(pReply); + return b; +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPjlDriver::HandleInfoReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPjlDriver::HandleInfoReply(pReply); + HandleAnyReply(pReply); + + // Ensure model is set correctly + if (GetPrinterType() >= 1000) + fMain->cbxModel->ItemIndex = GetPrinterType() - 998; + else + fMain->cbxModel->ItemIndex = GetPrinterType(); + + return b; +} + +/* +------------------------------------------------------------------------- +*/ +void CDebugBidiPjlDriver::HandleAnyReply(CDirectory* pReply) +{ + // Show PJL reply (as parsed) in window + char szBuf[2048]; + pReply->ClearFlags(); + pReply->Sprintf(szBuf); + m_pMemo->Lines->Text = m_pMemo->Lines->Text + szBuf; + m_pMemo->Perform(EM_LINESCROLL, 0, 2000000000L); + + // Update results display + m_pLabDisplay->Caption = m_szDisplay; + + if (m_bJobEndSeen) + m_pLabProgress->Caption = String("Printed ") + NumPrinted() + " sides total"; + else if (NumProcessed() > 0) + m_pLabProgress->Caption = String("Printed page ") + NumProcessed(); + else + m_pLabProgress->Caption = ""; + + m_pLabOther->Caption = + String(m_szID) + + (m_bDuplexCapable? "; duplex capable" : "; no duplex") + + (m_bDuplexMode? "; default duplex" : "; default simplex") + + (m_bOnline? "; online" : "; offline"); +} + +/* +------------------------------------------------------------------------- +*/ +CDebugBidiPsDriver::CDebugBidiPsDriver( + CjpPrinter* pPrinter, + CgoPrinter* pConfig, + CjpPsBanner* pBanner, + TMemo* pMemo, + TLabel* pLabDisplay, + TLabel* pLabProgress, + TLabel* pLabOther) + : CjpDriver(pPrinter, pConfig, pBanner, TRUE), + CjpBidiPsDriver(pPrinter, pConfig, pBanner) +{ + m_pMemo = pMemo; + if (m_pMemo) + { + m_pMemo->Text = ""; + m_pLabProgress = pLabProgress; + m_pLabOther = pLabOther; + m_pLabDisplay = pLabDisplay; + m_pLabDisplay->Caption = ""; // display not set later + m_pLabProgress->Caption = ""; + m_pLabOther->Caption = ""; + } + + // Stops status query getting corrupted + m_bJobEndSeen = FALSE; + m_nLastPage = -1; +} + +/* +------------------------------------------------------------------------- +*/ +UINT CDebugBidiPsDriver::Check(BOOL bBlock) +{ + // Base class - don't block unless genuinely reading + UINT nCode = CjpBidiPsDriver::Check(bBlock && m_pMemo); + + // If not reading, finish when all pending data sent + return (m_pMemo || IsDataInBuffer())? nCode : CIO_EOF; // !!! Changed by James. +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPsDriver::HandleJobReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPsDriver::HandleJobReply(pReply); + HandleAnyReply(pReply); + return b; +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPsDriver::HandleStatusReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPsDriver::HandleStatusReply(pReply); + HandleAnyReply(pReply); + return b; +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CDebugBidiPsDriver::HandleInfoReply(CDirectory* pReply) +{ + // Forward to base class + BOOL b = CjpBidiPsDriver::HandleInfoReply(pReply); + HandleAnyReply(pReply); + return b; +} + +/* +------------------------------------------------------------------------- +*/ +void CDebugBidiPsDriver::HandleAnyReply(CDirectory* pReply) +{ + // Show PS (fake PJL) command in window + char szBuf[2048]; + pReply->ClearFlags(); + pReply->Sprintf(szBuf); + m_pMemo->Lines->Text = m_pMemo->Lines->Text + szBuf; + m_pMemo->Perform(EM_LINESCROLL, 0, 2000000000L); + + // Update results display (no control panel display) + m_pLabDisplay->Caption = m_szDisplay; + + if (m_bJobEndSeen) + m_pLabProgress->Caption = String("Processed ") + m_nJobPageCount + " sides total"; + else if (m_nLastPage > 0) + m_pLabProgress->Caption = String("Processed page ") + m_nLastPage; + else + m_pLabProgress->Caption = ""; + + m_pLabOther->Caption = String("ID = ") + m_szID; + if (m_nLastPage > 0) + m_pLabOther->Caption = m_pLabOther->Caption + + (m_bDuplexMode? "; printed duplex" : "; printed simplex"); +} + +/* +------------------------------------------------------------------------- + Helper - shared banner formatting +*/ +void ExpandMacro(int nTextType, char* szOut) +{ + switch (nTextType) + { + case BAN_TYPE_USER: + strcpy(szOut, "BAN_TYPE_USER"); + break; + + case BAN_TYPE_JOB: + strcpy(szOut, "BAN_TYPE_JOB"); + break; + + case BAN_TYPE_TIME_PRINT: + strcpy(szOut, "BAN_TYPE_TIME_PRINT"); + break; + + case BAN_TYPE_COST: + strcpy(szOut, "BAN_TYPE_COST"); + break; + + case BAN_TYPE_AVAILABLE: + strcpy(szOut, "BAN_TYPE_AVAILABLE"); + break; + + case BAN_TYPE_OVERDRAFT: + strcpy(szOut, "BAN_TYPE_OVERDRAFT"); + break; + + case BAN_TYPE_QUEUE: + strcpy(szOut, "BAN_TYPE_QUEUE"); + break; + + case BAN_TYPE_CHARGE_PAGE_SIMPLEX: + strcpy(szOut, "BAN_TYPE_CHARGE_PAGE_SIMPLEX"); + break; + + case BAN_TYPE_FULLNAME: + strcpy(szOut, "BAN_TYPE_FULLNAME"); + break; + + case BAN_TYPE_BALANCE: + strcpy(szOut, "BAN_TYPE_BALANCE"); + break; + + case BAN_TYPE_TIME_SUBMIT: + strcpy(szOut, "BAN_TYPE_TIME_SUBMIT"); + break; + + case BAN_TYPE_CHARGE_BAN: + strcpy(szOut, "BAN_TYPE_CHARGE_BAN"); + break; + + case BAN_TYPE_CHARGE_MIN: + strcpy(szOut, "BAN_TYPE_CHARGE_MIN"); + break; + + case BAN_TYPE_BANNER_NAME: + strcpy(szOut, "BAN_TYPE_BANNER_NAME"); + break; + + case BAN_TYPE_BANNER_FILE: + strcpy(szOut, "BAN_TYPE_BANNER_FILE"); + break; + + case BAN_TYPE_USER_CN: + strcpy(szOut, "BAN_TYPE_USER_CN"); + break; + + case BAN_TYPE_REJ_REASON: + strcpy(szOut, "BAN_TYPE_REJ_REASON"); + break; + + case BAN_TYPE_CHARGE_PAGE_DUPLEX: + strcpy(szOut, "BAN_TYPE_CHARGE_PAGE_DUPLEX"); + break; + + case BAN_TYPE_TOTAL_SHEETS: + strcpy(szOut, "BAN_TYPE_TOTAL_SHEETS"); + break; + + case BAN_TYPE_MAXIMUM: + strcpy(szOut, "BAN_TYPE_MAXIMUM"); + break; + + case BAN_TYPE_JOB_ID: + strcpy(szOut, "BAN_TYPE_JOB_ID"); + break; + } +} + +/* +------------------------------------------------------------------------- +*/ +void CDebugPclBanner::ExpandMacro(int nTextType, char* szOut) +{ + ::ExpandMacro(nTextType, szOut); +} + +/* +------------------------------------------------------------------------- +*/ +//void CDebugPclXlBanner::ExpandMacro(int nTextType, char* szOut) +//{ +// ::ExpandMacro(nTextType, szOut); +//} + +/* +------------------------------------------------------------------------- +*/ +void CDebugPsBanner::ExpandMacro(int nTextType, char* szOut) +{ + ::ExpandMacro(nTextType, szOut); +} + + Added: trunk/spooler/jobtest/DebugClasses.h =================================================================== --- trunk/spooler/jobtest/DebugClasses.h (rev 0) +++ trunk/spooler/jobtest/DebugClasses.h 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,283 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 14/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#ifndef DebugClassesH +#define DebugClassesH + +#include "JpPjlCommandParser.h" +#include "JpBidiPjlDriver.h" +#include "JpBidiPsDriver.h" +#include "JpLpdPrinter.h" +#include "JpPclBanner.h" +//#include "JpPclXlBanner.h" +#include "JpPsBanner.h" +#include "JpJob.h" + +// Utility +extern const char* DataAsString(const char* pData, int nLen); + +/* +------------------------------------------------------------------------- + Input from Windows file; shows file in memo as read +*/ +class CDebugFileInput : public CjpJob +{ + public: + + // Construction + CDebugFileInput(LPCSTR szName, TMemo* pMemo); + + // Base class hook + void ResetJob(); + + protected: + + // Redefined + UINT GetBuffer(BOOL bBlock); + + private: + + // Filepath + char m_szName[128]; + + // Buffer/file + char m_pBuf[512]; + int m_hFile; + + // Log window + TMemo* m_pMemo; + AnsiString m_sData; +}; + +/* +------------------------------------------------------------------------- + TCP/IP printer that shows written/received data in memos +*/ +class CDebugPrinter : public CjpTcpIpPrinter +{ + public: + + // Construction + CDebugPrinter( + LPCSTR szIPAddr, + int nIPPort, + TMemo* pWriteMemo, + TMemo* pReadMemo = NULL); + + // Redefined CjpIO functions + UINT Write(const char* pBuf, ULONG* pcbBuf, BOOL bBlock = TRUE); + UINT Read(char* pBuf, ULONG* pcbBuf, BOOL bBlock = TRUE); + + // Redefined printer functions + BOOL Open(); + BOOL IsOpen(); + UINT Flush(BOOL); + BOOL Close(); + + // Data for sent memo + AnsiString m_sWriteData; + + private: + + TMemo* m_pWriteMemo; + TMemo* m_pReadMemo; +}; + +/* +------------------------------------------------------------------------- + TCP/IP printer that shows written/received data in memos +*/ +class CDebugLpdPrinter : public CjpLpdPrinter +{ + public: + + // Construction + CDebugLpdPrinter( + LPCSTR szIPAddr, + LPCSTR szLprQueue, + TMemo* pWriteMemo, + TMemo* pReadMemo = NULL); + + // Redefined CjpIO functions + UINT Write(const char* pBuf, ULONG* pcbBuf, BOOL bBlock = TRUE); + UINT Read(char* pBuf, ULONG* pcbBuf, BOOL bBlock = TRUE); + + // Redefined printer functions + BOOL Open(); + BOOL IsOpen(); + UINT Flush(BOOL); + BOOL Close(); + + // Data for sent memo + AnsiString m_sWriteData; + + private: + + TMemo* m_pWriteMemo; + TMemo* m_pReadMemo; +}; + +/* +------------------------------------------------------------------------- + PJL driver which shows parsed replies in memo +*/ +class CDebugBidiPjlDriver : public CjpBidiPjlDriver +{ + public: + + // Construction + CDebugBidiPjlDriver( + CjpPrinter* pPrinter, + CgoPrinter* pConfig, + CjpPclBanner* pBanner, + TMemo* pMemo, + TLabel* pLabDisplay, + TLabel* pLabProgress, + TLabel* pLabOther); + + // Redefined + UINT Check(BOOL bBlock); + + protected: + + // Redefined + BOOL HandleJobReply(CDirectory* pReply); + BOOL HandleStatusReply(CDirectory* pReply); + BOOL HandleInfoReply(CDirectory* pReply); + + private: + + TMemo* m_pMemo; + TLabel* m_pLabDisplay; + TLabel* m_pLabProgress; + TLabel* m_pLabOther; + + // Helper + void HandleAnyReply(CDirectory* pReply); +}; + +/* +------------------------------------------------------------------------- + PS L2 driver which shows parsed replies in memo +*/ +class CDebugBidiPsDriver : public CjpBidiPsDriver +{ + public: + + // Construction + CDebugBidiPsDriver( + CjpPrinter* pPrinter, + CgoPrinter* pConfig, + CjpPsBanner* pBanner, + TMemo* pMemo, + TLabel* pLabDisplay, + TLabel* pLabProgress, + TLabel* pLabOther); + + // Redefined + UINT Check(BOOL bBlock); + + protected: + + // Redefined + BOOL HandleJobReply(CDirectory* pReply); + BOOL HandleStatusReply(CDirectory* pReply); + BOOL HandleInfoReply(CDirectory* pReply); + + private: + + TMemo* m_pMemo; + TLabel* m_pLabProgress; + TLabel* m_pLabOther; + TLabel* m_pLabDisplay; + + // Helper + void HandleAnyReply(CDirectory* pReply); +}; + +/* +------------------------------------------------------------------------- + PCL banner generator +*/ +class CDebugPclBanner : public CjpPclBanner +{ + public: + + // Construction + CDebugPclBanner(CgoPrinter* pConfig) + : CjpPclBanner(pConfig) {} + + protected: + + // Expand macro + void ExpandMacro(int nTextType, char* szOut); +}; + +/* +------------------------------------------------------------------------- + PCLXL banner generator +*/ +//class CDebugPclXlBanner : public CjpPclXlBanner +//{ +// public: +// +// // Construction +// CDebugPclXlBanner(CgoPrinter* pConfig) +// : CjpPclXlBanner(pConfig) {} +// +// protected: +// +// // Expand macro +// void ExpandMacro(int nTextType, char* szOut); +//}; + +/* +------------------------------------------------------------------------- + PS banner generator +*/ +class CDebugPsBanner : public CjpPsBanner +{ + public: + + // Construction + CDebugPsBanner(CgoPrinter* pConfig) + : CjpPsBanner(pConfig) {} + + protected: + + // Expand macro + void ExpandMacro(int nTextType, char* szOut); +}; + +#endif Added: trunk/spooler/jobtest/Find.cpp =================================================================== --- trunk/spooler/jobtest/Find.cpp (rev 0) +++ trunk/spooler/jobtest/Find.cpp 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,43 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 8/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#include <vcl.h> +#pragma hdrstop + +#include "Find.h" + +#pragma package(smart_init) +#pragma resource "*.dfm" +TfFind *fFind; + Added: trunk/spooler/jobtest/Find.dfm =================================================================== (Binary files differ) Property changes on: trunk/spooler/jobtest/Find.dfm ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/spooler/jobtest/Find.h =================================================================== --- trunk/spooler/jobtest/Find.h (rev 0) +++ trunk/spooler/jobtest/Find.h 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,63 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 8/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#ifndef FindH +#define FindH + +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> + +/* +------------------------------------------------------------------------- +*/ +class TfFind : public TForm +{ + __published: // IDE-managed Components + + TEdit *edFind; + TButton *btnOK; + TButton *btnCancel; + + private: // User declarations + public: // User declarations + + __fastcall TfFind(TComponent* Owner) + : TForm(Owner) {} +}; + +extern PACKAGE TfFind *fFind; + +#endif Added: trunk/spooler/jobtest/JobTest.bpr =================================================================== --- trunk/spooler/jobtest/JobTest.bpr (rev 0) +++ trunk/spooler/jobtest/JobTest.bpr 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,207 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.06.00"/> + <PROJECT value="JobTest.exe"/> + <OBJFILES value="JobTest.obj About.obj Main.obj DebugClasses.obj Find.obj + "..\common\nds\Directory.obj" + "..\common\gpas\GeoUtils.obj" + "..\common\gpas\UtilsVcl.obj" + "..\common\jp\JpTcpIpSocket.obj" + "..\common\jp\JpAsciiFormatter.obj" + "..\common\jp\JpAsciiToPcl.obj" + "..\common\jp\JpBanner.obj" + "..\common\jp\JpBidiDriver.obj" + "..\common\jp\JpBidiPjlDriver.obj" + "..\common\jp\JpBidiPsDriver.obj" + "..\common\jp\JpDriver.obj" + "..\common\jp\JpIo.obj" + "..\common\jp\JpJob.obj" + "..\common\jp\JpLpdPrinter.obj" + "..\common\jp\JpModStream.obj" + "..\common\jp\JpParser.obj" + "..\common\jp\JpParserDriver.obj" + "..\common\jp\JpParserPrinter.obj" + "..\common\jp\JpPclBanner.obj" + "..\common\jp\JpPclParser.obj" + "..\common\jp\JpPclXlParser.obj" + "..\common\jp\JpPjlCommandParser.obj" + "..\common\jp\JpPjlDriver.obj" + "..\common\jp\JpPjlResponseParser.obj" + "..\common\jp\JpPsBanner.obj" + "..\common\jp\JpPsParser.obj" + "..\common\jp\JpSearch.obj" + "..\common\jp\JpSpoolerBase.obj" + "..\common\jp\JpTcpIpClient.obj" "..\common\jp\JpTcpIpPrinter.obj""/> + <RESFILES value="JobTest.res"/> + <IDLFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) About.dfm Main.dfm Find.dfm"/> + <LIBFILES value=""/> + <LIBRARIES value="vcl.lib rtl.lib"/> + <SPARELIBS value="rtl.lib vcl.lib"/> + <PACKAGES value="vclx.bpi rtl.bpi vcl.bpi"/> + <PATHCPP value=".;"..\common\nds";"..\common\gpas";"..\common\gpas";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp";"..\common\jp""/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value="GPAS_PCH_VCL;GPAS_JOBTEST;GPAS_DEBUG"/> + <SYSDEFINES value="NO_STRICT;_DEBUG"/> + <MAINSOURCE value="JobTest.cpp"/> + <INCLUDEPATH value="..\..\gpas3\G2Snap;f:\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl;"..\common\gpas";"..\common\nds";"..\common\jp""/> + <LIBPATH value=""..\common\jp";"..\common\gpas";"..\common\nds";..\..\gpas3\G2Snap;f:\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + <OTHERFILES value=""/> + </MACROS> + <OPTIONS> + <CFLAG1 value="-Od -H=f:\borland\CBUILD~1\lib\vcl60.csm -Hc -Vx -Ve -Tkh30000 -X- -r- -a8 + -b- -k -y -v -vi- -c -tW -tWM"/> + <PFLAGS value="-$YD -$W -$O- -$A8 -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zi"/> + <LFLAGS value="-D"" -aa -Tpe -x -Gn -v"/> + <OTHERFILES value=""/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + <OTHERFILES value=""/> + </LINKER> + <FILELIST> + <FILE FILENAME="JobTest.cpp" FORMNAME="" UNITNAME="JobTest" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="About.cpp" FORMNAME="fAbout" UNITNAME="About" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="Main.cpp" FORMNAME="fMain" UNITNAME="Main" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="JobTest.res" FORMNAME="" UNITNAME="JobTest" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="DebugClasses.cpp" FORMNAME="" UNITNAME="DebugClasses" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="Find.cpp" FORMNAME="fFind" UNITNAME="Find" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\nds\Directory.cpp" FORMNAME="" UNITNAME="Directory" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\gpas\GeoUtils.c" FORMNAME="" UNITNAME="GeoUtils" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\gpas\UtilsVcl.cpp" FORMNAME="" UNITNAME="UtilsVcl" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpTcpIpSocket.cpp" FORMNAME="" UNITNAME="JpTcpIpSocket" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpAsciiFormatter.cpp" FORMNAME="" UNITNAME="JpAsciiFormatter" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpAsciiToPcl.cpp" FORMNAME="" UNITNAME="JpAsciiToPcl" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpBanner.cpp" FORMNAME="" UNITNAME="JpBanner" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpBidiDriver.cpp" FORMNAME="" UNITNAME="JpBidiDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpBidiPjlDriver.cpp" FORMNAME="" UNITNAME="JpBidiPjlDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpBidiPsDriver.cpp" FORMNAME="" UNITNAME="JpBidiPsDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpDriver.cpp" FORMNAME="" UNITNAME="JpDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpIo.cpp" FORMNAME="" UNITNAME="JpIo" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpJob.cpp" FORMNAME="" UNITNAME="JpJob" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpLpdPrinter.cpp" FORMNAME="" UNITNAME="JpLpdPrinter" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpModStream.cpp" FORMNAME="" UNITNAME="JpModStream" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpParser.cpp" FORMNAME="" UNITNAME="JpParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpParserDriver.cpp" FORMNAME="" UNITNAME="JpParserDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpParserPrinter.cpp" FORMNAME="" UNITNAME="JpParserPrinter" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPclBanner.cpp" FORMNAME="" UNITNAME="JpPclBanner" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPclParser.cpp" FORMNAME="" UNITNAME="JpPclParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPclXlParser.cpp" FORMNAME="" UNITNAME="JpPclXlParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPjlCommandParser.cpp" FORMNAME="" UNITNAME="JpPjlCommandParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPjlDriver.cpp" FORMNAME="" UNITNAME="JpPjlDriver" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPjlResponseParser.cpp" FORMNAME="" UNITNAME="JpPjlResponseParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPsBanner.cpp" FORMNAME="" UNITNAME="JpPsBanner" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpPsParser.cpp" FORMNAME="" UNITNAME="JpPsParser" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpSearch.cpp" FORMNAME="" UNITNAME="JpSearch" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpSpoolerBase.cpp" FORMNAME="" UNITNAME="JpSpoolerBase" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpTcpIpClient.cpp" FORMNAME="" UNITNAME="JpTcpIpClient" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\common\jp\JpTcpIpPrinter.cpp" FORMNAME="" UNITNAME="JpTcpIpPrinter" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + </FILELIST> + <BUILDTOOLS> + </BUILDTOOLS> + + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=1 +MajorVer=4 +MinorVer=3 +Release=1 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=2057 +CodePage=1252 + +[Version Info Keys] +CompanyName=Salford Software Ltd +FileDescription=Job Proc Test Tool +FileVersion=4.3.1.0 +InternalName=JobTest +LegalCopyright=Copyright Salford Software Ltd 2008 +LegalTrademarks= +OriginalFilename=JobTest.exe +ProductName=GPAS +ProductVersion=4.3.1.0 +Comments= + +[Excluded Packages] +C:\Program Files\Borland\CBuilder6\Bin\bcbsmp60.bpl=Borland C++ Sample Components +C:\Program Files\Borland\CBuilder6\Bin\indy60.bpl=Internet Direct (Indy) for D6 +c:\program files\borland\cbuilder6\Bin\dclite60.bpl=Borland Integrated Translation Environment + +[HistoryLists\hlIncludePath] +Count=6 +Item0=..\..\gpas3\G2Snap;f:\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl;..\common\gpas;..\common\nds;..\common\jp +Item1=..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl;..\common\gpas;..\common\nds;..\common\jp +Item2=..\..\gpascommon\JP Shared;..\..\gpascommon\GPAS Shared;..\..\gpascommon\NDS Shared;..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl;..\common\gpas;..\common\nds;..\common\jp +Item3=..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl;..\..\gpascommon\GPAS Shared;..\..\gpascommon\NDS Shared;..\..\gpascommon\JP Shared +Item4=..\snapin;..\..\..\program files\borland\cbuilder3\projects;$(BCB)\include;$(BCB)\include\vcl +Item5=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=7 +Item0=..\common\jp;..\common\gpas;..\common\nds;..\..\gpas3\G2Snap;f:\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item1=..\common\jp;..\common\gpas;..\common\nds;..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item2=..\..\gpascommon\JP Shared;..\..\gpascommon\GPAS Shared;..\..\gpascommon\NDS Shared;..\common\jp;..\common\gpas;..\common\nds;..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item3=..\..\gpascommon\JP Shared;..\..\gpascommon\GPAS Shared;..\..\gpascommon\NDS Shared;..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item4=..\..\gpas3\G2Snap;C:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item5=..\snapin;..\..\..\program files\borland\cbuilder3\projects;$(BCB)\lib\obj;$(BCB)\lib +Item6=$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=11 +Item0=GPAS_PCH_VCL;GPAS_JOBTEST;GPAS_DEBUG +Item1=_DEBUG;GPAS_PCH_VCL;GPAS_JOBTEST +Item2=_DEBUG;GPAS_PCH_VCL;JOBTEST +Item3=_DEBUG;GPAS_PCH_VCL;GPAS2 +Item4=_DEBUG;GPAS_PCH_VCL +Item5=_DEBUG +Item6=_DEBUG;USEPACKAGES +Item7=_DEBUG;WIN32;USEPACKAGES +Item8=_RTLDLL;_DEBUG;WIN32;USEPACKAGES +Item9=_RTLDLL;_DEBUG;USEPACKAGES;WIN32 +Item10=_RTLDLL;USEPACKAGES;_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + </IDEOPTIONS> +</PROJECT> \ No newline at end of file Added: trunk/spooler/jobtest/JobTest.cpp =================================================================== --- trunk/spooler/jobtest/JobTest.cpp (rev 0) +++ trunk/spooler/jobtest/JobTest.cpp 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,51 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 8/6/99 MGR Created +------------------------------------------------------------------------- +*/ +#include <vcl.h> +#pragma hdrstop + +USEFORM("About.cpp", fAbout); +USEFORM("Main.cpp", fMain); +USEFORM("Find.cpp", fFind); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + Application->Initialize(); + Application->CreateForm(__classid(TfMain), &fMain); + Application->CreateForm(__classid(TfAbout), &fAbout); + Application->Run(); + + return 0; +} + Added: trunk/spooler/jobtest/JpAsciiFormatter.cpp =================================================================== --- trunk/spooler/jobtest/JpAsciiFormatter.cpp (rev 0) +++ trunk/spooler/jobtest/JpAsciiFormatter.cpp 2010-10-21 17:02:12 UTC (rev 92) @@ -0,0 +1,480 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-2000 +------------------------------------------------------------------------- + + Date Author Code Description + + 04/03/99 MAB/MGR PRB057 Handling of long lines + 11/2/00 MGR E0015 Merged with AsciiFormatEngine.c for GPAS 2 +------------------------------------------------------------------------- +*/ +#ifdef GPAS_PCH_VCL + #include <vcl.h> + #pragma hdrstop + #define TIMESTAMP NWTIMESTAMP + #pragma package(smart_init) +#endif + +#include "JpAsciiFormatter.h" +#include "GoQueue.h" +#include <stdio.h> +#include <string.h> + +/* +------------------------------------------------------------------------- +*/ +CjpAsciiFormatter::CjpAsciiFormatter( + CjpIO* pInput, + CgoQueue* pConfig, + ULONG nTabWidth) +{ + // Params + m_pInput = pInput; + m_pConfig = pConfig; + m_nTabWidth = nTabWidth; + + // Set page width and length + // NB: paper size currently assumed to be case A4_PAPER: // 26 + m_dPageWidth = (8.25*72); + m_dPageLength = (11.69*72); + +/* + case LETTER_PAPER: // 2 + m_dPageWidth = (8.5*72); + m_dPageLength = (11.0*72); + break; + case LEGAL_PAPER: // 3 + m_dPageWidth = (8.5*72); + m_dPageLength = (14.0*72); + break; + case EXECUTIVE_PAPER: // 1 + m_dPageWidth = (7.25*72); + m_dPageLength = (10.5*72); + break; + case A3_PAPER: // 27 + m_dPageWidth = (11.69*72); + m_dPageLength = (16.535*72); + break; +*/ + + // If landscape two column... + if (m_pConfig->m_nTextLayout == GPAS_Q_TEXTL2) + { + // Swap width & height before splitting width + double temp = m_dPageWidth; + m_dPageWidth = m_dPageLength / 2; + m_dPageLength = temp; + + // Use smaller font + m_dFontSize = 8; + } + else if (m_pConfig->m_nTextLayout == GPAS_Q_TEXTP2) + { + // In portrait 2-column, split width and use even smaller font + m_dPageWidth /= 2; + m_dFontSize = 6; + } + else + { + // Full-size portrait + m_dFontSize = 12; + } + + // Calc allowing 1cm margins (width is 60% of height in Courier) + m_nLinesPerPage = (int)((m_dPageLength - (2 * 28.0)) / m_dFontSize); + m_nCharsPerLine = (int)((m_dPageWidth - (2 * 28.0)) / (m_dFontSize * 0.6)); + + // State + m_bJobStarted = FALSE; + m_bJobFinished = FALSE; + m_bPageStarted = FALSE; + m_nPageNumber = 0; + m_nHorizPos = 0; + m_nVertPos = 0; + m_nMaxHPos = 0; + m_bChopped = FALSE; + m_eCurWeight = AF_NOTSET; + m_nColumn = 0; + + // Allocate output buffer with enough space for two lines. We work + // with two so that bold can be backed up across line breaks when wrapping + // or truncating + m_pOutChars = new char[m_nCharsPerLine * 2 + 1]; + m_pbBoldFlags = new char[m_nCharsPerLine * 2]; +} + +/* +------------------------------------------------------------------------- +*/ +CjpAsciiFormatter::~CjpAsciiFormatter() +{ + delete[] m_pOutChars; + delete[] m_pbBoldFlags; +} + +/* +------------------------------------------------------------------------- + Helper - start new page AND column +*/ +void CjpAsciiFormatter::PageStart() +{ + // New page + m_nPageNumber++; + + // Language-specific stuff + AddElement(AF_START_PAGE); + AddElement(AF_START_COLUMN); + + // Reset weight and indicate that we have started new page + m_eCurWeight = AF_NOTSET; + m_nColumn = 0; + m_bPageStarted = TRUE; + m_bChopped = FALSE; +} + +/* +------------------------------------------------------------------------- + Helper - end current column OR page +*/ +void CjpAsciiFormatter::PageEnd(BOOL bEndJob) +{ + // Seen too many lines - are we starting new column or page? + if (!bEndJob + && (m_pConfig->m_nTextLayout == GPAS_Q_TEXTP2 + || m_pConfig->m_nTextLayout == GPAS_Q_TEXTL2) + && m_nColumn == 0) + { + // Next column + AddElement(AF_END_COLUMN); + m_nColumn++; + AddElement(AF_START_COLUMN); + } + else + { + // Unless we haven't started this page yet... + if (m_bPageStarted) + { + // ...end it + AddElement(AF_END_COLUMN); + AddElement(AF_END_PAGE); + } + + // Reset + m_bPageStarted = FALSE; + m_nColumn = 0; + } + + // Reset vertical line pos + m_nVertPos = 0; + m_bChopped = FALSE; +} + +/* +------------------------------------------------------------------------- + Helper - outputs one line of nChars characters from the buffer + without wrapping. Advances the vertical position if bAdvance set +*/ +void CjpAsciiFormatter::PrintOneLine(int nChars, BOOL bAdvance) +{ + // If we haven't "started" a new page then do so... + if (!m_bPageStarted) + PageStart(); + + // Language-specific positioning: note these may occur without end-line if no advance + if (nChars > 0) + AddElement(AF_START_LINE); + + // Process each character in turn + int i = 0, nStartPos = 0; + for(i = 0; i < nChars; ++i) + { + // Get character + char c = m_pOutChars[i]; + + // Leave spaces in the same font + EjpWeight eWeight; + if (c == ' ' && m_eCurWeight != AF_NOTSET) + eWeight = m_eCurWeight; + else if (m_pbBoldFlags[i]) + eWeight = AF_BOLD; + else + eWeight = AF_NORMAL; + + // Change weight if required + if (m_eCurWeight != eWeight) + { + // If we have buffered some text so far + if (nStartPos != i) + { + // Write text up to last char + m_pOutChars[i] = 0; + AddElement(AF_WRITE_TEXT, (long)(m_pOutChars + nStartPos)); + m_pOutChars[i] = c; + + // End text to make way for weight code + AddElement(AF_END_TEXT, nStartPos); + } + + // Change font + AddElement(AF_CHANGE_WEIGHT, eWeight); + + // Keep track of the font we last used. + m_eCurWeight = eWeight; + nStartPos = i; + } + + // Start writing text + if (nStartPos == i) + AddElement(AF_START_TEXT, nStartPos); + } + + // Stop writing text + if (nStartPos != i) + { + // Write text up to last char + char c = m_pOutChars[i]; + m_pOutChars[i] = 0; + AddElement(AF_WRITE_TEXT, (long)(m_pOutChars + nStartPos)); + m_pOutChars[i] = c; + + // End text + AddElement(AF_END_TEXT, nStartPos); + } + + // If ending line... + if (bAdvance) + { + // Language-specific line advance + if (nChars > 0) + AddElement(AF_END_LINE); + + // Advance vertical position + m_nVertPos++; + + // Check to see if we have gone too far down the page + if (m_nVertPos >= m_nLinesPerPage) + PageEnd(FALSE); + } + + // If we've printed part of a line... + if (nChars < m_nMaxHPos) + { + // We've output one line so knock off width + m_nMaxHPos -= nChars; + m_nHorizPos = max(m_nHorizPos - nChars, 0); + + // Shuffle the characters up so that we can deal with the rest + for (int i = 0; i < m_nMaxHPos; i++) + { + // Must move bold flags too + m_pOutChars[i] = m_pOutChars[i + nChars]; + m_pbBoldFlags[i] = m_pbBoldFlags[i + nChars]; + } + } + else + { + // All gone + m_nMaxHPos = 0; + m_nHorizPos = 0; + } +} + +/* +------------------------------------------------------------------------- + Helper - called in response to CR or line feed +*/ +void CjpAsciiFormatter::PrintLine(BOOL bAdvance) +{ + // If we still have more than a line left... + if (m_nMaxHPos > m_nCharsPerLine) + { + // Print the first line of our wrapped line advancing only if wrapping + PrintOneLine(m_nCharsPerLine, m_pConfig->m_bTextWrap); + + // If not wrapping... + if (!m_pConfig->m_bTextWrap) + { + // Dump the remaining characters + m_nHorizPos = 0; + m_nMaxHPos = 0; + } + } + + // Print the last line - even if no characters, to cope with page ends + PrintOneLine(m_nMaxHPos, bAdvance); + + // Reset line-truncation flag only on LF (not CR) + if (bAdvance) + m... [truncated message content] |
From: <mar...@us...> - 2010-10-21 16:36:33
|
Revision: 91 http://gpas.svn.sourceforge.net/gpas/?rev=91&view=rev Author: martinalderson Date: 2010-10-21 16:36:26 +0000 (Thu, 21 Oct 2010) Log Message: ----------- Fixed mantis 0000003: Can't print multiple collated copies to a Ricoh SP821DN. We now use the first copies command greater than 1 (previously we just used the first copies command). The multiple copies handling is very involved and changing it to fully match the standard (specifically the difference between QTY and COPIES) would risk breaking backwards compatibility with other printer drivers. Modified Paths: -------------- trunk/spooler/common/jp/JpSpoolerBase.cpp trunk/spooler/netware/g2spool/GSpool.mcp trunk/spooler/netware/g2spool/rel_gspl.txt Modified: trunk/spooler/common/jp/JpSpoolerBase.cpp =================================================================== --- trunk/spooler/common/jp/JpSpoolerBase.cpp 2010-02-05 15:37:06 UTC (rev 90) +++ trunk/spooler/common/jp/JpSpoolerBase.cpp 2010-10-21 16:36:26 UTC (rev 91) @@ -752,7 +752,8 @@ || !stricmp(pVal->Name(), "QTY"))) // HP8000 PCL6 driver uses this { // Throw away if we've already seen a copies setting - if (!bObeySets || m_nPjlCopies > 0) + //MGA// 21/10/2010 - P0240 - Ricoh SP821DN has COPIES=1 followed by QTY=3. Only throw away if we've seen a copies setting > 1. + if (!bObeySets || m_nPjlCopies > 1) { pCmd->Delete(); continue; Modified: trunk/spooler/netware/g2spool/GSpool.mcp =================================================================== (Binary files differ) Modified: trunk/spooler/netware/g2spool/rel_gspl.txt =================================================================== --- trunk/spooler/netware/g2spool/rel_gspl.txt 2010-02-05 15:37:06 UTC (rev 90) +++ trunk/spooler/netware/g2spool/rel_gspl.txt 2010-10-21 16:36:26 UTC (rev 91) @@ -26,6 +26,8 @@ P0239: Multiple copies of a PostScript job was not being charged for with PostScript communications. This has been fixed. +P0240: + Fixed handling of Ricoh SP821DN multiple copies. Version 4.4.0 (29/Apr/09) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-02-05 15:37:20
|
Revision: 90 http://gpas.svn.sourceforge.net/gpas/?rev=90&view=rev Author: martinalderson Date: 2010-02-05 15:37:06 +0000 (Fri, 05 Feb 2010) Log Message: ----------- When printing multiple copies of a PostScript job the emulated PJL ustatus page messages are no longer grouped. This fixes a problem where the job was not being charged for. Modified Paths: -------------- trunk/spooler/common/jp/JpBidiPsDriver.cpp trunk/spooler/netware/g2spool/GSpool.mcp trunk/spooler/netware/g2spool/rel_gspl.txt Modified: trunk/spooler/common/jp/JpBidiPsDriver.cpp =================================================================== --- trunk/spooler/common/jp/JpBidiPsDriver.cpp 2010-01-08 17:38:48 UTC (rev 89) +++ trunk/spooler/common/jp/JpBidiPsDriver.cpp 2010-02-05 15:37:06 UTC (rev 90) @@ -150,16 +150,35 @@ " \n" // {\n "{\n" - // /gNumPages /gNumPages load currentpagedevice /NumCopies get type - "}n6O(0M<68*}n6O(0M<68*}1.<9}:(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8}" - // (nulltype) eq { #copies } { currentpagedevice /NumCopies get } ifelse add store\n - "u/(11)$-8t}8,}{}z:.-48*} }{}:(++8/)-<6898'4:8}nO(0Z.-48*}68)} }4781*8}<99}*).+8\n" - // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print - "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" - // currentpagedevice /Duplex known { currentpagedevice /Duplex get } - "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " - // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush - "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + + //MGA// 4/2/2010: P0239: Send back an @PJL USTATUS PAGE message for each page for multiple copies. + // currentpagedevice /NumCopies get type (nulltype) eq { #copies } { currentpagedevice /NumCopies get } ifelse\n + ":(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8}u/(11)$-8t}8,}{}z:.-48*} }{}:(++8/)-<6898'4:8}nO(0Z.-48*}68)} }4781*8\n" + // {\n + "{\n" + // /gNumPages /gNumPages load 1 add store + "}n6O(0M<68*}n6O(0M<68*}1.<9}l}<99}*).+8" + // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print + "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" + // currentpagedevice /Duplex known { currentpagedevice /Duplex get } + "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " + // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush + "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + // } repeat\n + " }+8-8<)\n" + + //MGA// // /gNumPages /gNumPages load currentpagedevice /NumCopies get type + //MGA// "}n6O(0M<68*}n6O(0M<68*}1.<9}:(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8}" + //MGA// // (nulltype) eq { #copies } { currentpagedevice /NumCopies get } ifelse add store\n + //MGA// "u/(11)$-8t}8,}{}z:.-48*} }{}:(++8/)-<6898'4:8}nO(0Z.-48*}68)} }4781*8}<99}*).+8\n" + //MGA// // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print + //MGA// "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" + //MGA// // currentpagedevice /Duplex known { currentpagedevice /Duplex get } + //MGA// "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " + //MGA// // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush + //MGA// "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + + // } ifelse\n " }4781*8\n" // systemdict begin showpage end\n @@ -178,32 +197,51 @@ " \n" // {\n "{\n" - // /gNumPages /gNumPages load currentpagedevice /NumCopies get type - "}n6O(0M<68*}n6O(0M<68*}1.<9}:(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8" - // (nulltype) eq { #copies} {currentpagedevice /NumCopies get} ifelse add store\n - "}u/(11)$-8t}8,}{}z:.-48* }{:(++8/)-<6898'4:8}nO(0Z.-48*}68) }4781*8}<99}*).+8\n" - // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print - "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" - // currentpagedevice /Duplex known { currentpagedevice /Duplex get } - "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " - // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush - "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + + //MGA// 4/2/2010: P0239: Send back an @PJL USTATUS PAGE message for each page for multiple copies. + // currentpagedevice /NumCopies get type (nulltype) eq { #copies } { currentpagedevice /NumCopies get } ifelse\n + ":(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8}u/(11)$-8t}8,}{}z:.-48*} }{}:(++8/)-<6898'4:8}nO(0Z.-48*}68)} }4781*8\n" + // {\n + "{\n" + // /gNumPages /gNumPages load 1 add store + "}n6O(0M<68*}n6O(0M<68*}1.<9}l}<99}*).+8" + // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print + "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" + // currentpagedevice /Duplex known { currentpagedevice /Duplex get } + "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " + // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush + "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + // } repeat\n + " }+8-8<)\n" + + //MGA// // /gNumPages /gNumPages load currentpagedevice /NumCopies get type + //MGA// "}n6O(0M<68*}n6O(0M<68*}1.<9}:(++8/)-<6898'4:8}nO(0Z.-48*}68)})$-8}" + //MGA// // (nulltype) eq { #copies } { currentpagedevice /NumCopies get } ifelse add store\n + //MGA// "u/(11)$-8t}8,}{}z:.-48*} }{}:(++8/)-<6898'4:8}nO(0Z.-48*}68)} }4781*8}<99}*).+8\n" + //MGA// // (@PJL USTATUS PAGE\\n) print /gNumPages load 6 string cvs print + //MGA// "}u]MSQ}HJIAIHJ}MAVX\\nt}-+4/)}n6O(0M<68*}1.<9}g}*)+4/6}:'*}-+4/)" + //MGA// // currentpagedevice /Duplex known { currentpagedevice /Duplex get } + //MGA// "}:(++8/)-<6898'4:8}nY(-18%}2/.&/}{}:(++8/)-<6898'4:8}nY(-18%}68)} " + //MGA// // { false } ifelse { (=DUPLEX\\n\\014) print } { (=SIMPLEX\\n\\014) print } ifelse\n flush + //MGA// "}{}7<1*8} }4781*8}{}u`YHMQXE\\n\\0lit}-+4/)} }{}u`JTPMQXE\\n\\0lit}-+4/)} }4781*8\n}71(*5" + + // } ifelse\n " }4781*8\n" // systemdict begin copypage end\n "*$*)8094:)};864/}:.-$-<68}8/9\n" // } bind def\n " };4/9}987\n" - // (@PJL USTATUS JOB\\nSTART\\nNAME= - "u]MSQ}HJIAIHJ}SN[\\nJIAKI\\nOAPX`"); + // (@PJL USTATUS JOB\\nSTART\\nNAME=\" + "u]MSQ}HJIAIHJ}SN[\\nJIAKI\\nOAPX`\""); // Job tag (e.g. GPAS-123456789) is not swap-catted strcat(szBuf, m_szJobTag); // Finish gSwapStrCat(szBuf, - // ) print\n - "t}-+4/)\n"); + // \") print\n + "\"t}-+4/)\n"); // ENH017 - only query pagecount if the printer supports it if (!m_pConfig->m_bPsProcessedOnly) @@ -246,16 +284,16 @@ // Build into second buffer for ASCII-85 encoding gSwapStrCat(szBuf, - // (@PJL USTATUS JOB\\nEND\\nNAME= - "}u]MSQ}HJIAIHJ}SN[\\nXOY\\nOAPX`"); + // (@PJL USTATUS JOB\\nEND\\nNAME=\" + "}u]MSQ}HJIAIHJ}SN[\\nXOY\\nOAPX`\""); // Job tag is not swap-catted strcat(szBuf, m_szJobTag); // Return number of GPAS-counted pages gSwapStrCat(szBuf, - // \\nPAGES=) print /gNumPages - "\\nMAVXJ`t}-+4/)}n6O(0M<68*" + // \"\\nPAGES=) print /gNumPages + "\"\\nMAVXJ`t}-+4/)}n6O(0M<68*" // load 6 string cvs print (\\n\\014) print flush\n "}1.<9}g}*)+4/6}:'*}-+4/)}u\\n\\0lit}-+4/)}71(*5\n"); Modified: trunk/spooler/netware/g2spool/GSpool.mcp =================================================================== (Binary files differ) Modified: trunk/spooler/netware/g2spool/rel_gspl.txt =================================================================== --- trunk/spooler/netware/g2spool/rel_gspl.txt 2010-01-08 17:38:48 UTC (rev 89) +++ trunk/spooler/netware/g2spool/rel_gspl.txt 2010-02-05 15:37:06 UTC (rev 90) @@ -23,6 +23,9 @@ Added support for Xerox Phaser 8550DP PCL drivers by assuming an equals sign after a PJL command name to be the start of a word list. +P0239: + Multiple copies of a PostScript job was not being charged for + with PostScript communications. This has been fixed. Version 4.4.0 (29/Apr/09) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-01-08 17:38:54
|
Revision: 89 http://gpas.svn.sourceforge.net/gpas/?rev=89&view=rev Author: martinalderson Date: 2010-01-08 17:38:48 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Modified Paths: -------------- trunk/gpasadmin/.tomcatplugin Modified: trunk/gpasadmin/.tomcatplugin =================================================================== --- trunk/gpasadmin/.tomcatplugin 2010-01-08 17:38:24 UTC (rev 88) +++ trunk/gpasadmin/.tomcatplugin 2010-01-08 17:38:48 UTC (rev 89) @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <tomcatProjectProperties> - <rootDir>/WebContent</rootDir> + <rootDir>WebContent</rootDir> <exportSource>false</exportSource> <reloadable>true</reloadable> - <redirectLogger>false</redirectLogger> + <redirectLogger>true</redirectLogger> <updateXml>true</updateXml> <warLocation></warLocation> <extraInfo></extraInfo> - <webPath>gpas</webPath> + <webPath>/gpas</webPath> </tomcatProjectProperties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-01-08 17:38:32
|
Revision: 88 http://gpas.svn.sourceforge.net/gpas/?rev=88&view=rev Author: martinalderson Date: 2010-01-08 17:38:24 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Fixed a problem where releasing a print job would promote it to the top of the queue. Modified Paths: -------------- trunk/osnative/etc/release/osnative trunk/osnative/osnative.jardesc trunk/osnative/osnative.manifest trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java trunk/osnative/src/salford/gpas/util/osnative/OSNative.java Modified: trunk/osnative/etc/release/osnative =================================================================== --- trunk/osnative/etc/release/osnative 2010-01-08 15:06:52 UTC (rev 87) +++ trunk/osnative/etc/release/osnative 2010-01-08 17:38:24 UTC (rev 88) @@ -1 +1 @@ -4.4.0.4 \ No newline at end of file +4.4.0.5 \ No newline at end of file Modified: trunk/osnative/osnative.jardesc =================================================================== --- trunk/osnative/osnative.jardesc 2010-01-08 15:06:52 UTC (rev 87) +++ trunk/osnative/osnative.jardesc 2010-01-08 17:38:24 UTC (rev 88) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <jardesc> - <jar path="W:/gpas/gpas4/osnative/osnative.jar"/> + <jar path="osnative.jar"/> <options overwrite="false" compress="true" exportErrors="false" exportWarnings="true" saveDescription="true" descriptionLocation="/GPAS OS-Native/osnative.jardesc" useSourceFolders="false" buildIfNeeded="true" includeDirectoryEntries="false"/> <manifest manifestVersion="1.0" usesManifest="true" reuseManifest="true" saveManifest="true" generateManifest="false" manifestLocation="/GPAS OS-Native/osnative.manifest" mainClassHandleIdentifier="=GPAS OS-Native/src<salford.gpas.util.osnative{OSNative.java[OSNative"> <sealing sealJar="false"> Modified: trunk/osnative/osnative.manifest =================================================================== --- trunk/osnative/osnative.manifest 2010-01-08 15:06:52 UTC (rev 87) +++ trunk/osnative/osnative.manifest 2010-01-08 17:38:24 UTC (rev 88) @@ -2,5 +2,5 @@ Main-Class: salford.gpas.util.osnative.OSNative Class-Path: ../lib/gpasadmodcache-4.4.0.2.jar ../lib/gpasutil-4.4.0.jar ../lib/gpasrmiutil-4.4.0.jar ../lib/gpassecutil-4.4.0.jar ../lib/novell/ldap-2006.06.22.jar ../lib/novell/njclv2r-2006.02.22.jar ../lib/novell/ndps-2006.02.22.jar ../lib/emory/backport-util-concurrent-2.2.jar ../lib/samba/jcifs-1.2.13.jar Implementation-Title: GPAS OS-Native -Implementation-Version: 4.4.0.4 +Implementation-Version: 4.4.0.5 Implementation-Vendor: Salford Software Ltd. Modified: trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java 2010-01-08 15:06:52 UTC (rev 87) +++ trunk/osnative/src/salford/gpas/util/osnative/NetWareImpl.java 2010-01-08 17:38:24 UTC (rev 88) @@ -1126,7 +1126,6 @@ BasicAttribute ba2 = new BasicAttribute(Oid.NDPS_ATT_JOB_OPERATOR_HOLD.getString(), new Integer(1)); bas.put(ba1); bas.put(ba2); - sourceJo.promote(); sourceJo.modifyAttrs(DirContext.REMOVE_ATTRIBUTE, bas); break; case PRINT_JOB_DELETE: Modified: trunk/osnative/src/salford/gpas/util/osnative/OSNative.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/OSNative.java 2010-01-08 15:06:52 UTC (rev 87) +++ trunk/osnative/src/salford/gpas/util/osnative/OSNative.java 2010-01-08 17:38:24 UTC (rev 88) @@ -416,7 +416,7 @@ /* Set the RMI Security Manager */ System.setSecurityManager(new RMISecurityManager()); - System.out.println("[GPAS OS-Native Service (v4.4.0.4), Copyright (C) Salford Software Ltd 2009]"); + System.out.println("[GPAS OS-Native Service (v4.4.0.5), Copyright (C) Salford Software Ltd 2009]"); System.out.println(); System.out.println("Running from: " + System.getProperty("gpas_home")); System.out.println(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-01-08 15:07:12
|
Revision: 87 http://gpas.svn.sourceforge.net/gpas/?rev=87&view=rev Author: martinalderson Date: 2010-01-08 15:06:52 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Fixing paths for build. Modified Paths: -------------- trunk/controller/build.xml trunk/g4batch/build.xml trunk/gpasadmin/build.xml trunk/kiosk/build.xml trunk/logdaemon/build.xml trunk/osnative/build.xml trunk/transaction-server/build.xml trunk/util-common/build.xml trunk/util-rmi/build.xml trunk/util-security/build.xml Modified: trunk/controller/build.xml =================================================================== --- trunk/controller/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/controller/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Copy Controller" default="dist" basedir="W:\gpas\gpas4\controller\" > +<project name="GPAS Copy Controller" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="release" location="W:\test" /> @@ -11,8 +11,8 @@ <target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}" deprecation="true" excludes="salford\gpas\commandline\**" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="..\util-common\bin" /> + <pathelement location="..\util-security\bin" /> <pathelement location="${sdks}\backport-util-concurrent-2.2\backport-util-concurrent.jar" /> <pathelement location="${sdks}\jldap\novell-jldap-devel-2006.06.22-1netware_windows\lib\ldap.jar" /> </classpath> Modified: trunk/g4batch/build.xml =================================================================== --- trunk/g4batch/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/g4batch/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="G4Batch" default="dist" basedir="W:\gpas\gpas4-tools\g4batch\" > +<project name="G4Batch" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="release" location="W:\test" /> @@ -11,9 +11,9 @@ <target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}" deprecation="true" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-rmi\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="..\util-common\bin" /> + <pathelement location="..\util-rmi\bin" /> + <pathelement location="..\util-security\bin" /> <pathelement location="${sdks}\jldap\novell-jldap-devel-2006.06.22-1netware_windows\lib\ldap.jar" /> </classpath> </javac> Modified: trunk/gpasadmin/build.xml =================================================================== --- trunk/gpasadmin/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/gpasadmin/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Admin Interface" default="dist" basedir="W:\gpas\gpas4\" > +<project name="GPAS Admin Interface" default="dist" basedir=".." > <property name="src" location="gpasadmin\src" /> <property name="build" location="gpasadmin\bin" /> <property name="sdks" location="W:\sdks" /> @@ -13,9 +13,9 @@ <javac srcdir="${src}" destdir="${build}" source="1.4" compiler="javac1.5" fork="yes" executable="C:\Program Files (x86)\Java\jdk1.5.0_12\bin\javac.exe" excludes="salford\gpas\admin\tools\**" > <compilerarg value="-Xlint:deprecation" /> <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-rmi\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="util-common\bin" /> + <pathelement location="util-rmi\bin" /> + <pathelement location="util-security\bin" /> <pathelement location="${sdks}\ini4j-0.2.6\dist\ini4j-compat.jar" /> <pathelement location="${sdks}\jldap\novell-jldap-devel-2006.06.22-1netware_windows\lib\ldap.jar" /> <pathelement location="${tomcat}\jsp-api.jar" /> Modified: trunk/kiosk/build.xml =================================================================== --- trunk/kiosk/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/kiosk/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Kiosk" default="dist" basedir="W:\gpas\gpas4\" > +<project name="GPAS Kiosk" default="dist" basedir=".." > <property name="src" location="kiosk\src" /> <property name="build" location="kiosk\bin" /> <property name="release" location="W:\test" /> @@ -13,9 +13,9 @@ <compilerarg value="-Xlint:unchecked" /> <compilerarg value="-Xlint:deprecation" /> <classpath> - <pathelement location="W:\gpas\gpas4\transaction-server\bin" /> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="transaction-server\bin" /> + <pathelement location="util-common\bin" /> + <pathelement location="util-security\bin" /> <pathelement location="${sdks}\backport-util-concurrent-2.2\backport-util-concurrent.jar" /> <pathelement location="${sdks}\ini4j-0.2.6\dist\ini4j.jar" /> <pathelement location="${sdks}\javamail-1.3.2\mail.jar" /> @@ -28,7 +28,7 @@ <arg line="-v1.2" /> <arg line="-keepgenerated" /> <arg line="-d ${build}" /> - <arg line="-classpath ${build};W:\gpas\gpas4\transaction-server\bin" /> + <arg line="-classpath ${build};transaction-server\bin" /> <arg line="salford.gpas.kiosk.GKiosk_Service" /> </exec> <move file="${build}\salford\gpas\kiosk\GKiosk_Service_Stub.java" todir="${src}\salford\gpas\kiosk" /> Modified: trunk/logdaemon/build.xml =================================================================== --- trunk/logdaemon/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/logdaemon/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Log Daemon" default="dist" basedir="W:\gpas\gpas4\logdaemon\" > +<project name="GPAS Log Daemon" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="release" location="W:\test" /> @@ -12,8 +12,8 @@ <target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}" deprecation="true" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="..\util-common\bin" /> + <pathelement location="..\util-security\bin" /> <pathelement location="${sdks}\jldap\novell-jldap-devel-2006.06.22-1netware_windows\lib\ldap.jar" /> </classpath> </javac> Modified: trunk/osnative/build.xml =================================================================== --- trunk/osnative/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/osnative/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS OS-Native" default="dist" basedir="W:\gpas\gpas4\osnative\" > +<project name="GPAS OS-Native" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="include" location="include" /> @@ -15,9 +15,9 @@ <compilerarg value="-Xlint:unchecked" /> <compilerarg value="-Xlint:deprecation" /> <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> - <pathelement location="W:\gpas\gpas4\ldapproxy\bin" /> + <pathelement location="..\util-common\bin" /> + <pathelement location="..\util-security\bin" /> + <pathelement location="..\ldapproxy\bin" /> <pathelement location="${sdks}\backport-util-concurrent-2.2\backport-util-concurrent.jar" /> <pathelement location="${sdks}\jcifs-1.2.13\jcifs-1.2.13.jar" /> <pathelement location="${sdks}\jsch-0.1.34\dist\lib\jsch-20071004.jar" /> Modified: trunk/transaction-server/build.xml =================================================================== --- trunk/transaction-server/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/transaction-server/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Transaction Server" default="dist" basedir="W:\gpas\gpas4\transaction-server\" > +<project name="GPAS Transaction Server" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="release" location="W:\test" /> @@ -11,8 +11,8 @@ <target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="..\util-common\bin" /> + <pathelement location="..\util-security\bin" /> <pathelement location="${sdks}\jldap\novell-jldap-devel-2006.06.22-1netware_windows\lib\ldap.jar" /> </classpath> </javac> Modified: trunk/util-common/build.xml =================================================================== --- trunk/util-common/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/util-common/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Common Utils" default="distclean" basedir="W:\gpas\gpas4\util-common\" > +<project name="GPAS Common Utils" default="distclean"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="release" location="W:\test" /> @@ -11,7 +11,7 @@ <target name="compile" depends="init" > <javac srcdir="${src}" destdir="${build}" deprecation="true" excludes="salford\webservices\** salford\gpas\commandline\** salford\gpas\printing\**" > <classpath> - <pathelement location="W:\gpas\gpas4\util-security\bin" /> + <pathelement location="..\util-security\bin" /> <pathelement location="${sdks}\backport-util-concurrent-2.2\backport-util-concurrent.jar" /> <pathelement location="${sdks}\ini4j-0.2.6\dist\ini4j-compat.jar" /> <pathelement location="${sdks}\installanywhere\IAClasses.zip" /> Modified: trunk/util-rmi/build.xml =================================================================== --- trunk/util-rmi/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/util-rmi/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Common RMI" default="dist" basedir="W:\gpas\gpas4" > +<project name="GPAS Common RMI" default="dist" basedir=".." > <property name="build" location="util-rmi\bin" /> <property name="src" location="util-rmi\src" /> <property name="release" location="W:\test" /> @@ -10,17 +10,17 @@ <target name="compile" depends="init" > <rmic stubversion="1.2" base="osnative\bin" sourcebase="${src}" includes="**/*Impl.class" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> + <pathelement location="util-common\bin" /> </classpath> </rmic> <rmic stubversion="1.2" base="logdaemon\bin" sourcebase="${src}" includes="**/*Impl.class **/G4LogDMain.class" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> + <pathelement location="util-common\bin" /> </classpath> </rmic> <rmic stubversion="1.2" base="controller\bin" sourcebase="${src}" includes="**/GCopyMain.class" > <classpath> - <pathelement location="W:\gpas\gpas4\util-common\bin" /> + <pathelement location="util-common\bin" /> </classpath> </rmic> <copy todir="${build}" > @@ -48,7 +48,7 @@ <target name="release" depends="release.check" > <copy file="util-rmi\gpasrmiutil.jar" tofile="${release}\lib\gpasrmiutil-${gpas.version}.jar" /> - <copy file="util-rmi\gpasrmiutil.jar" tofile="W:\gpas\gpas4\logdaemon\nativej\gpasrmiutil-${gpas.version}.jar" /> + <copy file="util-rmi\gpasrmiutil.jar" tofile="logdaemon\nativej\gpasrmiutil-${gpas.version}.jar" /> </target> <target name="release.check" depends="distclean" unless="gpas.version" > Modified: trunk/util-security/build.xml =================================================================== --- trunk/util-security/build.xml 2009-12-10 17:23:50 UTC (rev 86) +++ trunk/util-security/build.xml 2010-01-08 15:06:52 UTC (rev 87) @@ -1,4 +1,4 @@ -<project name="GPAS Common Security" default="dist" basedir="W:\gpas\gpas4\util-security\" > +<project name="GPAS Common Security" default="dist"> <property name="src" location="src" /> <property name="build" location="bin" /> <property name="nativej" location="C:\Program Files (x86)\NativeJ" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-10 17:23:59
|
Revision: 86 http://gpas.svn.sourceforge.net/gpas/?rev=86&view=rev Author: martinalderson Date: 2009-12-10 17:23:50 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Use relative paths for the common code. Modified Paths: -------------- trunk/spooler/windows/Spooler.vcproj Modified: trunk/spooler/windows/Spooler.vcproj =================================================================== --- trunk/spooler/windows/Spooler.vcproj 2009-12-10 16:20:23 UTC (rev 85) +++ trunk/spooler/windows/Spooler.vcproj 2009-12-10 17:23:50 UTC (rev 86) @@ -46,7 +46,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/GR" Optimization="0" - AdditionalIncludeDirectories="W:\sdks\Windows\vc\include;"$(VCInstallDir)include";C:\dev\gpas\gpas_old\GPAS3\Extras;"S:\Novell + GPAS Legacy\ndk\nwsdk\include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\nit";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\netinet";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\sys";"C:\dev\gpas\gpas4\windows-common";"C:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared";"C:\dev\gpas\gpas_old\gpascommon\JP.3 Shared";"C:\dev\gpas\gpas_old\gpascommon\NDS.3 Shared"" + AdditionalIncludeDirectories="W:\sdks\Windows\vc\include;"$(VCInstallDir)include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\nit";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\netinet";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\sys";"..\windows-common";"..\common\gpas";"..\common\jp";"..\common\nds"" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;VSTUDIO;_CRT_SECURE_NO_WARNINGS" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -134,7 +134,7 @@ <Tool Name="VCCLCompilerTool" AdditionalOptions="/GR" - AdditionalIncludeDirectories="W:\sdks\Windows\vc\include;"$(VCInstallDir)include";C:\dev\gpas\gpas_old\GPAS3\Extras;"S:\Novell + GPAS Legacy\ndk\nwsdk\include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\nit";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\netinet";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\sys";"C:\dev\gpas\gpas4\windows-common";"C:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared";"C:\dev\gpas\gpas_old\gpascommon\JP.3 Shared";"C:\dev\gpas\gpas_old\gpascommon\NDS.3 Shared"" + AdditionalIncludeDirectories="W:\sdks\Windows\vc\include;"$(VCInstallDir)include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\nit";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\netinet";"S:\Novell + GPAS Legacy\ndk\nwsdk\include\nlm\sys";"..\windows-common";"..\common\gpas";"..\common\jp";"..\common\nds"" PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;VSTUDIO;_CRT_SECURE_NO_WARNINGS" MinimalRebuild="false" RuntimeLibrary="0" @@ -330,107 +330,107 @@ Name="Job Processing" > <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpAsciiFormatter.cpp" + RelativePath="..\common\jp\JpAsciiFormatter.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpAsciiToPcl.cpp" + RelativePath="..\common\jp\JpAsciiToPcl.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpBidiDriver.cpp" + RelativePath="..\common\jp\JpBidiDriver.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpBidiPjlDriver.cpp" + RelativePath="..\common\jp\JpBidiPjlDriver.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpBidiPsDriver.cpp" + RelativePath="..\common\jp\JpBidiPsDriver.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpDriver.cpp" + RelativePath="..\common\jp\JpDriver.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpHTTPServer.cpp" + RelativePath="..\common\jp\JpHTTPServer.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpIo.cpp" + RelativePath="..\common\jp\JpIo.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpJob.cpp" + RelativePath="..\common\jp\JpJob.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpLpdPrinter.cpp" + RelativePath="..\common\jp\JpLpdPrinter.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpModStream.cpp" + RelativePath="..\common\jp\JpModStream.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpParser.cpp" + RelativePath="..\common\jp\JpParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPclBanner.cpp" + RelativePath="..\common\jp\JpPclBanner.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPclParser.cpp" + RelativePath="..\common\jp\JpPclParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPclXlParser.cpp" + RelativePath="..\common\jp\JpPclXlParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPjlCommandParser.cpp" + RelativePath="..\common\jp\JpPjlCommandParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPjlDriver.cpp" + RelativePath="..\common\jp\JpPjlDriver.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPjlResponseParser.cpp" + RelativePath="..\common\jp\JpPjlResponseParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPsBanner.cpp" + RelativePath="..\common\jp\JpPsBanner.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpPsParser.cpp" + RelativePath="..\common\jp\JpPsParser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpSearch.cpp" + RelativePath="..\common\jp\JpSearch.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpSpoolerBase.cpp" + RelativePath="..\common\jp\JpSpoolerBase.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpTcpIpClient.cpp" + RelativePath="..\common\jp\JpTcpIpClient.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpTcpIpPrinter.cpp" + RelativePath="..\common\jp\JpTcpIpPrinter.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpTcpIpServer.cpp" + RelativePath="..\common\jp\JpTcpIpServer.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpTcpIpSocket.cpp" + RelativePath="..\common\jp\JpTcpIpSocket.cpp" > </File> </Filter> @@ -438,23 +438,23 @@ Name="Utility Classes etc" > <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\CryptString.cpp" + RelativePath="..\common\gpas\CryptString.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\NDS.3 Shared\Directory.cpp" + RelativePath="..\common\nds\Directory.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GeoUtils.c" + RelativePath="..\common\gpas\GeoUtils.c" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\SecEncrypt.cpp" + RelativePath="..\common\gpas\SecEncrypt.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\SecHash.cpp" + RelativePath="..\common\gpas\SecHash.cpp" > </File> </Filter> @@ -462,55 +462,55 @@ Name="GPAS Objects" > <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoAccountType.cpp" + RelativePath="..\common\gpas\GoAccountType.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoConfigLog.cpp" + RelativePath="..\common\gpas\GoConfigLog.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoCopier.cpp" + RelativePath="..\common\gpas\GoCopier.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoCostCentre.cpp" + RelativePath="..\common\gpas\GoCostCentre.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoHelpers.cpp" + RelativePath="..\common\gpas\GoHelpers.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoLicenceMgr.cpp" + RelativePath="..\common\gpas\GoLicenceMgr.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoNdsQueue.cpp" + RelativePath="..\common\gpas\GoNdsQueue.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoPrinter.cpp" + RelativePath="..\common\gpas\GoPrinter.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoQueue.cpp" + RelativePath="..\common\gpas\GoQueue.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoServer.cpp" + RelativePath="..\common\gpas\GoServer.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoTaggedRef.cpp" + RelativePath="..\common\gpas\GoTaggedRef.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\GoUser.cpp" + RelativePath="..\common\gpas\GoUser.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\JP.3 Shared\JpBanner.cpp" + RelativePath="..\common\jp\JpBanner.cpp" > </File> </Filter> @@ -518,7 +518,7 @@ Name="Logging Classes" > <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\LogDefs.cpp" + RelativePath="..\common\gpas\LogDefs.cpp" > </File> </Filter> @@ -526,15 +526,15 @@ Name="NLM Classes" > <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\HtmlLogTemplateRead.cpp" + RelativePath="..\common\gpas\HtmlLogTemplateRead.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\HtmlTemplateRead.cpp" + RelativePath="..\common\gpas\HtmlTemplateRead.cpp" > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\SMTPMailer.cpp" + RelativePath="..\common\gpas\SMTPMailer.cpp" > </File> </Filter> @@ -646,7 +646,7 @@ > </File> <File - RelativePath="c:\dev\gpas\gpas_old\gpascommon\GPAS.3 Shared\CryptString.h" + RelativePath="..\common\gpas\CryptString.h" > </File> <File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-10 16:20:37
|
Revision: 85 http://gpas.svn.sourceforge.net/gpas/?rev=85&view=rev Author: martinalderson Date: 2009-12-10 16:20:23 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Initial import Added Paths: ----------- trunk/spooler/common/ trunk/spooler/common/gpas/ trunk/spooler/common/gpas/CryptString.cpp trunk/spooler/common/gpas/CryptString.h trunk/spooler/common/gpas/GErrMsg.h trunk/spooler/common/gpas/GTypes.h trunk/spooler/common/gpas/GeoUtils.c trunk/spooler/common/gpas/GeoUtils.h trunk/spooler/common/gpas/GoAccountType.cpp trunk/spooler/common/gpas/GoAccountType.h trunk/spooler/common/gpas/GoConfigLog.cpp trunk/spooler/common/gpas/GoConfigLog.h trunk/spooler/common/gpas/GoCopier.cpp trunk/spooler/common/gpas/GoCopier.h trunk/spooler/common/gpas/GoCostCentre.cpp trunk/spooler/common/gpas/GoCostCentre.h trunk/spooler/common/gpas/GoHelpers.cpp trunk/spooler/common/gpas/GoHelpers.h trunk/spooler/common/gpas/GoLicenceMgr.cpp trunk/spooler/common/gpas/GoLicenceMgr.h trunk/spooler/common/gpas/GoNdsQueue.cpp trunk/spooler/common/gpas/GoNdsQueue.h trunk/spooler/common/gpas/GoNdsServer.cpp trunk/spooler/common/gpas/GoNdsServer.h trunk/spooler/common/gpas/GoPrinter.cpp trunk/spooler/common/gpas/GoPrinter.h trunk/spooler/common/gpas/GoQueue.cpp trunk/spooler/common/gpas/GoQueue.h trunk/spooler/common/gpas/GoSchema.h trunk/spooler/common/gpas/GoServer.cpp trunk/spooler/common/gpas/GoServer.h trunk/spooler/common/gpas/GoSpoolerConfig.cpp trunk/spooler/common/gpas/GoSpoolerConfig.h trunk/spooler/common/gpas/GoTaggedRef.cpp trunk/spooler/common/gpas/GoTaggedRef.h trunk/spooler/common/gpas/GoUser.cpp trunk/spooler/common/gpas/GoUser.h trunk/spooler/common/gpas/Hash.c trunk/spooler/common/gpas/Hash.h trunk/spooler/common/gpas/HtmlLogTemplateRead.cpp trunk/spooler/common/gpas/HtmlLogTemplateRead.h trunk/spooler/common/gpas/HtmlTemplateRead.cpp trunk/spooler/common/gpas/HtmlTemplateRead.h trunk/spooler/common/gpas/HttpThread.cpp trunk/spooler/common/gpas/HttpThread.h trunk/spooler/common/gpas/JolStringList.cpp trunk/spooler/common/gpas/JolStringList.h trunk/spooler/common/gpas/LHlpDefs.h trunk/spooler/common/gpas/LICENSE.txt trunk/spooler/common/gpas/LicManLogin.cpp trunk/spooler/common/gpas/LicManLogin.h trunk/spooler/common/gpas/LogCache.cpp trunk/spooler/common/gpas/LogCache.h trunk/spooler/common/gpas/LogDefs.cpp trunk/spooler/common/gpas/LogDefs.h trunk/spooler/common/gpas/LogEntryWrite.cpp trunk/spooler/common/gpas/LogEntryWrite.h trunk/spooler/common/gpas/LogFile.cpp trunk/spooler/common/gpas/LogFile.h trunk/spooler/common/gpas/LogMaster.cpp trunk/spooler/common/gpas/LogMaster.h trunk/spooler/common/gpas/LogReader.cpp trunk/spooler/common/gpas/LogReader.h trunk/spooler/common/gpas/LogViewer.cpp trunk/spooler/common/gpas/LogViewer.h trunk/spooler/common/gpas/SMTPMailer.cpp trunk/spooler/common/gpas/SMTPMailer.h trunk/spooler/common/gpas/SecEncrypt.cpp trunk/spooler/common/gpas/SecEncrypt.h trunk/spooler/common/gpas/SecHash.cpp trunk/spooler/common/gpas/SecHash.h trunk/spooler/common/gpas/ServerConnManager.cpp trunk/spooler/common/gpas/ServerConnManager.h trunk/spooler/common/gpas/UtilsVcl.cpp trunk/spooler/common/gpas/UtilsVcl.h trunk/spooler/common/gpas/WinSockApi.h trunk/spooler/common/gpas/stdafx.h trunk/spooler/common/gpas/tchar.h trunk/spooler/common/jp/ trunk/spooler/common/jp/Ascii.h trunk/spooler/common/jp/JpAsciiFormatter.cpp trunk/spooler/common/jp/JpAsciiFormatter.h trunk/spooler/common/jp/JpAsciiToPcl.cpp trunk/spooler/common/jp/JpAsciiToPcl.h trunk/spooler/common/jp/JpBanner.cpp trunk/spooler/common/jp/JpBanner.h trunk/spooler/common/jp/JpBidiDriver.cpp trunk/spooler/common/jp/JpBidiDriver.h trunk/spooler/common/jp/JpBidiPjlDriver.cpp trunk/spooler/common/jp/JpBidiPjlDriver.h trunk/spooler/common/jp/JpBidiPsDriver.cpp trunk/spooler/common/jp/JpBidiPsDriver.h trunk/spooler/common/jp/JpDriver.cpp trunk/spooler/common/jp/JpDriver.h trunk/spooler/common/jp/JpHTTPClient.cpp trunk/spooler/common/jp/JpHTTPClient.h trunk/spooler/common/jp/JpHTTPDirClient.cpp trunk/spooler/common/jp/JpHTTPDirClient.h trunk/spooler/common/jp/JpHTTPServer.cpp trunk/spooler/common/jp/JpHTTPServer.h trunk/spooler/common/jp/JpIo.cpp trunk/spooler/common/jp/JpIo.h trunk/spooler/common/jp/JpJob.cpp trunk/spooler/common/jp/JpJob.h trunk/spooler/common/jp/JpLpdPrinter.cpp trunk/spooler/common/jp/JpLpdPrinter.h trunk/spooler/common/jp/JpModStream.cpp trunk/spooler/common/jp/JpModStream.h trunk/spooler/common/jp/JpParser.cpp trunk/spooler/common/jp/JpParser.h trunk/spooler/common/jp/JpParserDriver.cpp trunk/spooler/common/jp/JpParserDriver.h trunk/spooler/common/jp/JpParserPrinter.cpp trunk/spooler/common/jp/JpParserPrinter.h trunk/spooler/common/jp/JpPclBanner.cpp trunk/spooler/common/jp/JpPclBanner.h trunk/spooler/common/jp/JpPclParser.cpp trunk/spooler/common/jp/JpPclParser.h trunk/spooler/common/jp/JpPclXlParser.cpp trunk/spooler/common/jp/JpPclXlParser.h trunk/spooler/common/jp/JpPjlCommandParser.cpp trunk/spooler/common/jp/JpPjlCommandParser.h trunk/spooler/common/jp/JpPjlDriver.cpp trunk/spooler/common/jp/JpPjlDriver.h trunk/spooler/common/jp/JpPjlResponseParser.cpp trunk/spooler/common/jp/JpPjlResponseParser.h trunk/spooler/common/jp/JpPrinter.h trunk/spooler/common/jp/JpPsBanner.cpp trunk/spooler/common/jp/JpPsBanner.h trunk/spooler/common/jp/JpPsParser.cpp trunk/spooler/common/jp/JpPsParser.h trunk/spooler/common/jp/JpSearch.cpp trunk/spooler/common/jp/JpSearch.h trunk/spooler/common/jp/JpSpoolerBase.cpp trunk/spooler/common/jp/JpSpoolerBase.h trunk/spooler/common/jp/JpTcpIpClient.cpp trunk/spooler/common/jp/JpTcpIpClient.h trunk/spooler/common/jp/JpTcpIpPrinter.cpp trunk/spooler/common/jp/JpTcpIpPrinter.h trunk/spooler/common/jp/JpTcpIpServer.cpp trunk/spooler/common/jp/JpTcpIpServer.h trunk/spooler/common/jp/JpTcpIpSocket.cpp trunk/spooler/common/jp/JpTcpIpSocket.h trunk/spooler/common/jp/LICENSE.txt trunk/spooler/common/nds/ trunk/spooler/common/nds/Directory.cpp trunk/spooler/common/nds/Directory.h trunk/spooler/common/nds/DirectoryVcl.cpp trunk/spooler/common/nds/DirectoryVcl.h trunk/spooler/common/nds/GvNdsBrowser.cpp trunk/spooler/common/nds/GvNdsBrowser.dfm trunk/spooler/common/nds/GvNdsBrowser.h trunk/spooler/common/nds/GvNdsError.cpp trunk/spooler/common/nds/GvNdsError.dfm trunk/spooler/common/nds/GvNdsError.h trunk/spooler/common/nds/GvNdsGeneral.cpp trunk/spooler/common/nds/GvNdsGeneral.h trunk/spooler/common/nds/GvNdsTypeNames.h trunk/spooler/common/nds/GvNdsUserChooser.cpp trunk/spooler/common/nds/GvNdsUserChooser.dfm trunk/spooler/common/nds/GvNdsUserChooser.h trunk/spooler/common/nds/LICENSE.txt trunk/spooler/common/nds/NDSAddObject.cpp trunk/spooler/common/nds/NDSAddObject.h trunk/spooler/common/nds/NDSContext.cpp trunk/spooler/common/nds/NDSContext.h trunk/spooler/common/nds/NDSInput.cpp trunk/spooler/common/nds/NDSInput.h trunk/spooler/common/nds/NDSIteration.cpp trunk/spooler/common/nds/NDSIteration.h trunk/spooler/common/nds/NDSList.cpp trunk/spooler/common/nds/NDSList.h trunk/spooler/common/nds/NDSListContainers.cpp trunk/spooler/common/nds/NDSListContainers.h trunk/spooler/common/nds/NDSModifyClassDef.cpp trunk/spooler/common/nds/NDSModifyClassDef.h trunk/spooler/common/nds/NDSModifyEntry.cpp trunk/spooler/common/nds/NDSModifyEntry.h trunk/spooler/common/nds/NDSObject.cpp trunk/spooler/common/nds/NDSObject.h trunk/spooler/common/nds/NDSRead.cpp trunk/spooler/common/nds/NDSRead.h trunk/spooler/common/nds/NDSReadAttrDef.cpp trunk/spooler/common/nds/NDSReadAttrDef.h trunk/spooler/common/nds/NDSReadClassDef.cpp trunk/spooler/common/nds/NDSReadClassDef.h trunk/spooler/common/nds/NDSSearch.cpp trunk/spooler/common/nds/NDSSearch.h trunk/spooler/common/nds/NDSSession.cpp trunk/spooler/common/nds/NDSSession.h trunk/spooler/common/nds/NDSStream.cpp trunk/spooler/common/nds/NDSStream.h trunk/spooler/common/nds/NLMApp.cpp trunk/spooler/common/nds/NLMApp.h trunk/spooler/common/nds/NLMAppVcl.cpp trunk/spooler/common/nds/NLMAppVcl.h trunk/spooler/common/nds/NLMAppVclThread.cpp trunk/spooler/common/nds/NLMAppVclThread.h trunk/spooler/common/nds/NLMAsyncCall.cpp trunk/spooler/common/nds/NLMAsyncCall.h trunk/spooler/common/nds/NLMBase.cpp trunk/spooler/common/nds/NLMBase.h trunk/spooler/common/nds/NLMIODecoupler.cpp trunk/spooler/common/nds/NLMIODecoupler.h trunk/spooler/common/nds/NLMLibrary.cpp trunk/spooler/common/nds/NLMLibrary.h trunk/spooler/common/nds/NLMLock.cpp trunk/spooler/common/nds/NLMLock.h trunk/spooler/common/nds/NLMPortal.cpp trunk/spooler/common/nds/NLMPortal.h trunk/spooler/common/nds/NLMScreen.cpp trunk/spooler/common/nds/NLMScreen.h trunk/spooler/common/nds/NLMStd.h trunk/spooler/common/nds/NLMThread.cpp trunk/spooler/common/nds/NLMThread.h trunk/spooler/common/nds/NLMThreadPool.cpp trunk/spooler/common/nds/NLMThreadPool.h trunk/spooler/common/nds/NdsCacheSearch.cpp trunk/spooler/common/nds/NdsCacheSearch.h trunk/spooler/netware/ trunk/spooler/netware/g2ndps/ trunk/spooler/netware/g2ndps/G2Ndps.cpp trunk/spooler/netware/g2ndps/G2Ndps.def trunk/spooler/netware/g2ndps/G2Ndps.h trunk/spooler/netware/g2ndps/G2Ndps.mcp trunk/spooler/netware/g2ndps/LICENSE.txt trunk/spooler/netware/g2ndps/NdpsGwJob.cpp trunk/spooler/netware/g2ndps/NdpsGwJob.h trunk/spooler/netware/g2ndps/NdpsGwPA.cpp trunk/spooler/netware/g2ndps/NdpsGwPA.h trunk/spooler/netware/g2ndps/NdpsGwPrinter.cpp trunk/spooler/netware/g2ndps/NdpsGwPrinter.h trunk/spooler/netware/g2ndps/NdpsOpcodes.h trunk/spooler/netware/g2ndps/Prefix.h trunk/spooler/netware/g2ndps/rel_g2NDPS.txt trunk/spooler/netware/g2spool/ trunk/spooler/netware/g2spool/Ascii.h trunk/spooler/netware/g2spool/DebugThread.cpp trunk/spooler/netware/g2spool/DebugThread.h trunk/spooler/netware/g2spool/GSpool.cpp trunk/spooler/netware/g2spool/GSpool.def trunk/spooler/netware/g2spool/GSpool.h trunk/spooler/netware/g2spool/GSpool.mcp trunk/spooler/netware/g2spool/HttpSpThread.cpp trunk/spooler/netware/g2spool/HttpSpThread.h trunk/spooler/netware/g2spool/HttpThread.cpp trunk/spooler/netware/g2spool/HttpThread.h trunk/spooler/netware/g2spool/Job.cpp trunk/spooler/netware/g2spool/Job.h trunk/spooler/netware/g2spool/JobMoverThread.cpp trunk/spooler/netware/g2spool/JobMoverThread.h trunk/spooler/netware/g2spool/LICENSE.txt trunk/spooler/netware/g2spool/MixedScheduler.cpp trunk/spooler/netware/g2spool/MixedScheduler.h trunk/spooler/netware/g2spool/NLMApp.mlc trunk/spooler/netware/g2spool/NLMApp.mlh trunk/spooler/netware/g2spool/NdpsJob.cpp trunk/spooler/netware/g2spool/NdpsJob.h trunk/spooler/netware/g2spool/NdpsOpcodes.h trunk/spooler/netware/g2spool/NdpsScheduler.cpp trunk/spooler/netware/g2spool/NdpsScheduler.h trunk/spooler/netware/g2spool/PclBanner.h trunk/spooler/netware/g2spool/Prefix.h trunk/spooler/netware/g2spool/PrinterDisplay.cpp trunk/spooler/netware/g2spool/PrinterDisplay.h trunk/spooler/netware/g2spool/PrinterDisplayEntry.cpp trunk/spooler/netware/g2spool/PrinterDisplayEntry.h trunk/spooler/netware/g2spool/PrinterThread.cpp trunk/spooler/netware/g2spool/PrinterThread.h trunk/spooler/netware/g2spool/PsBanner.h trunk/spooler/netware/g2spool/QmsJob.cpp trunk/spooler/netware/g2spool/QmsJob.h trunk/spooler/netware/g2spool/QmsQueueManager.cpp trunk/spooler/netware/g2spool/QmsQueueManager.h trunk/spooler/netware/g2spool/QmsQueuePrinter.cpp trunk/spooler/netware/g2spool/QmsQueuePrinter.h trunk/spooler/netware/g2spool/QmsScheduler.cpp trunk/spooler/netware/g2spool/QmsScheduler.h trunk/spooler/netware/g2spool/Scheduler.cpp trunk/spooler/netware/g2spool/Scheduler.h trunk/spooler/netware/g2spool/Settings.cpp trunk/spooler/netware/g2spool/Settings.h trunk/spooler/netware/g2spool/UserPopupNotify.cpp trunk/spooler/netware/g2spool/UserPopupNotify.h trunk/spooler/netware/g2spool/rel_gspl.txt Added: trunk/spooler/common/gpas/CryptString.cpp =================================================================== --- trunk/spooler/common/gpas/CryptString.cpp (rev 0) +++ trunk/spooler/common/gpas/CryptString.cpp 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,220 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +//--------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-2001 +//--------------------------------------------------------------------------- + + Date Author Code Description + + 20/08/01 JOL Created +//--------------------------------------------------------------------------- +*/ + +#ifdef GPAS_PCH_VCL + #include <vcl.h> + #pragma hdrstop + #pragma package(smart_init) +#endif + +#ifdef VSTUDIO + #include "stdafx.h" + #pragma warning(disable:4018 4267) + #ifdef _DEBUG + #define new DEBUG_NEW + #endif +#endif + +#include "CryptString.h" +#include "SecEncrypt.h" +#include "stdio.h" + +//--------------------------------------------------------------------------- +// EncryptString. Encrypts a string and translates it into a hexadecimal +// form (suitable for transmission as a URL parameter, for example). Tamper- +// detection is built in by inserting a predictable (to us) sequence of +// characters throughout the string that can be verified during decryption. +// A new encrypted string is returned to the caller: it is the caller's +// responsibility to free this string when it is finished with. +char* EncryptString(const char* sz) +{ + // This is the GPAS copy controller key! + DWORD dwKey[] = { 0xe567bc32L, 0x94a8dc34L, 0x96b0fe83L, 0x59c3da56L }; + + // Strip trailing spaces to avoid unnecessary encryption + int nStLen; + if (sz) + for (nStLen = strlen(sz); nStLen && sz[nStLen-1] == ' '; --nStLen); + + // Check length, aborting if empty. + if (!sz || !sz[0]) return NULL; + + // Work out how many QWORDs we will have to encrypt. Note that due to + // character insertion the magic number here, unlike the decrypt function, + // is 7! Note also that we leave space for 1 character to be inserted + // at the beginning of the source string, which will hold the total number + // of QWORDs in the encrypted string. + int nLen = nStLen + 1; + int nQW = (nLen / 7) + ((nLen % 7) ? 1 : 0); + + // Now we can work out the size of the new buffer. + int nSize = nQW * 8 * 2; + char* szNew = new char[nSize+1]; + memset(szNew, 0, nSize+1); + char* szTmp = new char[nSize+1]; + memset(szTmp, 0, nSize+1); + + // Copy sz to szNew, inserting the number of QWORDs in the first character. + szNew[0] = (unsigned char)nQW; + strncat(szNew, sz, nStLen); + // Pad to a multiple of 7 in length + while (strlen(szNew) % 7) + { + szNew[strlen(szNew)] = ' '; + } + + // Copy sz to szTmp, inserting a random capital letter at the first 8th + // position, and then cycling through the letters for each subsequent 8th + // position. This ensures that each QWORD will have a random element, and + // that during decryption we can see if the string has been tampered with. +#ifdef GPAS_PCH_VCL + char cInsert = 'A' + (char)random(26); +#else + char cInsert = 'A' + (char)rand()%26; +#endif + char c2 = cInsert; + for (int i = 0; i < nQW; i++) + { + strncat(szTmp, &szNew[i*7], 7); + strncat(szTmp, &cInsert, 1); + cInsert = ((cInsert - 'A' + 1) % 26) + 'A'; + } + // Save the 'real' length of szTmp, as encryption can result in NULLs + // being placed in string so we cannot rely on strlen(). + int nTmp = strlen(szTmp); + + // Encrypt szTmp in blocks of 8 bytes (i.e. QWORDs) + CsecEncrypt crypt; + crypt.SetKey(dwKey, 4); + crypt.Init(); + crypt.Encrypt((QWORD*)szTmp, nQW); + + // The encrypted string is now in szTmp. Finally we convert it to hex + // (each character being represented by a 2-digit hex number), transferring + // it to szNew as we go. + for (unsigned int i = 0; i < nTmp; i++) + { + sprintf(&szNew[i*2], "%02X", (unsigned char)szTmp[i]); + } + + // Finally delete szTmp and return szNew + delete szTmp; + return szNew; +} + +//--------------------------------------------------------------------------- +// DecryptString. Decrypts a string previously encrypted with ConfigEncrypt. +// Returns the decrypted version iff the string was as expected; if any +// tampering is detected, NULL is returned. It is the caller's +// responsibility to free the returned string (if any) when it is finished +// with. +char* DecryptString(const char* sz) +{ + // This is the GPAS copy controller key! + DWORD dwKey[] = { 0xe567bc32L, 0x94a8dc34L, 0x96b0fe83L, 0x59c3da56L }; + + // Check length, aborting if not a multiple of 16 (i.e. 8 bytes encoded + // as hex). + if (!sz || strlen(sz) % 16) + return NULL; + + // Work out how many QWORDs we will have to decrypt. + int nLen = strlen(sz) / 2; + int nQW = (nLen / 8) + ((nLen % 8) ? 1 : 0); + + // Now we can work out the size of the new buffer. + int nSize = nQW * 8; + char* szNew = new char[nSize+1]; + memset(szNew, 0, nSize+1); + char* szTmp = new char[nSize+1]; + memset(szTmp, 0, nSize+1); + + // Now convert sz back from its hex representation to standard ASCII. + char szC[3] = { 0, 0, 0 }; + for (int i = 0; i < nLen; i++) + { + szC[0] = sz[i*2 ]; + szC[1] = sz[i*2+1]; + int n; + sscanf(szC, "%02X", &n); + szTmp[i] = (unsigned char)n; + } + // Note: at this point, szTmp may contain NULLs, but decryption should + // remove them! + + // Decrypt szTmp in blocks of 8 bytes (i.e. QWORDs) + CsecEncrypt crypt; + crypt.SetKey(dwKey, 4); + crypt.Init(); + crypt.Decrypt((QWORD*)szTmp, nQW); + + // The decrypted string is now in szTmp. Finally we strip out the + // inserted characters, checking the string's integrity and copying + // it to szNew as we go. + BOOL bOk = (nQW == szTmp[0]); + + // This loop will drop out if bOk becomes FALSE + char cInsert, cCheck; + for (unsigned int i = 0; i < nQW && bOk; i++) + { + // Check each successive inserted character + cCheck = szTmp[7+i*8]; + if (i == 0) + { + strncat(szNew, &szTmp[1], 6); + cInsert = cCheck; + } + else + { + strncat(szNew, &szTmp[i*8], 7); + cInsert = ((cInsert - 'A' + 1) % 26) + 'A'; + bOk = (cInsert == cCheck); + } + } + + // Now if bOk is TRUE, return szNew; otherwise delete it and return NULL. + delete szTmp; + if (bOk) + { + // Strip trailing spaces that were added as part of the encryption phase + for (int j = strlen(szNew); j && szNew[j - 1] == ' '; szNew[--j] = 0); + return szNew; + } + else + { + delete szNew; + return NULL; + } +} Added: trunk/spooler/common/gpas/CryptString.h =================================================================== --- trunk/spooler/common/gpas/CryptString.h (rev 0) +++ trunk/spooler/common/gpas/CryptString.h 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,46 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +//--------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-2001 +//--------------------------------------------------------------------------- + + Date Author Code Description + + 20/08/01 JOL Created +//--------------------------------------------------------------------------- +*/ + +#ifndef CryptStringH +#define CryptStringH + +//--------------------------------------------------------------------------- +// Helper functions for encrypting and decrypting configuration information +// sent via a URL's parameters. +char* EncryptString(const char* sz); +char* DecryptString(const char* sz); + +//--------------------------------------------------------------------------- +#endif Added: trunk/spooler/common/gpas/GErrMsg.h =================================================================== --- trunk/spooler/common/gpas/GErrMsg.h (rev 0) +++ trunk/spooler/common/gpas/GErrMsg.h 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,101 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 19990729 JOL Class for recording error messages. +------------------------------------------------------------------------- +*/ +#ifndef GErrMsg_H +#define GErrMsg_H + +#include <stdio.h> +#include <stdarg.h> +#if defined (N_PLAT_NLM) + #include <NLMStd.h> +#endif +#if defined (WIN32) + #include <windows.h> +#endif + + +#define GERR_MAX 20 + + +class CGErrMsg +{ + private: + char* m_szMsg[GERR_MAX]; + int m_nCount; + long m_lCode; + + public: + + CGErrMsg() + { + m_nCount = 0; + m_lCode = 0; + } + + ~CGErrMsg() { Clear(); } + + int GetCount() { return m_nCount; } + + long GetCode() { return m_lCode; } + void SetCode(long lCode) { m_lCode = lCode; } + + BOOL Add(const char *sz, ...) + { + if (m_nCount == GERR_MAX || !sz) return FALSE; + + m_szMsg[m_nCount] = new char[512]; + va_list arglist; + va_start (arglist, sz); + vsprintf(m_szMsg[m_nCount], sz, arglist); + va_end (arglist); + m_nCount++; + + return TRUE; + } + + void Clear() + { + for (int i = 0; i < m_nCount; i++) + delete []m_szMsg[i]; + m_nCount = 0; + m_lCode = 0; + } + + const char* Entry(int nIndex) + { + return (nIndex < 0 || nIndex >= m_nCount) ? "" : m_szMsg[nIndex]; + } +}; + +#endif Added: trunk/spooler/common/gpas/GTypes.h =================================================================== --- trunk/spooler/common/gpas/GTypes.h (rev 0) +++ trunk/spooler/common/gpas/GTypes.h 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,67 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-1999 +------------------------------------------------------------------------- + + Date Author Code Description + + 1999-08-10 JOL Type declarations + (previously in Directory.h) +------------------------------------------------------------------------- +*/ + +#ifndef GPAS_TYPES_H +#define GPAS_TYPES_H + +#ifdef _WIN32 + #include <windows.h> +#else + #include <ctype.h> + #include <ntypes.h> + #include <nwtypes.h> + #define WCHAR nuint16 + #define TEXT(x) x + #define TCHAR char + #define UCHAR unsigned char + #define LPSTR char* + #define LPWSTR WCHAR* + #define LPTSTR TCHAR* + #define LPCSTR const char* + #define LPCWSTR const WCHAR* + #define LPCTSTR const TCHAR* + #define ULONG unsigned long + #define DWORD nuint32 + #define BOOL int + #define UINT unsigned int + #define USHORT unsigned short + #define TRUE 1 + #define FALSE 0 +#endif + +#define MAX_DN_CHARS 256 + +#endif Added: trunk/spooler/common/gpas/GeoUtils.c =================================================================== --- trunk/spooler/common/gpas/GeoUtils.c (rev 0) +++ trunk/spooler/common/gpas/GeoUtils.c 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,311 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1997-2001 +------------------------------------------------------------------------- + + Date Author Code Description + 08/03/99 MAB Created + 08/02/00 MGR P0048 gStrstr special case for length 0 + 28/08/01 MGR P0163 NW5.1 SP3 abends with 8-bit char values +------------------------------------------------------------------------- +*/ +#ifdef VSTUDIO +#pragma warning(disable: 4018 4267) +#endif + +#include "GeoUtils.h" + +// standard +#include <string.h> + +/* +------------------------------------------------------------------------- +*/ +void gStripExtraSpaces(char* szStr) +{ + gStripSpacesNonPrint(szStr, FALSE); +} + +/* +------------------------------------------------------------------------- +*/ +void gStripSpacesNonPrint(char* szStr, BOOL bRemoveNonPrintable) +{ + int i; + int bSeenPrintable = FALSE; + char newString[512]; + strncpy(newString, szStr, 512); + newString[511] = 0; + + for (i=0; i < strlen(newString); i++) + { + // MGR 14/11/00 - replaces tabs/newlines with space + if (isspace(newString[i])) + { + // strip leading spaces too! + if (bSeenPrintable) + *szStr++ = ' '; + + // skip all but first of each space + // P0163 - avoid double-evaluation of isspace() macro parameter + while(++i, isspace(newString[i])); + i--; + } + else if (!bRemoveNonPrintable + || ((int)newString[i] >= 0 && (isalnum(newString[i]) || ispunct(newString[i])))) + { + *szStr++ = newString[i]; + bSeenPrintable = TRUE; + } + } + + // check for trailing space, remove if so... + if (*(--szStr) == ' ') + *szStr = '\0'; + else + *(++szStr) = '\0'; +} + +/* +------------------------------------------------------------------------- + Pass in 0 if you want to search to a 0 terminator, else they get searched past. + To match a space in the substring against any group of whitespace + in the searched string, pass an int* as matchWhite. The number of + characters in the matched section of the searched string will be returned. + For example, search "b c" in "ab cd" will return a length 5. +*/ +char* gStrstr(char* str, const char* substr, int lenStr, int ignoreCase, int* matchWhite) +{ + int i = 0, j = 0, k = 0; + int substrLen = strlen(substr); + + // P0048 - now pass in zero to mean search to zero terminator. For some + // purposes we want to search past 0's (e.g. PCL) - pass length to achieve this + if (lenStr < 1) + lenStr = strlen(str); + + // Scan portion specified + for (; i < lenStr; i++) + { + // If first character matches... + if ((ignoreCase && (gToupper(str[i]) == gToupper(substr[0]))) // P0163 - use new function + || (str[i] == substr[0]) ) + { + // Check remaining chars + for (j = i + 1, k = 1; j < lenStr && k < substrLen; j++, k++) + { + // If combining white space, skip following whitespace + if (matchWhite && substr[k - 1] == ' ') + for (; j < lenStr && isspace(str[j]); j++); + + // Break on first mismatch + if (j == lenStr + || !((ignoreCase && (gToupper(str[j]) == gToupper(substr[k]))) // P0163 - use new function + || (str[j] == substr[k]))) + break; + } + + // If whole substring matched, return + if (k == substrLen) + { + if (matchWhite) + *matchWhite = j - i; + + return &str[i]; + } + } + } + + // Not found + return NULL; +} + +/* +------------------------------------------------------------------------- +*/ +char* gStrchr(char* pStr, char cChr, int cLen) +{ + // Kind of "strnchr" that doesn't stop at zeroes + while (cLen--) + { + if (*pStr == cChr) + return pStr; + pStr++; + } + + // If not found within cLen, return NULL + return NULL; +} + +/* +------------------------------------------------------------------------- +*/ +void gSwapStrCat(char *cAppendTo, const char *cIn) +{ + int i; + char cLast = 0; + int nAppendToLen; + nAppendToLen = strlen(cAppendTo); + + for (i = 0; i < strlen(cIn); i++) + { + if (cIn[i] >= ' ' && cIn[i] <= '}' && cLast != '\\' + && !strchr("\\A{\"", cIn[i])) // between 32 and 125 inclusive + cAppendTo[nAppendToLen++] = '}' - cIn[i] + ' '; // 32->125, ..., 125->32 + else + cAppendTo[nAppendToLen++] = cIn[i]; + + cLast = cIn[i]; + } + + cAppendTo[nAppendToLen] = '\0'; +} + +/* +------------------------------------------------------------------------- +*/ +#define CHECK_LINE_END if ( ++nLineLen == 65 ) { nLineLen = 0; cOut[nOutPos++] = '\n'; } +int gEncodeAscii85(const char *cIn, int nIn, char *cOut) +{ + int nOutPos = 0, nInPos = 0, nBlock; + int nLineLen = 0; + unsigned long lBlock; + unsigned char cBlock[4], cEncBlock[5]; + + // Loop through entire cIn buffer. nInPos/nOutPos hold + // current offset in cIn/cOut buffers. + while (nInPos < nIn) + { + // Get the next 4 bytes into cBlock, or as many as are + // available if we are at the end of the buffer. + nBlock = 0; + memset(cBlock, 0, 4); + while (nBlock < 4 && nInPos + nBlock < nIn) + { + cBlock[nBlock++] = cIn[nInPos + nBlock]; + } + // nBlock now holds the number of bytes in the block: + // add this to the current buffer position for the next iteration. + nInPos = nInPos + nBlock; + + // Now encode the (upto 4) bytes as an (upto 5) byte asc85 block. + lBlock = (((unsigned long)((((unsigned int)cBlock[0]) << 8) | cBlock[1])) << 16) + | ((((unsigned int)cBlock[2]) << 8) | cBlock[3]); + if (lBlock == 0) + { + // If zero, write an ascii 'z' + cOut[nOutPos++] = 'z'; + CHECK_LINE_END; + } + else + { + // Otherwise, work out 5-byte encoding... + unsigned long q = lBlock / 7225; + unsigned r = (unsigned)lBlock - 7225 * (unsigned)q; + unsigned t; + cEncBlock[3] = (t = r / 85) + '!'; + cEncBlock[4] = r - 85 * t + '!'; + cEncBlock[0] = (t = q / 7225) + '!'; + r = (unsigned)q - 7225 * t; + cEncBlock[1] = (t = r / 85) + '!'; + cEncBlock[2] = r - 85 * t + '!'; + // ...always write first and second byte (the minimum to store if + // nBlock is 1)... + cOut[nOutPos++] = cEncBlock[0]; + CHECK_LINE_END; + cOut[nOutPos++] = cEncBlock[1]; + CHECK_LINE_END; + // ...but only write third byte if nBlock is two or more... + if (nBlock > 1) + { + cOut[nOutPos++] = cEncBlock[2]; + CHECK_LINE_END; + } + // ...and only write fourth byte if nBlock is three or more... + if (nBlock > 2) + { + cOut[nOutPos++] = cEncBlock[3]; + CHECK_LINE_END; + } + // ...and only write fifth byte if nBlock is two or more... + if (nBlock > 3) + { + cOut[nOutPos++] = cEncBlock[4]; + CHECK_LINE_END; + } + } + } + // Now append end of PS + cOut[nOutPos++] = '~'; + CHECK_LINE_END; + cOut[nOutPos++] = '>'; + CHECK_LINE_END; + return nOutPos; +} + +/* +------------------------------------------------------------------------- +*/ +int gSecondsSince1970( int nDay, int nMonth, int nYear, int nHour, int nMinute, int nSecond) +{ + int n, nResult = 0; + // Add years + for ( n = nYear; n > 1970; n-- ) + if ( n % 4 == 0 ) + nResult += 366; + else + nResult += 365; + // Add months + switch ( nMonth ) + { + case 12: nResult += 30; + case 11: nResult += 31; + case 10: nResult += 30; + case 9: nResult += 31; + case 8: nResult += 31; + case 7: nResult += 30; + case 6: nResult += 31; + case 5: nResult += 30; + case 4: nResult += 31; + case 3: + if ( nYear % 4 == 0 ) + nResult += 29; + else + nResult += 28; + + case 2: nResult += 31; + } + // Add days + nResult += nDay - 1; + + // convert to seconds + nResult = (nResult * 24 * 60 * 60) + (nHour * 60 * 60) + (nMinute * 60) + nSecond; + // Return result + return nResult; +} + + Added: trunk/spooler/common/gpas/GeoUtils.h =================================================================== --- trunk/spooler/common/gpas/GeoUtils.h (rev 0) +++ trunk/spooler/common/gpas/GeoUtils.h 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,70 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1997-2001 +------------------------------------------------------------------------- + + Date Author Code Description + 08/03/99 MAB Created + 28/08/01 MGR P0163 NW5.1 SP3 abends with 8-bit char values +------------------------------------------------------------------------- +*/ + +#ifndef GPAS_GEOUTILS_H +#define GPAS_GEOUTILS_H + +#include "gtypes.h" +#include "ctype.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void gStripExtraSpaces(char* szStr); +void gStripSpacesNonPrint(char* szStr, BOOL bRemoveNonPrintable); +char* gStrstr(char *str, const char *substr, int lenStr, int ignoreCase, int* matchWhite); +char* gStrchr(char* pStr, char cChr, int cLen); +void gSwapStrCat(char *cAppendTo, const char *cIn); +int gEncodeAscii85(const char *cIn, int nIn, char *cOut); +int gSecondsSince1970( int nDay, int nMonth, int nYear, int nHour, int nMinute, int nSecond); + +#ifdef __cplusplus +} + +// P0163 - C++ - make sure we only pass ASCII values +inline int gToupper(int c) { return isascii(c)? toupper(c) : c; } +inline int gTolower(int c) { return isascii(c)? tolower(c) : c; } + +#else + +// P0163 - C - make sure we only pass ASCII values +// NOTE: beware of double-evaluation of parameter +#define gToupper(c) (isascii(c)? toupper(c) : (c)) +#define gTolower(c) (isascii(c)? tolower(c) : (c)) + +#endif + +#endif // GPAS_GEOUTILS_H \ No newline at end of file Added: trunk/spooler/common/gpas/GoAccountType.cpp =================================================================== --- trunk/spooler/common/gpas/GoAccountType.cpp (rev 0) +++ trunk/spooler/common/gpas/GoAccountType.cpp 2009-12-10 16:20:23 UTC (rev 85) @@ -0,0 +1,912 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +/* +------------------------------------------------------------------------- + Geomica Printer Accounting System + Copyright (c) Geomica Ltd 1998-2000 +------------------------------------------------------------------------- + + Date Author Code Description + + 16/11/98 MGR Created + 16/2/99 MGR PRB053 Timeouts added + 10/2/99 MGR Modified for v2.0 + 23/12/99 MGR P0003 Cope with parenthesised negative formats + 23/10/00 MGR P0143 Bug reading revision +------------------------------------------------------------------------- +*/ +#ifdef GPAS_PCH_VCL + #include <vcl.h> + #pragma hdrstop + #define TIMESTAMP NWTIMESTAMP + #pragma package(smart_init) +#endif + +#ifdef VSTUDIO + #include "stdafx.h" + #pragma warning(disable: 4311 4312 4267 4996) +#endif + +#include "GoAccountType.h" +#include "GoSchema.h" +#include "NDSRead.h" +#include "NDSAddObject.h" +#include <nwnet.h> +#include <stdlib.h> + +// List bits for CgoTaggedRef +#define GPAS_AT_TRB_OPERATOR 0x01 +#define GPAS_AT_TRB_CCALLOWED 0x01 + +/* +------------------------------------------------------------------------- + Constructor sets up default settings. These are the initial values + for newly created account types, and also a baseline against which + changes are logged when account type are first saved +*/ +CgoAccountType::CgoAccountType() +{ + // Also called by CleanUp() + Construct(); +} + +/* +------------------------------------------------------------------------- +*/ +void CgoAccountType::Construct() +{ + // Set defaults + strcpy(m_szAmountFormat, "-1"); + m_bRestrictCCs = FALSE; + m_bAllowDeposits = FALSE; + m_bAnyReasons = FALSE; + m_szLogCentre[0] = 0; + m_bHideFromClient = FALSE; + + // Set old values for comparison + m_old = *this; + + // Set fixed values (no defaults) + m_nMode = -1; + m_szAttribute[0] = 0; + + // Internals + m_pCoreEntry = NULL; + m_szCoreSurplus = NULL; + m_nRevision = 0; + + // Because they're checked in destructor + m_pReasons = NULL; + m_pOperators = NULL; + m_pCostCentres = NULL; + + m_pCostCodes = NULL; //E0215 + +#ifdef VSTUDIO + m_whenChanged[0] = 0; +#endif +} + +/* +------------------------------------------------------------------------- +*/ +CgoAccountType::~CgoAccountType() +{ + // Clean up + CleanUp(); +} + +/* +------------------------------------------------------------------------- + Free any resources used by the object currently loaded, in preparation + to load another or to destruct +*/ +void CgoAccountType::CleanUp() +{ + // Clean out other directories + if (m_pReasons) + m_pReasons->Delete(); + if (m_pOperators) + m_pOperators->Delete(); + if (m_pCostCentres) + m_pCostCentres->Delete(); + + if( m_pCostCodes) free((void*)m_pCostCodes); //E0215 + + // Surplus is gStrdup'ed + delete[] m_szCoreSurplus; + + // Set the rest + Construct(); +} + +/* +------------------------------------------------------------------------- + Specify account type without loading NDS object. Do not need to load + object to test operator status or write changes to config log (e.g. + queue changes) +*/ +void CgoAccountType::SetObject(LPCSTR szAcctType) +{ + // Clean out old object's stuff + CleanUp(); + + // Save name + CNDSObject::SetObject(szAcctType); + + // Set up stream - context must have been set already + m_configLog.SetAttrib(GetContext(), szAcctType, GPAS_A_LOG); +} + +/* +------------------------------------------------------------------------- + Call base class to load required properties into directory, then + read directory and set struct members for easier access. Returns + FALSE on NDS read error and context error codes will give more details +*/ +BOOL CgoAccountType::ReadObject() +{ + // Clean out old object's stuff + CleanUp(); + + // Select attributes to read and build name list + LPCSTR pszAttribs[] = + { + GPAS_A_SETTINGS, + GPAS_A_TAGGEDREF, + A_REVISION, + NULL + }; + + // Read object using base class + if (!CNDSObject::ReadObject(pszAttribs)) + return FALSE; + + // Testing +#ifdef GPAS_DEBUG + char buf[4096]; + DirSprintf(buf, GetAttribDir()); + ShowMessage(buf); +#endif + + // Read revision - may not be returned sometimes! + LPCSTR szCurRev = GetAttribDir()->GetValue(A_REVISION "\\0"); + m_nRevision = szCurRev? atol(szCurRev) : 0; + + // Load tagged references for all referenced object types + m_taggedRefs.Attach(GetAttribDir()->Find(GPAS_A_TAGGEDREF)); + + // Create case-insensitive directory structures + m_pOperators = CDirectory::CreateRoot("Operators"); + m_pCostCentres = CDirectory::CreateRoot("Cost centres"); + m_pOperators ->SetAttribs(DIR_IGNORECASE); + m_pCostCentres ->SetAttribs(DIR_IGNORECASE); + + // Create tree structure to receive reasons + m_pReasons = CDirectory::CreateRoot("Reasons"); + m_pReasons->Create("Credit") ->SetAttribs(DIR_IGNORECASE); + m_pReasons->Create("Debit") ->SetAttribs(DIR_IGNORECASE); + m_pReasons->Create("Overdraft") ->SetAttribs(DIR_IGNORECASE); + m_pReasons->Create("Maximum") ->SetAttribs(DIR_IGNORECASE); + m_pReasons->Create("Balance") ->SetAttribs(DIR_IGNORECASE); + + // All user references are operators - create public entry for each + LPCSTR szDN = m_taggedRefs.First(GPAS_TR_USER); + for (; szDN; szDN = m_taggedRefs.Next()) + { + // Check for operator bit before adding to list + if (m_taggedRefs.GetTag(szDN) & GPAS_AT_TRB_OPERATOR) + m_pOperators->Create(szDN); + } + + // All cost centre refs go in allowed list - create public entry for each + szDN = m_taggedRefs.First(GPAS_TR_COSTCENTRE); + for (; szDN; szDN = m_taggedRefs.Next()) + { + // Check for allowed bit before adding to list (logging CC also stored) + if (m_taggedRefs.GetTag(szDN) & GPAS_AT_TRB_CCALLOWED) + m_pCostCentres->Create(szDN); + } + + // Scan settings + CDirectory* pDir = GetAttribDir()->Find(GPAS_A_SETTINGS); + if (pDir) + pDir = pDir->FirstPair(); + for (; pDir; pDir = pDir->NextPair()) + { + // Copy entry to buffer to parse and strip leading char + char szEntry[1024]; + gStrncpy(szEntry, pDir->GetValue(), sizeof(szEntry)); + strtok(szEntry, "|"); + LPCSTR szItem; + + // Meaning of entry depends on initial letter + switch (szEntry[0]) + { + // Fixed settings + case 'F': + { + // Fixed settings + if ((szItem = strtok(NULL, "|")) != NULL) + m_nMode = atoi(szItem); + if ((szItem = strtok(NULL, "|")) != NULL) + gStrncpy(m_szAttribute, szItem, sizeof(m_szAttribute)); + break; + } + + // Core settings + case 'C': + { + // Keep record for deletion if we modify settings + m_pCoreEntry = pDir; + + // General + if ((szItem = strtok(NULL, "|")) != NULL) + gStrncpy(m_szAmountFormat, szItem, sizeof(m_szAmountFormat)); + if ((szItem = strtok(NULL, "|")) != NULL) + m_bRestrictCCs = atoi(szItem); + if ((szItem = strtok(NULL, "|")) != NULL) + m_bAllowDeposits = atoi(szItem); + if ((szItem = strtok(NULL, "|")) != NULL) + m_bAnyReasons = atoi(szItem); + + // Logging + if ((szItem = strtok(NULL, "|")) != NULL + && (szItem = m_taggedRefs.GetIDRef(atol(szItem))) != NULL) + gStrncpy(m_szLogCentre, szItem, sizeof(m_szLogCentre)); + + //MGA// 28/1/2009 + if ((szItem = strtok(NULL, "|")) != NULL) + m_bHideFromClient = atoi(szItem); + + // Record surplus so we can append when writing back + szItem = strtok(NULL, ""); + m_szCoreSurplus = (szItem? gStrdup(szItem) : NULL); + break; + } + + // Reasons + case 'R': + { + // Abort if entry incomplete + if ((szItem = strtok(NULL, "|")) == NULL) + break; + + // Switch according to type + CDirectory* pRDir = NULL; + switch (szItem[0]) + { + // Credit reason + case 'C': + if ((szItem = strtok(NULL, "|")) != NULL) + pRDir = m_pReasons->Find("Credit")->Create(szItem); + break; + + // Debit reason + case 'D': + if ((szItem = strtok(NULL, "|")) != NULL) + pRDir = m_pReasons->Find("Debit")->Create(szItem); + break; + + // Set overdraft reason + case 'O': + if ((szItem = strtok(NULL, "|")) != NULL) + pRDir = m_pReasons->Find("Overdraft")->Create(szItem); + break; + + // Set maximum reason + case 'M': + if ((szItem = strtok(NULL, "|")) != NULL) + pRDir = m_pReasons->Find("Maximum")->Create(szItem); + break; + + // Set balance reason + case 'B': + if ((szItem = strtok(NULL, "|")) != NULL) + pRDir = m_pReasons->Find("Balance")->Create(szItem); + break; + } + + // Save entry ref in case reason removed + if (pRDir) + pRDir->SetTag((DWORD)pDir); + break; + } + case 'T': //E0215 + { + szItem = strtok(NULL, ""); + m_pCostCodes = (szItem? gStrdup(szItem) : NULL); + break; + } + } + } + + // Set reason translations + m_pReasons->SetValue("Balance", "Set balance"); + m_pReasons->SetValue("Maximum", "Set maximum"); + if (GPAS_AT_DECLINING == m_nMode) + { + // Descending account + m_pReasons->SetValue("Credit", "Credit account"); + m_pReasons->SetValue("Debit", "Debit account"); + m_pReasons->SetValue("Overdraft", "Set overdraft"); + } + else + { + // Ascending account + m_pReasons->SetValue("Credit", "Decrease balance"); + m_pReasons->SetValue("Debit", "Increase balance"); + m_pReasons->Delete("Overdraft"); + } + + // Clear flags so changes can be detected + m_pOperators->ClearFlags(); + m_pCostCentres->ClearFlags(); + m_pReasons->ClearFlags(); + + // Save settings for comparison on save + m_old = *this; + return TRUE; +} + +/* +------------------------------------------------------------------------- + Check the current revision number +*/ +BOOL CgoAccountType::ObjectChanged() +{ + // Can't check unless loaded + if (!GetAttribDir()) + return FALSE; + + // Read the current revision attribute (don't blat attrib dir) + // P0143 - was passing wrong parameters to Execute + CNDSRead ndsRead(GetContext()); + if (!ndsRead.Create() + || !ndsRead.PutName(A_REVISION) + || !ndsRead.Execute(GetObjectName(), FALSE, CNDSRead::eValues, FALSE)) + { + // On error, return FALSE so as not to trigger a re-load which may fail + GetContext()->ResetNDSError(); + return FALSE; + } + + // Get current revision - may not be returned sometimes + CDirectory* pResults = ndsRead.Results(); + LPCSTR szCurRev = pResults->GetValue(A_REVISION "\\0"); + long nCurRev = szCurRev? atol(szCurRev) : 0; + pResults->Delete(); + + // Return TRUE if current revision is greater than as read + return nCurRev > m_nRevision; +} + +/* +------------------------------------------------------------------------- +*/ +BOOL CgoAccountType::WriteObject(LPCSTR szLogUser) +{ + char szBuf[2048]; + + // Can't write unless loaded + if (!GetAttribDir()) + return FALSE; + + // Don't write if object has been updated since read + if (ObjectChanged()) + return FALSE; + + // Prepare to write changes to config log (including name/date header) + if (!m_configLog.Open(szLogUser)) + return FALSE; + + // Ensure we have a tagged ref attribute + CDirectory* pTRAttr = GetAttribDir()->Find(GPAS_A_TAGGEDREF); + if (!pTRAttr) + { + // Attribute doesn't exist - create it + pTRAttr = GetAttribDir()->Create(GPAS_A_TAGGEDREF); + pTRAttr->SetTag(SYN_TYPED_NAME); + + // Attach map + m_taggedRefs.Attach(pTRAttr); + } + + // Ensure we have a settings attribute + CDirectory* pSAttr = GetAttribDir()->Find(GPAS_A_SETTINGS); + if (!pSAttr) + { + // Attribute doesn't exist - create it + pSAttr = GetAttribDir()->Create(GPAS_A_SETTINGS); + pSAttr->SetTag(SYN_CE_STRING); + } + + // ----- Core settings ----- + + // m_szAmountFormat + if (stricmp(m_szAmountFormat, m_old.m_szAmountFormat)) + { + sprintf( + szBuf, + "Amount format changed to %s (was %s)", + m_szAmountFormat, + m_old.m_szAmountFormat); + WriteLogEntry(szBuf, GPAS_CL_TEXT); + } + + // m_bRestrictCCs = TRUE/FALSE + if ((m_bRestrictCCs != FALSE) != (m_old.m_bRestrictCCs != FALSE)) + { + if (m_bRestrictCCs) + WriteLogEntry("Debits restricted to listed cost centres", GPAS_CL_TEXT); + else + WriteLogEntry("Debits granted to any cost centre", GPAS_CL_TEXT); + } + + // m_bAllowDeposits = TRUE/FALSE + if ((m_bAllowDeposits != FALSE) != (m_old.m_bAllowDeposits != FALSE)) + { + if (m_bAllowDeposits) + WriteLogEntry("Credits allowed from Card/Cash DepositStations", GPAS_CL_TEXT); + else + WriteLogEntry("Credits not allowed from Card/Cash DepositStations", GPAS_CL_TEXT); + } + + // m_bAnyReasons = TRUE/FALSE + if ((m_bAnyReasons != FALSE) != (m_old.m_bAnyReasons != FALSE)) + { + if (m_bAnyReasons) + WriteLogEntry("Operators may give any transaction reason", GPAS_CL_TEXT); + else + WriteLogEntry("Operators may give only pre-set transaction reasons", GPAS_CL_TEXT); + } + + // m_szLogCentre + if (stricmp(m_szLogCentre, m_old.m_szLogCentre)) + { + if (!m_old.m_szLogCentre[0]) + { + // Logging cost centre set (cannot blank) + sprintf( + szBuf, + "Logging cost centre set to %s", + m_szLogCentre); + WriteLogEntry(szBuf, GPAS_CL_TEXT); + + // Modify reference counts + m_taggedRefs.AddIDRef(m_szLogCentre, GPAS_TR_COSTCENTRE); + } + else + { + // Logging cost centre changed + sprintf( + szBuf, + "Logging cost centre changed to %s (was %s)", + m_szLogCentre, + m_old.m_szLogCentre); + WriteLogEntry(szBuf, GPAS_CL_TEXT); + + // Modify reference counts + m_taggedRefs.AddIDRef(m_szLogCentre, GPAS_TR_COSTCENTRE); + m_taggedRefs.DelRef(m_old.m_szLogCentre); + } + } + + // m_bHideFromClient = TRUE/FALSE + if ((m_bHideFromClient != FALSE) != (m_old.m_bHideFromClient != FALSE)) + { + if (m_bHideFromClient) + WriteLogEntry("Will not be shown by the GPAS client", GPAS_CL_TEXT); + else + WriteLogEntry("Will be shown by the GPAS client", GPAS_CL_TEXT); + } + + // Build core settings entry + sprintf( + szBuf, + "C|%s|%d|%d|%d|%ld|%s", + m_szAmountFormat, + (int)m_bRestrictCCs, + (int)m_bAllowDeposits, + (int)m_bAnyReasons, + m_taggedRefs.GetIDRef(m_szLogCentre), + (int)m_bHideFromClient, + m_szCoreSurplus? m_szCoreSurplus : ""); + + // Compare core settings with original entry if there is one + // Note: don't compare value-by-value as even if equal, entry may be different + // Example: same CC may have different ID if deleted and re-added + if (m_pCoreEntry && stricmp(szBuf, m_pCoreEntry->GetValue())) + { + // Existing entry is different, so delete it + m_pCoreEntry->FlagDeleted(); + m_pCoreEntry = NULL; + } + + // If there's a core entry now, it's the same so don't replace it + if (!m_pCoreEntry) + { + // No core entry so write new one + pSAttr->FindOrCreate("C")->SetValue(szBuf); + } + + // ----- Cost centre list ----- + + // Iterate cost centres and check for additions/deletions/changes + CDirectory* pDir; + m_pCostCentres->SetAttribs(DIR_SHOWDELETED); + for (pDir = m_pCostCentres->FirstPair(); pDir; pDir = pDir->NextPair()) + { + switch (pDir->GetFlags() & (DIR_CREATED|DIR_DELETED)) + { + // Created then deleted, or deleted then created - do nothing + case DIR_DELETED|DIR_CREATED: + case 0: + break; + + // Cost centre entry deleted + case DIR_DELETED: + + // Remove ref to cost centre and clear allowed flag + m_taggedRefs.SetTag( + pDir->Name(), + m_taggedRefs.GetTag(pDir->Name()) & ~GPAS_AT_TRB_CCALLOWED); + m_taggedRefs.DelRef(pDir->Name()); + + // Write log entry + sprintf( + szBuf, + "Access revoked from cost centre %.100s", + pDir->Name()); + WriteLogEntry(szBuf, GPAS_CL_TEXT); + break; + + // Cost centre entry added + case DIR_CREATED: + + // Add ref to cost centre and set iteration flag + m_taggedRefs.AddIDRef(pDir->Name(), GPAS_TR_COSTCENTRE); + m_taggedRefs.SetTag( + pDir->Name(), + m_taggedRefs.GetTag(pDir->Name()) | GPAS_AT_TRB_CCALLOWED); + + // Write log entry + sprintf( + szBuf, + "Access granted to cost centre %.100s", + pDir->Name()); + WriteLogEntry(szBuf, GPAS_CL_TEXT); + break; + } + } + + // ----- Operator list ----- + + // Iterate operators and check for additions/deletions/changes + m_pOperators->SetAttribs(DIR_SHOWDELETED); + for (pDir = m_pOperators->FirstPair(); pDir; pDir = pDir->NextPair()) + { + switch (pDir->GetFlags() & (DIR_CREATED|DIR_DELETED)) + { + // Created then deleted, or deleted then created - do nothing + case DIR_DELETED|DIR_CREATED: + case 0: + break; + + // Operator entry deleted + case DIR_DELETED: + + // Remove ref to user - causes deletion + m_taggedRefs.SetTag( + pDir->Name(), + m_taggedRefs.GetTag(pDir->Name()) & ~GPAS_AT_TRB_OPERATOR); + m_taggedRefs.DelRef(pDir->Name()); + + // Retract operator security-equivalence + // NB: ignore failure as we can't do anything about it +#ifndef VSTUDIO + NWDSRemSecurityEquiv( + GetContext()->Handle(), + (char*)pDir->Name(), + (char*)GetObjectName()); +#endif + + // Write log entry + sprintf( + szBuf, + "Operator %.100s removed", + pDir->Name()); + ... [truncated message content] |
From: <mar...@us...> - 2009-12-10 12:43:48
|
Revision: 84 http://gpas.svn.sourceforge.net/gpas/?rev=84&view=rev Author: martinalderson Date: 2009-12-10 12:43:30 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Changed the error message when an exception occurs during a coin being deposited and removed the message box and application exit. Modified Paths: -------------- trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs Modified: trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2009-12-10 11:08:58 UTC (rev 83) +++ trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2009-12-10 12:43:30 UTC (rev 84) @@ -417,9 +417,7 @@ } catch (Exception e) { - App.writeEventLogEntry("Unexpected error starting GPAS Kiosk GUI:\n\n" + e.ToString(), EventLogEntryType.Error); - System.Windows.MessageBox.Show("GPAS Kiosk GUI is exiting abnormally - please check the Windows Event Log", "GPAS Kiosk"); - System.Windows.Forms.Application.Exit(); + App.writeEventLogEntry("Unexpected error handling deposited coin:\n\n" + e.ToString(), EventLogEntryType.Error); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-10 11:09:09
|
Revision: 83 http://gpas.svn.sourceforge.net/gpas/?rev=83&view=rev Author: martinalderson Date: 2009-12-10 11:08:58 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Communication with the backend service is now escaped correctly. This allows users with passwords containing any of & < > " ' to log in. Modified Paths: -------------- trunk/kiosk/gui/KioskAPI.cs Modified: trunk/kiosk/gui/KioskAPI.cs =================================================================== --- trunk/kiosk/gui/KioskAPI.cs 2009-12-09 18:29:30 UTC (rev 82) +++ trunk/kiosk/gui/KioskAPI.cs 2009-12-10 11:08:58 UTC (rev 83) @@ -27,6 +27,7 @@ using System.Diagnostics; using System.Net; using System.Net.Sockets; +using System.Security; using System.Text; using System.Xml; @@ -723,8 +724,8 @@ public static ValidatedUser validateUser(string username, string password, int validationType) { string validateUser = "<KioskFacade method=\"validateUser\">" + - "<argument name=\"user\" type=\"String\" value=\"" + username + "\" />" + - "<argument name=\"password\" type=\"String\" value=\"" + password + "\" />" + + "<argument name=\"user\" type=\"String\" value=\"" + SecurityElement.Escape(username) + "\" />" + + "<argument name=\"password\" type=\"String\" value=\"" + SecurityElement.Escape(password) + "\" />" + "<argument name=\"test\" type=\"Integer\" value=\"" + validationType + "\" />" + "</KioskFacade>\n"; XmlDocument xmlDocument; @@ -786,7 +787,7 @@ App.writeEventLogEntry("Retrieving Account Balance: " + userDN, EventLogEntryType.Information); string getAccountBalance = "<KioskFacade method=\"getAccountBalance\">" + - "<argument name=\"userDN\" type=\"String\" value=\"" + userDN + "\" />" + + "<argument name=\"userDN\" type=\"String\" value=\"" + SecurityElement.Escape(userDN) + "\" />" + "</KioskFacade>\n"; XmlDocument xmlDocument = sendMessage(getAccountBalance); @@ -829,7 +830,7 @@ break; } - string logEntryMask = "<GGPASLogFileFilter maxresults="" + maxresults + "" searchperiod="365" accounttype="" + historyType + "" userdn="" + userDN + "" />"; + string logEntryMask = "<GGPASLogFileFilter maxresults="" + maxresults + "" searchperiod="365" accounttype="" + historyType + "" userdn="" + SecurityElement.Escape(userDN) + "" />"; App.writeEventLogEntry("Retrieving History Results (" + historyType + "): " + userDN, EventLogEntryType.Information); @@ -912,11 +913,11 @@ App.writeEventLogEntry("Operator Reset Totals: " + userDN, EventLogEntryType.Information); string operatorResetTotals = "<KioskFacade method=\"operatorResetTotals\">" + - "<argument name=\"userDN\" type=\"String\" value=\"" + userDN + "\" />" + + "<argument name=\"userDN\" type=\"String\" value=\"" + SecurityElement.Escape(userDN) + "\" />" + "<argument name=\"cashTotal\" type=\"Integer\" value=\"" + cashTotal + "\" />" + "<argument name=\"noteTotal\" type=\"Integer\" value=\"" + noteTotal + "\" />" + "<argument name=\"coinTotal\" type=\"Integer\" value=\"" + coinTotal + "\" />" + - "<argument name=\"info\" type=\"String\" value=\"" + info + "\" />" + + "<argument name=\"info\" type=\"String\" value=\"" + SecurityElement.Escape(info) + "\" />" + "</KioskFacade>\n"; XmlDocument xmlDocument = sendMessage(operatorResetTotals); @@ -939,8 +940,8 @@ creditAmount = creditAmount * (App.BalanceScalingFactor / 100); string updateAccountBalance = "<KioskFacade method=\"updateAccountBalance\">" + - "<argument name=\"paymentID\" type=\"String\" value=\"" + transactionID + "\" />" + - "<argument name=\"userDN\" type=\"String\" value=\"" + userDN + "\" />" + + "<argument name=\"paymentID\" type=\"String\" value=\"" + SecurityElement.Escape(transactionID) + "\" />" + + "<argument name=\"userDN\" type=\"String\" value=\"" + SecurityElement.Escape(userDN) + "\" />" + "<argument name=\"credit\" type=\"Integer\" value=\"" + creditAmount + "\" />" + "<argument name=\"printReceipt\" type=\"Boolean\" value=\"" + printReceipt + "\" />" + "</KioskFacade>\n"; @@ -978,9 +979,9 @@ public static SendEmailMessageResult sendEmailMessage(string recipient, string subject, string body) { string sendEmailMessage = "<KioskFacade method=\"sendEmailMessage\">" + - "<argument name=\"recipient\" type=\"String\" value=\"" + recipient + "\" />" + - "<argument name=\"subject\" type=\"String\" value=\"" + subject + "\" />" + - "<argument name=\"body\" type=\"String\" value=\"" + body + "\" />" + + "<argument name=\"recipient\" type=\"String\" value=\"" + SecurityElement.Escape(recipient) + "\" />" + + "<argument name=\"subject\" type=\"String\" value=\"" + SecurityElement.Escape(subject) + "\" />" + + "<argument name=\"body\" type=\"String\" value=\"" + SecurityElement.Escape(body) + "\" />" + "</KioskFacade>\n"; XmlDocument xmlDocument = sendMessage(sendEmailMessage); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-09 18:29:38
|
Revision: 82 http://gpas.svn.sourceforge.net/gpas/?rev=82&view=rev Author: martinalderson Date: 2009-12-09 18:29:30 +0000 (Wed, 09 Dec 2009) Log Message: ----------- Fixing a build error caused by svn revision 80. Revision Links: -------------- http://gpas.svn.sourceforge.net/gpas/?rev=80&view=rev Modified Paths: -------------- trunk/kiosk/gui/CashMech/AbstractCashMech.cs Modified: trunk/kiosk/gui/CashMech/AbstractCashMech.cs =================================================================== --- trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2009-12-09 18:17:30 UTC (rev 81) +++ trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2009-12-09 18:29:30 UTC (rev 82) @@ -465,7 +465,7 @@ if (creditAccountPanel != null) { object[] args = { deposit.value - 1 }; - ((CreditAccountPanel)uiElement).getDispatcher().BeginInvoke(DispatcherPriority.Input, new SR3CoinDepositedDelegate(CoinsDeposited), creditAccountPanel, args); + creditAccountPanel.getDispatcher().BeginInvoke(DispatcherPriority.Input, new SR3CoinDepositedDelegate(CoinsDeposited), creditAccountPanel, args); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-09 18:17:36
|
Revision: 81 http://gpas.svn.sourceforge.net/gpas/?rev=81&view=rev Author: martinalderson Date: 2009-12-09 18:17:30 +0000 (Wed, 09 Dec 2009) Log Message: ----------- The inactivity timer needed to be stopped at the relevant places. Modified Paths: -------------- trunk/kiosk/gui/KioskWindow.xaml.cs trunk/kiosk/gui/Panels/AccountDetailsPanel.xaml.cs trunk/kiosk/gui/Panels/MainPanel.xaml.cs trunk/kiosk/gui/Panels/PasswordPanel.xaml.cs Modified: trunk/kiosk/gui/KioskWindow.xaml.cs =================================================================== --- trunk/kiosk/gui/KioskWindow.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) +++ trunk/kiosk/gui/KioskWindow.xaml.cs 2009-12-09 18:17:30 UTC (rev 81) @@ -252,6 +252,8 @@ public void inactivityTimer_OnTimeout(object sender, EventArgs args) { + inactivityTimer.Stop(); + if (displayPanel != null && displayPanel is CreditAccountPanel) { ((CreditAccountPanel)displayPanel).OnTimeout(); Modified: trunk/kiosk/gui/Panels/AccountDetailsPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/AccountDetailsPanel.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) +++ trunk/kiosk/gui/Panels/AccountDetailsPanel.xaml.cs 2009-12-09 18:17:30 UTC (rev 81) @@ -62,7 +62,7 @@ public void OnClick_ButtonLogOut(Object sender, RoutedEventArgs args) { - theApp.setDisplayPanel(new StartPanel(theApp), false); + theApp.setDisplayPanel(new StartPanel(theApp), true); } public void OnClick_ButtonCreditAccount(Object sender, RoutedEventArgs args) Modified: trunk/kiosk/gui/Panels/MainPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/MainPanel.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) +++ trunk/kiosk/gui/Panels/MainPanel.xaml.cs 2009-12-09 18:17:30 UTC (rev 81) @@ -71,6 +71,7 @@ if (theApp.getKioskConfig().getGeneralSettings().getInactivityTimeout() > 0) { + theApp.getInactivityTimer().Stop(); theApp.getInactivityTimer().Start(); } Modified: trunk/kiosk/gui/Panels/PasswordPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/PasswordPanel.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) +++ trunk/kiosk/gui/Panels/PasswordPanel.xaml.cs 2009-12-09 18:17:30 UTC (rev 81) @@ -76,6 +76,7 @@ if (theApp.getKioskConfig().getGeneralSettings().getInactivityTimeout() > 0) { + theApp.getInactivityTimer().Stop(); theApp.getInactivityTimer().Start(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-09 18:01:58
|
Revision: 80 http://gpas.svn.sourceforge.net/gpas/?rev=80&view=rev Author: martinalderson Date: 2009-12-09 18:01:44 +0000 (Wed, 09 Dec 2009) Log Message: ----------- A 3 second logging out message is displayed to allow coins inserted but not yet accepted when the user logged out (via log out button or time out) enough time to be accounted for. In case this is not long enough subsequent coins accepted will be credited to the last user rather than just ignored. Modified Paths: -------------- trunk/kiosk/gui/CashMech/AbstractCashMech.cs trunk/kiosk/gui/KioskWindow.xaml.cs trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs trunk/kiosk/gui/Panels/UsernamePanel.xaml.cs Modified: trunk/kiosk/gui/CashMech/AbstractCashMech.cs =================================================================== --- trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2009-12-07 18:04:39 UTC (rev 79) +++ trunk/kiosk/gui/CashMech/AbstractCashMech.cs 2009-12-09 18:01:44 UTC (rev 80) @@ -461,10 +461,9 @@ } else { - UIElement uiElement = theApp.getDisplayPanel(); - if (uiElement != null && uiElement is CreditAccountPanel) + CreditAccountPanel creditAccountPanel = CreditAccountPanel.LastCreditAccountPanel; + if (creditAccountPanel != null) { - CreditAccountPanel creditAccountPanel = (CreditAccountPanel)uiElement; object[] args = { deposit.value - 1 }; ((CreditAccountPanel)uiElement).getDispatcher().BeginInvoke(DispatcherPriority.Input, new SR3CoinDepositedDelegate(CoinsDeposited), creditAccountPanel, args); } @@ -498,10 +497,9 @@ { App.writeEventLogEntry("CoinAccepted: " + (cashInputEventArgs.InputValue * 100).ToString() + ", channel: " + deposit, EventLogEntryType.Information); - UIElement uiElement = theApp.getDisplayPanel(); - if (uiElement != null && uiElement is CreditAccountPanel) + CreditAccountPanel creditAccountPanel = CreditAccountPanel.LastCreditAccountPanel; + if (creditAccountPanel != null) { - CreditAccountPanel creditAccountPanel = (CreditAccountPanel)uiElement; object[] args = { deposit }; creditAccountPanel.getDispatcher().BeginInvoke(DispatcherPriority.Input, new NetshiftCoinAcceptedDelegate(CoinsDeposited), creditAccountPanel, args); } @@ -517,10 +515,9 @@ { App.writeEventLogEntry("NoteAccepted: " + cashInputEventArgs.InputValue.ToString(), EventLogEntryType.Information); - UIElement uiElement = theApp.getDisplayPanel(); - if (uiElement != null && uiElement is CreditAccountPanel) + CreditAccountPanel creditAccountPanel = CreditAccountPanel.LastCreditAccountPanel; + if (creditAccountPanel != null) { - CreditAccountPanel creditAccountPanel = (CreditAccountPanel)uiElement; object[] args = { (int)cashInputEventArgs.InputValue }; creditAccountPanel.getDispatcher().BeginInvoke(DispatcherPriority.Input, new NetshiftNoteAcceptedDelegate(NotesEntered), creditAccountPanel, args); } @@ -528,10 +525,9 @@ private void UBA10NotesEnteredCallback(object sender, AxUBA10Lib._DUba10Events_DepositEvent deposit) { - UIElement uiElement = theApp.getDisplayPanel(); - if (uiElement != null && uiElement is CreditAccountPanel) + CreditAccountPanel creditAccountPanel = CreditAccountPanel.LastCreditAccountPanel; + if (creditAccountPanel != null) { - CreditAccountPanel creditAccountPanel = (CreditAccountPanel)uiElement; object[] args = { deposit.value }; creditAccountPanel.getDispatcher().BeginInvoke(DispatcherPriority.Input, new UBA10NoteEnteredDelegate(NotesEntered), creditAccountPanel, args); } Modified: trunk/kiosk/gui/KioskWindow.xaml.cs =================================================================== --- trunk/kiosk/gui/KioskWindow.xaml.cs 2009-12-07 18:04:39 UTC (rev 79) +++ trunk/kiosk/gui/KioskWindow.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) @@ -254,7 +254,7 @@ { if (displayPanel != null && displayPanel is CreditAccountPanel) { - ((CreditAccountPanel)displayPanel).OnClick_ButtonFinish(null, null); + ((CreditAccountPanel)displayPanel).OnTimeout(); } else { Modified: trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2009-12-07 18:04:39 UTC (rev 79) +++ trunk/kiosk/gui/Panels/CreditAccountPanel.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) @@ -49,6 +49,13 @@ public partial class CreditAccountPanel : System.Windows.Controls.Grid { + // Store the last creditAccountPanel globally so any coins accepted after the credit panel is removed from the screen can be credited to the right user. + private static CreditAccountPanel lastCreditAccountPanel = null; + public static CreditAccountPanel LastCreditAccountPanel + { + get { return lastCreditAccountPanel; } + } + private KioskWindow theApp; private KioskAPI.ValidatedUser validatedUser; @@ -73,8 +80,12 @@ private int maximumBalance = 0; private int initialBalance = -999999; + private System.Windows.Forms.Timer finishTimer = new System.Windows.Forms.Timer(); + private Boolean finishing = false; + public CreditAccountPanel(KioskWindow theApp, KioskAPI.ValidatedUser validatedUser) { + lastCreditAccountPanel = this; this.theApp = theApp; this.validatedUser = validatedUser; @@ -261,6 +272,22 @@ public void OnClick_ButtonFinish(Object sender, RoutedEventArgs args) { + Finish("You are being logged out"); + } + + public void OnTimeout() + { + Finish("Your session has timed out"); + } + + private void Finish(string message) + { + if (finishing) + { + return; + } + finishing = true; + if (acceptCoins) { theApp.getCashMech().setCoinConnected(false); @@ -277,6 +304,29 @@ acceptNotes = false; } + this.Dispatcher.Invoke(DispatcherPriority.Normal, new System.Windows.Forms.MethodInvoker(delegate() + { + textBlock_CreditLine1.Text = message; + textBlock_CreditLine2.Text = ""; + textBlock_CreditLine3.Text = "Please Wait..."; + stackPanel_CreditPage.InvalidateVisual(); + + textBlock_CreditLine3.Margin = new Thickness(0, 15, 0, 0); + textBlock_CashDeposited.Margin = new Thickness(0, 20, 0, 0); + button_Finish.Visibility = Visibility.Hidden; + button_Print.Visibility = Visibility.Hidden; + })); + + // Allow pending payments to be processed. + finishTimer.Tick += new EventHandler(FinishTimer_Tick); + finishTimer.Interval = 3000; + finishTimer.Start(); + } + + private void FinishTimer_Tick(Object sender, EventArgs args) + { + finishTimer.Stop(); + if (cashDeposited > 0) { bool printReceipt = true; @@ -323,7 +373,6 @@ } finally { - this.validatedUser = null; cashDeposited = 0; } } Modified: trunk/kiosk/gui/Panels/UsernamePanel.xaml.cs =================================================================== --- trunk/kiosk/gui/Panels/UsernamePanel.xaml.cs 2009-12-07 18:04:39 UTC (rev 79) +++ trunk/kiosk/gui/Panels/UsernamePanel.xaml.cs 2009-12-09 18:01:44 UTC (rev 80) @@ -75,6 +75,7 @@ if (theApp.getKioskConfig().getGeneralSettings().getInactivityTimeout() > 0) { + theApp.getInactivityTimer().Stop(); theApp.getInactivityTimer().Start(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-07 18:04:54
|
Revision: 79 http://gpas.svn.sourceforge.net/gpas/?rev=79&view=rev Author: martinalderson Date: 2009-12-07 18:04:39 +0000 (Mon, 07 Dec 2009) Log Message: ----------- Modified Paths: -------------- trunk/osnative/src/salford/gpas/util/osnative/Scp_Copier.java trunk/osnative/src/salford/gpas/util/osnative/Windows_Native_Methods.java Removed Paths: ------------- trunk/osnative/src/salford/gpas/util/osnative/OSNative_Tester.java Deleted: trunk/osnative/src/salford/gpas/util/osnative/OSNative_Tester.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/OSNative_Tester.java 2009-12-04 17:49:28 UTC (rev 78) +++ trunk/osnative/src/salford/gpas/util/osnative/OSNative_Tester.java 2009-12-07 18:04:39 UTC (rev 79) @@ -1,80 +0,0 @@ -/* - * GPAS Print Accounting System - * Copyright (C) 2009 Salford Software Ltd. - * - * This file is part of GPAS Print Accounting System. - * - * GPAS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GPAS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. - * - * See http://gpas.sourceforge.net/ for more information and contact - * details. - */ -/* - * Created on 13-Jan-2006 - */ -package salford.gpas.util.osnative; - -import java.rmi.Remote; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import salford.gpas.util.rmi.OSNativeInterface; -import salford.gpas.util.security.GSecEncrypt; -import salford.gpas.util.security.GSecEncryptUtil; - -/** - * @author Paul Spink - */ -public class OSNative_Tester { - /** - * @param args - * @throws Exception - */ - public static void main(String[] args) throws Exception { - Registry rmiRegistry = LocateRegistry.getRegistry("127.0.0.1", 10099); - Remote remote = rmiRegistry.lookup("OSNative"); - - if (remote instanceof OSNativeInterface) { - OSNativeInterface osNative = (OSNativeInterface)remote; - - GSecEncrypt secEncrypt = new GSecEncrypt(); - String password = secEncrypt.encryptString("$F3nT?12", GSecEncryptUtil.dwGPASStringEncryptionKey); -// String password = secEncrypt.encryptString("bespin2002", GSecEncryptUtil.dwGPASStringEncryptionKey); - -// Map map = osNative.getSharedLibraryInfo("PAULS-NETWARE65-VMWARE", ".admin.users.salfordsoftware", password); -// System.out.println(map); - -// HashMap arguments = new HashMap(); -// arguments.put("AGE", new Integer(7)); -// arguments.put("NAME", "GPASDESC"); - -// osNative.createServerDirectory("PAULS-NETWARE65-VMWARE/SYS", "GpasLogD", "PAULS-NETWARE65-TREE", "GPAS License.salfordsoftware", password, "GPAS License.salfordsoftware"); -// osNative.controlGPASSoftware(OSNativeInterface.G2SPOOL_START, null); - -// System.out.println("Server Connection: " + osNative.openServerConnection("PAULS-NETWARE65-VMWARE/SYS/GpasLogD", "PAULS-NETWARE65-TREE", "paul.users.salfordsoftware", "salf0rd")); -// System.out.println("Server Connection: " + osNative.openServerConnection("PAULS-NETWARE65-VMWARE/SYS/GpasLogD", "PAULS-NETWARE65-TREE", "admin.users.salfordsoftware", "bespin2002")); -// System.out.println("Server Connection: " + osNative.openServerConnection("PAULS-NETWARE65-VMWARE/SYS/GpasLogD", "PAULS-NETWARE65-TREE", "paul.users.salfordsoftware", "salf0rd")); -// System.out.println("Server Connection: " + osNative.openServerConnection("PAULS-NETWARE65-VMWARE/SYS/GpasLogD", "PAULS-NETWARE65-TREE", "admin.users.salfordsoftware", "bespin2002")); - - int connection = osNative.openServerConnection("PAULS-NETWARE65-VMWARE/SYS/GPAS/tmp", "PAULS-NETWARE65-TREE", "admin.users.salfordsoftware", password); - - if (connection != -1) { - byte[] data = new byte[] {}; - - osNative.writeFile("tmpFile.txt", data, connection); - } - } - } - -} Modified: trunk/osnative/src/salford/gpas/util/osnative/Scp_Copier.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/Scp_Copier.java 2009-12-04 17:49:28 UTC (rev 78) +++ trunk/osnative/src/salford/gpas/util/osnative/Scp_Copier.java 2009-12-07 18:04:39 UTC (rev 79) @@ -47,7 +47,7 @@ public Scp_Copier(String path, String password, String user, String host) { super(path); - m_password = "bespin2002";// password; + m_password = password; String [] parts = user.split("\\."); m_user = parts[0]; m_host = host; @@ -158,12 +158,6 @@ return b; } - public static void main(String[] args) { - Scp_Copier copier = new Scp_Copier("", "bespin2002", "root", - "10.1.14.20"); - copier.copyFileTo("test.data", "This has been copied".getBytes()); - } - public String[] promptKeyboardInteractive(String arg0, String arg1, String arg2, String[] arg3, boolean[] arg4) { return new String [] {m_password}; } Modified: trunk/osnative/src/salford/gpas/util/osnative/Windows_Native_Methods.java =================================================================== --- trunk/osnative/src/salford/gpas/util/osnative/Windows_Native_Methods.java 2009-12-04 17:49:28 UTC (rev 78) +++ trunk/osnative/src/salford/gpas/util/osnative/Windows_Native_Methods.java 2009-12-07 18:04:39 UTC (rev 79) @@ -164,32 +164,4 @@ getPrinterInfoForUser(user); return (Vector) m_printJobs.get(user); } - -// public static void main (String [] args) { -// GConfigDetails.symtemRunningOn = GConfigDetails.WINDOWS; -// -// GLDAPConnection connection = GLDAPConnection.getGLDAPConnection("10.1.14.101", 389, -// "cn=Administrator,cn=Users,DC=win1,DC=panda,DC=pri", "bespin2002"); -// -// try { -// connection.createLDAPConnection(); -// -// Registry rmiRegistry = LocateRegistry.getRegistry("10.1.14.101", 10099); -// Remote remote = rmiRegistry.lookup("OSNative"); -// -// GConnections osNative = new GConnections(connection , (OSNativeInterface) remote); -// Permissions permissions = connection.getPermissions("cn=Free,DC=win1,DC=panda,DC=pri", osNative ); -// -// } catch (LDAPException e) { -// e.printStackTrace(); -// } catch (RemoteException e) { -// e.printStackTrace(); -// } catch (NotBoundException e) { -// e.printStackTrace(); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// System.out.println("Completed"); -// } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-04 17:49:40
|
Revision: 78 http://gpas.svn.sourceforge.net/gpas/?rev=78&view=rev Author: martinalderson Date: 2009-12-04 17:49:28 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Initial import Added Paths: ----------- trunk/kiosk/cashmech/ trunk/kiosk/cashmech/sr3/ trunk/kiosk/cashmech/sr3/LICENSE.txt trunk/kiosk/cashmech/sr3/Sr3Ctl.bmp trunk/kiosk/cashmech/sr3/Sr3Ctl.cpp trunk/kiosk/cashmech/sr3/Sr3Ctl.h trunk/kiosk/cashmech/sr3/Sr3Ppg.cpp trunk/kiosk/cashmech/sr3/Sr3Ppg.h trunk/kiosk/cashmech/sr3/StdAfx.cpp trunk/kiosk/cashmech/sr3/StdAfx.h trunk/kiosk/cashmech/sr3/build.bat trunk/kiosk/cashmech/sr3/gpas_logo2.ico trunk/kiosk/cashmech/sr3/resource.h trunk/kiosk/cashmech/sr3/sr3.aps trunk/kiosk/cashmech/sr3/sr3.clw trunk/kiosk/cashmech/sr3/sr3.cpp trunk/kiosk/cashmech/sr3/sr3.def trunk/kiosk/cashmech/sr3/sr3.h trunk/kiosk/cashmech/sr3/sr3.odl trunk/kiosk/cashmech/sr3/sr3.opt trunk/kiosk/cashmech/sr3/sr3.rc trunk/kiosk/cashmech/sr3/sr3.sln trunk/kiosk/cashmech/sr3/sr3.vcproj trunk/kiosk/cashmech/uba10/ trunk/kiosk/cashmech/uba10/LICENSE.txt trunk/kiosk/cashmech/uba10/StdAfx.cpp trunk/kiosk/cashmech/uba10/StdAfx.h trunk/kiosk/cashmech/uba10/Uba10Ctl.bmp trunk/kiosk/cashmech/uba10/Uba10Ctl.cpp trunk/kiosk/cashmech/uba10/Uba10Ctl.h trunk/kiosk/cashmech/uba10/Uba10Ppg.cpp trunk/kiosk/cashmech/uba10/Uba10Ppg.h trunk/kiosk/cashmech/uba10/build.bat trunk/kiosk/cashmech/uba10/gpas_logo2.ico trunk/kiosk/cashmech/uba10/resource.h trunk/kiosk/cashmech/uba10/uba10.aps trunk/kiosk/cashmech/uba10/uba10.clw trunk/kiosk/cashmech/uba10/uba10.cpp trunk/kiosk/cashmech/uba10/uba10.def trunk/kiosk/cashmech/uba10/uba10.h trunk/kiosk/cashmech/uba10/uba10.odl trunk/kiosk/cashmech/uba10/uba10.opt trunk/kiosk/cashmech/uba10/uba10.rc trunk/kiosk/cashmech/uba10/uba10.sln trunk/kiosk/cashmech/uba10/uba10.vcproj Added: trunk/kiosk/cashmech/sr3/LICENSE.txt =================================================================== --- trunk/kiosk/cashmech/sr3/LICENSE.txt (rev 0) +++ trunk/kiosk/cashmech/sr3/LICENSE.txt 2009-12-04 17:49:28 UTC (rev 78) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. Added: trunk/kiosk/cashmech/sr3/Sr3Ctl.bmp =================================================================== (Binary files differ) Property changes on: trunk/kiosk/cashmech/sr3/Sr3Ctl.bmp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/kiosk/cashmech/sr3/Sr3Ctl.cpp =================================================================== --- trunk/kiosk/cashmech/sr3/Sr3Ctl.cpp (rev 0) +++ trunk/kiosk/cashmech/sr3/Sr3Ctl.cpp 2009-12-04 17:49:28 UTC (rev 78) @@ -0,0 +1,687 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +// Sr3Ctl.cpp : Implementation of the CSr3Ctrl ActiveX Control class. + +#include "stdafx.h" +#include "sr3.h" +#include "Sr3Ctl.h" +#include "Sr3Ppg.h" +#include ".\sr3ctl.h" + + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + + +IMPLEMENT_DYNCREATE(CSr3Ctrl, COleControl) + + +///////////////////////////////////////////////////////////////////////////// +// Message map + +BEGIN_MESSAGE_MAP(CSr3Ctrl, COleControl) + //{{AFX_MSG_MAP(CSr3Ctrl) + //}}AFX_MSG_MAP + ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties) +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// Dispatch map + +BEGIN_DISPATCH_MAP(CSr3Ctrl, COleControl) + //{{AFX_DISPATCH_MAP(CSr3Ctrl) + DISP_PROPERTY_EX(CSr3Ctrl, "PortID", GetPortID, SetPortID, VT_I2) + DISP_PROPERTY_EX(CSr3Ctrl, "ConnectedState", GetConnectedState, SetConnectedState, VT_I2) + DISP_PROPERTY_EX(CSr3Ctrl, "InhibitedState", GetInhibitedState, SetInhibitedState, VT_I2) + DISP_PROPERTY_EX(CSr3Ctrl, "CurrencyMask", GetCurrencyMask, SetCurrencyMask, VT_I2) + DISP_PROPERTY_EX(CSr3Ctrl, "ClearRejectedCoins", GetClearRejectedCoins, SetClearRejectedCoins, VT_I2) + DISP_PROPERTY_EX(CSr3Ctrl, "DebugMode", GetDebugMode, SetDebugMode, VT_I2) + //}}AFX_DISPATCH_MAP +END_DISPATCH_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// Event map + +BEGIN_EVENT_MAP(CSr3Ctrl, COleControl) + //{{AFX_EVENT_MAP(CSr3Ctrl) + EVENT_CUSTOM_ID("Deposit", eventidDeposit, Deposit, VTS_I4) + //}}AFX_EVENT_MAP +END_EVENT_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// Property pages + +BEGIN_PROPPAGEIDS(CSr3Ctrl, 1) + PROPPAGEID(CSr3PropPage::guid) +END_PROPPAGEIDS(CSr3Ctrl) + + +///////////////////////////////////////////////////////////////////////////// +// Initialize class factory and guid + +IMPLEMENT_OLECREATE_EX(CSr3Ctrl, "SR3.Sr3Ctrl.1", + 0xe9c5bfa6, 0x5b3b, 0x11da, 0xb0, 0x7a, 0xd2, 0x13, 0x1e, 0xd, 0x46, 0x64) + + +///////////////////////////////////////////////////////////////////////////// +// Type library ID and version + +IMPLEMENT_OLETYPELIB(CSr3Ctrl, _tlid, _wVerMajor, _wVerMinor) + + +///////////////////////////////////////////////////////////////////////////// +// Interface IDs + +const IID BASED_CODE IID_DSr3 = + { 0xe9c5bfa4, 0x5b3b, 0x11da, { 0xb0, 0x7a, 0xd2, 0x13, 0x1e, 0xd, 0x46, 0x64 } }; +const IID BASED_CODE IID_DSr3Events = + { 0xe9c5bfa5, 0x5b3b, 0x11da, { 0xb0, 0x7a, 0xd2, 0x13, 0x1e, 0xd, 0x46, 0x64 } }; + + +///////////////////////////////////////////////////////////////////////////// +// Control type information + +static const DWORD BASED_CODE _dwSr3OleMisc = + OLEMISC_INVISIBLEATRUNTIME | + OLEMISC_ACTIVATEWHENVISIBLE | + OLEMISC_SETCLIENTSITEFIRST | + OLEMISC_INSIDEOUT | + OLEMISC_CANTLINKINSIDE | + OLEMISC_RECOMPOSEONRESIZE; + +IMPLEMENT_OLECTLTYPE(CSr3Ctrl, IDS_SR3, _dwSr3OleMisc) + + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl::CSr3CtrlFactory::UpdateRegistry - +// Adds or removes system registry entries for CSr3Ctrl + +BOOL CSr3Ctrl::CSr3CtrlFactory::UpdateRegistry(BOOL bRegister) +{ + // TODO: Verify that your control follows apartment-model threading rules. + // Refer to MFC TechNote 64 for more information. + // If your control does not conform to the apartment-model rules, then + // you must modify the code below, changing the 6th parameter from + // afxRegApartmentThreading to 0. + + if (bRegister) + return AfxOleRegisterControlClass( + AfxGetInstanceHandle(), + m_clsid, + m_lpszProgID, + IDS_SR3, + IDB_SR3, + afxRegApartmentThreading, + _dwSr3OleMisc, + _tlid, + _wVerMajor, + _wVerMinor); + else + return AfxOleUnregisterClass(m_clsid, m_lpszProgID); +} + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl::OnDraw - Drawing function + +void CSr3Ctrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid) +{ + if (!pdc) return; + HICON hIcon = (HICON)LoadImage(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,32,32,0); + if(hIcon) pdc->DrawIcon(0,0,hIcon); +} + + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl::DoPropExchange - Persistence support + +void CSr3Ctrl::DoPropExchange(CPropExchange* pPX) +{ + ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor)); + COleControl::DoPropExchange(pPX); +} + + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl::GetControlFlags - +// Flags to customize MFC's implementation of ActiveX controls. +DWORD CSr3Ctrl::GetControlFlags() +{ + DWORD dwFlags = COleControl::GetControlFlags(); + dwFlags |= windowlessActivate; + return dwFlags; +} + + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl::OnResetState - Reset control to default state + +void CSr3Ctrl::OnResetState() +{ + COleControl::OnResetState(); // Resets defaults found in DoPropExchange +} + +static CSr3Ctrl* thisClass = NULL; + +static VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) +{ + //A lock-out is necessary. Do not remove. + static BOOL processing = FALSE; + if(!processing) + { + processing = TRUE; + thisClass->ReadCredit(); //Could switch off timer when coin mechanism is inhibited. + processing = FALSE; + } +} + +CSr3Ctrl::CSr3Ctrl() +{ + InitializeIIDs(&IID_DSr3, &IID_DSr3Events); + m_portID = 1; + m_connectedState = 0; + m_inhibitedState = 0; + m_currencyMask = DEFAULTMASK; //2 = \xA31, 4 = 50p, 8 = 20p, 16 = 10p, 32 = 5p + m_internalMask = 0; + m_handle = INVALID_HANDLE_VALUE; + m_clearRejectedCoins = 0; + m_debugMode = FALSE; + m_debugStream = NULL; + m_currencyID = ID_POUNDS; + char data[8]; + int ret = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, data, 8); + if(ret && data[0] == -128) m_currencyID = ID_EUROS; + thisClass = this; +} + +CSr3Ctrl::~CSr3Ctrl() +{ + ::KillTimer(NULL,TIMERID); +} + +BOOL CSr3Ctrl::uWrite(DWORD size) +{ + DWORD nBytes; + OVERLAPPED osWrite = {0}; + osWrite.hEvent = CreateEvent(NULL,TRUE,FALSE,NULL); + if(osWrite.hEvent == NULL) return FALSE; + out[0] = 2; out[2] = 1; + PurgeComm(m_handle,PURGE_TXABORT|PURGE_RXABORT|PURGE_TXCLEAR|PURGE_RXCLEAR); + BOOL fRes = TRUE; + if(!WriteFile(m_handle,out,size,&nBytes,&osWrite)) + { + if(GetLastError() != ERROR_IO_PENDING) fRes = FALSE; + else + { + switch(WaitForSingleObject(osWrite.hEvent,200)) + { + case WAIT_OBJECT_0: + fRes = GetOverlappedResult(m_handle,&osWrite,&nBytes,FALSE); + break; + default: + fRes = FALSE; + break; + } + } + } + CloseHandle(osWrite.hEvent); + return (fRes && nBytes == size); +} + +BOOL CSr3Ctrl::uRead(DWORD size,DWORD milliseconds) +{ + DWORD nBytes = 0; + OVERLAPPED osReader = {0}; + osReader.hEvent = CreateEvent(NULL,TRUE,FALSE,NULL); + if(osReader.hEvent == NULL) return FALSE; + memset(in,0,size); + BOOL fRes = TRUE; + Sleep(milliseconds); + if(!ReadFile(m_handle,in,size,&nBytes,&osReader)) + { + if(GetLastError() != ERROR_IO_PENDING) fRes = FALSE; + else + { + switch(WaitForSingleObject(osReader.hEvent,200)) + { + case WAIT_OBJECT_0: + fRes = GetOverlappedResult(m_handle,&osReader,&nBytes,FALSE); + break; + default: + fRes = FALSE; + break; + } + } + } + CloseHandle(osReader.hEvent); //Added at version 1.1.3.1 + return (fRes && nBytes && (size == nBytes || size == INBUFFSIZE)); +} + +BOOL CSr3Ctrl::GetStatus() //Command 248 +{ + static WORD oldStatus = 0xffff; + if(!GetConnectedState()) + { + if(oldStatus != 0x100) + { + //SendMessage(m_hWnd,WM_USER+2,0x100,0); + oldStatus = 0x100; + } + return FALSE; + } + BYTE cmd[] = {2,0,1,248,5}; + BYTE ret[] = {2,0,1,248,5,1,1,2,0}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + ++k; + if(!uWrite(5) || !uRead(11,WAITTIME)) continue; + if(memcmp(in,ret,9) || in[9]+in[10] != 252) continue; + if(in[9] != oldStatus) + { + //SendMessage(m_hWnd,WM_USER+2,(WPARAM)in[9],0); + oldStatus = in[9]; + } + return TRUE; + } + return FALSE; +} + +BOOL CSr3Ctrl::Product() //Command 244 +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,0,1,244,9}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + ++k; + if(!uWrite(5) || !uRead(INBUFFSIZE,2*WAITTIME)) continue; + if(memcmp(in+9,"SR3",3)) continue; + return TRUE; + } + return FALSE; +} + +BOOL CSr3Ctrl::TestSolenoids() //Command 240 +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,1,1,240,1,11}; + BYTE ret[] = {1,0,2,0,253}; //Ack + memcpy(out,cmd,6); + for(int k=0; k<4; Sleep(WAITTIME)) + { + ++k; + if(!uWrite(6) || !uRead(11,500 + WAITTIME)) continue; + if(memcmp(in,out,6) || memcmp(in+6,ret,5)) continue; + return TRUE; + } + return FALSE; +} + +int CSr3Ctrl::PerformSelfCheck() //Command 232 - returns fault code or zero if OK. +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,0,1,232,21}; + BYTE ret[] = {2,0,1,232,21,1,1,2,0,0,252}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + ++k; + if(!uWrite(5) || !uRead(11,2*WAITTIME)) continue; + if(memcmp(in,ret,9) || !SumCheck(11)) continue; + return (in[9] == 0); + } + return FALSE; +} + +void CSr3Ctrl::SetCheck(int size) +{ + int sum = 0; + for(int i = 0; i<size; ++i) sum += out[i]; //Was size - 1. Fixed 4 Sept 2008 + out[size] = (sum/256 + 1)*256 - sum; +} + +BOOL CSr3Ctrl::ModifyInhibit(WORD mask) //Command 231 +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,2,1,231,0,0}; + BYTE ret[] = {1,0,2,0,253}; //Ack + memcpy(out,cmd,6); + out[4] = LOBYTE(mask); + out[5] = HIBYTE(mask); + SetCheck(6); + for(int k=0; k<3; Sleep(WAITTIME)) + { + if(k) DumpData(231, FALSE, 7); + ++k; + if(!uWrite(7) || !uRead(12,WAITTIME)) continue; + if(memcmp(in,out,7) || memcmp(in+7,ret,5)) continue; + DumpData(231, TRUE, 12); + return TRUE; + } + return FALSE; +} + +BOOL CSr3Ctrl::SumCheck(int size) +{ + int sum = 0; + for(int i = 0; i<size; ++i) sum += in[i]; + return (sum%256 == 0); +} + +int CSr3Ctrl::RequestInhibit() //Command 230 +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,0,1,230,23}; + BYTE ret[] = {2,0,1,230,23,1,2,2,0}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + if(k) DumpData(230, FALSE, 5); + ++k; + if(!uWrite(5) || !uRead(12,WAITTIME)) continue; + if(memcmp(in,ret,9) || !SumCheck(12)) continue; + DumpData(230, TRUE, 12); + return MAKEWORD(in[9],in[10]); + } + return FALSE; +} + +void CSr3Ctrl::DumpData(int commandID, BOOL success, DWORD size) +{ + if(m_debugMode && m_debugStream) + { + fprintf(m_debugStream, "Command:%d Success:%d Data:", commandID, success); + for(DWORD ii = 0; ii<size; ++ii) fprintf(m_debugStream, "%d,", in[ii]); + fprintf(m_debugStream, "\n"); + } +} + +BOOL CSr3Ctrl::ReadCredit() //Command 229 +{ + static int lastEvent = -1; //Do not use zero because currentEvent is zero on power up, first coin would not be credited. + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,0,1,229,24}; + BYTE ret[] = {2,0,1,229,24,1,11,2,0}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + if(k) DumpData(229, FALSE, 5); + ++k; + if(!uWrite(5) || !uRead(21,WAITTIME)) continue; + if(memcmp(in,ret,9)) continue; + int currentEvent = in[9]; + if(currentEvent != lastEvent) + { + if(lastEvent == -1) + { + lastEvent = currentEvent; + ReportError(2000); //New diagnostic at version 1.1.2 - Success. + DumpData(229, TRUE, 21); + return TRUE; + } + if(lastEvent > currentEvent) lastEvent -= 255; + while(lastEvent < currentEvent) + { + DumpData(229, TRUE, 21); + ++lastEvent; + int offset = 10+2*(currentEvent - lastEvent); + int state = in[offset]; + if(state) + { + Deposit(m_coinID[state]); + ReportError(2000+state); //New diagnostic at version 1.1.2 - Success. + } + else ReportError(in[offset+1]); //Error condition + } + } + return TRUE; + } + return FALSE; +} + +short CSr3Ctrl::GetCoinValueFromChannel(WORD pos) //Command 184 - Request coin id +{ + if(!GetConnectedState()) return 0; + if(pos > 12) return 0; + BYTE cmd[] = {2,1,1,184,1,67}; + BYTE ret[] = {2,1,1,184,1,67,1,6,2,0}; + memcpy(out,cmd,6); + ret[4] = out[4] = (BYTE)pos; + ret[5] = out[5] = 68 - out[4]; + for(int k=0; k<3; Sleep(150)) + { + if(k) DumpData(184, FALSE, 6); + ++k; + if(!uWrite(6) || !uRead(17,WAITTIME)) continue; + if(memcmp(in,ret,10)) continue; + DumpData(184, TRUE, 17); + char* start = (char*)(in + 10); + switch(m_currencyID) + { + case ID_POUNDS: + if(strncmp(start,"GB",2)) return 0; + break; + case ID_EUROS: + if(strncmp(start,"EU",2) && strncmp(start,"IE",2)) return 0; + break; + } + start += 2; + if(strncmp(start,"200",3) == 0) return 200; + if(strncmp(start,"100",3) == 0) return 100; + if(strncmp(start,"050",3) == 0) return 50; + if(strncmp(start,"020",3) == 0) return 20; + if(strncmp(start,"010",3) == 0) return 10; + if(strncmp(start,"005",3) == 0) return 5; + return 0; + } + return 0; +} + +BOOL CSr3Ctrl::RequestCoin() +{ + //Convert the input coin mask (1=\xA32, 2=\xA31, 4=50p, 8=20p, 16=10p, 32=5p) + //to device coin channels (1=\xA32, 2=\xA31, 3=50p, 4=20p, 5=10p, 6=5p). + //This natural ordering of the channels is not guaranteed so we map the + //ordering via m_coinID[position] = natural ordering. + if(!GetConnectedState()) return FALSE; + WORD mask = 1; + m_internalMask = 0; + m_coinID[0] = 0; //Not used + for(WORD pos = 1; pos<=16; ++pos) + { + WORD val = GetCoinValueFromChannel(pos); + short m = 0,r = 0; + switch(val) + { + case 200:r = 1; m = 0x01; break; + case 100:r = 2; m = 0x02; break; + case 50: r = 3; m = 0x04; break; + case 20: r = 4; m = 0x08; break; + case 10: r = 5; m = 0x10; break; + case 5: r = 6; m = 0x20; break; + } + m_coinID[pos] = 0; + if(m_currencyMask&m) + { + m_coinID[pos] = r; + m_internalMask |= mask; + } + mask *= 2; + } + return (m_internalMask > 0); +} + +BOOL CSr3Ctrl::Reset() //Command 1 +{ + if(!GetConnectedState()) return FALSE; + BYTE cmd[] = {2,0,1,1,253}; + memcpy(out,cmd,5); + for(int k=0; k<3; Sleep(WAITTIME)) + { + ++k; + if(!uWrite(5) || !uRead(5,WAITTIME)) continue; + if(memcmp(out,in,5)) continue; + DumpData(1,TRUE,5); + return TRUE; + } + return FALSE; +} + +BOOL CSr3Ctrl::Start() +{ + if(!GetConnectedState()) return FALSE; + BOOL res = 1; + if(Product()) res |= 0x02; + if(PerformSelfCheck()) res |= 0x04; + if(Reset()) res |= 0x08; + if(ReadCredit()) res |= 0x10; //Initialise lastEvent + if(RequestCoin()) res |= 0x20; + if(ModifyInhibit(0)) res |= 0x40; + if(!::SetTimer(NULL,TIMERID,250,(TIMERPROC)TimerProc)) MessageBox("ERROR:Unable to create timer."); + //Elapsed time reduced from 500 to 250 to see if it fixes problem reported to 10Squared by DeMontford. 31 Jan 2006. + return res; +} + +// CSr3Ctrl message handlers + +short CSr3Ctrl::GetPortID() +{ + return m_portID; +} + +void CSr3Ctrl::SetPortID(short nNewValue) +{ + m_portID = nNewValue; +} + +short CSr3Ctrl::GetConnectedState() +{ + return (m_handle != INVALID_HANDLE_VALUE); +} + +void CSr3Ctrl::SetConnectedState(short nNewValue) +{ + if(nNewValue) + { + if(!GetConnectedState()) + { + char* port[] = {"COM1","COM2","COM3","COM4"}; + m_handle = CreateFile(port[m_portID-1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL); + if(m_handle != INVALID_HANDLE_VALUE) + { + DCB dcb = {0}; + dcb.DCBlength = sizeof(DCB); + dcb.BaudRate = 9600; + dcb.fBinary = 1; + dcb.fDtrControl = 1; + dcb.fRtsControl = 1; + dcb.XonLim = 2048; + dcb.XoffLim = 512; + dcb.ByteSize = 8; + dcb.Parity = NOPARITY; + dcb.StopBits = ONESTOPBIT; + SetCommState(m_handle, &dcb); + COMMTIMEOUTS ct = {0}; + ct.ReadIntervalTimeout = -1; + SetCommTimeouts(m_handle,&ct); + //Change at version 1.1.2. 26 June 2006. + //Greater detail at start up. Data passed to G2_C_ERROR.LOG when launching G2CASH TEST. + int ret = Start(); + ReportError(1000 + ret); //A value greater than 1001 indicates successful send and listen. + //////if(Start() > 1) ReportError(0); + //////else ReportError(1000); + } + } + } + else + { + if(GetConnectedState()) + { + if(!GetInhibitedState()) SetInhibitedState(1); + CloseHandle(m_handle); + m_handle = INVALID_HANDLE_VALUE; + if(m_debugStream) + { + fclose(m_debugStream); + m_debugStream = NULL; + } + } + } +} + +//Command 227 - Request master inhibit status - Always enabled so use RequestInhibit +short CSr3Ctrl::GetInhibitedState() +{ + if(!GetConnectedState()) return 1; + return (RequestInhibit() == 0); +} + +//Command 228 - Modify master inhibit status - Not in SR3 table - Does not work so use ModifyInhibit +void CSr3Ctrl::SetInhibitedState(short nNewValue) +{ + if(GetConnectedState()) + { + if(m_internalMask == 0) RequestCoin(); + ModifyInhibit(nNewValue? 0:m_internalMask); + } +} + +short CSr3Ctrl::GetCurrencyMask() +{ + return m_currencyMask; +} + +void CSr3Ctrl::SetCurrencyMask(short nNewValue) +{ + m_currencyMask = nNewValue; + if(GetConnectedState()) RequestCoin(); +} + +short CSr3Ctrl::GetClearRejectedCoins() +{ + return m_clearRejectedCoins; +} + +void CSr3Ctrl::SetClearRejectedCoins(short nNewValue) +{ + m_clearRejectedCoins = nNewValue; + TestSolenoids(); +} + +short CSr3Ctrl::GetDebugMode() +{ + return m_debugMode; +} + +void CSr3Ctrl::SetDebugMode(short nNewValue) +{ + m_debugMode = nNewValue; + if(m_debugMode && !m_debugStream) fopen_s(&m_debugStream, "C:\\GPASCashStationCoinTrace.txt","wt"); +} Added: trunk/kiosk/cashmech/sr3/Sr3Ctl.h =================================================================== --- trunk/kiosk/cashmech/sr3/Sr3Ctl.h (rev 0) +++ trunk/kiosk/cashmech/sr3/Sr3Ctl.h 2009-12-04 17:49:28 UTC (rev 78) @@ -0,0 +1,145 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +#if !defined(AFX_SR3CTL_H__E9C5BFB2_5B3B_11DA_B07A_D2131E0D4664__INCLUDED_) +#define AFX_SR3CTL_H__E9C5BFB2_5B3B_11DA_B07A_D2131E0D4664__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Sr3Ctl.h : Declaration of the CSr3Ctrl ActiveX Control class. + +///////////////////////////////////////////////////////////////////////////// +// CSr3Ctrl : See Sr3Ctl.cpp for implementation. +#include <stdio.h> + +#define INBUFFSIZE 256 +#define OUTBUFFSIZE 8 +#define TIMERID 7123 +#define DEFAULTMASK 15 +#define WAITTIME 70 + +#define ID_POUNDS 1 +#define ID_EUROS 2 + +class CSr3Ctrl : public COleControl +{ + DECLARE_DYNCREATE(CSr3Ctrl) + +// Constructor +public: + CSr3Ctrl(); + BOOL ReadCredit(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSr3Ctrl) + public: + virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid); + virtual void DoPropExchange(CPropExchange* pPX); + virtual void OnResetState(); + virtual DWORD GetControlFlags(); + //}}AFX_VIRTUAL + +// Implementation +protected: + ~CSr3Ctrl(); + short m_portID; + short m_connectedState; + short m_inhibitedState; + short m_currencyMask; //Input user mask + short m_clearRejectedCoins; + short m_debugMode; + short m_internalMask; //Internal coin channel mask that is equivalent to input user mask + short m_coinID[17]; + HANDLE m_handle; + BYTE out[OUTBUFFSIZE],in[INBUFFSIZE]; + FILE* m_debugStream; + int m_currencyID; // 1=Pounds; 2=Euros + + BOOL Start(); + BOOL GetStatus(); + BOOL uWrite(DWORD); + BOOL uRead(DWORD,DWORD); + void DumpData(int commandID, BOOL success, DWORD size); + BOOL Reset(); + BOOL Product(); + BOOL TestSolenoids(); + int PerformSelfCheck(); + BOOL ModifyInhibit(WORD); + BOOL RequestInhibit(); + short GetCoinValueFromChannel(WORD pos); + short GetCoinChannel(short); + BOOL RequestCoin(); + BOOL SumCheck(int); + void SetCheck(int); + + DECLARE_OLECREATE_EX(CSr3Ctrl) // Class factory and guid + DECLARE_OLETYPELIB(CSr3Ctrl) // GetTypeInfo + DECLARE_PROPPAGEIDS(CSr3Ctrl) // Property page IDs + DECLARE_OLECTLTYPE(CSr3Ctrl) // Type name and misc status + +// Message maps + //{{AFX_MSG(CSr3Ctrl) + //}}AFX_MSG + DECLARE_MESS... [truncated message content] |
From: <mar...@us...> - 2009-12-04 15:34:55
|
Revision: 77 http://gpas.svn.sourceforge.net/gpas/?rev=77&view=rev Author: martinalderson Date: 2009-12-04 15:34:46 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Initial import Added Paths: ----------- trunk/g4sync/ trunk/g4sync/.classpath trunk/g4sync/.project trunk/g4sync/LICENSE.txt trunk/g4sync/SyncGPASAttributes.jardesc trunk/g4sync/SyncGPASAttributes.manifest trunk/g4sync/docs/ trunk/g4sync/docs/Sync Gpas Attributes.doc trunk/g4sync/misc/ trunk/g4sync/misc/g4sync.bat trunk/g4sync/misc/g4sync.logging trunk/g4sync/misc/g4sync.xml trunk/g4sync/src/ trunk/g4sync/src/Salford/ trunk/g4sync/src/Salford/SyncGpsAttributes.java Added: trunk/g4sync/.classpath =================================================================== --- trunk/g4sync/.classpath (rev 0) +++ trunk/g4sync/.classpath 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry path="src" kind="src"/> + <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> + <classpathentry path="/GPAS Common Utils" exported="true" combineaccessrules="false" kind="src"/> + <classpathentry path="org.eclipse.jdt.USER_LIBRARY/Novell LDAP" kind="con"/> + <classpathentry path="bin" kind="output"/> +</classpath> Added: trunk/g4sync/.project =================================================================== --- trunk/g4sync/.project (rev 0) +++ trunk/g4sync/.project 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>SyncGPASAttributes</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/g4sync/LICENSE.txt =================================================================== --- trunk/g4sync/LICENSE.txt (rev 0) +++ trunk/g4sync/LICENSE.txt 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. Added: trunk/g4sync/SyncGPASAttributes.jardesc =================================================================== --- trunk/g4sync/SyncGPASAttributes.jardesc (rev 0) +++ trunk/g4sync/SyncGPASAttributes.jardesc 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<jardesc> + <jar path="C:/jars/g4sync.jar"/> + <options buildIfNeeded="true" compress="true" descriptionLocation="/SyncGPASAttributes/SyncGPASAttributes.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" useSourceFolders="false"/> + <manifest generateManifest="false" mainClassHandleIdentifier="=SyncGPASAttributes/src<Salford{SyncGpsAttributes.java[SyncGpsAttributes" manifestLocation="/SyncGPASAttributes/SyncGPASAttributes.manifest" manifestVersion="1.0" reuseManifest="true" saveManifest="true" usesManifest="true"> + <sealing sealJar="true"> + <packagesToSeal/> + <packagesToUnSeal/> + </sealing> + </manifest> + <selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false"> + <javaElement handleIdentifier="=GPAS Common Utils/src"/> + <javaElement handleIdentifier="=GPAS Common Security/src"/> + <javaElement handleIdentifier="=GPAS OS-Native/src<salford.gpas.util.osnative{WindowsImpl_Stub.java"/> + <javaElement handleIdentifier="=SyncGPASAttributes/src<Salford"/> + </selectedElements> +</jardesc> Added: trunk/g4sync/SyncGPASAttributes.manifest =================================================================== --- trunk/g4sync/SyncGPASAttributes.manifest (rev 0) +++ trunk/g4sync/SyncGPASAttributes.manifest 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Sealed: true +Main-Class: Salford.SyncGpsAttributes +Class-Path: ldap.jar + Added: trunk/g4sync/docs/Sync Gpas Attributes.doc =================================================================== (Binary files differ) Property changes on: trunk/g4sync/docs/Sync Gpas Attributes.doc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/g4sync/misc/g4sync.bat =================================================================== --- trunk/g4sync/misc/g4sync.bat (rev 0) +++ trunk/g4sync/misc/g4sync.bat 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1 @@ +@java -Djava.util.logging.config.file=g4sync.logging -jar g4sync.jar %* Added: trunk/g4sync/misc/g4sync.logging =================================================================== --- trunk/g4sync/misc/g4sync.logging (rev 0) +++ trunk/g4sync/misc/g4sync.logging 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,8 @@ +handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler +.level=INFO +java.util.logging.FileHandler.pattern=g4sync-%g.log +java.util.logging.FileHandler.limit=1048576 +java.util.logging.FileHandler.count=20 +java.util.logging.FileHandler.append=true +java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.FileHandler.level=INFO Added: trunk/g4sync/misc/g4sync.xml =================================================================== --- trunk/g4sync/misc/g4sync.xml (rev 0) +++ trunk/g4sync/misc/g4sync.xml 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,22 @@ +<SyncConfiguration> + <eDirectory serverAddress="eDirectory.ldap.server" serverPort="389" useSSL="false" username="cn=admin,o=myorg" password="my eDirectory password" /> + <aDirectory serverAddress="Active Directory.ldap.server" serverPort="389" useSSL="false" username="cn=administrator,cn=users,dc=mydomain" password="my Active Directory password" licenseDN="cn=GPAS License,cn=GPAS,cn=Program Data,dc=mydomain" osNativeURI="rmi://OS-Native Server Address:10099/OSNative" /> + + <!-- The filename of a cache to use when attributes are written to AD --> + <cache filename="g4sync.cache" /> + + <!-- The attributes to copy --> + <attributes attribute="geomicaGPASCashBal" adattribute="geomicaGPASMoneyBal"/> + <attributes attribute="geomicaGPASCashMax" adattribute="geomicaGPASMoneyMax"/> + <attributes attribute="geomicaGPASCashOD" adattribute="geomicaGPASMoneyOD"/> + + <!-- Specifies when a repair should take place. Valid values are "always", "never", "added_or_updated", "added". --> + <repair condition="added" /> + + <!-- The contexts to look for users in. Users in context "edir" in eDirectory will be mapped to users in "adir" in Active Directory --> + <contexts edir="ou=100,ou=users,o=myorg" adir="ou=100,ou=TestUsers,dc=mydomain" /> + <contexts edir="ou=500,ou=users,o=myorg" adir="ou=500,ou=TestUsers,dc=mydomain" /> + <contexts edir="ou=10000,ou=users,o=myorg" adir="ou=10000,ou=TestUsers,dc=mydomain" /> + <!-- The attribute to use to find the users in Active Directory. The "source" attribute for a user in eDirectory must have the same value as the "target" attribute for the user in Active Directory --> + <identifier source="cn" target="samAccountName" /> +</SyncConfiguration> Added: trunk/g4sync/src/Salford/SyncGpsAttributes.java =================================================================== --- trunk/g4sync/src/Salford/SyncGpsAttributes.java (rev 0) +++ trunk/g4sync/src/Salford/SyncGpsAttributes.java 2009-12-04 15:34:46 UTC (rev 77) @@ -0,0 +1,630 @@ +/* + * GPAS Print Accounting System + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Print Accounting System. + * + * GPAS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GPAS.. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact + * details. + */ + +package Salford; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.rmi.NotBoundException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import salford.gpas.util.Constants; +import salford.gpas.util.GAccountStatus; +import salford.gpas.util.GConfigDetails; +import salford.gpas.util.GConnections; +import salford.gpas.util.GDNMap; +import salford.gpas.util.GDNUtil; +import salford.gpas.util.GLDAPConnection; +import salford.gpas.util.GLicense; +import salford.gpas.util.GUser; +import salford.gpas.util.InvalidWindowsEnterpriseLicenseConnectionException; +import salford.gpas.util.OSNativeHelper; +import salford.gpas.util.rmi.OSNativeInterface; + +import com.novell.ldap.LDAPAttribute; +import com.novell.ldap.LDAPConnection; +import com.novell.ldap.LDAPEntry; +import com.novell.ldap.LDAPException; +import com.novell.ldap.LDAPModification; + +public class SyncGpsAttributes { + private static final Logger LOGGER = Logger.getLogger(SyncGpsAttributes.class.getPackage().getName()); + + public static class Pair { + + private String first; + + private String second; + + public Pair(String attribute, String attribute2) { + first = attribute; + second = attribute2; + } + + public String getFirst() { + return first; + } + + public String getSecond() { + return second; + } + + public String toString() { + return first; + } + } + + protected DocumentBuilder docBuilder; + + protected Document configDoc; + + private boolean verbose; + + private String eDirUsername; + + private String eDirServer; + + private boolean eDirUseSSL = false; + + private int eDirPort = 389; + + private String eDirPassword; + + private String aDirServer; + + private boolean aDirUseSSL = false; + + private int aDirPort = 389; + + private String aDirUsername; + + private String aDirPassword; + + private File cacheFile; + + private boolean hasErrors; + + private HashMap cache = new HashMap(); + + private GLDAPConnection eDirLdap; + + private List contexts; + private static final String CONTEXT_EDIR = "edir"; + private static final String CONTEXT_ADIR = "adir"; + private static final String CONTEXT_SCOPE = "scope"; + + private String sourceIdentifier; + + private String targetIdentifier; + + private List attributes; + + private GLDAPConnection aDirLdap; + + private OSNativeInterface osNativeInterface = null; + + private GLicense license = null; + + private static final int NUM_ATTEMPTS_PER_ENTRY = 2; + + private String repairCondition = REPAIR_NEVER; + + private static final String REPAIR_NEVER = "never"; + private static final String REPAIR_IF_ADDED = "added"; + private static final String REPAIR_IF_ADDED_OR_UPDATED = "added_or_updated"; + private static final String REPAIR_ALWAYS = "always"; + private static Set repairConditions = new HashSet(); + static { + repairConditions.add(REPAIR_NEVER); + repairConditions.add(REPAIR_IF_ADDED); + repairConditions.add(REPAIR_IF_ADDED_OR_UPDATED); + repairConditions.add(REPAIR_ALWAYS); + } + + + public SyncGpsAttributes(File configFile, boolean verbose) throws SAXException, IOException { + this.verbose = verbose; + + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + try { + docBuilder = dbFactory.newDocumentBuilder(); + configDoc = docBuilder.parse(configFile); + } catch (ParserConfigurationException e) { + } + + eDirServer = this.getElementValue("eDirectory", "serverAddress"); + String eDirUseSSLString = getElementValueOrNull("eDirectory", "useSSL"); + String eDirPortString = getElementValueOrNull("eDirectory", "serverPort"); + if (eDirUseSSLString != null) { + eDirUseSSL = Boolean.parseBoolean(eDirUseSSLString); + if (eDirPortString == null) { + eDirPort = eDirUseSSL ? 636 : 389; + } + } + if (eDirPortString != null) { + eDirPort = Integer.parseInt(eDirPortString); + if (eDirUseSSLString == null) { + eDirUseSSL = eDirPort == 636; + } + } + eDirUsername = this.getElementValue("eDirectory", "username"); + eDirPassword = this.getElementValue("eDirectory", "password"); + + aDirServer = this.getElementValue("aDirectory", "serverAddress"); + String aDirUseSSLString = getElementValueOrNull("aDirectory", "useSSL"); + String aDirPortString = getElementValueOrNull("aDirectory", "serverPort"); + if (aDirUseSSLString != null) { + aDirUseSSL = Boolean.parseBoolean(aDirUseSSLString); + if (aDirPortString == null) { + aDirPort = aDirUseSSL ? 636 : 389; + } + } + if (aDirPortString != null) { + aDirPort = Integer.parseInt(aDirPortString); + if (aDirUseSSLString == null) { + aDirUseSSL = aDirPort == 636; + } + } + aDirUsername = this.getElementValue("aDirectory", "username"); + aDirPassword = this.getElementValue("aDirectory", "password"); + + cacheFile = new File(this.getElementValue("cache", "filename")); + + // Since we are doing GPAS work on Active Directory (for repairing) tell + // GPAS common code that we are running on Windows. We will hit + // problems if we try and do GPAS work on eDirectory too. + GConfigDetails.setRunningon(Constants.SYSTEM_WINDOWS); + + eDirLdap = GLDAPConnection.getGLDAPConnection(eDirServer, eDirPort, eDirUsername, eDirPassword, eDirUseSSL, "", ""); + + aDirLdap = GLDAPConnection.getGLDAPConnection(aDirServer, aDirPort, aDirUsername, aDirPassword, aDirUseSSL, "", ""); + try { + if (verbose) { + LOGGER.info("Connecting to eDirectory LDAP server: " + (eDirUseSSL ? "ldap" : "ldaps") + "://" + eDirServer + ":" + eDirPort); + } + eDirLdap.createLDAPConnection(); + connectToActiveDirectory(); + } catch (LDAPException e1) { + e1.printStackTrace(); + System.exit(1); + } + + String osNativeURI = this.getElementValueOrNull("aDirectory", "osNativeURI"); + if (osNativeURI != null) { + try { + osNativeInterface = OSNativeHelper.getOSNativeInterfaceByUrl(osNativeURI); + } catch (NotBoundException e) { + e.printStackTrace(); + System.exit(1); + } + } + + String licenseDN = this.getElementValueOrNull("aDirectory", "licenseDN"); + if (licenseDN != null) { + if (osNativeInterface == null) { + System.err.println("OS-Native URI must be specified when GPAS License DN specified."); + System.exit(1); + } + try { + license = new GLicense(); + GConnections connections = GConnections.getStaticConnections(aDirLdap, osNativeInterface); + license.readFromEntry(connections.getLDAPConnection().getLDAPEntry(licenseDN), connections); +// license = GLicense.readFromEntry(licenseDN, GConnections.getStaticConnections(aDirLdap, osNativeInterface)); + } catch (InvalidWindowsEnterpriseLicenseConnectionException e) { + LOGGER.warning("Connected to Active Directory with a GPAS Enterprise license - should connect via OS-Native"); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + repairCondition = this.getElementValueOrNull("repair", "condition"); + if (repairCondition != null && !repairCondition.equals(REPAIR_NEVER)) { + if (osNativeInterface == null || license == null) { + System.err.println("OS-Native URI and GPAS License DN must be specified for repair."); + System.exit(1); + } + if (!repairConditions.contains(repairCondition)) { + System.err.println("Unknown repair condition."); + System.exit(1); + } + } + + if (hasErrors) { + System.err.println("Problems reading configuration please check."); + System.exit(1); + } + + if (cacheFile.exists()) { + readCache(); + } + + contexts = getElementValueMaps("contexts"); + sourceIdentifier = getElementValue("identifier", "source"); + targetIdentifier = getElementValue("identifier", "target"); + attributes = getElementValues("attributes", "attribute" , "adattribute"); + + for (int index = 0; index < contexts.size(); ++index) { + Map context = (Map) contexts.get(index); + String eDirContext = (String) context.get(CONTEXT_EDIR); + String aDirContext = (String) context.get(CONTEXT_ADIR); + if (verbose) { + LOGGER.info("Searching context " + eDirContext); + } + + String scopeString = (String) context.get(CONTEXT_SCOPE); + int scope = LDAPConnection.SCOPE_SUB; + if (scopeString != null) { + String[] scopeStrings = new String[] {"base", "one", "sub"}; + int scopeIndex = Arrays.asList(scopeStrings).indexOf(scopeString); + if (scopeIndex != -1) { + scope = scopeIndex; + } + } + + try { + LDAPEntry[] entries = this.eDirLdap.getEntries( + eDirContext, + "(objectClass=" + eDirLdap.getPersonObject() + ")", + (String[]) getEDirAttributeNames(attributes).toArray(new String[0]), + scope); + + for (int entriesLoop = 0; entriesLoop < entries.length; ++entriesLoop) { + LDAPEntry entry = entries[entriesLoop]; + boolean succeeded = false; + int remainingAttempts = NUM_ATTEMPTS_PER_ENTRY; + do { + remainingAttempts--; + + try { + // Try to get the Active Directory entry. + LDAPEntry[] possibleADEntries = this.aDirLdap.getEntries( + aDirContext, + "(" + targetIdentifier + "=" + entry.getAttribute(sourceIdentifier).getStringValue() + ")"); + if (possibleADEntries.length != 1) { + LOGGER.warning("Unable to find the Active Directory entry for " + entry.getDN() + " (found " + possibleADEntries.length + " entries)"); + continue; + } + LDAPEntry adEntry = possibleADEntries[0]; + + boolean added = false; + boolean updated = false; + + for (int attributeLoop = 0; attributeLoop < attributes + .size(); ++attributeLoop) { + String attributeName = ((Pair) attributes.get(attributeLoop)).getFirst(); + LDAPAttribute attribute = entry.getAttribute(attributeName); + if (attribute != null) { + String key = (GDNUtil.getConsistentDN(entry.getDN()) + " - " + attributes.get(attributeLoop).toString()).toLowerCase(); + String newValue = attribute.getStringValue(); + String oldValue = (String) cache.get(key); + if (oldValue != null) { + if (!oldValue.equals(newValue)) { + updateAD( + key, + newValue , + oldValue , + ((Pair) attributes.get(attributeLoop)).getSecond(), + adEntry); + updated = true; + } else { + if (verbose) { + LOGGER.info("Entry:" + entry.getDN() + ", attribute:" + attributeName + ", Up to date"); + } + } + } else { + if (newValue != null) { + updateAD( + key, + newValue , + oldValue , + ((Pair) attributes.get(attributeLoop)).getSecond(), + adEntry); + added = true; + } else { + if (verbose) { + LOGGER.info("Entry:" + entry.getDN() + ", attribute:" + attributeName + ", Attribute has no value"); + } + } + } + } else { + if (verbose) { + LOGGER.info("Entry:" + entry.getDN() + ", attribute:" + attributeName + ", Attribute not found"); + } + } + } + + // Repair. + if (repairCondition != null && (repairCondition.equals(REPAIR_ALWAYS) || + (repairCondition.equals(REPAIR_IF_ADDED_OR_UPDATED) && (added || updated)) || + (repairCondition.equals(REPAIR_IF_ADDED) && added))) { + adEntry = aDirLdap.getLDAPEntry(adEntry.getDN()); + GUser user = new GUser(license, aDirLdap); + user.readFromEntry(adEntry); + GDNMap currentAccountsMap = user.getCurrentAccounts(); + for (Iterator i = currentAccountsMap.values().iterator(); i.hasNext(); ) { + GAccountStatus accountStatus = (GAccountStatus) i.next(); + accountStatus.setRepairRequested(true); + } + user.writeToEntry(GConnections.getStaticConnections(aDirLdap, osNativeInterface)); + System.out.println("Repaired " + adEntry.g... [truncated message content] |
From: <mar...@us...> - 2009-12-04 15:01:42
|
Revision: 76 http://gpas.svn.sourceforge.net/gpas/?rev=76&view=rev Author: martinalderson Date: 2009-12-04 15:01:36 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Unused file. Removed Paths: ------------- trunk/g4batch/myg4batch.jardesc Deleted: trunk/g4batch/myg4batch.jardesc =================================================================== --- trunk/g4batch/myg4batch.jardesc 2009-12-04 14:57:04 UTC (rev 75) +++ trunk/g4batch/myg4batch.jardesc 2009-12-04 15:01:36 UTC (rev 76) @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?> -<jardesc> - <jar path="g4batch.jar"/> - <options buildIfNeeded="true" compress="true" descriptionLocation="/G4Batch/g4batch.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> - <storedRefactorings deprecationInfo="true" structuralOnly="false"/> - <selectedProjects/> - <manifest generateManifest="false" mainClassHandleIdentifier="=G4Batch/src<salford.gpas.commandline.g4batch{Main.java[Main" manifestLocation="/G4Batch/g4batch.manifest" manifestVersion="1.0" reuseManifest="true" saveManifest="true" usesManifest="true"> - <sealing sealJar="true"> - <packagesToSeal/> - <packagesToUnSeal/> - </sealing> - </manifest> - <selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false"> - <javaElement handleIdentifier="=G4Batch/src"/> - </selectedElements> -</jardesc> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-04 14:57:10
|
Revision: 75 http://gpas.svn.sourceforge.net/gpas/?rev=75&view=rev Author: martinalderson Date: 2009-12-04 14:57:04 +0000 (Fri, 04 Dec 2009) Log Message: ----------- License comment was messed up preventing compilation. Modified Paths: -------------- trunk/util-common/src/salford/gpas/util/installer/ConfigureMessage.java Modified: trunk/util-common/src/salford/gpas/util/installer/ConfigureMessage.java =================================================================== --- trunk/util-common/src/salford/gpas/util/installer/ConfigureMessage.java 2009-12-04 14:32:23 UTC (rev 74) +++ trunk/util-common/src/salford/gpas/util/installer/ConfigureMessage.java 2009-12-04 14:57:04 UTC (rev 75) @@ -1,4 +1,4 @@ -/*/* +/* * GPAS Common Library * Copyright (C) 2009 Salford Software Ltd. * @@ -20,7 +20,7 @@ * See http://gpas.sourceforge.net/ for more information and contact details. */ - +/* * Created on 18-Sep-2006 * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2009-12-04 14:32:43
|
Revision: 74 http://gpas.svn.sourceforge.net/gpas/?rev=74&view=rev Author: martinalderson Date: 2009-12-04 14:32:23 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Initial import Added Paths: ----------- trunk/util-security/ trunk/util-security/.classpath trunk/util-security/.project trunk/util-security/LICENSE.txt trunk/util-security/build.xml trunk/util-security/doc/ trunk/util-security/doc/changelog-secutil.txt trunk/util-security/misc/ trunk/util-security/misc/passwordtool.bat trunk/util-security/misc/passwordtool.ncf trunk/util-security/misc/passwordtool.sh trunk/util-security/nativej/ trunk/util-security/nativej/gpas_logo2.ico trunk/util-security/nativej/passwordtool.njp trunk/util-security/security.jardesc trunk/util-security/security.manifest trunk/util-security/src/ trunk/util-security/src/salford/ trunk/util-security/src/salford/gpas/ trunk/util-security/src/salford/gpas/commandline/ trunk/util-security/src/salford/gpas/commandline/passwordgui/ trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordGUI.java trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordMain.java trunk/util-security/src/salford/gpas/commandline/passwordgui/gpas_logo2.png trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.jardesc trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.manifest trunk/util-security/src/salford/gpas/util/ trunk/util-security/src/salford/gpas/util/security/ trunk/util-security/src/salford/gpas/util/security/GSecEncrypt.java trunk/util-security/src/salford/gpas/util/security/GSecEncryptUtil.java trunk/util-security/src/salford/gpas/util/security/GSecHash.java trunk/util-security/src/salford/gpas/util/security/GSecHashUtil.java Added: trunk/util-security/.classpath =================================================================== --- trunk/util-security/.classpath (rev 0) +++ trunk/util-security/.classpath 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/util-security/.project =================================================================== --- trunk/util-security/.project (rev 0) +++ trunk/util-security/.project 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>GPAS Common Security</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/util-security/LICENSE.txt =================================================================== --- trunk/util-security/LICENSE.txt (rev 0) +++ trunk/util-security/LICENSE.txt 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: trunk/util-security/build.xml =================================================================== --- trunk/util-security/build.xml (rev 0) +++ trunk/util-security/build.xml 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,42 @@ +<project name="GPAS Common Security" default="dist" basedir="W:\gpas\gpas4\util-security\" > + <property name="src" location="src" /> + <property name="build" location="bin" /> + <property name="nativej" location="C:\Program Files (x86)\NativeJ" /> + <property name="release" location="W:\test" /> + + <target name="init" > + <mkdir dir="${build}" /> + </target> + + <target name="compile" depends="init" > + <javac srcdir="${src}" destdir="${build}" /> + </target> + + <target name="dist" depends="compile" > + <jar jarfile="gpassecutil.jar" basedir="${build}" manifest="security.manifest" excludes="salford\gpas\commandline\**" /> + <jar jarfile="passwordgui.jar" basedir="${build}" manifest="${src}\salford\gpas\commandline\passwordgui\passwordgui.manifest" excludes="salford\gpas\util\**" /> + </target> + + <target name="distclean" depends="clean,dist" > + </target> + + <target name="release" depends="release.check" > + <copy file="gpassecutil.jar" tofile="${release}\lib\gpassecutil-${gpas.version}.jar" /> + <copy file="passwordgui.jar" todir="${release}\bin" /> + <copy file="gpassecutil.jar" tofile="nativej\gpassecutil-${gpas.version}.jar" /> + <exec executable="${nativej}\nativejc.exe"> + <arg line="nativej\passwordtool.njp" /> + </exec> + <copy file="nativej\passwordtool.exe" todir="${release}\bin" /> + </target> + + <target name="release.check" depends="distclean" unless="gpas.version" > + <fail message="No release version has been specified: -Dgpas.version="x.x.x"" /> + </target> + + <target name="clean" > + <delete file="gpassecutil.jar" /> + <delete file="passwordgui.jar" /> + <delete dir="${build}" /> + </target> +</project> \ No newline at end of file Added: trunk/util-security/doc/changelog-secutil.txt =================================================================== --- trunk/util-security/doc/changelog-secutil.txt (rev 0) +++ trunk/util-security/doc/changelog-secutil.txt 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,5 @@ +GPAS Common Security Change Log +------------------------------- + +Current release 4.4.0 (03/06/2008) + Added: trunk/util-security/misc/passwordtool.bat =================================================================== --- trunk/util-security/misc/passwordtool.bat (rev 0) +++ trunk/util-security/misc/passwordtool.bat 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,22 @@ +@echo off +REM Template passwordtool.bat +REM ------------------------- +REM +REM If installing to a different location than the default, ensure the command line at the end of this file contains the correct installation location. +REM +REM +REM +REM Use this command line if running the GPAS Encrypted Password Tool from the default installation path: +REM java -jar "C:\Program Files\Salford Software\GPAS\bin\passwordtool.jar" +REM +REM Else, replace each instance of <INSTALLDIR> in the following line with the correct installation location of the the GPAS Encrypted Password Tool and replace the command line at the end of the file with this one: +REM java -jar <INSTALLDIR>\bin\passwordtool.jar +REM +REM + + + +REM +REM Modify the following command line to point to your installation directory: +REM +javaw -jar "C:\Program Files\Salford Software\GPAS\bin\passwordtool.jar" Added: trunk/util-security/misc/passwordtool.ncf =================================================================== --- trunk/util-security/misc/passwordtool.ncf (rev 0) +++ trunk/util-security/misc/passwordtool.ncf 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,21 @@ +# Template passwordtool.ncf +# ------------------------- +# +# If installing to a different location than the default, ensure the command line at the end of this file contains the correct installation location. +# +# +# +# Use this command line if running the GPAS Encrypted Password Tool from the default installation path: +# java -ns -sn"GPAS Encrypted Password Tool" -jar SYS:/GPAS/bin/passwordtool.jar -c +# +# Else, replace each instance of <INSTALLDIR> in the following line with the correct installation location of the the GPAS Encrypted Password Tool and replace the command line at the end of the file with this one: +# java -ns -sn"GPAS Encrypted Password Tool" -jar <INSTALLDIR>/bin/passwordtool.jar -c +# +# + + + +# +# Modify the following command line to point to your installation directory: +# +java -ns -sn"GPAS Encrypted Password Tool" -jar SYS:/GPAS/bin/passwordtool.jar -c Added: trunk/util-security/misc/passwordtool.sh =================================================================== --- trunk/util-security/misc/passwordtool.sh (rev 0) +++ trunk/util-security/misc/passwordtool.sh 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Template passwordtool.sh +# ------------------------ +# +# If installing to a different location than the default, ensure the command line at the end of this file contains the correct installation location. +# +# +# +# Use this command line if running the GPAS Encrypted Password Tool from the default installation path: +# java -jar /opt/GPAS/bin/passwordtool.jar +# +# Else, replace each instance of <INSTALLDIR> in the following line with the correct installation location of the the GPAS Encrypted Password Tool and replace the command line at the end of the file with this one: +# java -jar <INSTALLDIR>/bin/passwordtool.jar +# +# + + +# +# Modify the following command line to point to your installation directory: +# +java -jar /opt/GPAS/bin/passwordtool.jar Added: trunk/util-security/nativej/gpas_logo2.ico =================================================================== (Binary files differ) Property changes on: trunk/util-security/nativej/gpas_logo2.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/util-security/nativej/passwordtool.njp =================================================================== --- trunk/util-security/nativej/passwordtool.njp (rev 0) +++ trunk/util-security/nativej/passwordtool.njp 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,41 @@ +[NativeJ Project Definition] +ApplicationType=1 +AllowAsService=0 +AppIcon=gpas_logo2.ico +TargetExe=passwordtool.exe +EmbeddedJars=passwordtool.jar;|gpassecutil-4.4.0.jar| +RedirectStdOutType=2 +RedirectStdErrType=2 +RedirectStdOut=stdout.log +RedirectStdErr=stderr.log +ProcessPriority=3 +JvmVersion=2 +JvmSearchOrder=01234 +Classpath=passwordtool.jar;|gpassecutil-4.4.0.jar| +DeleteJars=1 +ExtractJarsLocal=2 +AllPathsRelative=0 +StayInCurrentDir=0 +GraphicalAppClass=salford.gpas.commandline.passwordgui.PasswordMain +AllowMultipleInstance=0 +SplashScreenTitle=Loading application... +SplashScreenWatch=0 +SplashScreenTimeout=0 +IncludeVersion=1 +FileVer0=4 +FileVer1=4 +FileVer2=0 +FileVer3=0 +ProductVer0=4 +ProductVer1=4 +ProductVer2=0 +ProductVer3=0 +VerLang=2057 +CompanyName=Salford Software Ltd +FileDescription=GPAS Encrypted Password Tool +FileVersion=4.4.0.0 +InternalName=passwordtool +LegalCopyright=(c) Salford Software Ltd, 2009 +ProductName=GPAS Encrypted Password Tool +ProductVersion=4.4.0.0 + Added: trunk/util-security/security.jardesc =================================================================== --- trunk/util-security/security.jardesc (rev 0) +++ trunk/util-security/security.jardesc 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jardesc> + <jar path="W:/gpas/gpas4/util-security/gpassecutil.jar"/> + <options overwrite="false" compress="true" exportErrors="false" exportWarnings="false" saveDescription="true" descriptionLocation="/GPAS Common Security/security.jardesc" useSourceFolders="false" buildIfNeeded="true" includeDirectoryEntries="false"/> + <manifest manifestVersion="1.0" usesManifest="true" reuseManifest="false" saveManifest="true" generateManifest="false" manifestLocation="/GPAS Common Security/security.manifest"> + <sealing sealJar="true"> + <packagesToSeal/> + <packagesToUnSeal/> + </sealing> + </manifest> + <selectedElements exportClassFiles="true" exportOutputFolder="false" exportJavaFiles="false"> + <javaElement handleIdentifier="=GPAS Common Security/src<salford.gpas.util.security"/> + </selectedElements> +</jardesc> Added: trunk/util-security/security.manifest =================================================================== --- trunk/util-security/security.manifest (rev 0) +++ trunk/util-security/security.manifest 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Sealed: true +Implementation-Title: GPAS Common Security +Implementation-Version: 4.4.0 +Implementation-Vendor: Salford Software Ltd. + Added: trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordGUI.java =================================================================== --- trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordGUI.java (rev 0) +++ trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordGUI.java 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,322 @@ +/* + * GPAS Common Library + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Common Library + * + * GPAS Common Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS Common Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GPAS Common Library. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact details. + */ + +package salford.gpas.commandline.passwordgui; + +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.io.UnsupportedEncodingException; +import java.net.URL; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.JTextField; +import javax.swing.UnsupportedLookAndFeelException; + +import salford.gpas.util.security.GSecEncrypt; +import salford.gpas.util.security.GSecEncryptUtil; + +public class PasswordGUI extends JFrame { + + private JPanel jContentPane = null; + private JLabel jLabelPassword = null; + private JPasswordField jPasswordFieldPassword = null; + private JButton jButtonEncrypt = null; + private JLabel jLabelPasswordConf = null; + private JPasswordField jPasswordFieldPasswordConf = null; + private JPanel jPanelEncryptedPassword = null; + private JTextField jTextFieldEncryptedPassword = null; + private JButton jButtonDecrypt = null; + private JTextField jTextFieldDecryptedPassword = null; + + /** + * This method initializes jPasswordFieldPassword + * + * @return javax.swing.JPasswordField + */ + private JPasswordField getJTextFieldPassword() { + if (jPasswordFieldPassword == null) { + jPasswordFieldPassword = new JPasswordField(); + } + return jPasswordFieldPassword; + } + + /** + * This method initializes jButtonEncrypt + * + * @return javax.swing.JButton + */ + private JButton getJButtonEncrypt() { + if (jButtonEncrypt == null) { + jButtonEncrypt = new JButton(); + jButtonEncrypt.setText("Encrypt"); + jButtonEncrypt.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent e) { + if (jPasswordFieldPassword.getPassword().length <= 0) { + JOptionPane.showMessageDialog(getJContentPane(), "No password entered!", + "Encrypted Password Generator", JOptionPane.ERROR_MESSAGE); + } + else if (new String(jPasswordFieldPassword.getPassword()).equals(new String(jPasswordFieldPasswordConf.getPassword()))) { + GSecEncrypt secEncrypt = new GSecEncrypt(); + + try { + jTextFieldEncryptedPassword.setText(secEncrypt.encryptString(new String(jPasswordFieldPassword.getPassword()), + GSecEncryptUtil.dwGPASStringEncryptionKey)); + } catch (UnsupportedEncodingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + else { + JOptionPane.showMessageDialog(getJContentPane(), "Passwords entered do not match!", + "Encrypted Password Generator", JOptionPane.ERROR_MESSAGE); + } + } + }); + } + return jButtonEncrypt; + } + + /** + * This method initializes jPasswordFieldPasswordConf + * + * @return javax.swing.JPasswordField + */ + private JPasswordField getJTextFieldPasswordConf() { + if (jPasswordFieldPasswordConf == null) { + jPasswordFieldPasswordConf = new JPasswordField(); + } + return jPasswordFieldPasswordConf; + } + + /** + * This method initializes jPanelEncryptedPassword + * + * @return javax.swing.JPanel + */ + private JPanel getJPanelEncryptedPassword() { + if (jPanelEncryptedPassword == null) { + GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); + gridBagConstraints8.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints8.gridx = 0; + gridBagConstraints8.gridy = 1; + gridBagConstraints8.weightx = 1.0; + gridBagConstraints8.gridwidth = 21; + gridBagConstraints8.insets = new java.awt.Insets(10,10,10,10); + GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); + gridBagConstraints7.anchor = java.awt.GridBagConstraints.EAST; + gridBagConstraints7.gridx = 1; + gridBagConstraints7.gridy = 0; + gridBagConstraints7.weightx = 0.0D; + gridBagConstraints7.insets = new java.awt.Insets(10,10,0,10); + GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); + gridBagConstraints6.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints6.gridx = 0; + gridBagConstraints6.gridy = 0; + gridBagConstraints6.weightx = 1.0; + gridBagConstraints6.insets = new java.awt.Insets(10,10,0,10); + jPanelEncryptedPassword = new JPanel(); + jPanelEncryptedPassword.setLayout(new GridBagLayout()); + jPanelEncryptedPassword.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Encrypted Password:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); + jPanelEncryptedPassword.add(getJTextFieldEncryptedPassword(), gridBagConstraints6); + jPanelEncryptedPassword.add(getJButtonDecrypt(), gridBagConstraints7); + jPanelEncryptedPassword.add(getJTextFieldDecryptedPassword(), gridBagConstraints8); + } + return jPanelEncryptedPassword; + } + + /** + * This method initializes jTextFieldEncryptedPassword + * + * @return javax.swing.JTextField + */ + private JTextField getJTextFieldEncryptedPassword() { + if (jTextFieldEncryptedPassword == null) { + jTextFieldEncryptedPassword = new JTextField(); + jTextFieldEncryptedPassword.setEditable(false); + jTextFieldEncryptedPassword.setFont(new java.awt.Font("Courier New", java.awt.Font.PLAIN, 12)); + } + return jTextFieldEncryptedPassword; + } + + /** + * This method initializes jButtonDecrypt + * + * @return javax.swing.JButton + */ + private JButton getJButtonDecrypt() { + if (jButtonDecrypt == null) { + jButtonDecrypt = new JButton(); + jButtonDecrypt.setText("Decrypt"); + jButtonDecrypt.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent e) { + if (jTextFieldEncryptedPassword.getText().length() <= 0) { + JOptionPane.showMessageDialog(getJContentPane(), "No encrypted password to decrypt!", + "Encrypted Password Generator", JOptionPane.ERROR_MESSAGE); + } + else { + String decryptedPassword; + try { + GSecEncrypt secEncrypt = new GSecEncrypt(); + decryptedPassword = secEncrypt.decryptString(jTextFieldEncryptedPassword.getText(), GSecEncryptUtil.dwGPASStringEncryptionKey); + } catch (CloneNotSupportedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + return; + } + + if (decryptedPassword == null || decryptedPassword.length() == 0) { + JOptionPane.showMessageDialog(getJContentPane(), "Error decrypting password!", + "Encrypted Password Generator", JOptionPane.ERROR_MESSAGE); + } + jTextFieldDecryptedPassword.setText(decryptedPassword); + } + } + }); + } + return jButtonDecrypt; + } + + /** + * This method initializes jTextFieldDecryptedPassword + * + * @return javax.swing.JTextField + */ + private JTextField getJTextFieldDecryptedPassword() { + if (jTextFieldDecryptedPassword == null) { + jTextFieldDecryptedPassword = new JTextField(); + jTextFieldDecryptedPassword.setEnabled(false); + } + return jTextFieldDecryptedPassword; + } + + /** + * This is the default constructor + */ + public PasswordGUI() { + super(); + + try { + javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + initialize(); + } + + /** + * This method initializes this + * + * @return void + */ + private void initialize() { + this.setSize(480, 240); + this.setContentPane(getJContentPane()); + this.setTitle("Encrypted Password Generator"); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize(); + URL url = this.getClass().getResource("gpas_logo2.png"); + if (url != null) { + this.setIconImage(Toolkit.getDefaultToolkit().getImage(url)); + } + this.setLocation((screenDim.width - this.getBounds().width) / 2, + (screenDim.height - this.getBounds().height) / 2); + } + + /** + * This method initializes jContentPane + * + * @return javax.swing.JPanel + */ + private JPanel getJContentPane() { + if (jContentPane == null) { + GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); + gridBagConstraints5.gridx = 0; + gridBagConstraints5.gridy = 3; + gridBagConstraints5.insets = new java.awt.Insets(10,10,10,10); + gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints5.anchor = java.awt.GridBagConstraints.SOUTH; + gridBagConstraints5.weightx = 1.0D; + gridBagConstraints5.weighty = 1.0D; + gridBagConstraints5.gridwidth = 2; + GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); + gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints4.gridx = 1; + gridBagConstraints4.gridy = 1; + gridBagConstraints4.insets = new java.awt.Insets(10,10,0,10); + gridBagConstraints4.weightx = 1.0; + GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); + gridBagConstraints3.gridx = 0; + gridBagConstraints3.insets = new java.awt.Insets(10,10,0,0); + gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints3.gridy = 1; + jLabelPasswordConf = new JLabel(); + jLabelPasswordConf.setText("Password Confirmation:"); + GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); + gridBagConstraints2.gridx = 1; + gridBagConstraints2.insets = new java.awt.Insets(10,10,10,10); + gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST; + gridBagConstraints2.gridy = 2; + GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); + gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints1.insets = new java.awt.Insets(10,10,0,10); + gridBagConstraints1.gridx = 1; + gridBagConstraints1.gridy = 0; + gridBagConstraints1.weightx = 1.0; + GridBagConstraints gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.insets = new java.awt.Insets(10,10,0,0); + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.gridy = 0; + jLabelPassword = new JLabel(); + jLabelPassword.setText("Password:"); + jContentPane = new JPanel(); + jContentPane.setLayout(new GridBagLayout()); + jContentPane.add(jLabelPassword, gridBagConstraints); + jContentPane.add(getJTextFieldPassword(), gridBagConstraints1); + jContentPane.add(jLabelPasswordConf, gridBagConstraints3); + jContentPane.add(getJButtonEncrypt(), gridBagConstraints2); + jContentPane.add(getJTextFieldPasswordConf(), gridBagConstraints4); + jContentPane.add(getJPanelEncryptedPassword(), gridBagConstraints5); + } + return jContentPane; + } + +} Added: trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordMain.java =================================================================== --- trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordMain.java (rev 0) +++ trunk/util-security/src/salford/gpas/commandline/passwordgui/PasswordMain.java 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,112 @@ +/* + * GPAS Common Library + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Common Library + * + * GPAS Common Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS Common Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GPAS Common Library. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact details. + */ + +package salford.gpas.commandline.passwordgui; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; + +import salford.gpas.util.security.GSecEncrypt; +import salford.gpas.util.security.GSecEncryptUtil; + +public class PasswordMain { + + /** + * @param args + */ + public static void main(String[] args) { + if (args.length != 1) { + PasswordGUI gui = new PasswordGUI(); + gui.show(); + } + else if (args.length == 1) { + String arg = args[0]; + + if (arg.equalsIgnoreCase("/c") || arg.equalsIgnoreCase("\\c") || + arg.equalsIgnoreCase("-c") || arg.equalsIgnoreCase("--c") || + arg.equalsIgnoreCase("-command") || arg.equalsIgnoreCase("--command")) { + while (true) { + System.out.print("Please enter password to encrypt (case-sensitive): "); + + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); + + String password; + try { + password = bufferedReader.readLine(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + continue; + } + + if (password == null || password.length() == 0) { + System.out.println(); + System.out.println("No password entered"); + System.out.println(); + } + else { + System.out.print("Please confirm password to encrypt: "); + + String passwordConf; + try { + passwordConf = bufferedReader.readLine(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + continue; + } + + if (password.equals(passwordConf)) { + GSecEncrypt secEncrypt = new GSecEncrypt(); + + System.out.println(); + try { + System.out.print("Encrypted password is: " + secEncrypt.encryptString(passwordConf, GSecEncryptUtil.dwGPASStringEncryptionKey)); + System.exit(0); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + continue; + } + } + else { + System.out.println(); + System.out.println("Passwords entered do not match"); + System.out.println(); + } + } + } + } + else if (arg.equalsIgnoreCase("/?") || arg.equalsIgnoreCase("\\?") || + arg.equalsIgnoreCase("-h") || arg.equalsIgnoreCase("--h") || + arg.equalsIgnoreCase("-help") || arg.equalsIgnoreCase("--help")) { + System.out.println("GPAS Encrypted Password Generation Tool (v4.4.0)"); + System.out.println("------------------------------------------------"); + System.out.println(); + System.out.println("Usage: --help to see this information"); + System.out.println(" --command to run in command line mode"); + } + } + } +} Added: trunk/util-security/src/salford/gpas/commandline/passwordgui/gpas_logo2.png =================================================================== (Binary files differ) Property changes on: trunk/util-security/src/salford/gpas/commandline/passwordgui/gpas_logo2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.jardesc =================================================================== --- trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.jardesc (rev 0) +++ trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.jardesc 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jardesc> + <jar path="W:/gpas/gpas4/util-security/nativej/passwordtool.jar"/> + <options overwrite="false" compress="true" exportErrors="false" exportWarnings="true" saveDescription="true" descriptionLocation="/GPAS Common Security/src/salford/gpas/commandline/passwordgui/passwordgui.jardesc" useSourceFolders="false" buildIfNeeded="true" includeDirectoryEntries="false"/> + <manifest manifestVersion="1.0" usesManifest="true" reuseManifest="true" saveManifest="true" generateManifest="false" manifestLocation="/GPAS Common Security/src/salford/gpas/commandline/passwordgui/passwordgui.manifest" mainClassHandleIdentifier="=GPAS Common Security/src<salford.gpas.commandline.passwordgui{PasswordMain.java[PasswordMain"> + <sealing sealJar="true"> + <packagesToSeal/> + <packagesToUnSeal/> + </sealing> + </manifest> + <selectedElements exportClassFiles="true" exportOutputFolder="false" exportJavaFiles="false"> + <javaElement handleIdentifier="=GPAS Common Security/src<salford.gpas.commandline.passwordgui{PasswordMain.java"/> + <file path="/GPAS Common Security/src/salford/gpas/commandline/passwordgui/gpas_logo2.png"/> + <javaElement handleIdentifier="=GPAS Common Security/src<salford.gpas.commandline.passwordgui{PasswordGUI.java"/> + </selectedElements> +</jardesc> Added: trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.manifest =================================================================== --- trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.manifest (rev 0) +++ trunk/util-security/src/salford/gpas/commandline/passwordgui/passwordgui.manifest 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Sealed: true +Main-Class: salford.gpas.commandline.passwordgui.PasswordMain +Class-Path: ../lib/gpassecutil-4.4.0.jar +Implementation-Title: GPAS Password GUI Tool +Implementation-Version: 4.4.0 +Implementation-Vendor: Salford Software Ltd. Added: trunk/util-security/src/salford/gpas/util/security/GSecEncrypt.java =================================================================== --- trunk/util-security/src/salford/gpas/util/security/GSecEncrypt.java (rev 0) +++ trunk/util-security/src/salford/gpas/util/security/GSecEncrypt.java 2009-12-04 14:32:23 UTC (rev 74) @@ -0,0 +1,673 @@ +/* + * GPAS Common Library + * Copyright (C) 2009 Salford Software Ltd. + * + * This file is part of GPAS Common Library + * + * GPAS Common Library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GPAS Common Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GPAS Common Library. If not, see <http://www.gnu.org/licenses/>. + * + * See http://gpas.sourceforge.net/ for more information and contact details. + */ + +/* + * Created on 10-Aug-2005 + */ +package salford.gpas.util.security; + +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.security.SecureRandom; + +/** + * @author Paul Spink + */ +public class GSecEncrypt { + /** + * Helper class to emulate C++ QWORD - struct QWORD { DWORD L, R; }; + * + * @author Paul Spink + */ + public static class QWORD { + public long L; + public long R; + + public QWORD() { + } + public QWORD(long l, long r) { + L = l; + R = r; + } + protected Object clone() throws CloneNotSupportedException { + return new QWORD(L, R); + } + public String toString() { + char[] ch = new char[8]; + ByteBuffer b = ByteBuffer.allocate(8); + b = b.order(ByteOrder.LITTLE_ENDIAN); + b.putInt((int)L); + b.putInt((int)R); + for (int i = 0; i < 8; i++) { + ch[i] += b.get(i) & 0xFF; + } + return new String(ch); + } + } + + /** + * Initial values for P-array. + */ + private static final long[] ms_dwInitP = + { + 0x243f6a88L, 0x85a308d3L, 0x13198a2eL, 0x03707344L, 0xa4093822L, 0x299f31d0L, + 0x082efa98L, 0xec4e6c89L, 0x452821e6L, 0x38d01377L, 0xbe5466cfL, 0x34e90c6cL, + 0xc0ac29b7L, 0xc97c50ddL, 0x3f84d5b5L, 0xb5470917L, 0x9216d5d9L, 0x8979fb1bL + }; + + /** + * Initial values for S-boxes. + */ + private static final long[][] ms_dwInitS = + { + { + 0xd1310ba6L, 0x98dfb5acL, 0x2ffd72dbL, 0xd01adfb7L, 0xb8e1afedL, 0x6a267e96L, + 0xba7c9045L, 0xf12c7f99L, 0x24a19947L, 0xb3916cf7L, 0x0801f2e2L, 0x858efc16L, + 0x636920d8L, 0x71574e69L, 0xa458fea3L, 0xf4933d7eL, 0x0d95748fL, 0x728eb658L, + 0x718bcd58L, 0x82154aeeL, 0x7b54a41dL, 0xc25a59b5L, 0x9c30d539L, 0x2af26013L, + 0xc5d1b023L, 0x286085f0L, 0xca417918L, 0xb8db38efL, 0x8e79dcb0L, 0x603a180eL, + 0x6c9e0e8bL, 0xb01e8a3eL, 0xd71577c1L, 0xbd314b27L, 0x78af2fdaL, 0x55605c60L, + 0xe65525f3L, 0xaa55ab94L, 0x57489862L, 0x63e81440L, 0x55ca396aL, 0x2aab10b6L, + 0xb4cc5c34L, 0x1141e8ceL, 0xa15486afL, 0x7c72e993L, 0xb3ee1411L, 0x636fbc2aL, + 0x2ba9c55dL, 0x741831f6L, 0xce5c3e16L, 0x9b87931eL, 0xafd6ba33L, 0x6c24cf5cL, + 0x7a325381L, 0x28958677L, 0x3b8f4898L, 0x6b4bb9afL, 0xc4bfe81bL, 0x66282193L, + 0x61d809ccL, 0xfb21a991L, 0x487cac60L, 0x5dec8032L, 0xef845d5dL, 0xe98575b1L, + 0xdc262302L, 0xeb651b88L, 0x23893e81L, 0xd396acc5L, 0x0f6d6ff3L, 0x83f44239L, + 0x2e0b4482L, 0xa4842004L, 0x69c8f04aL, 0x9e1f9b5eL, 0x21c66842L, 0xf6e96c9aL, + 0x670c9c61L, 0xabd388f0L, 0x6a51a0d2L, 0xd8542f68L, 0x960fa728L, 0xab5133a3L, + 0x6eef0b6cL, 0x137a3be4L, 0xba3bf050L, 0x7efb2a98L, 0xa1f1651dL, 0x39af0176L, + 0x66ca593eL, 0x82430e88L, 0x8cee8619L, 0x456f9fb4L, 0x7d84a5c3L, 0x3b8b5ebeL, + 0xe06f75d8L, 0x85c12073L, 0x401a449fL, 0x56c16aa6L, 0x4ed3aa62L, 0x363f7706L, + 0x1bfedf72L, 0x429b023dL, 0x37d0d724L, 0xd00a1248L, 0xdb0fead3L, 0x49f1c09bL, + 0x075372c9L, 0x80991b7bL, 0x25d479d8L, 0xf6e8def7L, 0xe3fe501aL, 0xb6794c3bL, + 0x976ce0bdL, 0x04c006baL, 0xc1a94fb6L, 0x409f60c4L, 0x5e5c9ec2L, 0x196a2463L, + 0x68fb6fafL, 0x3e6c53b5L, 0x1339b2ebL, 0x3b52ec6fL, 0x6dfc511fL, 0x9b30952cL, + 0xcc814544L, 0xaf5ebd09L, 0xbee3d004L, 0xde334afdL, 0x660f2807L, 0x192e4bb3L, + 0xc0cba857L, 0x45c8740fL, 0xd20b5f39L, 0xb9d3fbdbL, 0x5579c0bdL, 0x1a60320aL, + 0xd6a100c6L, 0x402c7279L, 0x679f25feL, 0xfb1fa3ccL, 0x8ea5e9f8L, 0xdb3222f8L, + 0x3c7516dfL, 0xfd616b15L, 0x2f501ec8L, 0xad0552abL, 0x323db5faL, 0xfd238760L, + 0x53317b48L, 0x3e00df82L, 0x9e5c57bbL, 0xca6f8ca0L, 0x1a87562eL, 0xdf1769dbL, + 0xd542a8f6L, 0x287effc3L, 0xac6732c6L, 0x8c4f5573L, 0x695b27b0L, 0xbbca58c8L, + 0xe1ffa35dL, 0xb8f011a0L, 0x10fa3d98L, 0xfd2183b8L, 0x4afcb56cL, 0x2dd1d35bL, + 0x9a53e479L, 0xb6f84565L, 0xd28e49bcL, 0x4bfb9790L, 0xe1ddf2daL, 0xa4cb7e33L, + 0x62fb1341L, 0xcee4c6e8L, 0xef20cadaL, 0x36774c01L, 0xd07e9efeL, 0x2bf11fb4L, + 0x95dbda4dL, 0xae909198L, 0xeaad8e71L, 0x6b93d5a0L, 0xd08ed1d0L, 0xafc725e0L, + 0x8e3c5b2fL, 0x8e7594b7L, 0x8ff6e2fbL, 0xf2122b64L, 0x8888b812L, 0x900df01cL, + 0x4fad5ea0L, 0x688fc31cL, 0xd1cff191L, 0xb3a8c1adL, 0x2f2f2218L, 0xbe0e1777L, + 0xea752dfeL, 0x8b021fa1L, 0xe5a0cc0fL, 0xb56f74e8L, 0x18acf3d6L, 0xce89e299L, + 0xb4a84fe0L, 0xfd13e0b7L, 0x7cc43b81L, 0xd2ada8d9L, 0x165fa266L, 0x80957705L, + 0x93cc7314L, 0x211a1477L, 0xe6ad2065L, 0x77b5fa86L, 0xc75442f5L, 0xfb9d35cfL, + 0xebcdaf0cL, 0x7b3e89a0L, 0xd6411bd3L, 0xae1e7e49L, 0x00250e2dL, 0x2071b35eL, + 0x226800bbL, 0x57b8e0afL, 0x2464369bL, 0xf009b91eL, 0x5563911dL, 0x59dfa6aaL, + 0x78c14389L, 0xd95a537fL, 0x207d5ba2L, 0x02e5b9c5L, 0x83260376L, 0x6295cfa9L, + 0x11c81968L, 0x4e734a41L, 0xb3472dcaL, 0x7b14a94aL, 0x1b510052L, 0x9a532915L, + 0xd60f573fL, 0xbc9bc6e4L, 0x2b60a476L, 0x81e67400L, 0x08ba6fb5L, 0x571be91fL, + 0xf296ec6bL, 0x2a0dd915L, 0xb6636521L, 0xe7b9f9b6L, 0xff34052eL, 0xc5855664L, + 0x53b02d5dL, 0xa99f8fa1L, 0x08ba4799L, 0x6e85076aL + }, + + { + 0x4b7a70e9L, 0xb5b32944L, 0xdb75092eL, 0xc4192623L, 0xad6ea6b0L, 0x49a7df7dL, + 0x9cee60b8L, 0x8fedb266L, 0xecaa8c71L, 0x699a17ffL, 0x5664526cL, 0xc2b19ee1L, + 0x193602a5L, 0x75094c29L, 0xa0591340L, 0xe4183a3eL, 0x3f54989aL, 0x5b429d65L, + 0x6b8fe4d6L, 0x99f73fd6L, 0xa1d29c07L, 0xefe830f5L, 0x4d2d38e6L, 0xf0255dc1L, + 0x4cdd2086L, 0x8470eb26L, 0x6382e9c6L, 0x021ecc5eL, 0x09686b3fL, 0x3ebaefc9L, + 0x3c971814L, 0x6b6a70a1L, 0x687f3584L, 0x52a0e286L, 0xb79c5305L, 0xaa500737L, + 0x3e07841cL, 0x7fdeae5cL, 0x8e7d44ecL, 0x5716f2b8L, 0xb03ada37L, 0xf0500c0dL, + 0xf01c1f04L, 0x0200b3ffL, 0xae0cf51aL, 0x3cb574b2L, 0x25837a58L, 0xdc0921bdL, + 0xd19113f9L, 0x7ca92ff6L, 0x94324773L, 0x22f54701L, 0x3ae5e581L, 0x37c2dadcL, + 0xc8b57634L, 0x9af3dda7L, 0xa9446146L, 0x0fd0030eL, 0xecc8c73eL, 0xa4751e41L, + 0xe238cd99L, 0x3bea0e2fL, 0x3280bba1L, 0x183eb331L, 0x4e548b38L, 0x4f6db908L, + 0x6f420d03L, 0xf60a04bfL, 0x2cb81290L, 0x24977c79L, 0x5679b072L, 0xbcaf89afL, + 0xde9a771fL, 0xd9930810L, 0xb38bae12L, 0xdccf3f2eL, 0x5512721fL, 0x2e6b7124L, + 0x501adde6L, 0x9f84cd87L, 0x7a584718L, 0x7408da17L, 0xbc9f9abcL, 0xe94b7d8cL, + 0xec7aec3aL, 0xdb851dfaL, 0x63094366L, 0xc464c3d2L, 0xef1c1847L, 0x3215d908L, + 0xdd433b37L, 0x24c2ba16L, 0x12a14d43L, 0x2a65c451L, 0x50940002L, 0x133ae4ddL, + 0x71dff89eL, 0x10314e55L, 0x81ac77d6L, 0x5f11199bL, 0x043556f1L, 0xd7a3c76bL, + 0x3c11183bL, 0x5924a509L, 0xf28fe6edL, 0x97f1fbfaL, 0x9ebabf2cL, 0x1e153c6eL, + 0x86e34570L, 0xeae96fb1L, 0x860e5e0aL, 0x5a3e2ab3L, 0x771fe71cL, 0x4e3d06faL, + 0x2965dcb9L, 0x99e71d0fL, 0x803e89d6L, 0x5266c825L, 0x2e4cc978L, 0x9c10b36aL, + 0xc6150ebaL, 0x94e2ea78L, 0xa5fc3c53L, 0x1e0a2df4L, 0xf2f74ea7L, 0x361d2b3dL, + 0x1939260fL, 0x19c27960L, 0x5223a708L, 0xf71312b6L, 0xebadfe6eL, 0xeac31f66L, + 0xe3bc4595L, 0xa67bc883L, 0xb17f37d1L, 0x018cff28L, 0xc332ddefL, 0xbe6c5aa5L, + 0x65582185L, 0x68ab9802L, 0xeecea50fL, 0xdb2f953bL, 0x2aef7dadL, 0x5b6e2f84L, + 0x1521b628L, 0x29076170L, 0xecdd4775L, 0x619f1510L, 0x13cca830L, 0xeb61bd96L, + 0x0334fe1eL, 0xaa0363cfL, 0xb5735c90L, 0x4c70a239L, 0xd59e9e0bL, 0xcbaade14L, + 0xeecc86bcL, 0x60622ca7L, 0x9cab5cabL, 0xb2f3846eL, 0x648b1eafL, 0x19bdf0caL, + 0xa02369b9L, 0x655abb50L, 0x40685a32L, 0x3c2ab4b3L, 0x319ee9d5L, 0xc021b8f7L, + 0x9b540b19L, 0x875fa099L, 0x95f7997eL, 0x623d7da8L, 0xf837889aL, 0x97e32d77L, + 0x11ed935fL, 0x16681281L, 0x0e358829L, 0xc7e61fd6L, 0x96dedfa1L, 0x7858ba99L, + 0x57f584a5L, 0x1b227263L, 0x9b83c3ffL, 0x1ac24696L, 0xcdb30aebL, 0x532e3054L, + 0x8fd948e4L, 0x6dbc3128L, 0x58ebf2efL, 0x34c6ffeaL, 0xfe28ed61L, 0xee7c3c73L, + 0x5d4a14d9L, 0xe864b7e3L, 0x42105d14L, 0x203e13e0L, 0x45eee2b6L, 0xa3aaabeaL, + 0xdb6c4f15L, 0xfacb4fd0L, 0xc742f442L, 0xef6abbb5L, 0x654f3b1dL, 0x41cd2105L, + 0xd81e799eL, 0x86854dc7L, 0xe44b476aL, 0x3d816250L, 0xcf62a1f2L, 0x5b8d2646L, + 0xfc8883a0L, 0xc1c7b6a3L, 0x7f1524c3L, 0x69cb7492L, 0x47848a0bL, 0x5692b285L, + 0x095bbf00L, 0xad19489dL, 0x1462b174L, 0x23820e00L, 0x58428d2aL, 0x0c55f5eaL, + 0x1dadf43eL, 0x233f7061L, 0x3372f092L, 0x8d937e41L, 0xd65fecf1L, 0x6c223bdbL, + 0x7cde3759L, 0xcbee7460L, 0x4085f2a7L, 0xce77326eL, 0xa6078084L, 0x19f8509eL, + 0xe8efd855L, 0x61d99735L, 0xa969a7aaL, 0xc50c06c2L, 0x5a04abfcL, 0x800bcadcL, + 0x9e447a2eL, 0xc3453484L, 0xfdd56705L, 0x0e1e9ec9L, 0xdb73dbd3L, 0x105588cdL, + 0x675fda79L, 0xe3674340L, 0xc5c43465L, 0x713e38d8L, 0x3d28f89eL, 0xf16dff20L, + 0x153e21e7L, 0x8fb03d4aL, 0xe6e39f2bL, 0xdb83adf7L + }, + + { + 0xe93d5a68L, 0x948140f7L, 0xf64c261cL, 0x94692934L, 0x411520f7L, 0x7602d4f7L, + 0xbcf46b2eL, 0xd4a20068L, 0xd4082471L, 0x3320f46aL, 0x43b7d4b7L, 0x500061afL, + 0x1e39f62eL, 0x97244546L, 0x14214f74L, 0xbf8b8840L, 0x4d95fc1dL, 0x96b591afL, + 0x70f4ddd3L, 0x66a02f45L, 0xbfbc09ecL, 0x03bd9785L, 0x7fac6dd0L, 0x31cb8504L, + 0x96eb27b3L, 0x55fd3941L, 0xda2547e6L, 0xabca0a9aL, 0x28507825L, 0x530429f4L, + 0x0a2c86daL, 0xe9b66dfbL, 0x68dc1462L, 0xd7486900L, 0x680ec0a4L, 0x27a18deeL, + 0x4f3ffea2L, 0xe887ad8cL, 0xb58ce006L, 0x7af4d6b6L, 0xaace1e7cL, 0xd3375fecL, + 0xce78a399L, 0x406b2a42L, 0x20fe9e35L, 0xd9f385b9L, 0xee39d7abL, 0x3b124e8bL, + 0x1dc9faf7L, 0x4b6d1856L, 0x26a36631L, 0xeae397b2L, 0x3a6efa74L, 0xdd5b4332L, + 0x6841e7f7L, 0xca7820fbL, 0xfb0af54eL, 0xd8feb397L, 0x454056acL, 0xba489527L, + 0x55533a3aL, 0x20838d87L, 0xfe6ba9b7L, 0xd096954bL, 0x55a867bcL, 0xa1159a58L, + 0xcca92963L, 0x99e1db33L, 0xa62a4a56L, 0x3f3125f9L, 0x5ef47e1cL, 0x9029317cL, + 0xfdf8e802L, 0x04272f70L, 0x80bb155cL, 0x05282ce3L, 0x95c11548L, 0xe4c66d22L, + 0x48c1133fL, 0xc70f86dcL, 0x07f9c9eeL, 0x41041f0fL, 0x404779a4L, 0x5d886e17L, + 0x325f51ebL, 0xd59bc0d1L, 0xf2bcc18fL, 0x41113564L, 0x257b7834L, 0x602a9c60L, + 0xdff8e8a3L, 0x1f636c1bL, 0x0e12b4c2L, 0x02e1329eL, 0xaf664fd1L, 0xcad18115L, + 0x6b2395e0L, 0x333e92e1L, 0x3b240b62L, 0xeebeb922L, 0x85b2a20eL, 0xe6ba0d99L, + 0xde720c8cL, 0x2da2f728L, 0xd0127845L, 0x95b794fdL, 0x647d0862L, 0xe7ccf5f0L, + 0x5449a36fL, 0x877d48faL, 0xc39dfd27L, 0xf33e8d1eL, 0x0a476341L, 0x992eff74L, + 0x3a6f6eabL, 0xf4f8fd37L, 0xa812dc60L, 0xa1ebddf8L, 0x991be14cL, 0xdb6e6b0dL, + 0xc67b5510L, 0x6d672c37L, 0x2765d43bL, 0xdcd0e804L, 0xf1290dc7L, 0xcc00ffa3L, + 0xb5390f92L, 0x690fed0bL, 0x667b9ffbL, 0xcedb7d9cL, 0xa091cf0bL, 0xd9155ea3L, + 0xbb132f88L, 0x515bad24L, 0x7b9479bfL, 0x763bd6ebL, 0x37392eb3L, 0xcc115979L, + 0x8026e297L, 0xf42e312dL, 0x6842ada7L, 0xc66a2b3bL, 0x12754cccL, 0x782ef11cL, + 0x6a124237L, 0xb79251e7L, 0x06a1bbe6L, 0x4bfb6350L, 0x1a6b1018L, 0x11caedfaL, + 0x3d25bdd8L, 0xe2e1c3c9L, 0x44421659L, 0x0a121386L, 0xd90cec6eL, 0xd5abea2aL, + 0x64af674eL, 0xda86a85fL, 0xbebfe988L, 0x64e4c3feL, 0x9dbc8057L, 0xf0f7c086L, + 0x60787bf8L, 0x6003604dL, 0xd1fd8346L, 0xf6381fb0L, 0x7745ae04L, 0xd736fcccL, + 0x83426b33L, 0xf01eab71L, 0xb0804187L, 0x3c005e5fL, 0x77a057beL, 0xbde8ae24L, + 0x55464299L, 0xbf582e61L, 0x4e58f48fL, 0xf2ddfda2L, 0xf474ef38L, 0x8789bdc2L, + 0x5366f9c3L, 0xc8b38e74L, 0xb475f255L, 0x46fcd9b9L, 0x7aeb2661L, 0x8b1ddf84L, + 0x846a0e79L, 0x915f95e2L, 0x466e598eL, 0x20b45770L, 0x8cd55591L, 0xc902de4cL, + 0xb90bace1L, 0xbb8205d0L, 0x11a86248L, 0x7574a99eL, 0xb77f19b6L, 0xe0a9dc09L, + 0x662d09a1L, 0xc4324633L, 0xe85a1f02L, 0x09f0be8cL, 0x4a99a025L, 0x1d6efe10L, + 0x1ab93d1dL, 0x0ba5a4dfL, 0xa186f20fL, 0x2868f169L, 0xdcb7da83L, 0x573906feL, + 0xa1e2ce9bL, 0x4fcd7f52L, 0x50115e01L, 0xa70683faL, 0xa002b5c4L, 0x0de6d027L, + 0x9af88c27L, 0x773f8641L, 0xc3604c06L, 0x61a806b5L, 0xf0177a28L, 0xc0f586e0L, + 0x006058aaL, 0x30dc7d62L, 0x11e69ed7L, 0x2338ea63L, 0x53c2dd94L, 0xc2c21634L, + 0xbbcbee56L, 0x90bcb6deL, 0xebfc7da1L, 0xce591d76L, 0x6f05e409L, 0x4b7c0188L, + 0x39720a3dL, 0x7c927c24L, 0x86e3725fL, 0x724d9db9L, 0x1ac15bb4L, 0xd39eb8fcL, + 0xed545578L, 0x08fca5b5L, 0xd83d7cd3L, 0x4dad0fc4L, 0x1e50ef5eL, 0xb161e6f8L, + 0xa28514d9L, 0x6c51133cL, 0x6fd5c7e7L, 0x56e14ec4L, 0x362abfceL, 0xddc6c837L, + 0xd79a3234L, 0x92638212L, 0x670efa8eL, 0x406000e0L + }, + + { + 0x3a39ce37L, 0xd3faf5cfL, 0xabc27737L, 0x5ac52d1bL, 0x5cb0679eL, 0x4fa33742L, + 0xd3822740L, 0x99bc9bbeL, 0xd5118e9dL, 0xbf0f7315L, 0xd62d1c7eL, 0xc700c47bL, + 0xb78c1b6bL, 0x21a19045L, 0xb26eb1beL, 0x6a366eb4L, 0x5748ab2fL, 0xbc946e79L, + 0xc6a376d2L, 0x6549c2c8L, 0x530ff8eeL, 0x468dde7dL, 0xd5730a1dL, 0x4cd04dc6L, + 0x2939bbdbL, 0xa9ba4650L, 0xac9526e8L, 0xbe5ee304L, 0xa1fad5f0L, 0x6a2d519aL, + 0x63ef8ce2L, 0x9a86ee22L, 0xc089c2b8L, 0x43242ef6L, 0xa51e03aaL, 0x9cf2d0a4L, + 0x83c061baL, 0x9be96a4dL, 0x8fe51550L, 0xba645bd6L, 0x2826a2f9L, 0xa73a3ae1L, + 0x4ba99586L, 0xef5562e9L, 0xc72fefd3L, 0xf752f7daL, 0x3f046f69L, 0x77fa0a59L, + 0x80e4a915L, 0x87b08601L, 0x9b09e6adL, 0x3b3ee593L, 0xe990fd5aL, 0x9e34d797L, + 0x2cf0b7d9L, 0x022b8b51L, 0x96d5ac3aL, 0x017da67dL, 0xd1cf3ed6L, 0x7c7d2d28L, + 0x1f9f25cfL, 0xadf2b89bL, 0x5ad6b472L, 0x5a88f54cL, 0xe029ac71L, 0xe019a5e6L, + 0x47b0acfdL, 0xed93fa9bL, 0xe8d3c48dL, 0x283b57ccL, 0xf8d56629L, 0x79132e28L, + 0x785f0191L, 0xed756055L, 0xf7960e44L, 0xe3d35e8cL, 0x15056dd4L, 0x88f46dbaL, + 0x03a16125L, 0x0564f0bdL, 0xc3eb9e15L, 0x3c9057a2L, 0x97271aecL, 0xa93a072aL, + 0x1b3f6d9bL, 0x1e6321f5L, 0xf59c66fbL, 0x26dcf319L, 0x7533d928L, 0xb155fdf5L, + 0x03563482L, 0x8aba3cbbL, 0x28517711L, 0xc20ad9f8L, 0xabcc5167L, 0xccad925fL, + 0x4de81751L, 0x3830dc8eL, 0x379d5862L, 0x9320f991L, 0xea7a90c2L, 0xfb3e7bceL, + 0x5121ce64L, 0x774fbe32L, 0xa8b6e37eL, 0xc3293d46L, 0x48de5369L, 0x6413e680L, + 0xa2ae0810L, 0xdd6db224L, 0x69852dfdL, 0x09072166L, 0xb39a460aL, 0x6445c0ddL, + 0x586cdecfL, 0x1c20c8aeL, 0x5bbef7ddL, 0x1b588d40L, 0xccd2017fL, 0x6bb4e3bbL, + 0xdda26a7eL, 0x3a59ff45L, 0x3e350a44L, 0xbcb4cdd5L, 0x72eacea8L, 0xfa6484bbL, + 0x8d6612aeL, 0xbf3c6f47L, 0xd29be463L, 0x542f5d9eL, 0xaec2771bL, 0xf64e6370L, + 0x740e0d8dL, 0xe75b1357L, 0xf8721671L, 0xaf537d5dL, 0x4040cb08L, 0x4eb4e2ccL, + 0x34d2466aL, 0x0115af84L, 0xe1b00428L, 0x95983a1dL, 0x06b89fb4L, 0xce6ea048L, + 0x6f3f3b82L, 0x3520ab82L, 0x011a1d4bL, 0x277227f8L, 0x611560b1L, 0xe7933fdcL, + 0xbb3a792bL, 0x344525bdL, 0xa08839e1L, 0x51ce794bL, 0x2f32c9b7L, 0xa01fbac9L, + 0xe01cc87eL, 0xbcc7d1f6L, 0xcf0111c3L, 0xa1e8aac7L, 0x1a908749L, 0xd44fbd9aL, + 0xd0dadecbL, 0xd50ada38L, 0x0339c32aL, 0xc6913667L, 0x8df9317cL, 0xe0b12b4fL, + 0xf79e59b7L, 0x43f5bb3aL, 0xf2d519ffL, 0x27d9459cL, 0xbf97222cL, 0x15e6fc2aL, + 0x0f91fc71L, 0x9b941525L, 0xfae59361L, 0xceb69cebL, 0xc2a86459L, 0x12baa8d1L, + 0xb6c1075eL, 0xe3056a0cL, 0x10d25065L, 0xcb03a442L, 0xe0ec6e0eL, 0x1698db3bL, + 0x4c98a0beL, 0x3278e964L, 0x9f1f9532L, 0xe0d392dfL, 0xd3a0342bL, 0x8971f21eL, + 0x1b0a7441L, 0x4ba3348cL, 0xc5be7120L, 0xc37632d8L, 0xdf359f8dL, 0x9b992f2eL, + 0xe60b6f47L, 0x0fe3f11dL, 0xe54cda54L, 0x1edad891L, 0xce6279cfL, 0xcd3e7e6fL, + 0x1618b166L, 0xfd2c1d05L, 0x848fd2c5L, 0xf6fb2299L, 0xf523f357L, 0xa6327623L, + 0x93a83531L, 0x56cccd02L, 0xacf08162L, 0x5a75ebb5L, 0x6e163697L, 0x88d273ccL, + 0xde966292L, 0x81b949d0L, 0x4c50901bL, 0x71c65614L, 0xe6c6c7bdL, 0x327a140aL, + 0x45e1d006L, 0xc3f27b9aL, 0xc9aa53fdL, 0x62a80f00L, 0xbb25bfe2L, 0x35bdd2f6L, + 0x71126905L, 0xb2040222L, 0xb6cbcf7cL, 0xcd769c2bL, 0x53113ec0L, 0x1640e3d3L, + 0x38abbd60L, 0x2547adf0L, 0xba38209cL, 0xf746ce76L, 0x77afa1c5L, 0x20756060L, + 0x85cbfe4eL, 0x8ae88dd8L, 0x7aaaf9b0L, 0x4cf9aa7eL, 0x1948c25cL, 0x02fb8a8cL, + 0x01c36ae4L, 0xd6ebe1f9L, 0x90d4f869L, 0xa65cdea0L, 0x3f09252dL, 0xc208e69fL, + 0xb74e6132L, 0xce77e25bL, 0x578fdfe3L, 0x3ac372e6L + } + }; + + /** + * P-array. + */ + private long[] m_dwP = new long[18]; + + /** + * S-boxes. + */ + private long[][] m_dwS = new long[4][256]; + + private QWORD m_qwLast = new QWORD(); + + /** + * + * @param pqwData + * @param cqwData + * @throws CloneNotSupportedException + */ + public void decrypt(QWORD[] pqwData, int cqwData) throws CloneNotSupportedException { + /* Check */ + if (cqwData < 1) { + return; + } + + /* Iterate successive blocks */ + for (int i = 0; i < cqwData; i++) { + /* Save encrypted value */ + QWORD qw = (QWORD)pqwData[i].clone(); + + /* Decrypt */ + this.decrypt64(pqwData[i]); + + /* Combine previous encrypted values into stream */ + pqwData[i].L ^= m_qwLast.L; + pqwData[i].R ^= m_qwLast.R; + + /* Next time, use saved value to XOR */ + m_qwLast = (QWORD)qw.clone(); + } + } + + /** + * Helper - block decrypt two DWORDs + * + * @param pqwData + */ + private void decrypt64(QWORD pqw) { + long dwL = pqw.L; + long dwR = pqw.R; + long dwTemp; + + /* 16 rounds */ + for (int i = 17; i > 1; i--) { + /* Feistel XOR */ + dwL = dwL ^ m_dwP[i]; + dwR = f(dwL) ^ dwR; + + /* Swap longs */ + dwTemp = dwL; + dwL = dwR; + dwR = dwTemp; + } + + /* Undo last swap */ + dwTemp = dwL; + dwL = dwR; + dwR = dwTemp; + + /* Final XOR */ + dwR = dwR ^ m_dwP[1]; + dwL = dwL ^ m_dwP[0]; + + pqw.L = dwL; + pqw.R = dwR; + } + + /** + * DecryptString. Decrypts a string previously encrypted with ConfigEncrypt. + * Returns the decrypted version iff the string was as expected; if any + * tampering is detected, NULL is returned. It is the caller's + * responsibility to free the returned string (if any) when it is finished + * with. + * + * @param string + * @return + * @throws UnsupportedEncodingException + * @throws CloneNotSupportedException + */ + public String decryptString(String string, long[] dwKey) throws CloneNotSupportedException { + /* Check length, aborting if not a multiple of 16 (i.e. 8 bytes encoded as hex) */ + if (string == null || string.length() == 0 || string.length() % 16 != 0) { + return null; + } + + /* Work out how many QWORDs we will have to decrypt */ + int nLen = string.length() / 2; + int nQW = (nLen / 8) + ((nLen % 8) != 0 ? 1 : 0); + + /* Now we can work out the size of the new buffer */ + int nSize = nQW * 8; + StringBuffer szNew = new StringBuffer(nSize + 1); + szNew.setLength(nSize + 1); + StringBuffer szTmp = new StringBuffer(nSize + 1); + szTmp.setLength(nSize + 1); + + /* Now convert string back from its hex representation to standard ASCII */ + char[] szC = {0, 0}; + for (int i = 0; i < nLen; i++) { + szC[0] = string.charAt(i * 2); + szC[1] = string.charAt(i * 2 + 1); + String s = new String(szC); + int n = Integer.parseInt(s, 16); + szTmp.setCharAt(i, (char)n); + } + /* Note: at this point, szTmp may contain NULLs, but decryption should remove them! */ + + QWORD[] qwords = new QWORD[nQW]; + for (int i = 0; i < nQW; i++) { + QWORD qword = new QWORD(); + qword.L = f(new int[] {szTmp.charAt(8 * i), szTmp.charAt(8 * i + 1), szTmp.charAt(8 * i + 2), szTmp.charAt(8 * i + 3)}); + qword.R = f(new int[] {szTmp.charAt(8 * i + 4), szTmp.charAt(8 * i + 5), szTmp.charAt(8 * i + 6), szTmp.charAt(8 * i + 7)}); + qwor... [truncated message content] |
From: <mar...@us...> - 2009-12-04 12:59:24
|
Revision: 73 http://gpas.svn.sourceforge.net/gpas/?rev=73&view=rev Author: martinalderson Date: 2009-12-04 12:59:16 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Initial import Added Paths: ----------- trunk/util-rmi/ trunk/util-rmi/.classpath trunk/util-rmi/.project trunk/util-rmi/LICENSE.txt trunk/util-rmi/build.xml trunk/util-rmi/doc/ trunk/util-rmi/doc/changelog.txt trunk/util-rmi/rmiutil.jardesc trunk/util-rmi/rmiutil.manifest Added: trunk/util-rmi/.classpath =================================================================== --- trunk/util-rmi/.classpath (rev 0) +++ trunk/util-rmi/.classpath 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path=""/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/util-rmi/.project =================================================================== --- trunk/util-rmi/.project (rev 0) +++ trunk/util-rmi/.project 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>GPAS Common RMI</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>net.genady.rmi.RMIBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>net.genady.rmi.RMINature</nature> + </natures> +</projectDescription> Added: trunk/util-rmi/LICENSE.txt =================================================================== --- trunk/util-rmi/LICENSE.txt (rev 0) +++ trunk/util-rmi/LICENSE.txt 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: trunk/util-rmi/build.xml =================================================================== --- trunk/util-rmi/build.xml (rev 0) +++ trunk/util-rmi/build.xml 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,63 @@ +<project name="GPAS Common RMI" default="dist" basedir="W:\gpas\gpas4" > + <property name="build" location="util-rmi\bin" /> + <property name="src" location="util-rmi\src" /> + <property name="release" location="W:\test" /> + + <target name="init" > + <mkdir dir="${build}" /> + </target> + + <target name="compile" depends="init" > + <rmic stubversion="1.2" base="osnative\bin" sourcebase="${src}" includes="**/*Impl.class" > + <classpath> + <pathelement location="W:\gpas\gpas4\util-common\bin" /> + </classpath> + </rmic> + <rmic stubversion="1.2" base="logdaemon\bin" sourcebase="${src}" includes="**/*Impl.class **/G4LogDMain.class" > + <classpath> + <pathelement location="W:\gpas\gpas4\util-common\bin" /> + </classpath> + </rmic> + <rmic stubversion="1.2" base="controller\bin" sourcebase="${src}" includes="**/GCopyMain.class" > + <classpath> + <pathelement location="W:\gpas\gpas4\util-common\bin" /> + </classpath> + </rmic> + <copy todir="${build}" > + <fileset dir="util-common/bin" > + <include name="salford/gpas/util/rmi/" /> + </fileset> + <fileset dir="osnative/bin" > + <include name="**/*_Stub.class" /> + </fileset> + <fileset dir="logdaemon/bin" > + <include name="**/*_Stub.class" /> + </fileset> + <fileset dir="controller/bin" > + <include name="**/*_Stub.class" /> + </fileset> + </copy> + </target> + + <target name="dist" depends="compile" > + <jar jarfile="util-rmi\gpasrmiutil.jar" basedir="${build}" manifest="util-rmi\rmiutil.manifest" /> + </target> + + <target name="distclean" depends="clean,dist" > + </target> + + <target name="release" depends="release.check" > + <copy file="util-rmi\gpasrmiutil.jar" tofile="${release}\lib\gpasrmiutil-${gpas.version}.jar" /> + <copy file="util-rmi\gpasrmiutil.jar" tofile="W:\gpas\gpas4\logdaemon\nativej\gpasrmiutil-${gpas.version}.jar" /> + </target> + + <target name="release.check" depends="distclean" unless="gpas.version" > + <fail message="No release version has been specified: -Dgpas.version="x.x.x"" /> + </target> + + <target name="clean" > + <delete file="util-rmi\gpasrmiutil.jar" /> + <delete dir="${build}" /> + <delete dir="${src}" /> + </target> +</project> \ No newline at end of file Added: trunk/util-rmi/doc/changelog.txt =================================================================== --- trunk/util-rmi/doc/changelog.txt (rev 0) +++ trunk/util-rmi/doc/changelog.txt 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,68 @@ +GPAS Common RMI Change Log +-------------------------- + +Current release 4.4.0 (03/06/2009) + + +-------------------------------------------------------------------------------------------------------- +Release 4.4.0 (03/06/2009) - Bug fix release + + +-------------------------------------------------------------------------------------------------------- +Release 4.3.4 (09/01/2009) - Bug fix release + +08/01/2009: + Modified default SQL SELECT generation to optimise UserDN searching. + + +-------------------------------------------------------------------------------------------------------- +Release 4.3.3 (21/10/2008) - Bug fix release + + +-------------------------------------------------------------------------------------------------------- +Release 4.3.2 (22/07/2008) - Bug fix release + + +-------------------------------------------------------------------------------------------------------- +Release 4.3.1 (20/06/2008) - GPAS Copy Controller 4.3 Release + + +-------------------------------------------------------------------------------------------------------- +Release 4.3.0 (12/05/2008) - GPAS 4.3.0 Release + + +-------------------------------------------------------------------------------------------------------- +Release 4.2.0 (06/09/2007) - GPAS 4.2 Release + + +-------------------------------------------------------------------------------------------------------- +Release 4.2.0-beta1 (20/11/2006) - Windows Beta 1 Release + + +-------------------------------------------------------------------------------------------------------- +Release 4.1.0 (28/09/2006) - GPAS 4.1 Release + +24/08/2006: + Added switchTo() routine for starting up another instance of OSNative then exiting. + Added exit() routine so OSNative can be killed by other instances. + + +-------------------------------------------------------------------------------------------------------- +Release 4.0.20 (17/08/2006) - GPAS Log Daemon Bug Fix + +17/08/2006: + Added extractFiles() routine to OS-Native for extracting a zip file to a remote machine of the same system type. + + +-------------------------------------------------------------------------------------------------------- +Release 4.0.18 (18/07/2006) - e-Payments: + +06/07/2006 + Added FailedOsNativeLogMonitorTimerTask to handle any failed logs that haven't been written to central log store. + + +-------------------------------------------------------------------------------------------------------- +Release 4.0.17 (23/05/2006) - e-Payments API: + +11/05/2006: + Removed need for user dn to be full and valid LDAP dn when creating filter for log searching. Added: trunk/util-rmi/rmiutil.jardesc =================================================================== --- trunk/util-rmi/rmiutil.jardesc (rev 0) +++ trunk/util-rmi/rmiutil.jardesc 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jardesc> + <jar path="W:/gpas/gpas4/util-rmi/gpasrmiutil.jar"/> + <options overwrite="false" compress="true" exportErrors="false" exportWarnings="true" saveDescription="true" descriptionLocation="/GPAS Common RMI/rmiutil.jardesc" useSourceFolders="false" buildIfNeeded="true" includeDirectoryEntries="false"/> + <manifest manifestVersion="1.0" usesManifest="true" reuseManifest="true" saveManifest="true" generateManifest="false" manifestLocation="/GPAS Common RMI/rmiutil.manifest"> + <sealing sealJar="false"> + <packagesToSeal/> + <packagesToUnSeal/> + </sealing> + </manifest> + <selectedElements exportClassFiles="true" exportOutputFolder="false" exportJavaFiles="false"> + <javaElement handleIdentifier="=GPAS Log Daemon/src<salford.gpas.logdaemon{DBLogSearchImpl_Stub.java"/> + <javaElement handleIdentifier="=GPAS Controller/src<salford.gpas.controller{GCopyMain_Stub.java"/> + <javaElement handleIdentifier="=GPAS Log Daemon/src<salford.gpas.logdaemon{G4LogDMain_Stub.java"/> + <javaElement handleIdentifier="=GPAS OS-Native/src<salford.gpas.util.osnative{NetWareImpl_Stub.java"/> + <javaElement handleIdentifier="=GPAS Common Utils/src<salford.gpas.util.rmi"/> + <javaElement handleIdentifier="=GPAS Log Daemon/src<salford.gpas.logdaemon{LogSearchImpl_Stub.java"/> + <javaElement handleIdentifier="=GPAS OS-Native/src<salford.gpas.util.osnative{LinuxImpl_Stub.java"/> + <javaElement handleIdentifier="=GPAS OS-Native/src<salford.gpas.util.osnative{WindowsImpl_Stub.java"/> + </selectedElements> +</jardesc> Added: trunk/util-rmi/rmiutil.manifest =================================================================== --- trunk/util-rmi/rmiutil.manifest (rev 0) +++ trunk/util-rmi/rmiutil.manifest 2009-12-04 12:59:16 UTC (rev 73) @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Implementation-Title: GPAS Common RMI +Implementation-Version: 4.4.0 +Implementation-Vendor: Salford Software Ltd. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |