Search in sources :

Example 1 with WSAuthHandlerEntry

use of com.sun.identity.console.webservices.model.WSAuthHandlerEntry in project OpenAM by OpenRock.

the class WSAuthNServicesViewBean method populateHandlersTable.

private void populateHandlersTable(Set handlers) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;
    for (Iterator iter = handlers.iterator(); iter.hasNext(); ) {
        String c = (String) iter.next();
        WSAuthHandlerEntry entry = new WSAuthHandlerEntry(c);
        if (entry.isValid()) {
            if (!firstEntry) {
                tblModel.appendRow();
            } else {
                firstEntry = false;
            }
            tblModel.setValue(TBL_HANDLERS_DATA_KEY, entry.strKey);
            tblModel.setValue(TBL_HANDLERS_DATA_CLASS, entry.strClass);
            tblModel.setValue(TBL_HANDLERS_HREF_ACTION, Integer.toString(counter));
        }
        counter++;
    }
    setPageSessionAttribute(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS, (OrderedSet) handlers);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) WSAuthHandlerEntry(com.sun.identity.console.webservices.model.WSAuthHandlerEntry)

Example 2 with WSAuthHandlerEntry

use of com.sun.identity.console.webservices.model.WSAuthHandlerEntry in project OpenAM by OpenRock.

the class WSAuthNServicesHandlersEditViewBean method getRequestData.

/**
     * Used to extract the mechanism handler data passed in the page session.
     * The mechanism name is needed to construct the breadcrumb trail.
     */
private void getRequestData() {
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    Map mapAttrs = (Map) getPageSessionAttribute(WSAuthNServicesViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet set = (OrderedSet) mapAttrs.get(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    mechanismEntry = (String) set.get(index);
    WSAuthHandlerEntry entry = new WSAuthHandlerEntry(mechanismEntry);
    mechanismName = entry.strKey;
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) WSAuthHandlerEntry(com.sun.identity.console.webservices.model.WSAuthHandlerEntry) Map(java.util.Map)

Example 3 with WSAuthHandlerEntry

use of com.sun.identity.console.webservices.model.WSAuthHandlerEntry in project OpenAM by OpenRock.

the class WSAuthNServicesHandlersEditViewBean method handleButton1Request.

protected void handleButton1Request(Map values) {
    WSAuthNServicesViewBean vb = (WSAuthNServicesViewBean) getViewBean(WSAuthNServicesViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(WSAuthNServicesViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet handlers = (OrderedSet) mapAttrs.get(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    String key = (String) values.get(ATTR_KEY);
    String val = (String) values.get(ATTR_CLASS);
    WSAuthHandlerEntry e = new WSAuthHandlerEntry(key, val);
    if (handlerExists(handlers, e)) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "webservices.authentication.service.handlers.duplicates");
        forwardTo(getRequestContext());
        return;
    }
    handlers.set(index, e.toString());
    setPageSessionAttribute(WSAuthNServicesViewBean.PAGE_MODIFIED, "1");
    backTrail();
    unlockPageTrailForSwapping();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) WSAuthHandlerEntry(com.sun.identity.console.webservices.model.WSAuthHandlerEntry) Map(java.util.Map)

Example 4 with WSAuthHandlerEntry

use of com.sun.identity.console.webservices.model.WSAuthHandlerEntry in project OpenAM by OpenRock.

the class WSAuthNServicesHandlersAddViewBean method handleButton1Request.

protected void handleButton1Request(Map values) {
    WSAuthNServicesViewBean vb = (WSAuthNServicesViewBean) getViewBean(WSAuthNServicesViewBean.class);
    Map attrValues = (Map) getPageSessionAttribute(WSAuthNServicesViewBean.PROPERTY_ATTRIBUTE);
    Set handlers = (Set) attrValues.get(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    if ((handlers == null) || handlers.isEmpty()) {
        handlers = new OrderedSet();
        attrValues.put(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS, (OrderedSet) handlers);
    }
    String key = (String) values.get(ATTR_KEY);
    String val = (String) values.get(ATTR_CLASS);
    WSAuthHandlerEntry e = new WSAuthHandlerEntry(key, val);
    if (handlerExists(handlers, e)) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "webservices.authentication.service.handlers.duplicates");
        forwardTo(getRequestContext());
        return;
    }
    handlers.add(e.toString());
    setPageSessionAttribute(WSAuthNServicesViewBean.PAGE_MODIFIED, "1");
    backTrail();
    unlockPageTrailForSwapping();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) WSAuthHandlerEntry(com.sun.identity.console.webservices.model.WSAuthHandlerEntry) Map(java.util.Map)

Example 5 with WSAuthHandlerEntry

use of com.sun.identity.console.webservices.model.WSAuthHandlerEntry in project OpenAM by OpenRock.

the class WSAuthNServicesHandlersViewBeanBase method setValues.

protected void setValues(String value) {
    WSAuthHandlerEntry entry = new WSAuthHandlerEntry(value);
    propertySheetModel.setValue(ATTR_KEY, entry.strKey);
    propertySheetModel.setValue(ATTR_CLASS, entry.strClass);
}
Also used : WSAuthHandlerEntry(com.sun.identity.console.webservices.model.WSAuthHandlerEntry)

Aggregations

WSAuthHandlerEntry (com.sun.identity.console.webservices.model.WSAuthHandlerEntry)5 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)3 Map (java.util.Map)3 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1