Search in sources :

Example 1 with View

use of com.iplanet.jato.view.View in project OpenAM by OpenRock.

the class AMPropertySheetModel method createChild.

public View createChild(View parent, String name, AMModel model) {
    String tagName = (String) childMap.get(name);
    View view = null;
    if (tagName != null) {
        if (tagName.equals(ORDERED_LIST)) {
            CCOrderedListModel m = new CCOrderedListModel();
            view = new CCOrderedList((ContainerView) parent, m, name);
            m.setAddButtonLabel(model.getLocalizedString("addremove.orderable.list.add.button"));
            m.setDeleteButtonLabel(model.getLocalizedString("addremove.orderable.list.delete.button"));
            setModel(name, m);
        } else if (tagName.equals(UNORDERED_LIST)) {
            CCUnOrderedListModel m = new CCUnOrderedListModel();
            view = new CCUnOrderedList((ContainerView) parent, m, name);
            setModel(name, m);
        } else if (tagName.equals(MAP_LIST) || tagName.equals(GLOBAL_MAP_LIST)) {
            CCMapListModel m = new CCMapListModel();
            view = new CCMapList((ContainerView) parent, m, name);
            m.setValueOptionList(mapOptionList.get(name));
            m.setKeyLabel(model.getLocalizedString("maplist.key.label"));
            m.setValueLabel(model.getLocalizedString("maplist.value.label"));
            m.setMsgInvalidEntry(model.getLocalizedString("maplist.msg.invalid.entry"));
            m.setMsgInvalidKey(model.getLocalizedString("maplist.msg.invalid.key"));
            m.setMsgInvalidValue(model.getLocalizedString("maplist.msg.invalid.value"));
            m.setMsgInvalidNoKey(model.getLocalizedString("maplist.msg.invalid.nokey"));
            setModel(name, m);
        } else if (tagName.equals(ADDREMOVE_LIST)) {
            CCAddRemoveModel m = (CCAddRemoveModel) getModel(name);
            if (m == null) {
                setModel(name, new CCAddRemoveModel());
            }
        }
    }
    if (view == null) {
        view = super.createChild(parent, name);
    }
    if (CCEditableList.class.isInstance(view)) {
        CCEditableList editable = (CCEditableList) view;
        CCEditableListModel m = (CCEditableListModel) editable.getModel();
        m.setAddBtnLabel(model.getLocalizedString("editableList.addButtonLabel"));
        m.setRemoveBtnLabel(model.getLocalizedString("editableList.deleteButtonLabel"));
    }
    children.add(view);
    return view;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) CCMapListModel(com.sun.identity.console.ui.model.CCMapListModel) CCMapList(com.sun.identity.console.ui.view.CCMapList) CCUnOrderedListModel(com.sun.identity.console.ui.model.CCUnOrderedListModel) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) ContainerView(com.iplanet.jato.view.ContainerView) CCOrderedListModel(com.sun.identity.console.ui.model.CCOrderedListModel) CCOrderedList(com.sun.identity.console.ui.view.CCOrderedList) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView) CCUnOrderedList(com.sun.identity.console.ui.view.CCUnOrderedList)

Example 2 with View

use of com.iplanet.jato.view.View in project OpenAM by OpenRock.

the class DelegationViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SEARCH)) {
        populateTableModelEx();
        view = new CCActionTable(this, tblModel, name);
    } else if (name.equals(PAGETITLE)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (tblModel.isChildSupported(name)) {
        view = tblModel.createChild(this, name);
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 3 with View

use of com.iplanet.jato.view.View 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 View

use of com.iplanet.jato.view.View in project OpenAM by OpenRock.

the class ServerEditViewBeanBase method getAttributeValues.

protected Map<String, String> getAttributeValues() {
    Map<String, String> map = new HashMap<String, String>();
    for (String uiName : activePropertyNames) {
        View view = getChild(uiName);
        String value;
        if (view instanceof CCEditableList) {
            CCEditableList list = (CCEditableList) view;
            list.restoreStateData();
            // Create a comma delimited String from the items in the OptionList for storage.
            value = StringUtils.join(getValues(list.getModel().getOptionList()), ",");
        } else {
            value = (String) getDisplayFieldValue(uiName);
        }
        String propertyName = getActualPropertyName(uiName);
        if (view instanceof CCCheckBox) {
            value = (value.equals("true")) ? ServerPropertyValidator.getTrueValue(propertyName) : ServerPropertyValidator.getFalseValue(propertyName);
        }
        if (view instanceof CCPassword) {
            // encrypt and include in the map of attribute values to save
            if (!AMPropertySheetModel.passwordRandom.equals(value)) {
                value = AccessController.doPrivileged(new EncodeAction(value));
                map.put(propertyName, value);
            }
        } else {
            map.put(propertyName, value);
        }
    }
    return map;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) EncodeAction(com.sun.identity.security.EncodeAction) HashMap(java.util.HashMap) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) View(com.iplanet.jato.view.View) CCPassword(com.sun.web.ui.view.html.CCPassword)

Example 5 with View

use of com.iplanet.jato.view.View in project OpenAM by OpenRock.

the class NewAuthInstanceViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(PGTITLE_TWO_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());
        if (name.equals(INSTANCE_TYPE)) {
            //set the available options for the radio button
            CCRadioButton radio = (CCRadioButton) view;
            radio.setOptions(createAuthTypeOptionList());
        }
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Aggregations

View (com.iplanet.jato.view.View)35 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)17 CCActionTable (com.sun.web.ui.view.table.CCActionTable)16 SerializedField (com.sun.identity.console.components.view.html.SerializedField)10 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)9 HashMap (java.util.HashMap)7 Iterator (java.util.Iterator)7 ContainerView (com.iplanet.jato.view.ContainerView)6 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)6 Map (java.util.Map)6 CCMapList (com.sun.identity.console.ui.view.CCMapList)4 HashSet (java.util.HashSet)4 Set (java.util.Set)4 CCOrderedList (com.sun.identity.console.ui.view.CCOrderedList)3 CCUnOrderedList (com.sun.identity.console.ui.view.CCUnOrderedList)3 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)3 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)3 CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)3 DisplayField (com.iplanet.jato.view.DisplayField)2 ViewBean (com.iplanet.jato.view.ViewBean)2