Search in sources :

Example 1 with SerializedField

use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.

the class DelegationViewBean method populateTableModelEx.

private void populateTableModelEx() {
    if (!tblModelPopulated) {
        tblModelPopulated = true;
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        List cache = (List) szCache.getSerializedObj();
        if ((cache != null) && !cache.isEmpty()) {
            populateTableModel(cache);
        }
    }
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with SerializedField

use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.

the class DelegationViewBean method populateTableModel.

private void populateTableModel(Collection DelegationNames) {
    tblModel.clearAll();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    if ((DelegationNames != null) && !DelegationNames.isEmpty()) {
        List cache = new ArrayList(DelegationNames.size());
        DelegationModel model = (DelegationModel) getModel();
        SSOToken ssoToken = model.getUserSSOToken();
        boolean firstEntry = true;
        for (Iterator iter = DelegationNames.iterator(); iter.hasNext(); ) {
            String id = (String) iter.next();
            try {
                AMIdentity entity = IdUtils.getIdentity(ssoToken, id);
                if (firstEntry) {
                    firstEntry = false;
                } else {
                    tblModel.appendRow();
                }
                String name = AMFormatUtils.getIdentityDisplayName(model, entity);
                tblModel.setValue(TBL_DATA_NAME, name);
                tblModel.setValue(TBL_DATA_UNIVERSALNAME, id);
                tblModel.setValue(TBL_DATA_ACTION_HREF, stringToHex(id));
                cache.add(id);
            } catch (IdRepoException e) {
            //ignore since ID is not found.
            }
        }
        szCache.setValue((Serializable) cache);
    } else {
        szCache.setValue(null);
    }
}
Also used : SSOToken(com.iplanet.sso.SSOToken) DelegationModel(com.sun.identity.console.delegation.model.DelegationModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) AMIdentity(com.sun.identity.idm.AMIdentity) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) IdRepoException(com.sun.identity.idm.IdRepoException) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with SerializedField

use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.

the class ServerConfigXMLViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SERVERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
        populateServerTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblServerModel, name);
    } else if (name.equals(TBL_USERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
        populateUserTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblUserModel, name);
    } else if (name.equals(PGTITLE_THREE_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (tblServerModel.isChildSupported(name)) {
        view = tblServerModel.createChild(this, name);
    } else if (tblUserModel.isChildSupported(name)) {
        view = tblUserModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 4 with SerializedField

use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.

the class ServerConfigXMLViewBean method populateServerTableModel.

private void populateServerTableModel(List entries) {
    tblServerModel.clearAll();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
    int counter = 0;
    if ((entries != null) && !entries.isEmpty()) {
        for (Iterator i = entries.iterator(); i.hasNext(); counter++) {
            if (counter > 0) {
                tblServerModel.appendRow();
            }
            ServerConfigXML.ServerObject entry = (ServerConfigXML.ServerObject) i.next();
            tblServerModel.setValue(TBL_SERVERS_NAME_DATA, entry.name);
            tblServerModel.setValue(TBL_SERVERS_HOST_DATA, entry.host);
            tblServerModel.setValue(TBL_SERVERS_PORT_DATA, entry.port);
            tblServerModel.setValue(TBL_SERVERS_TYPE_DATA, entry.type);
            tblServerModel.setSelectionVisible(counter, true);
        }
    }
    szCache.setValue(entries);
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) Iterator(java.util.Iterator) ServerConfigXML(com.sun.identity.common.configuration.ServerConfigXML)

Example 5 with SerializedField

use of com.sun.identity.console.components.view.html.SerializedField in project OpenAM by OpenRock.

the class ServerConfigXMLViewBean method populateUserTableModel.

private void populateUserTableModel(List entries) {
    if (bAMSDKEnabled) {
        tblUserModel.clearAll();
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
        int counter = 0;
        if ((entries != null) && !entries.isEmpty()) {
            for (Iterator i = entries.iterator(); i.hasNext(); counter++) {
                if (counter > 0) {
                    tblUserModel.appendRow();
                }
                ServerConfigXML.ServerObject entry = (ServerConfigXML.ServerObject) i.next();
                tblUserModel.setValue(TBL_USERS_NAME_DATA, entry.name);
                tblUserModel.setValue(TBL_USERS_HOST_DATA, entry.host);
                tblUserModel.setValue(TBL_USERS_PORT_DATA, entry.port);
                tblUserModel.setValue(TBL_USERS_TYPE_DATA, entry.type);
                tblUserModel.setSelectionVisible(counter, true);
            }
        }
        szCache.setValue(entries);
    }
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) Iterator(java.util.Iterator) ServerConfigXML(com.sun.identity.common.configuration.ServerConfigXML)

Aggregations

SerializedField (com.sun.identity.console.components.view.html.SerializedField)57 ArrayList (java.util.ArrayList)33 List (java.util.List)31 CCActionTable (com.sun.web.ui.view.table.CCActionTable)28 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)19 Iterator (java.util.Iterator)19 HashSet (java.util.HashSet)17 Set (java.util.Set)17 Map (java.util.Map)15 HashMap (java.util.HashMap)14 View (com.iplanet.jato.view.View)10 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)9 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)9 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)8 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)6 ServerSiteModel (com.sun.identity.console.service.model.ServerSiteModel)6 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)5 IdRepoException (com.sun.identity.idm.IdRepoException)4 SSOToken (com.iplanet.sso.SSOToken)3 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3