openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject svn commit: r1455412 - in /openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms: UserRoomsPanel.html UserRoomsPanel.java
Date Tue, 12 Mar 2013 06:01:07 GMT
Author: solomax
Date: Tue Mar 12 06:01:06 2013
New Revision: 1455412

URL: http://svn.apache.org/r1455412
Log:
HTML5: list of public rooms with refreshable user count is added;

Modified:
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html?rev=1455412&r1=1455411&r2=1455412&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html
Tue Mar 12 06:01:06 2013
@@ -21,5 +21,16 @@
 <html xmlns:wicket="http://wicket.apache.org">
 	<wicket:panel>
 		<div wicket:id="title"></div>
+		<div wicket:id="desc"></div>
+		<table style="border-collapse: collapse;">
+			<tr wicket:id="list" style="background-color: rgb(248, 248, 248); border-bottom: 5px
solid white;">
+				<td>
+					<span wicket:id="roomName">[room name]</span><br/>
+					<wicket:ommessage key="398" />&nbsp;<span wicket:id="curUsers"></span>&nbsp;/&nbsp;<span
+					wicket:id="totalUsers"></span>&nbsp;&nbsp;<span wicket:id="refresh"

+					class="ui-icon ui-icon-arrowrefresh-1-n" style="display: inline-block"></span></td>
+				<td><button><wicket:ommessage key="131"/></button></td>
+			</tr>
+		</table>
 	</wicket:panel>
 </html>

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java?rev=1455412&r1=1455411&r2=1455412&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java
Tue Mar 12 06:01:06 2013
@@ -18,10 +18,23 @@
  */
 package org.apache.openmeetings.web.components.user.rooms;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.openmeetings.data.conference.dao.RoomDao;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.session.SessionManager;
+import org.apache.openmeetings.web.app.Application;
 import org.apache.openmeetings.web.app.WebSession;
 import org.apache.openmeetings.web.components.MenuPanel.MenuParams;
 import org.apache.openmeetings.web.components.UserPanel;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
 
 public class UserRoomsPanel extends UserPanel {
 	private static final long serialVersionUID = -3246259803623925341L;
@@ -29,18 +42,52 @@ public class UserRoomsPanel extends User
 	public UserRoomsPanel(String id, MenuParams param) {
 		super(id);
 
-		long title = 777L;
+		long title, desc;
+		List<Room> rooms;
 		switch (param) {
-		case myTabButton:
-			title = 781L;
-			break;
-		case privateTabButton:
-			title = 779L;
-			break;
-		case publicTabButton:
-		default:
-			break;
+			case myTabButton:
+				title = 781L;
+				desc = 782L;
+				//rooms = Application.getBean(RoomDao.class).getPublicRooms();
+				//FIXME 2 !!!! fake rooms appointmentLogic.getTodaysAppointmentsForUser(users_id);
+				rooms = new ArrayList<Room>();
+				break;
+			case privateTabButton:
+				title = 779L;
+				desc = 780L;
+				//FIXME getRoomsOrganisationByOrganisationId
+				rooms = new ArrayList<Room>();
+				break;
+			case publicTabButton:
+			default:
+				title = 777L;
+				desc = 778L;
+				rooms = Application.getBean(RoomDao.class).getPublicRooms();
+				break;
 		}
 		add(new Label("title", WebSession.getString(title)));
+		add(new Label("desc", WebSession.getString(desc)));
+		add(new ListView<Room>("list", rooms) {
+			private static final long serialVersionUID = 9189085478336224890L;
+
+			@Override
+			protected void populateItem(ListItem<Room> item) {
+				final Room r = item.getModelObject();
+				item.add(new Label("roomName", r.getName()));
+				final IModel<Integer> curUsersModel = new Model<Integer>(Application.getBean(SessionManager.class).getClientListByRoom(r.getRooms_id()).size());

+				final Label curUsers = new Label("curUsers", curUsersModel);
+				item.add(curUsers.setOutputMarkupId(true));
+				item.add(new Label("totalUsers", r.getNumberOfPartizipants()));
+				item.add(new AjaxLink<Void>("refresh") {
+					private static final long serialVersionUID = -3426813755917489787L;
+
+					@Override
+					public void onClick(AjaxRequestTarget target) {
+						curUsersModel.setObject(Application.getBean(SessionManager.class).getClientListByRoom(r.getRooms_id()).size());
+						target.add(curUsers);
+					}
+				});
+			}
+		});
 	}
 }



Mime
View raw message