List of usage examples for javax.xml.registry.infomodel RegistryObject getLifeCycleManager
LifeCycleManager getLifeCycleManager() throws JAXRException;
From source file:it.cnr.icar.eric.client.xml.registry.util.JAXRUtility.java
/** * Adds slots specified by slotsMap to RegistryObject ro. * *//*from w w w. ja v a 2s. c o m*/ public static void addSlotsToRegistryObject(RegistryObject ro, Map<?, ?> slotsMap) throws JAXRException { ArrayList<Slot> slots = new ArrayList<Slot>(); Iterator<?> iter = slotsMap.keySet().iterator(); while (iter.hasNext()) { Object key = iter.next(); Object slotValue = slotsMap.get(key); Slot slot = null; //slotValue must either be a String or a Collection of Strings if (slotValue instanceof String) { slot = ro.getLifeCycleManager().createSlot((String) key, (String) slotValue, (String) null); } else if (slotValue instanceof Collection) { Collection<?> c = (Collection<?>) slotValue; slot = ro.getLifeCycleManager().createSlot((String) key, c, (String) null); } else { //??throw new IllegalArgumentException(resourceBundle.getString("message.addingParameter", // new String[]{slotValue.getClass().getName()})); } if (slot != null) { slots.add(slot); } } ro.addSlots(slots); }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
/** * Delete existing Registry Object. Returns Failure/Success string for display. * * @param none/*from w w w . ja v a 2 s.com*/ * @return String */ public String doDeleteObject(RegistryObjectBean deleteROB) { String status = "failure"; ArrayList<Key> roList = new ArrayList<Key>(); RegistryObject ro = deleteROB.getRegistryObject(); try { roList.add(ro.getKey()); LifeCycleManager lcm = ro.getLifeCycleManager(); lcm.deleteObjects(roList); status = "publishSuccessful"; refreshSearchExplore(); } catch (ReferencesExistException ree) { log.error(WebUIResourceBundle.getInstance().getString("message.FailedToDeleteThisObject") + ":" + ree.getLocalizedMessage()); append(WebUIResourceBundle.getInstance().getString("lcmDeleteError") + " " + ree.getLocalizedMessage()); } catch (Exception je) { log.error("Error in Delete Existing RegistryObject ", je); append(WebUIResourceBundle.getInstance().getString("deleteROError") + " " + je.getLocalizedMessage()); } return status; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
/** * Approve created Registry Object. Returns Failure/Success string for display. * * @param none// w w w . jav a 2 s . com * @return String */ public String doApproveOnCurrentROB() { String status = "failure"; if (!isUserAllowedToPublish()) { status = RegistryBrowser.getInstance().getAuthenticationStatus(); RegistryBrowser.getInstance() .setPublishOperationMessage(WebUIResourceBundle.getInstance().getString("approveButtonText")); } else { List<Key> roList = new ArrayList<Key>(); RegistryObject ro = currentRegistryObject.getRegistryObject(); try { roList.add(ro.getKey()); LifeCycleManager lcm = ro.getLifeCycleManager(); ((LifeCycleManagerImpl) lcm).approveObjects(roList); status = "publishSuccessful"; refreshSearchExplore(); } catch (Exception ex) { log.error(WebUIResourceBundle.getInstance().getString("message.FailedToApproveThisObject"), ex); append(WebUIResourceBundle.getInstance().getString("approveROError") + " " + ex.getLocalizedMessage()); } } return status; }
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 ww . ja v a2s . co m*/ * @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; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
/** * UnDeprecate deprecated Registry Object. Returns Failure/Success string for display. * * @param none/*from ww w . j a v a 2 s .c om*/ * @return String */ public String doUndeprecateOnCurrentROB() { String status = "failure"; if (!isUserAllowedToPublish()) { status = RegistryBrowser.getInstance().getAuthenticationStatus(); RegistryBrowser.getInstance().setPublishOperationMessage( WebUIResourceBundle.getInstance().getString("undeprecateButtonText")); } else { List<Key> roList = new ArrayList<Key>(); RegistryObject ro = currentRegistryObject.getRegistryObject(); try { roList.add(ro.getKey()); LifeCycleManager lcm = ro.getLifeCycleManager(); lcm.unDeprecateObjects(roList); status = "publishSuccessful"; refreshSearchExplore(); } catch (Exception je) { log.error(WebUIResourceBundle.getInstance().getString("message.ErrorInUndeprecatingRegistryObject"), je); append(WebUIResourceBundle.getInstance().getString("undeprecateROError") + " " + je.getLocalizedMessage()); } } return status; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
/** * Delete existing Registry Object. Returns Failure/Success string for display. * * @param none/* w ww.j a va2 s . c o m*/ * @return String */ public String doDeleteOnCurrentROB() { String status = "failure"; if (!isUserAllowedToPublish()) { status = RegistryBrowser.getInstance().getAuthenticationStatus(); RegistryBrowser.getInstance() .setPublishOperationMessage(WebUIResourceBundle.getInstance().getString("deleteButtonText")); } else { ArrayList<Key> roList = new ArrayList<Key>(); RegistryObject ro = currentRegistryObject.getRegistryObject(); try { roList.add(ro.getKey()); LifeCycleManager lcm = ro.getLifeCycleManager(); lcm.deleteObjects(roList); status = "publishSuccessful"; refreshSearchExplore(); } catch (Exception je) { log.error( WebUIResourceBundle.getInstance().getString("message.ErrorInDeleteExistingRegistryObject"), je); append(WebUIResourceBundle.getInstance().getString("deleteROError") + " " + je.getLocalizedMessage()); } } return status; }
From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java
/** * Set selected status on Registry Object. Returns Failure/Success string for display. * * @param none/*from w w w .j av a2s . c o m*/ * @return String */ public String doStatusOnCurrentROB() { String status = "failure"; if (!isUserAllowedToPublish()) { status = RegistryBrowser.getInstance().getAuthenticationStatus(); } else { ArrayList<Key> roList = new ArrayList<Key>(); BulkResponse br = null; try { RegistryObject ro = currentRegistryObject.getRegistryObject(); roList.add(ro.getKey()); LifeCycleManagerImpl lcm = (LifeCycleManagerImpl) ro.getLifeCycleManager(); br = lcm.setStatusOnObjects(roList, getCurrentRegistryObjectBean().getStatusTypeConcept()); if (br.getStatus() == 0) { this.refreshSearchPanel(); } status = "publishSuccessful"; } catch (Exception je) { log.error( WebUIResourceBundle.getInstance().getString("message.ErrorInSettingStatusOfRegistryObject"), je); append(WebUIResourceBundle.getInstance().getString("setStatusROError") + " " + je.getLocalizedMessage()); } } return status; }