if (!isRightGroup()) {
if (isMultiSelectionOwnerKeys()) {
String[] radioKeysOwners = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
String[] radioValuesOwners = { translator.translate("sendtochooser.form.radio.owners.all"),
translator.translate("sendtochooser.form.radio.owners.nothing"), translator.translate("sendtochooser.form.radio.owners.choose") };
radioButtonOwner = new RadioButtonGroupElement(true, "sendtochooser.form.radio.owners", radioKeysOwners, radioValuesOwners);
radioButtonOwner.select(NLS_RADIO_ALL, true);
// Owner MultiSelection
SecurityGroup owners = businessGroup.getOwnerGroup();
List<Identity> ownerList = scrtMngr.getIdentitiesOfSecurityGroup(owners);
String[] keysOwner = new String[ownerList.size()];
String[] valuesOwner = new String[ownerList.size()];
for (int i = 0; i < ownerList.size(); i++) {
keysOwner[i] = ownerList.get(i).getKey().toString();
valuesOwner[i] = ownerList.get(i).getName().toString();
}
multiSelectionOwnerKeys = new StaticMultipleSelectionElement(null, keysOwner, valuesOwner, ownerList.size() > 0 ? true : false);
addFormElement("radioButtonOwner", radioButtonOwner);
addFormElement("multiSelectionOwnerKeys", multiSelectionOwnerKeys);
// rule owner
rule = new VisibilityDependsOnSelectionRule(radioButtonOwner, multiSelectionOwnerKeys, "choose", true, null, true);
addVisibilityDependsOnSelectionRule(rule);
} else {
String[] radioKeysOwners = { NLS_RADIO_ALL, NLS_RADIO_NOTHING };
String[] radioValuesOwners = { translator.translate("sendtochooser.form.radio.owners.all"),
translator.translate("sendtochooser.form.radio.owners.nothing") };
radioButtonOwner = new RadioButtonGroupElement(true, "sendtochooser.form.radio.owners", radioKeysOwners, radioValuesOwners);
radioButtonOwner.select(NLS_RADIO_ALL, true);
addFormElement("radioButtonOwner", radioButtonOwner);
}
}
if (isMultiSelectionPartipKeys()) {
if (isRightGroup()) {
String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_CHOOSE };
String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.rightgroup.all"), translator.translate("sendtochooser.form.radio.partip.rightgroup.choose") };
radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.rightgroup", radioKeysPartip, radioValuesPartip);
radioButtonPartip.select(NLS_RADIO_ALL, true);
// Participator MultiSelection
SecurityGroup participants = businessGroup.getPartipiciantGroup();
List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
String[] keysPartip = new String[participantsList.size()];
String[] valuesPartip = new String[participantsList.size()];
for (int i = 0; i < participantsList.size(); i++) {
keysPartip[i] = participantsList.get(i).getKey().toString();
valuesPartip[i] = participantsList.get(i).getName().toString();
}
multiSelectionPartipKeys = new StaticMultipleSelectionElement(null, keysPartip, valuesPartip, participantsList.size() > 0 ? true
: false);
addFormElement("radioButtonPartip", radioButtonPartip);
addFormElement("multiSelectionPartipKeys", multiSelectionPartipKeys);
// rule partips
rule = new VisibilityDependsOnSelectionRule(radioButtonPartip, multiSelectionPartipKeys, "choose", true, null, true);
addVisibilityDependsOnSelectionRule(rule);
} else {
String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all"),
translator.translate("sendtochooser.form.radio.partip.nothing"), translator.translate("sendtochooser.form.radio.partip.choose") };
radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip", radioKeysPartip, radioValuesPartip);
radioButtonPartip.select(NLS_RADIO_ALL, true);
// Participator MultiSelection
SecurityGroup participants = businessGroup.getPartipiciantGroup();
List<Identity> participantsList = scrtMngr.getIdentitiesOfSecurityGroup(participants);
String[] keysPartip = new String[participantsList.size()];
String[] valuesPartip = new String[participantsList.size()];
for (int i = 0; i < participantsList.size(); i++) {
keysPartip[i] = participantsList.get(i).getKey().toString();
valuesPartip[i] = participantsList.get(i).getName().toString();
}
multiSelectionPartipKeys = new StaticMultipleSelectionElement(null, keysPartip, valuesPartip, participantsList.size() > 0 ? true
: false);
addFormElement("radioButtonPartip", radioButtonPartip);
addFormElement("multiSelectionPartipKeys", multiSelectionPartipKeys);
// rule partips
rule = new VisibilityDependsOnSelectionRule(radioButtonPartip, multiSelectionPartipKeys, "choose", true, null, true);
addVisibilityDependsOnSelectionRule(rule);
}
} else {
if (isRightGroup()) {
String[] radioKeysPartip = { NLS_RADIO_ALL };
String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all.rightgroup") };
radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip.rightgroup", radioKeysPartip, radioValuesPartip);
radioButtonPartip.select(NLS_RADIO_ALL, true);
addFormElement("radioButtonPartip", radioButtonPartip);
} else {
String[] radioKeysPartip = { NLS_RADIO_ALL, NLS_RADIO_NOTHING };
String[] radioValuesPartip = { translator.translate("sendtochooser.form.radio.partip.all"),
translator.translate("sendtochooser.form.radio.partip.nothing") };
radioButtonPartip = new RadioButtonGroupElement(true, "sendtochooser.form.radio.partip", radioKeysPartip, radioValuesPartip);
radioButtonPartip.select(NLS_RADIO_ALL, true);
addFormElement("radioButtonPartip", radioButtonPartip);
}
}
if ( isAdmin && businessGroup.getWaitingListEnabled().booleanValue()) {
String[] radioKeysWaitings = { NLS_RADIO_ALL, NLS_RADIO_NOTHING, NLS_RADIO_CHOOSE };
String[] radioValuesWaitings = {translator.translate("sendtochooser.form.radio.waitings.all"), translator.translate("sendtochooser.form.radio.waitings.nothing"), translator.translate("sendtochooser.form.radio.waitings.choose")};
radioButtonWaiting = new RadioButtonGroupElement(true, "sendtochooser.form.radio.waitings", radioKeysWaitings, radioValuesWaitings);
radioButtonWaiting.select(NLS_RADIO_ALL, true);
// Waitings MultiSelection
SecurityGroup waitingList = businessGroup.getWaitingGroup();
List<Identity> waitingListIdentities = scrtMngr.getIdentitiesOfSecurityGroup(waitingList);