private AccessibleContext sidePanel;
private HashMap<String,Integer> commodMap;
+ public PrintStream dtxt = null;
private PropertyChangeListener changeListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
// check if we've been turned off in the control panel
Preferences prefs = Preferences.userNodeForPackage(getClass());
+ if (prefs.getBoolean("writeDebugFiles", false)) {
+ try {
+ dtxt = new PrintStream(new File("jarrg-debug-log.txt"));
+ } catch (java.io.FileNotFoundException e) {
+ System.err.println("JARRG: Error opening debug log: "+e);
+ }
+ }
+
if (prefs.getBoolean("useLiveServers", false)) {
YARRG_URL = YARRG_LIVE_URL;
PCTB_HOST_URL = PCTB_LIVE_HOST_URL;
resultSummary.setText("");
arbitrageResult.setText("");
try {
- runPCTB();
+ runUpload();
} catch(Exception e) {
error(e.toString());
e.printStackTrace();
*
* @exception Exception if an error we didn't expect occured
*/
- private void runPCTB() throws Exception {
+ private void runUpload() throws Exception {
progresslog("starting");
String yarrgts = "";
latch.await(2, java.util.concurrent.TimeUnit.SECONDS);
}
+ if (islandName == null) {
+ error("Could not find island name in YPP user interface.");
+ return;
+ }
+
progresslog("table check...");
String headings_expected[] = new String[]
progressNote(pm, "Yarrg: Uploading");
progresslog("yarrg upload...");
- if (islandName != null) {
- doneyarrg = runYarrg(yarrgts, oceanName, islandName, yarrgdata);
- } else {
- System.out.println("Couldn't upload to Yarrg - no island name found");
- }
+ doneyarrg = runYarrg(yarrgts, oceanName, islandName, yarrgdata);
progresslog("yarrg done.");
}
int first = sb.indexOf("<pre>") + 5;
int last = sb.indexOf("</body>");
xml = sb.substring(first,last);
+ //if (dtxt!=null) {
+ // dtxt.println(">>");
+ // dtxt.println(sb);;
+ // dtxt.println("||");
+ // dtxt.println(xml);
+ // dtxt.println("<<");
+ //}
//System.out.println(xml);
Reader reader = new CharArrayReader(xml.toCharArray());
Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(reader));