Example usage for javax.xml.registry LifeCycleManager deprecateObjects

List of usage examples for javax.xml.registry LifeCycleManager deprecateObjects

Introduction

In this page you can find the example usage for javax.xml.registry LifeCycleManager deprecateObjects.

Prototype

BulkResponse deprecateObjects(Collection keys) throws JAXRException;

Source Link

Document

Deprecates one or more previously submitted objects.

Usage

From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java

/**
* Deprecate existing Registry Object.  Returns Failure/Success string for display.
* 
* @param none/*from   w  w w.java 2  s .  com*/
* @return String
*/
public String doDeprecateOnCurrentROB() {
    String status = "failure";
    if (!isUserAllowedToPublish()) {
        status = RegistryBrowser.getInstance().getAuthenticationStatus();
        RegistryBrowser.getInstance()
                .setPublishOperationMessage(WebUIResourceBundle.getInstance().getString("deprecateButtonText"));
    } else {
        ArrayList<Key> roList = new ArrayList<Key>();
        RegistryObject ro = currentRegistryObject.getRegistryObject();
        try {
            roList.add(ro.getKey());
            LifeCycleManager lcm = ro.getLifeCycleManager();
            lcm.deprecateObjects(roList);
            status = "publishSuccessful";
            refreshSearchExplore();
        } catch (Exception je) {
            log.error(WebUIResourceBundle.getInstance().getString("message.ErrorInDeprecateRegistryObject"),
                    je);
            append(WebUIResourceBundle.getInstance().getString("deprecateROError") + " "
                    + je.getLocalizedMessage());
        }
    }
    return status;
}