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();
}
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();
}
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");
}
}
}
}
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);
}
}
}
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;
}
Aggregations