add(new DropDownChoice<RoomType>("roomtype", Application.getBean(RoomTypeDao.class).getAll(WebSession.getLanguage()),
new ChoiceRenderer<RoomType>("label.value", "roomtypes_id")));
add(new TextArea<String>("comment"));
add(new CheckBox("appointment"));
add(new CheckBox("ispublic"));
List<Organisation> orgList = Application.getBean(OrganisationDao.class).get(0, Integer.MAX_VALUE);
List<RoomOrganisation> orgRooms = new ArrayList<RoomOrganisation>(orgList.size());
for (Organisation org : orgList) {
orgRooms.add(new RoomOrganisation(org));
}
ListMultipleChoice<RoomOrganisation> orgChoiceList = new ListMultipleChoice<RoomOrganisation>(
"roomOrganisations", orgRooms,
new ChoiceRenderer<RoomOrganisation>("organisation.name",
"organisation.organisation_id"));
orgChoiceList.setMaxRows(6);
add(orgChoiceList);
add(new CheckBox("isDemoRoom"));
TextField<Integer> demoTime = new TextField<Integer>("demoTime");
demoTime.setLabel(new Model<String>(WebSession.getString(637)));
add(demoTime);
add(new CheckBox("allowUserQuestions"));
add(new CheckBox("isAudioOnly"));
add(new CheckBox("allowFontStyles"));
add(new CheckBox("isClosed"));
add(new TextField<String>("redirectURL"));
add(new CheckBox("waitForRecording"));
add(new CheckBox("allowRecording"));
add(new CheckBox("hideTopBar"));
add(new CheckBox("hideChat"));
add(new CheckBox("hideActivitiesAndActions"));
add(new CheckBox("hideFilesExplorer"));
add(new CheckBox("hideActionsMenu"));
add(new CheckBox("hideScreenSharing"));
add(new CheckBox("hideWhiteboard"));
add(new CheckBox("showMicrophoneStatus"));
add(new CheckBox("chatModerated"));
add(new CheckBox("chatOpened"));
add(new CheckBox("filesOpened"));
add(new CheckBox("autoVideoSelect"));
// Users in this Room
clientsContainer = new WebMarkupContainer("clientsContainer");
clients = new ListView<Client>("clients", clientsInRoom){
private static final long serialVersionUID = 8542589945574690054L;
@Override
protected void populateItem(final ListItem<Client> item) {
Client client = item.getModelObject();
item.add(new Label("clientId", "" + client.getId()))
.add(new Label("clientLogin", "" + client.getUsername()))
.add(new WebMarkupContainer("clientDelete").add(new AjaxEventBehavior("onclick"){
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
}
@Override
protected void onEvent(AjaxRequestTarget target) {
Client c = item.getModelObject();
getBean(IUserService.class).kickUserByStreamId(getSid(), c.getStreamid()
, c.getServer() == null ? 0 : c.getServer().getId());
updatClients(target);
}
}));
}
};
add(clientsContainer.add(clients.setOutputMarkupId(true)).setOutputMarkupId(true));
// Moderators
moderators = new ListView<RoomModerator>("moderators", moderatorsInRoom) {
private static final long serialVersionUID = -7935197812421549677L;
@Override
protected void populateItem(final ListItem<RoomModerator> item) {
final RoomModerator moderator = item.getModelObject();
item.add(new Label("isSuperModerator", "" + moderator.getIsSuperModerator()))
.add(new Label("userId", "" + moderator.getUser().getUser_id()))
.add(new Label("uName", "" + moderator.getUser().getFirstname() + " " + moderator.getUser().getLastname()))
.add(new Label("email", ""+ moderator.getUser().getAdresses().getEmail()))
.add(new WebMarkupContainer("delete").add(new AjaxEventBehavior("onclick"){
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
}
@Override
protected void onEvent(AjaxRequestTarget target) {
Application.getBean(RoomModeratorsDao.class).removeRoomModeratorByUserId(moderator.getRoomModeratorsId());
updateModerators(target);
}
}));
item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
}
};
// FIXME: Room user moderator list
CheckBox isModeratedRoom = new CheckBox("isModeratedRoom");
add(isModeratedRoom.setOutputMarkupId(true));
moderatorContainer = new WebMarkupContainer("moderatorContainer");
add(moderatorContainer.add(moderators).setOutputMarkupId(true));