use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method handleTblDataActionDuplicateHrefRequest.
/**
* Handles duplicate device request.
*
* @param event Request Invocation Event.
*/
public void handleTblDataActionDuplicateHrefRequest(RequestInvocationEvent event) {
String name = (String) getDisplayFieldValue(TBL_DATA_ACTION_DUPLICATE_HREF);
MAPServiceModel model = (MAPServiceModel) getModel();
MAPDuplicationDeviceViewBean vb = (MAPDuplicationDeviceViewBean) getViewBean(MAPDuplicationDeviceViewBean.class);
vb.clientType = model.getClientTypePrefix() + name;
vb.deviceName = model.getDeviceNamePrefix() + model.getDeviceUserAgent(name);
vb.setDisplayFieldValue(MAPDuplicationDeviceViewBean.TF_ORIG_CLIENT_TYPE, name);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method populateTableModel.
private void populateTableModel() {
tblModel.clearAll();
boolean first = true;
String filter = (String) getDisplayFieldValue(TF_FILTER);
MAPServiceModel model = (MAPServiceModel) getModel();
Set devices = model.getDeviceNames(getProfileName(), getBaseStyle(), filter);
if ((devices != null) && !devices.isEmpty()) {
for (Iterator iter = devices.iterator(); iter.hasNext(); ) {
if (!first) {
tblModel.appendRow();
} else {
first = false;
}
String name = (String) iter.next();
tblModel.setValue(TBL_DATA_NAME, name);
tblModel.setValue(TBL_DATA_ACTION_HREF, name);
tblModel.setValue(TBL_DATA_ACTION_DEFAULT_HREF, name);
tblModel.setValue(TBL_DATA_ACTION_DUPLICATE_HREF, name);
tblModel.setValue(TBL_DATA_ACTION_DELETE_HREF, name);
tblModel.setValue(TBL_DATA_ACTION_LABEL, "clientDetection.edit.hyperlink.label");
tblModel.setValue(TBL_DATA_ACTION_DUPLICATE_LABEL, "clientDetection.duplicate.hyperlink.label");
if (model.isCustomizable(name)) {
tblModel.setValue(TBL_CUSTOMIZABLE, "clientDetection.customizable.label");
} else {
tblModel.setValue(TBL_CUSTOMIZABLE, "");
}
if (model.hasDefaultSetting(name)) {
tblModel.setValue(TBL_DATA_ACTION_DEFAULT_LABEL, "clientDetection.default.hyperlink.label");
} else {
tblModel.setValue(TBL_DATA_ACTION_DEFAULT_LABEL, "");
}
if (model.canBeDeleted(name)) {
tblModel.setValue(TBL_DATA_ACTION_DELETE_LABEL, "clientDetection.delete.hyperlink.label");
} else {
tblModel.setValue(TBL_DATA_ACTION_DELETE_LABEL, "");
}
}
}
}
Aggregations