Examples of GuiRestoreListener


Examples of org.exist.backup.restore.listener.GuiRestoreListener

        }
    }
   
    private static void restoreWithGui(final String username, final String password, final String dbaPassword, final File f, final String uri) {
       
        final GuiRestoreListener listener = new GuiRestoreListener();
       
        final Callable<Void> callable = new Callable<Void>() {

            @Override
            public Void call() throws Exception {
               
                final Restore restore = new Restore();
               
                try {
                    restore.restore(listener, username, password, dbaPassword, f, uri);

                    listener.hideDialog();

                    if (JOptionPane.showConfirmDialog(null, "Would you like to rebuild the application repository?\nThis is only necessary if application packages were restored.", "Rebuild App Repository?",
                            JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                        System.out.println("Rebuilding application repository ...");
                        try {
                            String rootURI = uri;
                            if(!(rootURI.contains(XmldbURI.ROOT_COLLECTION) || rootURI.endsWith( XmldbURI.ROOT_COLLECTION))) {
                                rootURI += XmldbURI.ROOT_COLLECTION;
                            }
                            final Collection root = DatabaseManager.getCollection(rootURI, username, dbaPassword);
                            ClientFrame.repairRepository(root);
                            System.out.println("Application repository rebuilt successfully.");
                        } catch (XMLDBException e) {
                            reportError(e);
                            System.err.println("Rebuilding application repository failed!");
                        }
                    }
                } catch (final Exception e) {
                    ClientFrame.showErrorMessage(e.getMessage(), null); //$NON-NLS-1$
                } finally {
                    if(listener.hasProblems()) {
                        ClientFrame.showErrorMessage(listener.warningsAndErrorsAsString(), null);
                    }
                }
               
                return null;
            }
View Full Code Here

Examples of org.exist.backup.restore.listener.GuiRestoreListener

                    JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
                    null, null, null) == JOptionPane.YES_OPTION) {
                    final String newDbaPass = passInput.getPassword().length == 0 ? null : new String(passInput.getPassword());
              final String restoreFile = f.getAbsolutePath();
             
                    final GuiRestoreListener listener = new GuiRestoreListener(this);   
                    doRestore(listener, properties.getProperty(InteractiveClient.USER, SecurityManager.DBA_USER), properties.getProperty(InteractiveClient.PASSWORD, null), newDbaPass, new File(restoreFile), properties.getProperty(InteractiveClient.URI, "xmldb:exist://"));
          }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.