http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentDialog.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentDialog.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentDialog.java index e468e36..e721c0b 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentDialog.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentDialog.java @@ -1,510 +1,510 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.calendar; - -import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; -import static org.apache.openmeetings.web.app.Application.getBean; -import static org.apache.openmeetings.web.app.WebSession.getRights; -import static org.apache.openmeetings.web.app.WebSession.getUserId; -import static org.apache.openmeetings.web.util.CalendarWebHelper.getDate; -import static org.apache.openmeetings.web.util.CalendarWebHelper.getDateTime; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.apache.openmeetings.db.dao.calendar.AppointmentDao; -import org.apache.openmeetings.db.dao.room.RoomDao; -import org.apache.openmeetings.db.dao.user.GroupUserDao; -import org.apache.openmeetings.db.dao.user.UserDao; -import org.apache.openmeetings.db.entity.calendar.Appointment; -import org.apache.openmeetings.db.entity.calendar.Appointment.Reminder; -import org.apache.openmeetings.db.entity.calendar.MeetingMember; -import org.apache.openmeetings.db.entity.calendar.OmCalendar; -import org.apache.openmeetings.db.entity.room.Room; -import org.apache.openmeetings.db.entity.user.Group; -import org.apache.openmeetings.db.entity.user.GroupUser; -import org.apache.openmeetings.db.entity.user.User; -import org.apache.openmeetings.db.util.AuthLevelUtil; -import org.apache.openmeetings.db.util.FormatHelper; -import org.apache.openmeetings.service.calendar.caldav.AppointmentManager; -import org.apache.openmeetings.web.app.Application; -import org.apache.openmeetings.web.app.WebSession; -import org.apache.openmeetings.web.common.GroupChoiceProvider; -import org.apache.openmeetings.web.common.OmDateTimePicker; -import org.apache.openmeetings.web.pages.MainPage; -import org.apache.openmeetings.web.user.rooms.RoomEnterBehavior; -import org.apache.openmeetings.web.util.RoomTypeDropDown; -import org.apache.openmeetings.web.util.UserMultiChoice; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior; -import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; -import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; -import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.CheckBox; -import org.apache.wicket.markup.html.form.ChoiceRenderer; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.IChoiceRenderer; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.Radio; -import org.apache.wicket.markup.html.form.RadioGroup; -import org.apache.wicket.markup.html.form.RequiredTextField; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.LoadableDetachableModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.model.util.CollectionModel; -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; -import org.wicketstuff.select2.Select2MultiChoice; - -import com.googlecode.wicket.jquery.core.JQueryBehavior; -import com.googlecode.wicket.jquery.core.Options; -import com.googlecode.wicket.jquery.ui.JQueryUIBehavior; -import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygEditor; -import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.toolbar.DefaultWysiwygToolbar; -import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog; -import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButtons; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogIcon; -import com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog; -import com.googlecode.wicket.kendo.ui.form.datetime.local.DateTimePicker; -import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel; - -public class AppointmentDialog extends AbstractFormDialog<Appointment> { - private static final long serialVersionUID = 1L; - private static final Logger log = Red5LoggerFactory.getLogger(AppointmentDialog.class, webAppRootKey); - - private AppointmentForm form; - private DialogButton save = new DialogButton("save", Application.getString(813)); - private DialogButton cancel = new DialogButton("cancel", Application.getString(1130)); - private DialogButton delete = new DialogButton("delete", Application.getString(814)); - private DialogButton enterRoom = new DialogButton("enterRoom", Application.getString(1282)); - private final CalendarPanel calendarPanel; - private final KendoFeedbackPanel feedback = new KendoFeedbackPanel("feedback", new Options("button", true)); - final MessageDialog confirmDelete; - private final WebMarkupContainer sipContainer = new WebMarkupContainer("sip-container"); - //FIXME TODO need to be unified with RoomInvitationForm - private final RadioGroup<InviteeType> rdi = new RadioGroup<>("inviteeType", Model.of(InviteeType.user)); - private final Select2MultiChoice<Group> groups = new Select2MultiChoice<>("groups" - , new CollectionModel<Group>(new ArrayList<>()) - , new GroupChoiceProvider()); - private final UserMultiChoice attendees = new UserMultiChoice("attendees", new CollectionModel<User>(new ArrayList<>())); - private enum InviteeType { - user - , group - } - - @Override - public int getWidth() { - return 650; - } - - @Override - public void onConfigure(JQueryBehavior behavior) { - super.onConfigure(behavior); - behavior.setOption("classes", "{'ui-dialog': 'ui-corner-all appointment'}"); - } - - public void setModelObjectWithAjaxTarget(Appointment a, AjaxRequestTarget target) { - form.setModelObject(a); - form.start.setModelObject(getDateTime(a.getStart())); - form.end.setModelObject(getDateTime(a.getEnd())); - form.setEnabled(isOwner(a)); - log.debug(" -- setModelObjectWithAjaxTarget -- Current model " + a); - if (a.getId() != null) { - delete.setVisible(isOwner(a), target); - enterRoom.setVisible(a.getRoom() != null, target); - } else { - delete.setVisible(false, target); - enterRoom.setVisible(false, target); - } - if (a.getRoom() != null) { - target.add(sipContainer.replace(new Label("room.confno", a.getRoom().getConfno())).setVisible(a.getRoom().isSipEnabled())); - } - save.setVisible(isOwner(a), target); - super.setModelObject(a); - } - - public AppointmentDialog(String id, String title, CalendarPanel calendarPanel, CompoundPropertyModel<Appointment> model) { - super(id, title, model, true); - log.debug(" -- AppointmentDialog -- Current model " + getModel().getObject()); - this.calendarPanel = calendarPanel; - setOutputMarkupId(true); - form = new AppointmentForm("appForm", model); - add(form); - confirmDelete = new MessageDialog("confirmDelete", Application.getString(814), Application.getString(833), DialogButtons.OK_CANCEL, DialogIcon.WARN){ - private static final long serialVersionUID = 1L; - - @Override - public void onClose(IPartialPageRequestHandler handler, DialogButton button) { - if (button != null && button.match(AbstractDialog.OK)){ - deleteAppointment(handler); - } - } - }; - add(confirmDelete); - } - - protected void deleteAppointment(IPartialPageRequestHandler handler) { - Appointment a = getModelObject(); - getBean(AppointmentDao.class).delete(a, getUserId()); - calendarPanel.refresh(handler); - if (a.getCalendar() != null && a.getHref() != null) { - calendarPanel.updatedeleteAppointment(handler, CalendarDialog.DIALOG_TYPE.DELETE_APPOINTMENT, a); - } - } - - @Override - protected List<DialogButton> getButtons() { - return Arrays.asList(enterRoom, save, delete, cancel); - } - - @Override - public DialogButton getSubmitButton() { - return save; - } - - @Override - public Form<?> getForm() { - return form; - } - - @Override - protected void onOpen(IPartialPageRequestHandler handler) { - handler.add(form.add(new JQueryUIBehavior("#tabs", "tabs"))); - } - - @Override - public void onClose(IPartialPageRequestHandler handler, DialogButton button) { - if (delete.equals(button)) { - confirmDelete.open(handler); - } else if (enterRoom.equals(button)) { - RoomEnterBehavior.roomEnter((MainPage)getPage(), handler, getModelObject().getRoom().getId()); - } - } - - @Override - protected void onError(AjaxRequestTarget target) { - target.add(feedback); - } - - @Override - protected void onSubmit(AjaxRequestTarget target) { - Appointment a = form.getModelObject(); - a.setRoom(form.createRoom ? form.appRoom : form.groom.getModelObject()); - final List<MeetingMember> mms = a.getMeetingMembers() == null ? new ArrayList<>() : a.getMeetingMembers(); - Set<Long> currentIds = new HashSet<>(); - List<User> users = new ArrayList<>(); - if (InviteeType.group == rdi.getModelObject()) { - //lets iterate through all group users - for (Group g : groups.getModelObject()) { - for (GroupUser gu : getBean(GroupUserDao.class).get(g.getId(), 0, Integer.MAX_VALUE)) { - User u = gu.getUser(); - if (!currentIds.contains(u.getId())) { - users.add(u); - currentIds.add(u.getId()); - } - } - } - } else { - users = new ArrayList<>(attendees.getModelObject()); - for (User u : users) { - if (u.getId() != null) { - currentIds.add(u.getId()); - } - } - } - - //remove users - for (Iterator<MeetingMember> i = mms.iterator(); i.hasNext();) { - MeetingMember m = i.next(); - if (!currentIds.contains(m.getUser().getId())) { - i.remove(); - } - } - Set<Long> originalIds = new HashSet<>(); - for (MeetingMember m : mms) { - originalIds.add(m.getUser().getId()); - } - //add users - for (User u : users) { - if (u.getId() == null || !originalIds.contains(u.getId())) { - MeetingMember mm = new MeetingMember(); - mm.setUser(u); - mm.setDeleted(false); - mm.setInserted(a.getInserted()); - mm.setUpdated(a.getUpdated()); - mm.setAppointment(a); - mms.add(mm); - } - } - a.setMeetingMembers(mms); - a.setStart(getDate(form.start.getModelObject())); - a.setEnd(getDate(form.end.getModelObject())); - a.setCalendar(form.cals.getModelObject()); - getBean(AppointmentDao.class).update(a, getUserId()); - if (a.getCalendar() != null) { - calendarPanel.updatedeleteAppointment(target, CalendarDialog.DIALOG_TYPE.UPDATE_APPOINTMENT, a); - } - target.add(feedback); - calendarPanel.refresh(target); - } - - public static boolean isOwner(Appointment object) { - return object.getOwner() != null && getUserId().equals(object.getOwner().getId()); - } - - private class AppointmentForm extends Form<Appointment> { - private static final long serialVersionUID = 1L; - private boolean createRoom = true; - private Room appRoom = null; - private final DateTimePicker start = new OmDateTimePicker("start", Model.of(LocalDateTime.now())); - private final DateTimePicker end = new OmDateTimePicker("end", Model.of(LocalDateTime.now())); - private final PasswordTextField pwd = new PasswordTextField("password"); - private final Label owner = new Label("aowner", Model.of("")); - private final WebMarkupContainer ownerPanel = new WebMarkupContainer("owner-row"); - private final WebMarkupContainer createRoomBlock = new WebMarkupContainer("create-room-block", new CompoundPropertyModel<>(appRoom)); - private final DropDownChoice<Room.Type> roomType = new RoomTypeDropDown("type"); - private final DropDownChoice<Room> groom = new DropDownChoice<>( - "groom" - , Model.of(new Room()) - , getRoomList() - , new ChoiceRenderer<Room>("name", "id")); - private DropDownChoice<OmCalendar> cals = new DropDownChoice<>( - "calendar", - new LoadableDetachableModel<List<? extends OmCalendar>>() { - private static final long serialVersionUID = 1L; - - @Override - protected List<? extends OmCalendar> load() { - return getCalendarList(); - } - }, - new ChoiceRenderer<OmCalendar>("title", "id") - ); - private final WebMarkupContainer groupContainer = new WebMarkupContainer("groupContainer"); - - private Room createAppRoom() { - Room r = new Room(); - r.setAppointment(true); - if (r.getType() == null) { - r.setType(Room.Type.conference); - } - return r; - } - - @Override - protected void onModelChanged() { - super.onModelChanged(); - - Appointment a = getModelObject(); - if (a.getReminder() == null) { - a.setReminder(Reminder.none); - } - if (a.getRoom() == null) { - a.setRoom(createAppRoom()); - } - createRoom = a.getRoom().isAppointment(); - if (createRoom) { - appRoom = a.getRoom(); - } else { - groom.setModelObject(a.getRoom()); - appRoom = createAppRoom(); - } - createRoomBlock.setDefaultModelObject(appRoom); - createRoomBlock.setEnabled(createRoom); - groom.setEnabled(!createRoom); - if (a.getId() == null) { - java.util.Calendar start = WebSession.getCalendar(); - start.setTime(a.getStart()); - java.util.Calendar end = WebSession.getCalendar(); - end.setTime(a.getEnd()); - - if (start.equals(end)) { - end.add(java.util.Calendar.HOUR_OF_DAY, 1); - a.setEnd(end.getTime()); - } - cals.setEnabled(true); - } else { - cals.setEnabled(false); - } - - rdi.setModelObject(InviteeType.user); - attendees.setModelObject(new ArrayList<>()); - if (a.getMeetingMembers() != null) { - for (MeetingMember mm : a.getMeetingMembers()) { - attendees.getModelObject().add(mm.getUser()); - } - } - pwd.setEnabled(a.isPasswordProtected()); - owner.setDefaultModel(Model.of(FormatHelper.formatUser(a.getOwner()))); - ownerPanel.setVisible(!isOwner(a)); - } - - public AppointmentForm(String id, CompoundPropertyModel<Appointment> model) { - super(id, model); - setOutputMarkupId(true); - - add(feedback.setOutputMarkupId(true)); - //General - add(new RequiredTextField<String>("title").setLabel(Model.of(Application.getString(572)))); - add(ownerPanel.add(owner)); - boolean showGroups = AuthLevelUtil.hasAdminLevel(getRights()); - add(rdi.add(new AjaxFormChoiceComponentUpdatingBehavior() { - private static final long serialVersionUID = 1L; - - @Override - protected void onUpdate(AjaxRequestTarget target) { - boolean groupsEnabled = InviteeType.group == rdi.getModelObject(); - target.add(groups.setEnabled(groupsEnabled), attendees.setEnabled(!groupsEnabled)); - } - })); - groupContainer.add( - groups.setLabel(Model.of(Application.getString(126))).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true) - , new Radio<>("group", Model.of(InviteeType.group)) - ); - if (showGroups) { - groups.add(new AjaxFormComponentUpdatingBehavior("change") { - private static final long serialVersionUID = 1L; - - @Override - protected void onUpdate(AjaxRequestTarget target) { - // added to update model - } - }).setEnabled(false); - } - rdi.add(attendees.add(new AjaxFormComponentUpdatingBehavior("change") { - private static final long serialVersionUID = 1L; - - @Override - protected void onUpdate(AjaxRequestTarget target) { - // added to update model - } - }) - , groupContainer.setVisible(showGroups) - ); - rdi.add(new Radio<>("user", Model.of(InviteeType.user))); - - add(new TextField<String>("location")); - DefaultWysiwygToolbar toolbar = new DefaultWysiwygToolbar("toolbarContainer"); - add(toolbar); - add(new WysiwygEditor("description", toolbar)); - - //room - add(new AjaxCheckBox("createRoom", new PropertyModel<Boolean>(this, "createRoom")) { - private static final long serialVersionUID = 1L; - - @Override - protected void onUpdate(AjaxRequestTarget target) { - createRoom = getConvertedInput(); - target.add(createRoomBlock.setEnabled(createRoom), groom.setEnabled(!createRoom)); - } - }); - add(createRoomBlock.add(roomType, new CheckBox("moderated")).setEnabled(createRoom).setOutputMarkupId(true)); - add(groom.setRequired(true).setLabel(Model.of(Application.getString(406))).setEnabled(!createRoom).setOutputMarkupId(true)); - add(sipContainer.setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true)); - sipContainer.add(new Label("room.confno", "")).setVisible(false); - - //Advanced - add(new DropDownChoice<>( - "reminder" - , Arrays.asList(Reminder.values()) - , new IChoiceRenderer<Reminder>() { - private static final long serialVersionUID = 1L; - - @Override - public Object getDisplayValue(Reminder art) { - return getString("appointment.reminder." + art.name()); - } - - @Override - public String getIdValue(Reminder art, int index) { - return art.name(); - } - - @Override - public Reminder getObject(String id, IModel<? extends List<? extends Reminder>> choices) { - for (Reminder art : choices.getObject()) { - if (art.name().equals(id)) { - return art; - } - } - return null; - } - })); - add(new AjaxCheckBox("passwordProtected") { - private static final long serialVersionUID = 1L; - - @Override - protected void onUpdate(AjaxRequestTarget target) { - AppointmentForm.this.getModelObject().setPasswordProtected(getConvertedInput()); - pwd.setEnabled(AppointmentForm.this.getModelObject().isPasswordProtected()); - target.add(pwd); - } - }); - pwd.setEnabled(getModelObject().isPasswordProtected()); - pwd.setOutputMarkupId(true); - add(pwd); - add(cals.setNullValid(true).setLabel(Model.of("calendar")).setOutputMarkupId(true)); - } - - @Override - protected void onInitialize() { - super.onInitialize(); - add(start.setLabel(Model.of(getString("570"))).setRequired(true) - , end.setLabel(Model.of(getString("571"))).setRequired(true)); - } - - private List<Room> getRoomList() { - //FIXME need to be reviewed - List<Room> result = new ArrayList<>(); - RoomDao dao = getBean(RoomDao.class); - result.addAll(dao.getPublicRooms()); - for (GroupUser ou : getBean(UserDao.class).get(getUserId()).getGroupUsers()) { - result.addAll(dao.getGroupRooms(ou.getGroup().getId())); - } - if (getModelObject().getRoom() != null && getModelObject().getRoom().isAppointment()) { //FIXME review - result.add(getModelObject().getRoom()); - } - return result; - } - - private List<OmCalendar> getCalendarList(){ - return getBean(AppointmentManager.class).getCalendars(getUserId()); - } - - @Override - protected void onValidate() { - if (null != start.getConvertedInput() && null != end.getConvertedInput() && end.getConvertedInput().isBefore(start.getConvertedInput())) { - error(Application.getString(1592)); - } - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.calendar; + +import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; +import static org.apache.openmeetings.web.app.Application.getBean; +import static org.apache.openmeetings.web.app.WebSession.getRights; +import static org.apache.openmeetings.web.app.WebSession.getUserId; +import static org.apache.openmeetings.web.util.CalendarWebHelper.getDate; +import static org.apache.openmeetings.web.util.CalendarWebHelper.getDateTime; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.openmeetings.db.dao.calendar.AppointmentDao; +import org.apache.openmeetings.db.dao.room.RoomDao; +import org.apache.openmeetings.db.dao.user.GroupUserDao; +import org.apache.openmeetings.db.dao.user.UserDao; +import org.apache.openmeetings.db.entity.calendar.Appointment; +import org.apache.openmeetings.db.entity.calendar.Appointment.Reminder; +import org.apache.openmeetings.db.entity.calendar.MeetingMember; +import org.apache.openmeetings.db.entity.calendar.OmCalendar; +import org.apache.openmeetings.db.entity.room.Room; +import org.apache.openmeetings.db.entity.user.Group; +import org.apache.openmeetings.db.entity.user.GroupUser; +import org.apache.openmeetings.db.entity.user.User; +import org.apache.openmeetings.db.util.AuthLevelUtil; +import org.apache.openmeetings.db.util.FormatHelper; +import org.apache.openmeetings.service.calendar.caldav.AppointmentManager; +import org.apache.openmeetings.web.app.Application; +import org.apache.openmeetings.web.app.WebSession; +import org.apache.openmeetings.web.common.GroupChoiceProvider; +import org.apache.openmeetings.web.common.OmDateTimePicker; +import org.apache.openmeetings.web.pages.MainPage; +import org.apache.openmeetings.web.user.rooms.RoomEnterBehavior; +import org.apache.openmeetings.web.util.RoomTypeDropDown; +import org.apache.openmeetings.web.util.UserMultiChoice; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; +import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.ChoiceRenderer; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.form.Radio; +import org.apache.wicket.markup.html.form.RadioGroup; +import org.apache.wicket.markup.html.form.RequiredTextField; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.LoadableDetachableModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.model.util.CollectionModel; +import org.red5.logging.Red5LoggerFactory; +import org.slf4j.Logger; +import org.wicketstuff.select2.Select2MultiChoice; + +import com.googlecode.wicket.jquery.core.JQueryBehavior; +import com.googlecode.wicket.jquery.core.Options; +import com.googlecode.wicket.jquery.ui.JQueryUIBehavior; +import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygEditor; +import com.googlecode.wicket.jquery.ui.plugins.wysiwyg.toolbar.DefaultWysiwygToolbar; +import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog; +import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButtons; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogIcon; +import com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog; +import com.googlecode.wicket.kendo.ui.form.datetime.local.DateTimePicker; +import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel; + +public class AppointmentDialog extends AbstractFormDialog<Appointment> { + private static final long serialVersionUID = 1L; + private static final Logger log = Red5LoggerFactory.getLogger(AppointmentDialog.class, webAppRootKey); + + private AppointmentForm form; + private DialogButton save = new DialogButton("save", Application.getString(813)); + private DialogButton cancel = new DialogButton("cancel", Application.getString(1130)); + private DialogButton delete = new DialogButton("delete", Application.getString(814)); + private DialogButton enterRoom = new DialogButton("enterRoom", Application.getString(1282)); + private final CalendarPanel calendarPanel; + private final KendoFeedbackPanel feedback = new KendoFeedbackPanel("feedback", new Options("button", true)); + final MessageDialog confirmDelete; + private final WebMarkupContainer sipContainer = new WebMarkupContainer("sip-container"); + //FIXME TODO need to be unified with RoomInvitationForm + private final RadioGroup<InviteeType> rdi = new RadioGroup<>("inviteeType", Model.of(InviteeType.user)); + private final Select2MultiChoice<Group> groups = new Select2MultiChoice<>("groups" + , new CollectionModel<Group>(new ArrayList<>()) + , new GroupChoiceProvider()); + private final UserMultiChoice attendees = new UserMultiChoice("attendees", new CollectionModel<User>(new ArrayList<>())); + private enum InviteeType { + user + , group + } + + @Override + public int getWidth() { + return 650; + } + + @Override + public void onConfigure(JQueryBehavior behavior) { + super.onConfigure(behavior); + behavior.setOption("classes", "{'ui-dialog': 'ui-corner-all appointment'}"); + } + + public void setModelObjectWithAjaxTarget(Appointment a, AjaxRequestTarget target) { + form.setModelObject(a); + form.start.setModelObject(getDateTime(a.getStart())); + form.end.setModelObject(getDateTime(a.getEnd())); + form.setEnabled(isOwner(a)); + log.debug(" -- setModelObjectWithAjaxTarget -- Current model " + a); + if (a.getId() != null) { + delete.setVisible(isOwner(a), target); + enterRoom.setVisible(a.getRoom() != null, target); + } else { + delete.setVisible(false, target); + enterRoom.setVisible(false, target); + } + if (a.getRoom() != null) { + target.add(sipContainer.replace(new Label("room.confno", a.getRoom().getConfno())).setVisible(a.getRoom().isSipEnabled())); + } + save.setVisible(isOwner(a), target); + super.setModelObject(a); + } + + public AppointmentDialog(String id, String title, CalendarPanel calendarPanel, CompoundPropertyModel<Appointment> model) { + super(id, title, model, true); + log.debug(" -- AppointmentDialog -- Current model " + getModel().getObject()); + this.calendarPanel = calendarPanel; + setOutputMarkupId(true); + form = new AppointmentForm("appForm", model); + add(form); + confirmDelete = new MessageDialog("confirmDelete", Application.getString(814), Application.getString(833), DialogButtons.OK_CANCEL, DialogIcon.WARN){ + private static final long serialVersionUID = 1L; + + @Override + public void onClose(IPartialPageRequestHandler handler, DialogButton button) { + if (button != null && button.match(AbstractDialog.OK)){ + deleteAppointment(handler); + } + } + }; + add(confirmDelete); + } + + protected void deleteAppointment(IPartialPageRequestHandler handler) { + Appointment a = getModelObject(); + getBean(AppointmentDao.class).delete(a, getUserId()); + calendarPanel.refresh(handler); + if (a.getCalendar() != null && a.getHref() != null) { + calendarPanel.updatedeleteAppointment(handler, CalendarDialog.DIALOG_TYPE.DELETE_APPOINTMENT, a); + } + } + + @Override + protected List<DialogButton> getButtons() { + return Arrays.asList(enterRoom, save, delete, cancel); + } + + @Override + public DialogButton getSubmitButton() { + return save; + } + + @Override + public Form<?> getForm() { + return form; + } + + @Override + protected void onOpen(IPartialPageRequestHandler handler) { + handler.add(form.add(new JQueryUIBehavior("#tabs", "tabs"))); + } + + @Override + public void onClose(IPartialPageRequestHandler handler, DialogButton button) { + if (delete.equals(button)) { + confirmDelete.open(handler); + } else if (enterRoom.equals(button)) { + RoomEnterBehavior.roomEnter((MainPage)getPage(), handler, getModelObject().getRoom().getId()); + } + } + + @Override + protected void onError(AjaxRequestTarget target) { + target.add(feedback); + } + + @Override + protected void onSubmit(AjaxRequestTarget target) { + Appointment a = form.getModelObject(); + a.setRoom(form.createRoom ? form.appRoom : form.groom.getModelObject()); + final List<MeetingMember> mms = a.getMeetingMembers() == null ? new ArrayList<>() : a.getMeetingMembers(); + Set<Long> currentIds = new HashSet<>(); + List<User> users = new ArrayList<>(); + if (InviteeType.group == rdi.getModelObject()) { + //lets iterate through all group users + for (Group g : groups.getModelObject()) { + for (GroupUser gu : getBean(GroupUserDao.class).get(g.getId(), 0, Integer.MAX_VALUE)) { + User u = gu.getUser(); + if (!currentIds.contains(u.getId())) { + users.add(u); + currentIds.add(u.getId()); + } + } + } + } else { + users = new ArrayList<>(attendees.getModelObject()); + for (User u : users) { + if (u.getId() != null) { + currentIds.add(u.getId()); + } + } + } + + //remove users + for (Iterator<MeetingMember> i = mms.iterator(); i.hasNext();) { + MeetingMember m = i.next(); + if (!currentIds.contains(m.getUser().getId())) { + i.remove(); + } + } + Set<Long> originalIds = new HashSet<>(); + for (MeetingMember m : mms) { + originalIds.add(m.getUser().getId()); + } + //add users + for (User u : users) { + if (u.getId() == null || !originalIds.contains(u.getId())) { + MeetingMember mm = new MeetingMember(); + mm.setUser(u); + mm.setDeleted(false); + mm.setInserted(a.getInserted()); + mm.setUpdated(a.getUpdated()); + mm.setAppointment(a); + mms.add(mm); + } + } + a.setMeetingMembers(mms); + a.setStart(getDate(form.start.getModelObject())); + a.setEnd(getDate(form.end.getModelObject())); + a.setCalendar(form.cals.getModelObject()); + getBean(AppointmentDao.class).update(a, getUserId()); + if (a.getCalendar() != null) { + calendarPanel.updatedeleteAppointment(target, CalendarDialog.DIALOG_TYPE.UPDATE_APPOINTMENT, a); + } + target.add(feedback); + calendarPanel.refresh(target); + } + + public static boolean isOwner(Appointment object) { + return object.getOwner() != null && getUserId().equals(object.getOwner().getId()); + } + + private class AppointmentForm extends Form<Appointment> { + private static final long serialVersionUID = 1L; + private boolean createRoom = true; + private Room appRoom = null; + private final DateTimePicker start = new OmDateTimePicker("start", Model.of(LocalDateTime.now())); + private final DateTimePicker end = new OmDateTimePicker("end", Model.of(LocalDateTime.now())); + private final PasswordTextField pwd = new PasswordTextField("password"); + private final Label owner = new Label("aowner", Model.of("")); + private final WebMarkupContainer ownerPanel = new WebMarkupContainer("owner-row"); + private final WebMarkupContainer createRoomBlock = new WebMarkupContainer("create-room-block", new CompoundPropertyModel<>(appRoom)); + private final DropDownChoice<Room.Type> roomType = new RoomTypeDropDown("type"); + private final DropDownChoice<Room> groom = new DropDownChoice<>( + "groom" + , Model.of(new Room()) + , getRoomList() + , new ChoiceRenderer<Room>("name", "id")); + private DropDownChoice<OmCalendar> cals = new DropDownChoice<>( + "calendar", + new LoadableDetachableModel<List<? extends OmCalendar>>() { + private static final long serialVersionUID = 1L; + + @Override + protected List<? extends OmCalendar> load() { + return getCalendarList(); + } + }, + new ChoiceRenderer<OmCalendar>("title", "id") + ); + private final WebMarkupContainer groupContainer = new WebMarkupContainer("groupContainer"); + + private Room createAppRoom() { + Room r = new Room(); + r.setAppointment(true); + if (r.getType() == null) { + r.setType(Room.Type.conference); + } + return r; + } + + @Override + protected void onModelChanged() { + super.onModelChanged(); + + Appointment a = getModelObject(); + if (a.getReminder() == null) { + a.setReminder(Reminder.none); + } + if (a.getRoom() == null) { + a.setRoom(createAppRoom()); + } + createRoom = a.getRoom().isAppointment(); + if (createRoom) { + appRoom = a.getRoom(); + } else { + groom.setModelObject(a.getRoom()); + appRoom = createAppRoom(); + } + createRoomBlock.setDefaultModelObject(appRoom); + createRoomBlock.setEnabled(createRoom); + groom.setEnabled(!createRoom); + if (a.getId() == null) { + java.util.Calendar start = WebSession.getCalendar(); + start.setTime(a.getStart()); + java.util.Calendar end = WebSession.getCalendar(); + end.setTime(a.getEnd()); + + if (start.equals(end)) { + end.add(java.util.Calendar.HOUR_OF_DAY, 1); + a.setEnd(end.getTime()); + } + cals.setEnabled(true); + } else { + cals.setEnabled(false); + } + + rdi.setModelObject(InviteeType.user); + attendees.setModelObject(new ArrayList<>()); + if (a.getMeetingMembers() != null) { + for (MeetingMember mm : a.getMeetingMembers()) { + attendees.getModelObject().add(mm.getUser()); + } + } + pwd.setEnabled(a.isPasswordProtected()); + owner.setDefaultModel(Model.of(FormatHelper.formatUser(a.getOwner()))); + ownerPanel.setVisible(!isOwner(a)); + } + + public AppointmentForm(String id, CompoundPropertyModel<Appointment> model) { + super(id, model); + setOutputMarkupId(true); + + add(feedback.setOutputMarkupId(true)); + //General + add(new RequiredTextField<String>("title").setLabel(Model.of(Application.getString(572)))); + add(ownerPanel.add(owner)); + boolean showGroups = AuthLevelUtil.hasAdminLevel(getRights()); + add(rdi.add(new AjaxFormChoiceComponentUpdatingBehavior() { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + boolean groupsEnabled = InviteeType.group == rdi.getModelObject(); + target.add(groups.setEnabled(groupsEnabled), attendees.setEnabled(!groupsEnabled)); + } + })); + groupContainer.add( + groups.setLabel(Model.of(Application.getString(126))).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true) + , new Radio<>("group", Model.of(InviteeType.group)) + ); + if (showGroups) { + groups.add(new AjaxFormComponentUpdatingBehavior("change") { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + // added to update model + } + }).setEnabled(false); + } + rdi.add(attendees.add(new AjaxFormComponentUpdatingBehavior("change") { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + // added to update model + } + }) + , groupContainer.setVisible(showGroups) + ); + rdi.add(new Radio<>("user", Model.of(InviteeType.user))); + + add(new TextField<String>("location")); + DefaultWysiwygToolbar toolbar = new DefaultWysiwygToolbar("toolbarContainer"); + add(toolbar); + add(new WysiwygEditor("description", toolbar)); + + //room + add(new AjaxCheckBox("createRoom", new PropertyModel<Boolean>(this, "createRoom")) { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + createRoom = getConvertedInput(); + target.add(createRoomBlock.setEnabled(createRoom), groom.setEnabled(!createRoom)); + } + }); + add(createRoomBlock.add(roomType, new CheckBox("moderated")).setEnabled(createRoom).setOutputMarkupId(true)); + add(groom.setRequired(true).setLabel(Model.of(Application.getString(406))).setEnabled(!createRoom).setOutputMarkupId(true)); + add(sipContainer.setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true)); + sipContainer.add(new Label("room.confno", "")).setVisible(false); + + //Advanced + add(new DropDownChoice<>( + "reminder" + , Arrays.asList(Reminder.values()) + , new IChoiceRenderer<Reminder>() { + private static final long serialVersionUID = 1L; + + @Override + public Object getDisplayValue(Reminder art) { + return getString("appointment.reminder." + art.name()); + } + + @Override + public String getIdValue(Reminder art, int index) { + return art.name(); + } + + @Override + public Reminder getObject(String id, IModel<? extends List<? extends Reminder>> choices) { + for (Reminder art : choices.getObject()) { + if (art.name().equals(id)) { + return art; + } + } + return null; + } + })); + add(new AjaxCheckBox("passwordProtected") { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + AppointmentForm.this.getModelObject().setPasswordProtected(getConvertedInput()); + pwd.setEnabled(AppointmentForm.this.getModelObject().isPasswordProtected()); + target.add(pwd); + } + }); + pwd.setEnabled(getModelObject().isPasswordProtected()); + pwd.setOutputMarkupId(true); + add(pwd); + add(cals.setNullValid(true).setLabel(Model.of("calendar")).setOutputMarkupId(true)); + } + + @Override + protected void onInitialize() { + super.onInitialize(); + add(start.setLabel(Model.of(getString("570"))).setRequired(true) + , end.setLabel(Model.of(getString("571"))).setRequired(true)); + } + + private List<Room> getRoomList() { + //FIXME need to be reviewed + List<Room> result = new ArrayList<>(); + RoomDao dao = getBean(RoomDao.class); + result.addAll(dao.getPublicRooms()); + for (GroupUser ou : getBean(UserDao.class).get(getUserId()).getGroupUsers()) { + result.addAll(dao.getGroupRooms(ou.getGroup().getId())); + } + if (getModelObject().getRoom() != null && getModelObject().getRoom().isAppointment()) { //FIXME review + result.add(getModelObject().getRoom()); + } + return result; + } + + private List<OmCalendar> getCalendarList(){ + return getBean(AppointmentManager.class).getCalendars(getUserId()); + } + + @Override + protected void onValidate() { + if (null != start.getConvertedInput() && null != end.getConvertedInput() && end.getConvertedInput().isBefore(start.getConvertedInput())) { + error(Application.getString(1592)); + } + } + } +}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentModel.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentModel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentModel.java index 3e5cc63..5819d24 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentModel.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/AppointmentModel.java @@ -1,51 +1,51 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.calendar; - -import static org.apache.openmeetings.web.app.Application.getBean; -import static org.apache.openmeetings.web.app.WebSession.getUserId; -import static org.apache.openmeetings.web.util.CalendarWebHelper.getDate; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.openmeetings.db.dao.calendar.AppointmentDao; -import org.apache.openmeetings.db.entity.calendar.Appointment; - -import com.googlecode.wicket.jquery.ui.calendar.CalendarEvent; -import com.googlecode.wicket.jquery.ui.calendar.CalendarModel; -import com.googlecode.wicket.jquery.ui.calendar.ICalendarVisitor; - -public class AppointmentModel extends CalendarModel implements ICalendarVisitor { - private static final long serialVersionUID = 1L; - - @Override - public void visit(CalendarEvent event) { - //every event can be customized - } - - @Override - protected List<? extends CalendarEvent> load() { - List<CalendarEvent> list = new ArrayList<>(); - for (Appointment a : getBean(AppointmentDao.class).getInRange(getUserId(), getDate(getStart()), getDate(getEnd()))) { - list.add(new OmCalendarEvent(a)); - } - return list; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.calendar; + +import static org.apache.openmeetings.web.app.Application.getBean; +import static org.apache.openmeetings.web.app.WebSession.getUserId; +import static org.apache.openmeetings.web.util.CalendarWebHelper.getDate; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.openmeetings.db.dao.calendar.AppointmentDao; +import org.apache.openmeetings.db.entity.calendar.Appointment; + +import com.googlecode.wicket.jquery.ui.calendar.CalendarEvent; +import com.googlecode.wicket.jquery.ui.calendar.CalendarModel; +import com.googlecode.wicket.jquery.ui.calendar.ICalendarVisitor; + +public class AppointmentModel extends CalendarModel implements ICalendarVisitor { + private static final long serialVersionUID = 1L; + + @Override + public void visit(CalendarEvent event) { + //every event can be customized + } + + @Override + protected List<? extends CalendarEvent> load() { + List<CalendarEvent> list = new ArrayList<>(); + for (Appointment a : getBean(AppointmentDao.class).getInRange(getUserId(), getDate(getStart()), getDate(getEnd()))) { + list.add(new OmCalendarEvent(a)); + } + return list; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidget.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidget.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidget.java index d15eed3..8f81e1a 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidget.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidget.java @@ -1,49 +1,49 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.AbstractWidget; -import org.wicketstuff.dashboard.Widget; -import org.wicketstuff.dashboard.WidgetLocation; -import org.wicketstuff.dashboard.web.WidgetView; - -public class MyRoomsWidget extends AbstractWidget { - private static final long serialVersionUID = 1L; - public static final String WIDGET_ID_MY_ROOMS = "MyRoomsWidget"; - - public MyRoomsWidget() { - super(); - location = new WidgetLocation(0, 1); - init(); - } - - @Override - public void init() { - super.init(); - title = Application.getString(781L); - id = WIDGET_ID_MY_ROOMS; - } - - @Override - public WidgetView createView(String viewId) { - return new MyRoomsWidgetView(viewId, new Model<Widget>(this)); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.AbstractWidget; +import org.wicketstuff.dashboard.Widget; +import org.wicketstuff.dashboard.WidgetLocation; +import org.wicketstuff.dashboard.web.WidgetView; + +public class MyRoomsWidget extends AbstractWidget { + private static final long serialVersionUID = 1L; + public static final String WIDGET_ID_MY_ROOMS = "MyRoomsWidget"; + + public MyRoomsWidget() { + super(); + location = new WidgetLocation(0, 1); + init(); + } + + @Override + public void init() { + super.init(); + title = Application.getString(781L); + id = WIDGET_ID_MY_ROOMS; + } + + @Override + public WidgetView createView(String viewId) { + return new MyRoomsWidgetView(viewId, new Model<Widget>(this)); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetDescriptor.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetDescriptor.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetDescriptor.java index 5b65f5f..64a1a84 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetDescriptor.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetDescriptor.java @@ -1,51 +1,51 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.wicketstuff.dashboard.WidgetDescriptor; - -public class MyRoomsWidgetDescriptor implements WidgetDescriptor { - private static final long serialVersionUID = 1L; - - @Override - public String getName() { - return Application.getString(781L); - } - - @Override - public String getProvider() { - return "Apache Openmeetings"; - } - - @Override - public String getDescription() { - return Application.getString(782L); - } - - @Override - public String getWidgetClassName() { - return MyRoomsWidget.class.getName(); - } - - @Override - public String getTypeName() { - return "om.widget.myrooms"; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.wicketstuff.dashboard.WidgetDescriptor; + +public class MyRoomsWidgetDescriptor implements WidgetDescriptor { + private static final long serialVersionUID = 1L; + + @Override + public String getName() { + return Application.getString(781L); + } + + @Override + public String getProvider() { + return "Apache Openmeetings"; + } + + @Override + public String getDescription() { + return Application.getString(782L); + } + + @Override + public String getWidgetClassName() { + return MyRoomsWidget.class.getName(); + } + + @Override + public String getTypeName() { + return "om.widget.myrooms"; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.html index c37eccc..87cfeae 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.html @@ -1,25 +1,25 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<html xmlns:wicket="http://wicket.apache.org"> - <wicket:panel> - <div wicket:id="rooms"></div> - </wicket:panel> -</html> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<html xmlns:wicket="http://wicket.apache.org"> + <wicket:panel> + <div wicket:id="rooms"></div> + </wicket:panel> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.java index fee5901..6a9602a 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/MyRoomsWidgetView.java @@ -1,36 +1,36 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import static org.apache.openmeetings.web.common.UserPanel.getMyRooms; - -import org.apache.openmeetings.web.user.rooms.RoomsPanel; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.Widget; -import org.wicketstuff.dashboard.web.WidgetView; - -public class MyRoomsWidgetView extends WidgetView { - private static final long serialVersionUID = 1L; - - public MyRoomsWidgetView(String id, Model<Widget> model) { - super(id, model); - - add(new RoomsPanel("rooms", getMyRooms())); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import static org.apache.openmeetings.web.common.UserPanel.getMyRooms; + +import org.apache.openmeetings.web.user.rooms.RoomsPanel; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.Widget; +import org.wicketstuff.dashboard.web.WidgetView; + +public class MyRoomsWidgetView extends WidgetView { + private static final long serialVersionUID = 1L; + + public MyRoomsWidgetView(String id, Model<Widget> model) { + super(id, model); + + add(new RoomsPanel("rooms", getMyRooms())); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.html index 20926c3..c6151d9 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.html @@ -1,25 +1,25 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<html xmlns:wicket="http://wicket.apache.org"> - <wicket:panel> - <div wicket:id="dashboard" class="dashboard"></div> - </wicket:panel> -</html> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<html xmlns:wicket="http://wicket.apache.org"> + <wicket:panel> + <div wicket:id="dashboard" class="dashboard"></div> + </wicket:panel> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.java index 772476f..c1e291e 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/OmDashboardPanel.java @@ -1,36 +1,36 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.db.util.FormatHelper; -import org.apache.openmeetings.web.app.WebSession; -import org.apache.openmeetings.web.common.UserPanel; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.web.DashboardPanel; - -public class OmDashboardPanel extends UserPanel { - private static final long serialVersionUID = 1L; - - public OmDashboardPanel(String id) { - super(id); - - boolean isRtl = FormatHelper.isRtlLanguage(WebSession.get().getLocale().toLanguageTag()); - add(new DashboardPanel("dashboard", Model.of(WebSession.getDashboard())).setRtlModel(Model.of(isRtl))); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.db.util.FormatHelper; +import org.apache.openmeetings.web.app.WebSession; +import org.apache.openmeetings.web.common.UserPanel; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.web.DashboardPanel; + +public class OmDashboardPanel extends UserPanel { + private static final long serialVersionUID = 1L; + + public OmDashboardPanel(String id) { + super(id); + + boolean isRtl = FormatHelper.isRtlLanguage(WebSession.get().getLocale().toLanguageTag()); + add(new DashboardPanel("dashboard", Model.of(WebSession.getDashboard())).setRtlModel(Model.of(isRtl))); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidget.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidget.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidget.java index eadac94..f7353b1 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidget.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidget.java @@ -1,49 +1,49 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.AbstractWidget; -import org.wicketstuff.dashboard.Widget; -import org.wicketstuff.dashboard.WidgetLocation; -import org.wicketstuff.dashboard.web.WidgetView; - -public class RecentRoomsWidget extends AbstractWidget { - private static final long serialVersionUID = 1L; - public static final String WIDGET_ID_RECENT_ROOMS = "RecentRoomsWidget"; - - public RecentRoomsWidget() { - super(); - location = new WidgetLocation(1, 1); - init(); - } - - @Override - public void init() { - super.init(); - title = Application.getString("widget.recent.title"); - id = WIDGET_ID_RECENT_ROOMS; - } - - @Override - public WidgetView createView(String viewId) { - return new RecentRoomsWidgetView(viewId, new Model<Widget>(this)); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.AbstractWidget; +import org.wicketstuff.dashboard.Widget; +import org.wicketstuff.dashboard.WidgetLocation; +import org.wicketstuff.dashboard.web.WidgetView; + +public class RecentRoomsWidget extends AbstractWidget { + private static final long serialVersionUID = 1L; + public static final String WIDGET_ID_RECENT_ROOMS = "RecentRoomsWidget"; + + public RecentRoomsWidget() { + super(); + location = new WidgetLocation(1, 1); + init(); + } + + @Override + public void init() { + super.init(); + title = Application.getString("widget.recent.title"); + id = WIDGET_ID_RECENT_ROOMS; + } + + @Override + public WidgetView createView(String viewId) { + return new RecentRoomsWidgetView(viewId, new Model<Widget>(this)); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetDescriptor.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetDescriptor.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetDescriptor.java index 010e38a..feb2e12 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetDescriptor.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetDescriptor.java @@ -1,51 +1,51 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.wicketstuff.dashboard.WidgetDescriptor; - -public class RecentRoomsWidgetDescriptor implements WidgetDescriptor { - private static final long serialVersionUID = 1L; - - @Override - public String getName() { - return Application.getString("widget.recent.title"); - } - - @Override - public String getProvider() { - return "Apache Openmeetings"; - } - - @Override - public String getDescription() { - return Application.getString("widget.recent.desc"); - } - - @Override - public String getWidgetClassName() { - return RecentRoomsWidget.class.getName(); - } - - @Override - public String getTypeName() { - return "om.widget.recentrooms"; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.wicketstuff.dashboard.WidgetDescriptor; + +public class RecentRoomsWidgetDescriptor implements WidgetDescriptor { + private static final long serialVersionUID = 1L; + + @Override + public String getName() { + return Application.getString("widget.recent.title"); + } + + @Override + public String getProvider() { + return "Apache Openmeetings"; + } + + @Override + public String getDescription() { + return Application.getString("widget.recent.desc"); + } + + @Override + public String getWidgetClassName() { + return RecentRoomsWidget.class.getName(); + } + + @Override + public String getTypeName() { + return "om.widget.recentrooms"; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.html index c37eccc..87cfeae 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.html @@ -1,25 +1,25 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<html xmlns:wicket="http://wicket.apache.org"> - <wicket:panel> - <div wicket:id="rooms"></div> - </wicket:panel> -</html> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<html xmlns:wicket="http://wicket.apache.org"> + <wicket:panel> + <div wicket:id="rooms"></div> + </wicket:panel> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.java index 32b967e..73a3ef9 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RecentRoomsWidgetView.java @@ -1,38 +1,38 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import static org.apache.openmeetings.web.app.Application.getBean; -import static org.apache.openmeetings.web.app.WebSession.getUserId; - -import org.apache.openmeetings.db.dao.room.RoomDao; -import org.apache.openmeetings.web.user.rooms.RoomsPanel; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.Widget; -import org.wicketstuff.dashboard.web.WidgetView; - -public class RecentRoomsWidgetView extends WidgetView { - private static final long serialVersionUID = 1L; - - public RecentRoomsWidgetView(String id, Model<Widget> model) { - super(id, model); - - add(new RoomsPanel("rooms", getBean(RoomDao.class).getRecent(getUserId()))); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import static org.apache.openmeetings.web.app.Application.getBean; +import static org.apache.openmeetings.web.app.WebSession.getUserId; + +import org.apache.openmeetings.db.dao.room.RoomDao; +import org.apache.openmeetings.web.user.rooms.RoomsPanel; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.Widget; +import org.wicketstuff.dashboard.web.WidgetView; + +public class RecentRoomsWidgetView extends WidgetView { + private static final long serialVersionUID = 1L; + + public RecentRoomsWidgetView(String id, Model<Widget> model) { + super(id, model); + + add(new RoomsPanel("rooms", getBean(RoomDao.class).getRecent(getUserId()))); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidget.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidget.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidget.java index aee9f3b..674c350 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidget.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidget.java @@ -1,49 +1,49 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.apache.wicket.model.Model; -import org.wicketstuff.dashboard.AbstractWidget; -import org.wicketstuff.dashboard.Widget; -import org.wicketstuff.dashboard.WidgetLocation; -import org.wicketstuff.dashboard.web.WidgetView; - -public class RssWidget extends AbstractWidget { - private static final long serialVersionUID = 1L; - public static final String WIDGET_ID_RSS = "RssWidget"; - - public RssWidget() { - super(); - location = new WidgetLocation(1, 1); - init(); - } - - @Override - public void init() { - super.init(); - title = Application.getString(277L); - id = WIDGET_ID_RSS; - } - - @Override - public WidgetView createView(String viewId) { - return new RssWidgetView(viewId, new Model<Widget>(this)); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.apache.wicket.model.Model; +import org.wicketstuff.dashboard.AbstractWidget; +import org.wicketstuff.dashboard.Widget; +import org.wicketstuff.dashboard.WidgetLocation; +import org.wicketstuff.dashboard.web.WidgetView; + +public class RssWidget extends AbstractWidget { + private static final long serialVersionUID = 1L; + public static final String WIDGET_ID_RSS = "RssWidget"; + + public RssWidget() { + super(); + location = new WidgetLocation(1, 1); + init(); + } + + @Override + public void init() { + super.init(); + title = Application.getString(277L); + id = WIDGET_ID_RSS; + } + + @Override + public WidgetView createView(String viewId) { + return new RssWidgetView(viewId, new Model<Widget>(this)); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidgetDescriptor.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidgetDescriptor.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidgetDescriptor.java index 09487b3..ae33186 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidgetDescriptor.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/dashboard/RssWidgetDescriptor.java @@ -1,51 +1,51 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") + you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openmeetings.web.user.dashboard; - -import org.apache.openmeetings.web.app.Application; -import org.wicketstuff.dashboard.WidgetDescriptor; - -public class RssWidgetDescriptor implements WidgetDescriptor { - private static final long serialVersionUID = 1L; - - @Override - public String getName() { - return Application.getString(277L); - } - - @Override - public String getProvider() { - return "Apache Openmeetings"; - } - - @Override - public String getDescription() { - return Application.getString(277L); - } - - @Override - public String getWidgetClassName() { - return RssWidget.class.getName(); - } - - @Override - public String getTypeName() { - return "om.widget.rss"; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.user.dashboard; + +import org.apache.openmeetings.web.app.Application; +import org.wicketstuff.dashboard.WidgetDescriptor; + +public class RssWidgetDescriptor implements WidgetDescriptor { + private static final long serialVersionUID = 1L; + + @Override + public String getName() { + return Application.getString(277L); + } + + @Override + public String getProvider() { + return "Apache Openmeetings"; + } + + @Override + public String getDescription() { + return Application.getString(277L); + } + + @Override + public String getWidgetClassName() { + return RssWidget.class.getName(); + } + + @Override + public String getTypeName() { + return "om.widget.rss"; + } +}
