Search in sources :

Example 21 with SMDiscoveryServiceData

use of com.sun.identity.console.service.model.SMDiscoveryServiceData in project OpenAM by OpenRock.

the class EntityResourceOfferingViewBean method handleTblButtonDeleteRequest.

public void handleTblButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_ENTRIES);
    table.restoreStateData();
    EntityResourceOfferingModel model = (EntityResourceOfferingModel) getModel();
    String univId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
    DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
    String cacheID = (String) getPageSessionAttribute(EntityResourceOfferingViewBean.DATA_ID);
    SMDiscoveryServiceData smEntry = cache.getData(model.getUserSSOToken(), cacheID);
    Integer[] selected = tblModel.getSelectedRows();
    smEntry.deleteDiscoEntries(selected);
    try {
        model.setEntityDiscoEntry(univId, smEntry);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "discovery.service.table.entry.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) EntityResourceOfferingModel(com.sun.identity.console.idm.model.EntityResourceOfferingModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) DiscoveryDataCache(com.sun.identity.console.service.model.DiscoveryDataCache)

Aggregations

SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)21 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)15 DiscoveryDataCache (com.sun.identity.console.service.model.DiscoveryDataCache)13 SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)5 List (java.util.List)5 Map (java.util.Map)5 UMUserResourceOfferingModel (com.sun.identity.console.user.model.UMUserResourceOfferingModel)4 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)4 CCActionTable (com.sun.web.ui.view.table.CCActionTable)4 HashMap (java.util.HashMap)4 SSOException (com.iplanet.sso.SSOException)3 EntityResourceOfferingModel (com.sun.identity.console.idm.model.EntityResourceOfferingModel)3 RealmResourceOfferingModel (com.sun.identity.console.realm.model.RealmResourceOfferingModel)3 AMIdentity (com.sun.identity.idm.AMIdentity)3 IdRepoException (com.sun.identity.idm.IdRepoException)3 Set (java.util.Set)3 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)2 Iterator (java.util.Iterator)2 CaseInsensitiveHashMap (com.sun.identity.common.CaseInsensitiveHashMap)1 SMDescriptionData (com.sun.identity.console.service.model.SMDescriptionData)1