Search in sources :

Example 71 with AMPropertySheetModel

use of com.sun.identity.console.base.model.AMPropertySheetModel in project OpenAM by OpenRock.

the class G11NCharsetAliasEditViewBean method createPropertyModel.

protected void createPropertyModel() {
    DelegationConfig dConfig = DelegationConfig.getInstance();
    boolean canModify = dConfig.hasPermission("/", null, AMAdminConstants.PERMISSION_MODIFY, getRequestContext().getRequest(), getClass().getName());
    String xmlFile = (canModify) ? "com/sun/identity/console/propertyG11NCharsetAlias.xml" : "com/sun/identity/console/propertyG11NCharsetAlias_Readonly.xml";
    propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(xmlFile));
    propertySheetModel.clear();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig)

Example 72 with AMPropertySheetModel

use of com.sun.identity.console.base.model.AMPropertySheetModel in project OpenAM by OpenRock.

the class SelectTypeViewBeanBase method createPropertyModel.

private void createPropertyModel() {
    propertySheetModel = new AMPropertySheetModel(getClass().getClassLoader().getResourceAsStream(getPropertyXMLFileName()));
    propertySheetModel.clear();
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel)

Example 73 with AMPropertySheetModel

use of com.sun.identity.console.base.model.AMPropertySheetModel in project OpenAM by OpenRock.

the class TimeConditionHelper method setTimeZone.

public void setTimeZone(ConditionOpViewBeanBase viewBean, boolean canModify, String tz) {
    if ((tz != null) && (tz.trim().length() > 0)) {
        AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
        if (canModify) {
            CCDropDownMenu list = (CCDropDownMenu) viewBean.getChild(STANDARDTIMEZONE);
            OptionList optList = list.getOptions();
            if ((optList != null) && optList.hasValue(tz)) {
                propModel.setValue(STANDARDTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "standard");
            } else {
                propModel.setValue(CUSTOMTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "custom");
            }
        } else {
            String[] ids = TimeZone.getAvailableIDs();
            boolean contains = false;
            for (int i = 0; (i < ids.length) && !contains; i++) {
                contains = ids[i].equals(tz);
            }
            if (contains) {
                propModel.setValue(STANDARDTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "standard");
            } else {
                propModel.setValue(CUSTOMTIMEZONE, tz);
                propModel.setValue(RADIOTIMEZONE, "custom");
            }
        }
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 74 with AMPropertySheetModel

use of com.sun.identity.console.base.model.AMPropertySheetModel in project OpenAM by OpenRock.

the class TimeConditionHelper method setTime.

public void setTime(ConditionOpViewBeanBase viewBean, boolean bStart, String strTime) {
    int idx = strTime.indexOf(":");
    if (idx != -1) {
        String hours = strTime.substring(0, idx);
        String minutes = strTime.substring(idx + 1);
        try {
            int hr = Integer.parseInt(hours);
            int mm = Integer.parseInt(minutes);
            boolean ampm = (hr >= 12);
            if (ampm && (hr > 12)) {
                hr -= 12;
            }
            AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
            propModel.setValue((bStart) ? STARTHOUR : ENDHOUR, Integer.toString(hr));
            propModel.setValue((bStart) ? STARTMINUTE : ENDMINUTE, Integer.toString(mm));
            propModel.setValue((bStart) ? STARTSESSION : ENDSESSION, (ampm) ? "pm" : "am");
        } catch (NumberFormatException e) {
            AMModelBase.debug.error("TimeConditionHelper.setTime", e);
        }
    }
}
Also used : AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel)

Example 75 with AMPropertySheetModel

use of com.sun.identity.console.base.model.AMPropertySheetModel in project OpenAM by OpenRock.

the class TimeConditionHelper method getDateTime.

private boolean getDateTime(ConditionOpViewBeanBase viewBean, String childName, boolean bStart, Map values) {
    boolean valid = false;
    AMPropertySheetModel propModel = viewBean.getPropertySheetModel();
    String date = (String) propModel.getValue(childName);
    String formatedDate = getDateTime(viewBean, date, bStart);
    if (formatedDate != null) {
        if (formatedDate.length() > 0) {
            Set set = new HashSet(2);
            set.add(formatedDate);
            values.put(childName, set);
        }
        valid = true;
    }
    return valid;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) HashSet(java.util.HashSet)

Aggregations

AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)146 DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)32 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)16 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)9 InputStream (java.io.InputStream)8 HashSet (java.util.HashSet)7 Set (java.util.Set)7 Iterator (java.util.Iterator)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)3 List (java.util.List)3 ViewBean (com.iplanet.jato.view.ViewBean)2 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)2 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)2 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)2 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)2 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)2 CCOrderedListModel (com.sun.identity.console.ui.model.CCOrderedListModel)2