Package org.fcrepo.client.utility

Examples of org.fcrepo.client.utility.AutoPurger


                return;
            }
            m_pids = new HashSet();
            m_pids.add(pid);
        }
        AutoPurger purger = null;
        try {
            purger = new AutoPurger(Administrator.APIM);
        } catch (Exception e) {
            Administrator
                    .showErrorDialog(Administrator.getDesktop(),
                                     "Purge Failure",
                                     StringUtility.prettyPrint(e.getClass()
                                             .getName()
                                                               + ": " + e.getMessage(), 70, null),
                                     e);
        }
        if (purger != null) {
            Iterator pidIter = m_pids.iterator();
            if (m_pids.size() == 1) {
                String pid = (String) pidIter.next();
                // just purge one
                String reason =
                        JOptionPane
                                .showInputDialog("Why are you permanently removing "
                                                 + pid + "?");
                if (reason != null) {
                    try {
                        purger.purge(pid, reason);
                    } catch (Exception e) {
                        Administrator.showErrorDialog(Administrator
                                .getDesktop(), "Purge Failure", StringUtility
                                .prettyPrint(e.getClass().getName() + ": "
                                             + e.getMessage(), 70, null), e);
                        failed = true;
                    }
                    if (!failed) {
                        JOptionPane.showMessageDialog(Administrator
                                .getDesktop(), "Purge succeeded.");
                        if (m_parent != null) {
                            m_parent.dispose();
                        }
                    }
                }
            } else {
                // purge multiple
                String reason =
                        JOptionPane
                                .showInputDialog("Why are you permanently removing these objects?");
                if (reason != null) {
                    while (pidIter.hasNext()) {
                        try {
                            String pid = (String) pidIter.next();
                            purger.purge(pid, reason);
                        } catch (Exception e) {
                            Administrator
                                    .showErrorDialog(Administrator.getDesktop(),
                                                     "Purge Failure",
                                                     StringUtility
View Full Code Here

TOP

Related Classes of org.fcrepo.client.utility.AutoPurger

Copyright © 2018 www.massapicom. 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.