public void startupMapHook() {
        super.startupMapHook();
        ModeController mc = getController();
        MindMap model = getController().getMap();
        if (Tools.safeEquals(getResourceString("file_type"), "user")) {
            if (model == null)
                return; // there may be no map open
            if ((model.getFile() == null) || model.isReadOnly()) {
                if (mc.save()) {
                    export(model.getFile());
                    return;
                } else
                    return;
            } else
                export(model.getFile());
        } else {
            File saveFile = chooseFile();
            if (saveFile == null) {
                // no file.
                return;
            }
            try {
                mTransformResultWithoutError = true;
                String transformErrors = transform(saveFile);
                if (transformErrors != null) {
                    JOptionPane.showMessageDialog(null,
                            getResourceString(transformErrors), "Freemind",
                            JOptionPane.ERROR_MESSAGE);
                    mTransformResultWithoutError = false;
                } else {
                    if (Tools
                            .safeEquals(getResourceString("load_file"), "true")) {
                        getController().getFrame().openDocument(
                                Tools.fileToUrl(saveFile));
                    }
                }
            } catch (Exception e) {
                Resources.getInstance().logException(e);
                mTransformResultWithoutError = false;
            }
        }
    }