Search in sources :

Example 11 with Format

use of org.jdom2.output.Format in project JMRI by JMRI.

the class TrainInfoFile method writeTrainInfo.

/*
     *  Writes out Dispatcher options to a file in the user's preferences directory
     */
public void writeTrainInfo(TrainInfo tf, String name) throws java.io.IOException {
    log.debug("entered writeTrainInfo");
    root = new Element("traininfofile");
    doc = newDocument(root, dtdLocation + "dispatcher-traininfo.dtd");
    // add XSLT processing instruction
    // <?xml-stylesheet type="text/xsl" href="XSLT/block-values.xsl"?>
    java.util.Map<String, String> m = new java.util.HashMap<>();
    m.put("type", "text/xsl");
    m.put("href", xsltLocation + "dispatcher-traininfo.xsl");
    org.jdom2.ProcessingInstruction p = new org.jdom2.ProcessingInstruction("xml-stylesheet", m);
    doc.addContent(0, p);
    // save Dispatcher TrainInfo in xml format
    Element traininfo = new Element("traininfo");
    traininfo.setAttribute("transitname", tf.getTransitName());
    traininfo.setAttribute("trainname", tf.getTrainName());
    traininfo.setAttribute("dccaddress", tf.getDCCAddress());
    traininfo.setAttribute("trainintransit", "" + (tf.getTrainInTransit() ? "yes" : "no"));
    traininfo.setAttribute("startblockname", tf.getStartBlockName());
    traininfo.setAttribute("endblockname", tf.getDestinationBlockName());
    traininfo.setAttribute("trainfromroster", "" + (tf.getTrainFromRoster() ? "yes" : "no"));
    traininfo.setAttribute("trainfromtrains", "" + (tf.getTrainFromTrains() ? "yes" : "no"));
    traininfo.setAttribute("trainfromuser", "" + (tf.getTrainFromUser() ? "yes" : "no"));
    traininfo.setAttribute("priority", Integer.toString(tf.getPriority()));
    traininfo.setAttribute("resetwhendone", "" + (tf.getResetWhenDone() ? "yes" : "no"));
    switch(tf.getDelayedRestart()) {
        case ActiveTrain.SENSORDELAY:
            traininfo.setAttribute("delayedrestart", "sensor");
            traininfo.setAttribute("delayedrestartsensor", tf.getRestartSensorName());
            break;
        case ActiveTrain.TIMEDDELAY:
            traininfo.setAttribute("delayedrestart", "timed");
            traininfo.setAttribute("delayedrestarttime", Integer.toString(tf.getRestartDelayMin()));
            break;
        default:
            traininfo.setAttribute("delayedrestart", "no");
            break;
    }
    traininfo.setAttribute("reverseatend", "" + (tf.getReverseAtEnd() ? "yes" : "no"));
    if (tf.getDelayedStart() == ActiveTrain.TIMEDDELAY) {
        traininfo.setAttribute("delayedstart", "timed");
    } else if (tf.getDelayedStart() == ActiveTrain.SENSORDELAY) {
        traininfo.setAttribute("delayedstart", "sensor");
        if (tf.getDelaySensorName() != null) {
            traininfo.setAttribute("delayedSensor", tf.getDelaySensorName());
        }
    }
    traininfo.setAttribute("terminatewhendone", (tf.getTerminateWhenDone() ? "yes" : "no"));
    traininfo.setAttribute("departuretimehr", Integer.toString(tf.getDepartureTimeHr()));
    traininfo.setAttribute("departuretimemin", Integer.toString(tf.getDepartureTimeMin()));
    traininfo.setAttribute("traintype", tf.getTrainType());
    traininfo.setAttribute("autorun", "" + (tf.getAutoRun() ? "yes" : "no"));
    traininfo.setAttribute("loadatstartup", "" + (tf.getLoadAtStartup() ? "yes" : "no"));
    traininfo.setAttribute("allocatealltheway", "" + (tf.getAllocateAllTheWay() ? "yes" : "no"));
    // here save items related to automatically running active trains
    traininfo.setAttribute("speedfactor", Float.toString(tf.getSpeedFactor()));
    traininfo.setAttribute("maxspeed", Float.toString(tf.getMaxSpeed()));
    traininfo.setAttribute("ramprate", tf.getRampRate());
    traininfo.setAttribute("resistancewheels", "" + (tf.getResistanceWheels() ? "yes" : "no"));
    traininfo.setAttribute("runinreverse", "" + (tf.getRunInReverse() ? "yes" : "no"));
    traininfo.setAttribute("sounddecoder", "" + (tf.getSoundDecoder() ? "yes" : "no"));
    traininfo.setAttribute("maxtrainlength", Float.toString(tf.getMaxTrainLength()));
    root.addContent(traininfo);
    // write out the file
    try {
        if (!checkFile(fileLocation + name)) {
            // file does not exist, create it
            File file = new File(fileLocation + name);
            if (// create file and check result
            !file.createNewFile()) {
                log.error("createNewFile failed");
            }
        }
        // write content to file
        writeXML(findFile(fileLocation + name), doc);
    } catch (java.io.IOException ioe) {
        log.error("IO Exception " + ioe);
        throw (ioe);
    }
}
Also used : Element(org.jdom2.Element) File(java.io.File)

Example 12 with Format

use of org.jdom2.output.Format in project JMRI by JMRI.

the class RollingStockAttribute method store.

/**
     * Create an XML element to represent this Entry. This member has to remain
     * synchronized with the detailed DTD in operations-cars.dtd and operations-engines.dtd.
     * @param root Common Element for storage.
     * @param eNames New format Element group name
     * @param eName New format Element name
     * @param oldName Backwards compatibility Element name
     *
     */
public void store(Element root, String eNames, String eName, String oldName) {
    if (Control.backwardCompatible) {
        Element values = new Element(oldName);
        for (String name : getNames()) {
            // NOI18N
            values.addContent(name + "%%");
        }
        root.addContent(values);
    }
    // new format using elements
    Element names = new Element(eNames);
    for (String name : getNames()) {
        Element e = new Element(eName);
        if (eName.equals(Xml.LENGTH)) {
            e.setAttribute(new Attribute(Xml.VALUE, name));
        } else {
            e.setAttribute(new Attribute(Xml.NAME, name));
        }
        names.addContent(e);
    }
    root.addContent(names);
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 13 with Format

use of org.jdom2.output.Format in project JMRI by JMRI.

the class RollingStockAttribute method load.

public void load(Element root, String eNames, String eName, String oldName) {
    // new format using elements starting version 3.3.1
    if (root.getChild(eNames) != null) {
        @SuppressWarnings("unchecked") List<Element> l = root.getChild(eNames).getChildren(eName);
        Attribute a;
        String[] names = new String[l.size()];
        for (int i = 0; i < l.size(); i++) {
            Element name = l.get(i);
            if ((a = name.getAttribute(Xml.NAME)) != null) {
                names[i] = a.getValue();
            }
            // lengths use "VALUE"
            if ((a = name.getAttribute(Xml.VALUE)) != null) {
                names[i] = a.getValue();
            }
        }
        setNames(names);
    } else // try old format
    if (root.getChild(oldName) != null) {
        // NOI18N
        String[] names = root.getChildText(oldName).split("%%");
        setNames(names);
    }
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 14 with Format

use of org.jdom2.output.Format in project JMRI by JMRI.

the class EngineManager method load.

public void load(Element root) {
    // new format using elements starting version 3.3.1
    if (root.getChild(Xml.NEW_CONSISTS) != null) {
        @SuppressWarnings("unchecked") List<Element> consists = root.getChild(Xml.NEW_CONSISTS).getChildren(Xml.CONSIST);
        log.debug("Engine manager sees {} consists", consists.size());
        Attribute a;
        for (Element consist : consists) {
            if ((a = consist.getAttribute(Xml.NAME)) != null) {
                newConsist(a.getValue());
            }
        }
    } else // old format
    if (root.getChild(Xml.CONSISTS) != null) {
        String names = root.getChildText(Xml.CONSISTS);
        if (!names.equals(NONE)) {
            // NOI18N
            String[] consistNames = names.split("%%");
            log.debug("consists: {}", names);
            for (String name : consistNames) {
                newConsist(name);
            }
        }
    }
    if (root.getChild(Xml.ENGINES) != null) {
        @SuppressWarnings("unchecked") List<Element> engines = root.getChild(Xml.ENGINES).getChildren(Xml.ENGINE);
        log.debug("readFile sees {} engines", engines.size());
        for (Element e : engines) {
            register(new Engine(e));
        }
    }
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 15 with Format

use of org.jdom2.output.Format in project JMRI by JMRI.

the class Setup method load.

public static void load(Element e) {
    if (e.getChild(Xml.OPERATIONS) == null) {
        log.debug("operation setup values missing");
        return;
    }
    Element operations = e.getChild(Xml.OPERATIONS);
    org.jdom2.Attribute a;
    if ((operations.getChild(Xml.RAIL_ROAD) != null) && (a = operations.getChild(Xml.RAIL_ROAD).getAttribute(Xml.NAME)) != null) {
        String name = a.getValue();
        log.debug("railroadName: {}", name);
        if (name.equals(Xml.USE_JMRI_RAILROAD_NAME)) {
            getDefault().railroadName = null;
        } else {
            // don't set the dirty bit
            getDefault().railroadName = name;
        }
    }
    if ((operations.getChild(Xml.SETUP) != null) && (a = operations.getChild(Xml.SETUP).getAttribute(Xml.COMMENT)) != null) {
        String comment = a.getValue();
        log.debug("setup comment: {}", comment);
        getDefault().setupComment = comment;
    }
    if (operations.getChild(Xml.SETTINGS) != null) {
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.MAIN_MENU)) != null) {
            String enabled = a.getValue();
            log.debug("mainMenu: {}", enabled);
            setMainMenuEnabled(enabled.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CLOSE_ON_SAVE)) != null) {
            String enabled = a.getValue();
            log.debug("closeOnSave: {}", enabled);
            setCloseWindowOnSaveEnabled(enabled.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.TRAIN_DIRECTION)) != null) {
            String dir = a.getValue();
            log.debug("direction: {}", dir);
            try {
                setTrainDirection(Integer.parseInt(dir));
            } catch (NumberFormatException ee) {
                log.error("Train direction ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.TRAIN_LENGTH)) != null) {
            String length = a.getValue();
            log.debug("Max train length: {}", length);
            try {
                setMaxTrainLength(Integer.parseInt(length));
            } catch (NumberFormatException ee) {
                log.error("Train maximum length ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.MAX_ENGINES)) != null) {
            String size = a.getValue();
            log.debug("Max number of engines: {}", size);
            try {
                setMaxNumberEngines(Integer.parseInt(size));
            } catch (NumberFormatException ee) {
                log.error("Maximum number of engines ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.HPT)) != null) {
            String value = a.getValue();
            log.debug("HPT: {}", value);
            try {
                setHorsePowerPerTon(Integer.parseInt(value));
            } catch (NumberFormatException ee) {
                log.error("Train HPT ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.SCALE)) != null) {
            String scale = a.getValue();
            log.debug("scale: " + scale);
            try {
                setScale(Integer.parseInt(scale));
            } catch (NumberFormatException ee) {
                log.error("Scale ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CAR_TYPES)) != null) {
            String types = a.getValue();
            log.debug("CarTypes: " + types);
            setCarTypes(types);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.SWITCH_TIME)) != null) {
            String minutes = a.getValue();
            log.debug("switchTime: {}", minutes);
            try {
                setSwitchTime(Integer.parseInt(minutes));
            } catch (NumberFormatException ee) {
                log.error("Switch time ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.TRAVEL_TIME)) != null) {
            String minutes = a.getValue();
            log.debug("travelTime: {}", minutes);
            try {
                setTravelTime(Integer.parseInt(minutes));
            } catch (NumberFormatException ee) {
                log.error("Travel time ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.SHOW_VALUE)) != null) {
            String enable = a.getValue();
            log.debug("showValue: {}", enable);
            setValueEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.VALUE_LABEL)) != null) {
            String label = a.getValue();
            log.debug("valueLabel: {}", label);
            setValueLabel(label);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.SHOW_RFID)) != null) {
            String enable = a.getValue();
            log.debug("showRfid: {}", enable);
            setRfidEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.RFID_LABEL)) != null) {
            String label = a.getValue();
            log.debug("rfidLabel: {}", label);
            setRfidLabel(label);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.LENGTH_UNIT)) != null) {
            String unit = a.getValue();
            log.debug("lengthUnit: {}", unit);
            setLengthUnit(unit);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.YEAR_MODELED)) != null) {
            String year = a.getValue();
            log.debug("yearModeled: {}", year);
            setYearModeled(year);
        }
        // next eight attributes are here for backward compatibility
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_LOC_COMMENTS)) != null) {
            String enable = a.getValue();
            log.debug("printLocComments: {}", enable);
            setPrintLocationCommentsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_ROUTE_COMMENTS)) != null) {
            String enable = a.getValue();
            log.debug("printRouteComments: {}", enable);
            setPrintRouteCommentsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_LOADS_EMPTIES)) != null) {
            String enable = a.getValue();
            log.debug("printLoadsEmpties: {}", enable);
            setPrintLoadsAndEmptiesEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_TIMETABLE)) != null) {
            String enable = a.getValue();
            log.debug("printTimetable: {}", enable);
            setPrintTimetableNameEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.USE12HR_FORMAT)) != null) {
            String enable = a.getValue();
            log.debug("use12hrFormat: {}", enable);
            set12hrFormatEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_VALID)) != null) {
            String enable = a.getValue();
            log.debug("printValid: {}", enable);
            setPrintValidEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.SORT_BY_TRACK)) != null) {
            String enable = a.getValue();
            log.debug("sortByTrack: {}", enable);
            setSortByTrackNameEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.PRINT_HEADERS)) != null) {
            String enable = a.getValue();
            log.debug("printHeaders: {}", enable);
            setPrintHeadersEnabled(enable.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.PICKUP_ENG_FORMAT) != null) {
        if ((a = operations.getChild(Xml.PICKUP_ENG_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setPickupEnginePrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.PICKUP_ENG_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("pickupEngFormat: {}", setting);
            String[] keys = setting.split(",");
            keyToStringConversion(keys);
            setPickupEngineMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.DROP_ENG_FORMAT) != null) {
        if ((a = operations.getChild(Xml.DROP_ENG_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setDropEnginePrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.DROP_ENG_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("dropEngFormat: {}", setting);
            String[] keys = setting.split(",");
            keyToStringConversion(keys);
            setDropEngineMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.PICKUP_CAR_FORMAT) != null) {
        if ((a = operations.getChild(Xml.PICKUP_CAR_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setPickupCarPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.PICKUP_CAR_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("pickupCarFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setPickupManifestMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.DROP_CAR_FORMAT) != null) {
        if ((a = operations.getChild(Xml.DROP_CAR_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setDropCarPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.DROP_CAR_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("dropCarFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setDropManifestMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.LOCAL_FORMAT) != null) {
        if ((a = operations.getChild(Xml.LOCAL_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setLocalPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.LOCAL_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("localFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setLocalManifestMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.MISSING_CAR_FORMAT) != null) {
        if ((a = operations.getChild(Xml.MISSING_CAR_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("missingCarFormat: {}", setting);
            String[] keys = setting.split(",");
            keyToStringConversion(keys);
            setMissingCarMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.SWITCH_LIST) != null) {
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.SAME_AS_MANIFEST)) != null) {
            String b = a.getValue();
            log.debug("sameAsManifest: {}", b);
            setSwitchListFormatSameAsManifest(b.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.REAL_TIME)) != null) {
            String b = a.getValue();
            log.debug("realTime: {}", b);
            getDefault().switchListRealTime = b.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.ALL_TRAINS)) != null) {
            String b = a.getValue();
            log.debug("allTrains: {}", b);
            getDefault().switchListAllTrains = b.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.PAGE_FORMAT)) != null) {
            switch(a.getValue()) {
                case Xml.PAGE_NORMAL:
                    getDefault().switchListPageFormat = PAGE_NORMAL;
                    break;
                case Xml.PAGE_PER_TRAIN:
                    getDefault().switchListPageFormat = PAGE_PER_TRAIN;
                    break;
                case Xml.PAGE_PER_VISIT:
                    getDefault().switchListPageFormat = PAGE_PER_VISIT;
                    break;
                default:
                    log.error("Unknown switch list page format {}", a.getValue());
            }
        } else // old way to save switch list page format pre 3.11
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.PAGE_MODE)) != null) {
            String b = a.getValue();
            log.debug("old style pageMode: {}", b);
            if (b.equals(Xml.TRUE)) {
                getDefault().switchListPageFormat = PAGE_PER_TRAIN;
            }
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.PRINT_ROUTE_LOCATION)) != null) {
            String b = a.getValue();
            log.debug("print route location comment: {}", b);
            setSwitchListRouteLocationCommentEnabled(b.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST).getAttribute(Xml.TRACK_SUMMARY)) != null) {
            String b = a.getValue();
            log.debug("track summary: {}", b);
            setTrackSummaryEnabled(b.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.SWITCH_LIST_PICKUP_CAR_FORMAT) != null) {
        if ((a = operations.getChild(Xml.SWITCH_LIST_PICKUP_CAR_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setSwitchListPickupCarPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST_PICKUP_CAR_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("switchListpickupCarFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setPickupSwitchListMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.SWITCH_LIST_DROP_CAR_FORMAT) != null) {
        if ((a = operations.getChild(Xml.SWITCH_LIST_DROP_CAR_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setSwitchListDropCarPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST_DROP_CAR_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("switchListDropCarFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setDropSwitchListMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.SWITCH_LIST_LOCAL_FORMAT) != null) {
        if ((a = operations.getChild(Xml.SWITCH_LIST_LOCAL_FORMAT).getAttribute(Xml.PREFIX)) != null) {
            setSwitchListLocalPrefix(a.getValue());
        }
        if ((a = operations.getChild(Xml.SWITCH_LIST_LOCAL_FORMAT).getAttribute(Xml.SETTING)) != null) {
            String setting = a.getValue();
            log.debug("switchListLocalFormat: {}", setting);
            String[] keys = setting.split(",");
            replaceOldFormat(keys);
            xmlAttributeToKeyConversion(keys);
            keyToStringConversion(keys);
            setLocalSwitchListMessageFormat(keys);
        }
    }
    if (operations.getChild(Xml.PANEL) != null) {
        if ((a = operations.getChild(Xml.PANEL).getAttribute(Xml.NAME)) != null) {
            String panel = a.getValue();
            log.debug("panel: {}", panel);
            setPanelName(panel);
        }
        if ((a = operations.getChild(Xml.PANEL).getAttribute(Xml.TRAIN_ICONXY)) != null) {
            String enable = a.getValue();
            log.debug("TrainIconXY: {}", enable);
            setTrainIconCordEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.PANEL).getAttribute(Xml.TRAIN_ICON_APPEND)) != null) {
            String enable = a.getValue();
            log.debug("TrainIconAppend: {}", enable);
            setTrainIconAppendEnabled(enable.equals(Xml.TRUE));
        }
    }
    if ((operations.getChild(Xml.FONT_NAME) != null) && (a = operations.getChild(Xml.FONT_NAME).getAttribute(Xml.NAME)) != null) {
        String font = a.getValue();
        log.debug("fontName: {}", font);
        setFontName(font);
    }
    if ((operations.getChild(Xml.FONT_SIZE) != null) && (a = operations.getChild(Xml.FONT_SIZE).getAttribute(Xml.SIZE)) != null) {
        String size = a.getValue();
        log.debug("fontsize: {}", size);
        try {
            setManifestFontSize(Integer.parseInt(size));
        } catch (NumberFormatException ee) {
            log.error("Manifest font size ({}) isn't a valid number", a.getValue());
        }
    }
    if ((operations.getChild(Xml.PAGE_ORIENTATION) != null)) {
        if ((a = operations.getChild(Xml.PAGE_ORIENTATION).getAttribute(Xml.MANIFEST)) != null) {
            String orientation = a.getValue();
            log.debug("manifestOrientation: {}", orientation);
            setManifestOrientation(orientation);
        }
        if ((a = operations.getChild(Xml.PAGE_ORIENTATION).getAttribute(Xml.SWITCH_LIST)) != null) {
            String orientation = a.getValue();
            log.debug("switchListOrientation: {}", orientation);
            setSwitchListOrientation(orientation);
        }
    }
    if ((operations.getChild(Xml.MANIFEST_COLORS) != null)) {
        if ((a = operations.getChild(Xml.MANIFEST_COLORS).getAttribute(Xml.DROP_COLOR)) != null) {
            String dropColor = a.getValue();
            log.debug("dropColor: {}", dropColor);
            setDropTextColor(dropColor);
        }
        if ((a = operations.getChild(Xml.MANIFEST_COLORS).getAttribute(Xml.PICKUP_COLOR)) != null) {
            String pickupColor = a.getValue();
            log.debug("pickupColor: {}", pickupColor);
            setPickupTextColor(pickupColor);
        }
        if ((a = operations.getChild(Xml.MANIFEST_COLORS).getAttribute(Xml.LOCAL_COLOR)) != null) {
            String localColor = a.getValue();
            log.debug("localColor: {}", localColor);
            setLocalTextColor(localColor);
        }
    }
    if ((operations.getChild(Xml.TAB) != null)) {
        if ((a = operations.getChild(Xml.TAB).getAttribute(Xml.ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("tab: {}", enable);
            setTabEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.TAB).getAttribute(Xml.LENGTH)) != null) {
            String length = a.getValue();
            log.debug("tab 1 length: {}", length);
            try {
                setTab1length(Integer.parseInt(length));
            } catch (NumberFormatException ee) {
                log.error("Tab 1 length ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.TAB).getAttribute(Xml.TAB2_LENGTH)) != null) {
            String length = a.getValue();
            log.debug("tab 2 length: {}", length);
            try {
                setTab2length(Integer.parseInt(length));
            } catch (NumberFormatException ee) {
                log.error("Tab 2 length ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.TAB).getAttribute(Xml.TAB3_LENGTH)) != null) {
            String length = a.getValue();
            log.debug("tab 3 length: {}", length);
            try {
                setTab3length(Integer.parseInt(length));
            } catch (NumberFormatException ee) {
                log.error("Tab 3 length ({}) isn't a valid number", a.getValue());
            }
        }
    }
    if ((operations.getChild(Xml.MANIFEST) != null)) {
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_LOC_COMMENTS)) != null) {
            String enable = a.getValue();
            log.debug("manifest printLocComments: {}", enable);
            setPrintLocationCommentsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_ROUTE_COMMENTS)) != null) {
            String enable = a.getValue();
            log.debug("manifest printRouteComments: {}", enable);
            setPrintRouteCommentsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_LOADS_EMPTIES)) != null) {
            String enable = a.getValue();
            log.debug("manifest printLoadsEmpties: {}", enable);
            setPrintLoadsAndEmptiesEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_TIMETABLE)) != null) {
            String enable = a.getValue();
            log.debug("manifest printTimetable: {}", enable);
            setPrintTimetableNameEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.USE12HR_FORMAT)) != null) {
            String enable = a.getValue();
            log.debug("manifest use12hrFormat: {}", enable);
            set12hrFormatEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_VALID)) != null) {
            String enable = a.getValue();
            log.debug("manifest printValid: {}", enable);
            setPrintValidEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.SORT_BY_TRACK)) != null) {
            String enable = a.getValue();
            log.debug("manifest sortByTrack: {}", enable);
            setSortByTrackNameEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_HEADERS)) != null) {
            String enable = a.getValue();
            log.debug("manifest print headers: {}", enable);
            setPrintHeadersEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.TRUNCATE)) != null) {
            String enable = a.getValue();
            log.debug("manifest truncate: {}", enable);
            setTruncateManifestEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.USE_DEPARTURE_TIME)) != null) {
            String enable = a.getValue();
            log.debug("manifest use departure time: {}", enable);
            setUseDepartureTimeEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.USE_EDITOR)) != null) {
            String enable = a.getValue();
            log.debug("manifest useEditor: {}", enable);
            setManifestEditorEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_CABOOSE_LOAD)) != null) {
            String enable = a.getValue();
            log.debug("manifest print caboose load: {}", enable);
            setPrintCabooseLoadEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.PRINT_PASSENGER_LOAD)) != null) {
            String enable = a.getValue();
            log.debug("manifest print passenger load: {}", enable);
            setPrintPassengerLoadEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.MANIFEST).getAttribute(Xml.HAZARDOUS_MSG)) != null) {
            String message = a.getValue();
            log.debug("manifest hazardousMsg: {}", message);
            setHazardousMsg(message);
        }
    }
    if ((operations.getChild(Xml.MANIFEST_FORMAT) != null)) {
        if ((a = operations.getChild(Xml.MANIFEST_FORMAT).getAttribute(Xml.VALUE)) != null) {
            switch(a.getValue()) {
                case Xml.STANDARD:
                    getDefault().manifestFormat = STANDARD_FORMAT;
                    break;
                case Xml.TWO_COLUMN:
                    getDefault().manifestFormat = TWO_COLUMN_FORMAT;
                    break;
                case Xml.TWO_COLUMN_TRACK:
                    getDefault().manifestFormat = TWO_COLUMN_TRACK_FORMAT;
                    break;
                default:
                    log.debug("Unknown manifest format");
            }
        }
    } else if ((operations.getChild(Xml.COLUMN_FORMAT) != null)) {
        if ((a = operations.getChild(Xml.COLUMN_FORMAT).getAttribute(Xml.TWO_COLUMNS)) != null) {
            String enable = a.getValue();
            log.debug("two columns: {}", enable);
            if (enable.equals(Xml.TRUE)) {
                setManifestFormat(TWO_COLUMN_FORMAT);
            }
        }
    }
    // get manifest logo
    if ((operations.getChild(Xml.MANIFEST_LOGO) != null)) {
        if ((a = operations.getChild(Xml.MANIFEST_LOGO).getAttribute(Xml.NAME)) != null) {
            setManifestLogoURL(a.getValue());
        }
    }
    // manifest file options
    if ((operations.getChild(Xml.MANIFEST_FILE_OPTIONS) != null)) {
        if ((a = operations.getChild(Xml.MANIFEST_FILE_OPTIONS).getAttribute(Xml.MANIFEST_SAVE)) != null) {
            String enable = a.getValue();
            log.debug("manifest file save option: {}", enable);
            getDefault().saveTrainManifests = enable.equals(Xml.TRUE);
        }
    }
    if ((operations.getChild(Xml.BUILD_OPTIONS) != null)) {
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.AGGRESSIVE)) != null) {
            String enable = a.getValue();
            log.debug("aggressive: {}", enable);
            setBuildAggressive(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.NUMBER_PASSES)) != null) {
            String number = a.getValue();
            log.debug("number of passes: {}", number);
            try {
                setNumberPasses(Integer.parseInt(number));
            } catch (NumberFormatException ne) {
                log.debug("Number of passes isn't a number");
            }
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.ALLOW_LOCAL_INTERCHANGE)) != null) {
            String enable = a.getValue();
            log.debug("noLocalInterchange: {}", enable);
            setLocalInterchangeMovesEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.ALLOW_LOCAL_SPUR)) != null) {
            String enable = a.getValue();
            log.debug("noLocalSpur: {}", enable);
            setLocalSpurMovesEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.ALLOW_LOCAL_YARD)) != null) {
            String enable = a.getValue();
            log.debug("noLocalYard: {}", enable);
            setLocalYardMovesEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.STAGING_RESTRICTION_ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("stagingRestrictionEnabled: {}", enable);
            setTrainIntoStagingCheckEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.STAGING_TRACK_AVAIL)) != null) {
            String enable = a.getValue();
            log.debug("stagingTrackAvail: {}", enable);
            setStagingTrackImmediatelyAvail(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.ALLOW_RETURN_STAGING)) != null) {
            String enable = a.getValue();
            log.debug("allowReturnStaging: {}", enable);
            setAllowReturnToStagingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.PROMPT_STAGING_ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("promptStagingEnabled: {}", enable);
            setPromptFromStagingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.PROMPT_TO_STAGING_ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("promptToStagingEnabled: {}", enable);
            setPromptToStagingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.GENERATE_CSV_MANIFEST)) != null) {
            String enable = a.getValue();
            log.debug("generateCvsManifest: {}", enable);
            getDefault().generateCsvManifest = enable.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.BUILD_OPTIONS).getAttribute(Xml.GENERATE_CSV_SWITCH_LIST)) != null) {
            String enable = a.getValue();
            log.debug("generateCvsSwitchList: {}", enable);
            getDefault().generateCsvSwitchList = enable.equals(Xml.TRUE);
        }
    }
    if (operations.getChild(Xml.BUILD_REPORT) != null) {
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.LEVEL)) != null) {
            String level = a.getValue();
            log.debug("buildReportLevel: {}", level);
            setBuildReportLevel(level);
        }
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.ROUTER_LEVEL)) != null) {
            String level = a.getValue();
            log.debug("routerBuildReportLevel: {}", level);
            setRouterBuildReportLevel(level);
        }
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.USE_EDITOR)) != null) {
            String enable = a.getValue();
            log.debug("build report useEditor: {}", enable);
            setBuildReportEditorEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.INDENT)) != null) {
            String enable = a.getValue();
            log.debug("build report indent: {}", enable);
            setBuildReportIndentEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.FONT_SIZE)) != null) {
            String size = a.getValue();
            log.debug("build font size: {}", size);
            try {
                setBuildReportFontSize(Integer.parseInt(size));
            } catch (NumberFormatException ee) {
                log.error("Build report font size ({}) isn't a valid number", a.getValue());
            }
        }
        if ((a = operations.getChild(Xml.BUILD_REPORT).getAttribute(Xml.ALWAYS_PREVIEW)) != null) {
            String enable = a.getValue();
            log.debug("build report always preview: {}", enable);
            setBuildReportAlwaysPreviewEnabled(enable.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.ROUTER) != null) {
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.CAR_ROUTING_ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingEnabled: {}", enable);
            setCarRoutingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.CAR_ROUTING_VIA_YARDS)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingViaYards: {}", enable);
            setCarRoutingViaYardsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.CAR_ROUTING_VIA_STAGING)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingViaStaging: {}", enable);
            setCarRoutingViaStagingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.FORWARD_TO_YARD)) != null) {
            String enable = a.getValue();
            log.debug("forwardToYard: {}", enable);
            setForwardToYardEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.ONLY_ACTIVE_TRAINS)) != null) {
            String enable = a.getValue();
            log.debug("onlyActiveTrains: {}", enable);
            setOnlyActiveTrainsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.ROUTER).getAttribute(Xml.CHECK_CAR_DESTINATION)) != null) {
            String enable = a.getValue();
            log.debug("checkCarDestination: {}", enable);
            setCheckCarDestinationEnabled(enable.equals(Xml.TRUE));
        }
    } else if (operations.getChild(Xml.SETTINGS) != null) {
        // the next four items are for backwards compatibility
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CAR_ROUTING_ENABLED)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingEnabled: {}", enable);
            setCarRoutingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CAR_ROUTING_VIA_YARDS)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingViaYards: {}", enable);
            setCarRoutingViaYardsEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CAR_ROUTING_VIA_STAGING)) != null) {
            String enable = a.getValue();
            log.debug("carRoutingViaStaging: {}", enable);
            setCarRoutingViaStagingEnabled(enable.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.FORWARD_TO_YARD)) != null) {
            String enable = a.getValue();
            log.debug("forwardToYard: {}", enable);
            setForwardToYardEnabled(enable.equals(Xml.TRUE));
        }
    }
    if ((operations.getChild(Xml.OWNER) != null) && (a = operations.getChild(Xml.OWNER).getAttribute(Xml.NAME)) != null) {
        String owner = a.getValue();
        log.debug("owner: {}", owner);
        setOwnerName(owner);
    }
    if (operations.getChild(Xml.ICON_COLOR) != null) {
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.NORTH)) != null) {
            String color = a.getValue();
            log.debug("north color: {}", color);
            setTrainIconColorNorth(color);
        }
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.SOUTH)) != null) {
            String color = a.getValue();
            log.debug("south color: {}", color);
            setTrainIconColorSouth(color);
        }
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.EAST)) != null) {
            String color = a.getValue();
            log.debug("east color: {}", color);
            setTrainIconColorEast(color);
        }
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.WEST)) != null) {
            String color = a.getValue();
            log.debug("west color: {}", color);
            setTrainIconColorWest(color);
        }
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.LOCAL)) != null) {
            String color = a.getValue();
            log.debug("local color: {}", color);
            setTrainIconColorLocal(color);
        }
        if ((a = operations.getChild(Xml.ICON_COLOR).getAttribute(Xml.TERMINATE)) != null) {
            String color = a.getValue();
            log.debug("terminate color: {}", color);
            setTrainIconColorTerminate(color);
        }
    }
    if (operations.getChild(Xml.COMMENTS) != null) {
        if ((a = operations.getChild(Xml.COMMENTS).getAttribute(Xml.MISPLACED_CARS)) != null) {
            String comment = a.getValue();
            log.debug("Misplaced comment: {}", comment);
            setMiaComment(comment);
        }
    }
    if (operations.getChild(Xml.DISPLAY) != null) {
        if ((a = operations.getChild(Xml.DISPLAY).getAttribute(Xml.SHOW_TRACK_MOVES)) != null) {
            String enable = a.getValue();
            log.debug("show track moves: {}", enable);
            getDefault().showTrackMoves = enable.equals(Xml.TRUE);
        }
    }
    if (operations.getChild(Xml.VSD) != null) {
        if ((a = operations.getChild(Xml.VSD).getAttribute(Xml.ENABLE_PHYSICAL_LOCATIONS)) != null) {
            String enable = a.getValue();
            setVsdPhysicalLocationEnabled(enable.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.CATS) != null) {
        if ((a = operations.getChild(Xml.CATS).getAttribute(Xml.EXACT_LOCATION_NAME)) != null) {
            String enable = a.getValue();
            AbstractOperationsServer.setExactLocationName(enable.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.SETTINGS) != null) {
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.AUTO_SAVE)) != null) {
            String enabled = a.getValue();
            log.debug("autoSave: {}", enabled);
            setAutoSaveEnabled(enabled.equals(Xml.TRUE));
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.AUTO_BACKUP)) != null) {
            String enabled = a.getValue();
            log.debug("autoBackup: {}", enabled);
            setAutoBackupEnabled(enabled.equals(Xml.TRUE));
        }
    }
    if (operations.getChild(Xml.LOGGER) != null) {
        if ((a = operations.getChild(Xml.LOGGER).getAttribute(Xml.CAR_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("carLogger: {}", enable);
            getDefault().carLogger = enable.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.LOGGER).getAttribute(Xml.ENGINE_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("engineLogger: {}", enable);
            getDefault().engineLogger = enable.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.LOGGER).getAttribute(Xml.TRAIN_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("trainLogger: {}", enable);
            getDefault().trainLogger = enable.equals(Xml.TRUE);
        }
    } else if (operations.getChild(Xml.SETTINGS) != null) {
        // for backward compatibility
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.CAR_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("carLogger: {}", enable);
            getDefault().carLogger = enable.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.ENGINE_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("engineLogger: {}", enable);
            getDefault().engineLogger = enable.equals(Xml.TRUE);
        }
        if ((a = operations.getChild(Xml.SETTINGS).getAttribute(Xml.TRAIN_LOGGER)) != null) {
            String enable = a.getValue();
            log.debug("trainLogger: {}", enable);
            getDefault().trainLogger = enable.equals(Xml.TRUE);
        }
    }
}
Also used : Element(org.jdom2.Element)

Aggregations

Element (org.jdom2.Element)57 Document (org.jdom2.Document)20 XMLOutputter (org.jdom2.output.XMLOutputter)19 IOException (java.io.IOException)15 StringWriter (java.io.StringWriter)9 Attribute (org.jdom2.Attribute)9 Format (org.jdom2.output.Format)7 File (java.io.File)5 ArrayList (java.util.ArrayList)5 MCRRestAPIError (org.mycore.restapi.v1.errors.MCRRestAPIError)5 MCRRestAPIException (org.mycore.restapi.v1.errors.MCRRestAPIException)5 JsonWriter (com.google.gson.stream.JsonWriter)4 Date (java.util.Date)4 SAXBuilder (org.jdom2.input.SAXBuilder)4 SimpleDateFormat (java.text.SimpleDateFormat)3 JDOMException (org.jdom2.JDOMException)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 MalformedURLException (java.net.MalformedURLException)2 List (java.util.List)2 JComponent (javax.swing.JComponent)2