You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/05/18 05:39:03 UTC
[03/23] openmeetings git commit: Normalize all the line endings
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
index 02be695..eb536de 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/UserSearchPanel.java
@@ -1,154 +1,154 @@
-/*
- * 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.profile;
-
-import static org.apache.openmeetings.web.app.Application.getBean;
-import static org.apache.openmeetings.web.app.Application.isUserOnline;
-import static org.apache.openmeetings.web.app.WebSession.getUserId;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.openmeetings.db.dao.user.UserContactDao;
-import org.apache.openmeetings.db.dao.user.UserDao;
-import org.apache.openmeetings.db.entity.user.User;
-import org.apache.openmeetings.db.util.TimezoneUtil;
-import org.apache.openmeetings.web.common.PagingNavigatorPanel;
-import org.apache.openmeetings.web.common.UserPanel;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-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.Form;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.markup.repeater.data.DataView;
-import org.apache.wicket.markup.repeater.data.IDataProvider;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.PropertyModel;
-
-import com.googlecode.wicket.jquery.core.Options;
-import com.googlecode.wicket.jquery.ui.form.button.AjaxButton;
-import com.googlecode.wicket.jquery.ui.plugins.fixedheadertable.FixedHeaderTableBehavior;
-
-public class UserSearchPanel extends UserPanel {
- private static final long serialVersionUID = 1L;
- private final static List<Integer> itemsPerPage = Arrays.asList(10, 25, 50, 75, 100, 200, 500, 1000, 2500, 5000);
- private String text;
- private String search;
- private String offer;
- private String orderBy = "u.firstname";
- private boolean asc = true;
- private boolean searched = false;
- private final WebMarkupContainer container = new WebMarkupContainer("container");
- private final FixedHeaderTableBehavior fixedHeader = new FixedHeaderTableBehavior("#searchUsersTable", new Options("height", 400));
-
- private void refresh(IPartialPageRequestHandler handler) {
- handler.add(container.add(fixedHeader));
- }
-
- public UserSearchPanel(String id) {
- super(id);
-
- add(new Form<Void>("form") {
- private static final long serialVersionUID = 1L;
- {
- add(new TextField<>("text", new PropertyModel<String>(UserSearchPanel.this, "text")));
- add(new TextField<>("offer", new PropertyModel<String>(UserSearchPanel.this, "offer")));
- add(new TextField<>("search", new PropertyModel<String>(UserSearchPanel.this, "search")));
- add(new AjaxButton("submit") {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target) {
- searched = true;
- refresh(target);
- }
- });
- }
- });
- IDataProvider<User> dp = new IDataProvider<User>() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void detach() {
- }
-
- @Override
- public Iterator<? extends User> iterator(long first, long count) {
- return searched ? getBean(UserDao.class).searchUserProfile(getUserId(), text, offer, search, orderBy, (int)first, (int)count, asc).iterator()
- : new ArrayList<User>().iterator();
- }
-
- @Override
- public long size() {
- return searched ? getBean(UserDao.class).searchCountUserProfile(getUserId(), text, offer, search) : 0;
- }
-
- @Override
- public IModel<User> model(User object) {
- return new CompoundPropertyModel<>(object);
- }
-
- };
- final DataView<User> dw = new DataView<User>("users", dp) {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void populateItem(Item<User> item) {
- final UserContactDao contactsDao = getBean(UserContactDao.class);
- User u = item.getModelObject();
- final long userId = u.getId();
- item.add(new WebMarkupContainer("status").add(AttributeModifier.append("class", isUserOnline(userId) ? "online" : "offline")));
- item.add(new Label("name", getName(u)));
- item.add(new Label("tz", getBean(TimezoneUtil.class).getTimeZone(u).getID()));
- item.add(new Label("offer", u.getUserOffers()));
- item.add(new Label("search", u.getUserSearchs()));
- item.add(new WebMarkupContainer("view").add(AttributeModifier.append("onclick", String.format("showUserInfo(%s);", userId))));
- item.add(new WebMarkupContainer("add").setVisible(userId != getUserId() && !contactsDao.isContact(userId, getUserId()))
- .add(AttributeModifier.append("onclick", String.format("addContact(%s);", userId))));
- item.add(new WebMarkupContainer("message").setVisible(userId != getUserId()).add(AttributeModifier.append("onclick", String.format("privateMessage(%s);", userId))));
- item.add(new WebMarkupContainer("invite").setVisible(userId != getUserId()).add(AttributeModifier.append("onclick", String.format("inviteUser(%s);", userId))));
- //item.add(new TooltipBehavior(new Options("content", "TODO:: Picture will be displayed"))); //FIXME
- }
- };
-
- add(container.add(dw, new PagingNavigatorPanel("navigator", dw, itemsPerPage, 100) {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- refresh(target);
- }
- }).setOutputMarkupId(true));
- }
-
- private static String getName(User u) {
- return "" + u.getFirstname() + " " + u.getLastname() + " [" + u.getLogin() + "]"; //FIXME salutation
- }
-
- @Override
- public void onNewMessageClose(IPartialPageRequestHandler handler) {
- refresh(handler);
- }
-}
+/*
+ * 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.profile;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.Application.isUserOnline;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.openmeetings.db.dao.user.UserContactDao;
+import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.entity.user.User;
+import org.apache.openmeetings.db.util.TimezoneUtil;
+import org.apache.openmeetings.web.common.PagingNavigatorPanel;
+import org.apache.openmeetings.web.common.UserPanel;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+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.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.markup.repeater.data.DataView;
+import org.apache.wicket.markup.repeater.data.IDataProvider;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+
+import com.googlecode.wicket.jquery.core.Options;
+import com.googlecode.wicket.jquery.ui.form.button.AjaxButton;
+import com.googlecode.wicket.jquery.ui.plugins.fixedheadertable.FixedHeaderTableBehavior;
+
+public class UserSearchPanel extends UserPanel {
+ private static final long serialVersionUID = 1L;
+ private final static List<Integer> itemsPerPage = Arrays.asList(10, 25, 50, 75, 100, 200, 500, 1000, 2500, 5000);
+ private String text;
+ private String search;
+ private String offer;
+ private String orderBy = "u.firstname";
+ private boolean asc = true;
+ private boolean searched = false;
+ private final WebMarkupContainer container = new WebMarkupContainer("container");
+ private final FixedHeaderTableBehavior fixedHeader = new FixedHeaderTableBehavior("#searchUsersTable", new Options("height", 400));
+
+ private void refresh(IPartialPageRequestHandler handler) {
+ handler.add(container.add(fixedHeader));
+ }
+
+ public UserSearchPanel(String id) {
+ super(id);
+
+ add(new Form<Void>("form") {
+ private static final long serialVersionUID = 1L;
+ {
+ add(new TextField<>("text", new PropertyModel<String>(UserSearchPanel.this, "text")));
+ add(new TextField<>("offer", new PropertyModel<String>(UserSearchPanel.this, "offer")));
+ add(new TextField<>("search", new PropertyModel<String>(UserSearchPanel.this, "search")));
+ add(new AjaxButton("submit") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ searched = true;
+ refresh(target);
+ }
+ });
+ }
+ });
+ IDataProvider<User> dp = new IDataProvider<User>() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void detach() {
+ }
+
+ @Override
+ public Iterator<? extends User> iterator(long first, long count) {
+ return searched ? getBean(UserDao.class).searchUserProfile(getUserId(), text, offer, search, orderBy, (int)first, (int)count, asc).iterator()
+ : new ArrayList<User>().iterator();
+ }
+
+ @Override
+ public long size() {
+ return searched ? getBean(UserDao.class).searchCountUserProfile(getUserId(), text, offer, search) : 0;
+ }
+
+ @Override
+ public IModel<User> model(User object) {
+ return new CompoundPropertyModel<>(object);
+ }
+
+ };
+ final DataView<User> dw = new DataView<User>("users", dp) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void populateItem(Item<User> item) {
+ final UserContactDao contactsDao = getBean(UserContactDao.class);
+ User u = item.getModelObject();
+ final long userId = u.getId();
+ item.add(new WebMarkupContainer("status").add(AttributeModifier.append("class", isUserOnline(userId) ? "online" : "offline")));
+ item.add(new Label("name", getName(u)));
+ item.add(new Label("tz", getBean(TimezoneUtil.class).getTimeZone(u).getID()));
+ item.add(new Label("offer", u.getUserOffers()));
+ item.add(new Label("search", u.getUserSearchs()));
+ item.add(new WebMarkupContainer("view").add(AttributeModifier.append("onclick", String.format("showUserInfo(%s);", userId))));
+ item.add(new WebMarkupContainer("add").setVisible(userId != getUserId() && !contactsDao.isContact(userId, getUserId()))
+ .add(AttributeModifier.append("onclick", String.format("addContact(%s);", userId))));
+ item.add(new WebMarkupContainer("message").setVisible(userId != getUserId()).add(AttributeModifier.append("onclick", String.format("privateMessage(%s);", userId))));
+ item.add(new WebMarkupContainer("invite").setVisible(userId != getUserId()).add(AttributeModifier.append("onclick", String.format("inviteUser(%s);", userId))));
+ //item.add(new TooltipBehavior(new Options("content", "TODO:: Picture will be displayed"))); //FIXME
+ }
+ };
+
+ add(container.add(dw, new PagingNavigatorPanel("navigator", dw, itemsPerPage, 100) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ refresh(target);
+ }
+ }).setOutputMarkupId(true));
+ }
+
+ private static String getName(User u) {
+ return "" + u.getFirstname() + " " + u.getLastname() + " [" + u.getLogin() + "]"; //FIXME salutation
+ }
+
+ @Override
+ public void onNewMessageClose(IPartialPageRequestHandler handler) {
+ refresh(handler);
+ }
+}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
index acb81c9..4a57ffe 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
@@ -1,62 +1,62 @@
-<?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>
- <table>
- <tr>
- <td style="vertical-align: top">
- <div wicket:id="list"></div>
- </td>
- <td style="vertical-align: top">
- <!-- Users in this Room -->
- <fieldset class="ui-widget-content" wicket:id="details">
- <div class="formelement" style="font-style: italic;">
- <label><wicket:message key="404" /></label>
- </div>
- <div class="formelement">
- <label style="font-weight: bold;"><wicket:message key="406" /></label>
- <span wicket:id="roomName"></span> #<span wicket:id="roomId"></span>
- </div>
- <div class="formelement">
- <label style="font-weight: bold;"><wicket:message key="270" /></label>
- <span wicket:id="roomComment"></span>
- </div>
- <div class="formelement">
- <label><wicket:message key="407" /></label>
- </div>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="clientsContainer">
- <tr wicket:id="clients">
- <td style="width: 50px;"><img wicket:id="clientImage" style="min-width: 50px; height:50px" /></td>
- <td style="width: 350px; height:50px">
- <div style="width: 350px; height:50px"><span wicket:id="clientLogin"></span> <wicket:message key="408"/> <span wicket:id="from"></span></div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </fieldset>
- </td>
- </tr>
- </table>
-</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>
+ <table>
+ <tr>
+ <td style="vertical-align: top">
+ <div wicket:id="list"></div>
+ </td>
+ <td style="vertical-align: top">
+ <!-- Users in this Room -->
+ <fieldset class="ui-widget-content" wicket:id="details">
+ <div class="formelement" style="font-style: italic;">
+ <label><wicket:message key="404" /></label>
+ </div>
+ <div class="formelement">
+ <label style="font-weight: bold;"><wicket:message key="406" /></label>
+ <span wicket:id="roomName"></span> #<span wicket:id="roomId"></span>
+ </div>
+ <div class="formelement">
+ <label style="font-weight: bold;"><wicket:message key="270" /></label>
+ <span wicket:id="roomComment"></span>
+ </div>
+ <div class="formelement">
+ <label><wicket:message key="407" /></label>
+ </div>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="clientsContainer">
+ <tr wicket:id="clients">
+ <td style="width: 50px;"><img wicket:id="clientImage" style="min-width: 50px; height:50px" /></td>
+ <td style="width: 350px; height:50px">
+ <div style="width: 350px; height:50px"><span wicket:id="clientLogin"></span> <wicket:message key="408"/> <span wicket:id="from"></span></div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </fieldset>
+ </td>
+ </tr>
+ </table>
+</wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
index 6399fd0..1bd414c 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
@@ -1,137 +1,137 @@
-/*
- * 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.rooms;
-
-import static org.apache.openmeetings.web.app.Application.getBean;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.openmeetings.db.dao.room.RoomDao;
-import org.apache.openmeetings.db.dao.user.UserDao;
-import org.apache.openmeetings.db.entity.basic.Client;
-import org.apache.openmeetings.db.entity.room.Room;
-import org.apache.openmeetings.util.OmFileHelper;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.common.UserPanel;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.Image;
-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;
-import org.apache.wicket.request.resource.ByteArrayResource;
-import org.apache.wicket.util.io.IOUtils;
-
-public class RoomsPanel extends UserPanel {
- private static final long serialVersionUID = 1L;
- private final WebMarkupContainer clientsContainer = new WebMarkupContainer("clientsContainer");
- private final WebMarkupContainer details = new WebMarkupContainer("details");
- private final ListView<Client> clients;
- private IModel<Long> roomID = Model.of((Long)null);
- private IModel<String> roomName = Model.of((String)null);
- private IModel<String> roomComment = Model.of((String)null);
- private List<Client> clientsInRoom = null;
- private Long roomId = 0L;
-
- public RoomsPanel(String id, List<Room> rooms) {
- super(id);
- add(new RoomListPanel("list", rooms, Application.getString(131)) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onContainerClick(AjaxRequestTarget target, Room r) {
- roomId = r.getId();
- updateRoomDetails(target);
- }
-
- @Override
- public void onRefreshClick(AjaxRequestTarget target, Room r) {
- super.onRefreshClick(target, r);
- roomId = r.getId();
- updateRoomDetails(target);
- }
- });
-
- // Users in this Room
- add(details.setOutputMarkupId(true).setVisible(rooms.size() > 0));
- details.add(new Label("roomId", roomID));
- details.add(new Label("roomName", roomName));
- details.add(new Label("roomComment", roomComment));
- clients = new ListView<Client>("clients", clientsInRoom){
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void populateItem(final ListItem<Client> item) {
- Client client = item.getModelObject();
- final Long userId = client.getUserId();
- item.add(new Image("clientImage", new ByteArrayResource("image/jpeg") {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected ResourceResponse newResourceResponse(Attributes attributes) {
- ResourceResponse rr = super.newResourceResponse(attributes);
- rr.disableCaching();
- return rr;
- }
-
- @Override
- protected byte[] getData(Attributes attributes) {
- String uri = null;
- if (userId != null) {
- uri = getBean(UserDao.class).get(userId > 0 ? userId : -userId).getPictureuri();
- }
- File img = OmFileHelper.getUserProfilePicture(userId, uri);
- try (InputStream is = new FileInputStream(img)) {
- return IOUtils.toByteArray(is);
- } catch (Exception e) {
- //no-op
- }
- return null;
- }
- }));
- item.add(new Label("clientLogin", client.getUser().getLogin()));
- item.add(new Label("from", client.getConnectedSince()));
- }
- };
- details.add(clientsContainer.add(clients.setOutputMarkupId(true)).setOutputMarkupId(true));
- }
-
- void updateRoomDetails(AjaxRequestTarget target) {
- final List<Client> clientsInRoom = Application.getRoomClients(roomId);
- clients.setDefaultModelObject(clientsInRoom);
- Room room = getBean(RoomDao.class).get(roomId);
- roomID.setObject(room.getId());
- roomName.setObject(room.getName());
- roomComment.setObject(room.getComment());
- target.add(clientsContainer, details);
- }
-
- @Override
- protected void onDetach() {
- roomID.detach();
- roomName.detach();
- roomComment.detach();
- super.onDetach();
- }
-}
+/*
+ * 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.rooms;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.entity.basic.Client;
+import org.apache.openmeetings.db.entity.room.Room;
+import org.apache.openmeetings.util.OmFileHelper;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.common.UserPanel;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+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;
+import org.apache.wicket.request.resource.ByteArrayResource;
+import org.apache.wicket.util.io.IOUtils;
+
+public class RoomsPanel extends UserPanel {
+ private static final long serialVersionUID = 1L;
+ private final WebMarkupContainer clientsContainer = new WebMarkupContainer("clientsContainer");
+ private final WebMarkupContainer details = new WebMarkupContainer("details");
+ private final ListView<Client> clients;
+ private IModel<Long> roomID = Model.of((Long)null);
+ private IModel<String> roomName = Model.of((String)null);
+ private IModel<String> roomComment = Model.of((String)null);
+ private List<Client> clientsInRoom = null;
+ private Long roomId = 0L;
+
+ public RoomsPanel(String id, List<Room> rooms) {
+ super(id);
+ add(new RoomListPanel("list", rooms, Application.getString(131)) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void onContainerClick(AjaxRequestTarget target, Room r) {
+ roomId = r.getId();
+ updateRoomDetails(target);
+ }
+
+ @Override
+ public void onRefreshClick(AjaxRequestTarget target, Room r) {
+ super.onRefreshClick(target, r);
+ roomId = r.getId();
+ updateRoomDetails(target);
+ }
+ });
+
+ // Users in this Room
+ add(details.setOutputMarkupId(true).setVisible(rooms.size() > 0));
+ details.add(new Label("roomId", roomID));
+ details.add(new Label("roomName", roomName));
+ details.add(new Label("roomComment", roomComment));
+ clients = new ListView<Client>("clients", clientsInRoom){
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void populateItem(final ListItem<Client> item) {
+ Client client = item.getModelObject();
+ final Long userId = client.getUserId();
+ item.add(new Image("clientImage", new ByteArrayResource("image/jpeg") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(Attributes attributes) {
+ ResourceResponse rr = super.newResourceResponse(attributes);
+ rr.disableCaching();
+ return rr;
+ }
+
+ @Override
+ protected byte[] getData(Attributes attributes) {
+ String uri = null;
+ if (userId != null) {
+ uri = getBean(UserDao.class).get(userId > 0 ? userId : -userId).getPictureuri();
+ }
+ File img = OmFileHelper.getUserProfilePicture(userId, uri);
+ try (InputStream is = new FileInputStream(img)) {
+ return IOUtils.toByteArray(is);
+ } catch (Exception e) {
+ //no-op
+ }
+ return null;
+ }
+ }));
+ item.add(new Label("clientLogin", client.getUser().getLogin()));
+ item.add(new Label("from", client.getConnectedSince()));
+ }
+ };
+ details.add(clientsContainer.add(clients.setOutputMarkupId(true)).setOutputMarkupId(true));
+ }
+
+ void updateRoomDetails(AjaxRequestTarget target) {
+ final List<Client> clientsInRoom = Application.getRoomClients(roomId);
+ clients.setDefaultModelObject(clientsInRoom);
+ Room room = getBean(RoomDao.class).get(roomId);
+ roomID.setObject(room.getId());
+ roomName.setObject(room.getName());
+ roomComment.setObject(room.getComment());
+ target.add(clientsContainer, details);
+ }
+
+ @Override
+ protected void onDetach() {
+ roomID.detach();
+ roomName.detach();
+ roomComment.detach();
+ super.onDetach();
+ }
+}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.html
index dde60ba..f433301 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.html
@@ -1,27 +1,27 @@
-<?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="title" class="rooms title"></div>
- <div wicket:id="desc" class="rooms desc info-text"></div>
- <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="title" class="rooms title"></div>
+ <div wicket:id="desc" class="rooms desc info-text"></div>
+ <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/rooms/RoomsSelectorPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.java
index eb0ef24..b931e24 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsSelectorPanel.java
@@ -1,56 +1,56 @@
-/*
- * 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.rooms;
-
-import org.apache.openmeetings.db.dao.room.RoomDao;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.common.UserPanel;
-import org.apache.openmeetings.web.util.OmUrlFragment.MenuParams;
-import org.apache.wicket.markup.html.basic.Label;
-
-public class RoomsSelectorPanel extends UserPanel {
- private static final long serialVersionUID = 1L;
-
- public RoomsSelectorPanel(String id, MenuParams param) {
- super(id);
-
- long title, desc;
- RoomDao roomDao = Application.getBean(RoomDao.class);
- switch (param) {
- case myTabButton:
- title = 781L;
- desc = 782L;
- add(new RoomsPanel("rooms", getMyRooms()));
- break;
- case privateTabButton:
- title = 779L;
- desc = 780L;
- add(new RoomsTabbedPanel("rooms"));
- break;
- case publicTabButton:
- default:
- title = 777L;
- desc = 778L;
- add(new RoomsPanel("rooms", roomDao.getPublicRooms()));
- break;
- }
- add(new Label("title", Application.getString(title)));
- add(new Label("desc", Application.getString(desc)));
- }
-}
+/*
+ * 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.rooms;
+
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.common.UserPanel;
+import org.apache.openmeetings.web.util.OmUrlFragment.MenuParams;
+import org.apache.wicket.markup.html.basic.Label;
+
+public class RoomsSelectorPanel extends UserPanel {
+ private static final long serialVersionUID = 1L;
+
+ public RoomsSelectorPanel(String id, MenuParams param) {
+ super(id);
+
+ long title, desc;
+ RoomDao roomDao = Application.getBean(RoomDao.class);
+ switch (param) {
+ case myTabButton:
+ title = 781L;
+ desc = 782L;
+ add(new RoomsPanel("rooms", getMyRooms()));
+ break;
+ case privateTabButton:
+ title = 779L;
+ desc = 780L;
+ add(new RoomsTabbedPanel("rooms"));
+ break;
+ case publicTabButton:
+ default:
+ title = 777L;
+ desc = 778L;
+ add(new RoomsPanel("rooms", roomDao.getPublicRooms()));
+ break;
+ }
+ add(new Label("title", Application.getString(title)));
+ add(new Label("desc", Application.getString(desc)));
+ }
+}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.html
index b8aa48b..a92599d 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.html
@@ -1,30 +1,30 @@
-<?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 id="orgTabs">
- <ul>
- <li wicket:id="orgTabs"><a wicket:id="link"><wicket:container wicket:id="name"></wicket:container></a></li>
- </ul>
- <wicket:container wicket:id="orgRooms"><div wicket:id="rooms"></div></wicket:container>
- </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 id="orgTabs">
+ <ul>
+ <li wicket:id="orgTabs"><a wicket:id="link"><wicket:container wicket:id="name"></wicket:container></a></li>
+ </ul>
+ <wicket:container wicket:id="orgRooms"><div wicket:id="rooms"></div></wicket:container>
+ </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/rooms/RoomsTabbedPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.java
index 89eaa24..f73a2d9 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/rooms/RoomsTabbedPanel.java
@@ -1,70 +1,70 @@
-/*
- * 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.rooms;
-
-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.db.dao.user.UserDao;
-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.web.common.UserPanel;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-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.Model;
-
-import com.googlecode.wicket.jquery.core.JQueryBehavior;
-
-public class RoomsTabbedPanel extends UserPanel {
- private static final long serialVersionUID = 3642004664480074881L;
-
- public RoomsTabbedPanel(String id) {
- super(id);
-
- User u = getBean(UserDao.class).get(getUserId());
- add(new ListView<GroupUser>("orgTabs", u.getGroupUsers()) {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void populateItem(ListItem<GroupUser> item) {
- Group org = item.getModelObject().getGroup();
- item.add(new WebMarkupContainer("link")
- .add(new Label("name", Model.of(org.getName())))
- .add(new AttributeModifier("href", "#org" + org.getId())));
- }
- });
- add(new ListView<GroupUser>("orgRooms", u.getGroupUsers()) {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void populateItem(ListItem<GroupUser> item) {
- Group org = item.getModelObject().getGroup();
- item.add(new RoomsPanel("rooms"
- , getBean(RoomDao.class).getGroupRooms(org.getId()))
- .setMarkupId("org" + org.getId())).setRenderBodyOnly(true);
- }
- });
- add(new JQueryBehavior("#orgTabs", "tabs"));
- }
-}
+/*
+ * 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.rooms;
+
+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.db.dao.user.UserDao;
+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.web.common.UserPanel;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+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.Model;
+
+import com.googlecode.wicket.jquery.core.JQueryBehavior;
+
+public class RoomsTabbedPanel extends UserPanel {
+ private static final long serialVersionUID = 3642004664480074881L;
+
+ public RoomsTabbedPanel(String id) {
+ super(id);
+
+ User u = getBean(UserDao.class).get(getUserId());
+ add(new ListView<GroupUser>("orgTabs", u.getGroupUsers()) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void populateItem(ListItem<GroupUser> item) {
+ Group org = item.getModelObject().getGroup();
+ item.add(new WebMarkupContainer("link")
+ .add(new Label("name", Model.of(org.getName())))
+ .add(new AttributeModifier("href", "#org" + org.getId())));
+ }
+ });
+ add(new ListView<GroupUser>("orgRooms", u.getGroupUsers()) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void populateItem(ListItem<GroupUser> item) {
+ Group org = item.getModelObject().getGroup();
+ item.add(new RoomsPanel("rooms"
+ , getBean(RoomDao.class).getGroupRooms(org.getId()))
+ .setMarkupId("org" + org.getId())).setRenderBodyOnly(true);
+ }
+ });
+ add(new JQueryBehavior("#orgTabs", "tabs"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/webapp/conf/om_ldap.cfg
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/webapp/conf/om_ldap.cfg b/openmeetings-web/src/main/webapp/conf/om_ldap.cfg
index 4415d8f..e65436c 100644
--- a/openmeetings-web/src/main/webapp/conf/om_ldap.cfg
+++ b/openmeetings-web/src/main/webapp/conf/om_ldap.cfg
@@ -1,109 +1,109 @@
-#
-# 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.
-#
-#ConfigurationFile for LDAP Auth
-#ConfigKey 'ldap_config_path' must be set in DataBase Configration of OM and point to this file
-#o.becherer,14.01.2009
-
-#LDAP URL
-# This is the URL used to access your LDAP server.
-# if you want to use "ldaps://" links, please be aware that you need to import your CA certificate
-# to a java keystore and add the -Djavax.net.ssl.keyStore, -Djavax.net.ssl.keyStorePassword,
-# -Djavax.net.ssl.trustStore and -Djavax.net.ssl.trustStorePassword parameters to your
-# JAVA_OPT environment
-ldap_conn_host=dc2.medint.local
-ldap_conn_port=389
-ldap_conn_secure=false
-
-# Login distinguished name (DN) for Authentication on LDAP Server - keep empty if not required
-# Use full qualified LDAP DN
-ldap_admin_dn=CN=dummy,OU=Company,DC=medint,DC=local
-
-# Loginpass for Authentication on LDAP Server - keep empty if not required
-ldap_passwd=dummy07
-
-# base to search for userdata(of user, that wants to login)
-ldap_search_base=OU=Company,DC=medint,DC=local
-
-# Fieldnames (can differ between Ldap servers)
-ldap_search_query=(uid=%s)
-
-# the scope of the search might be: OBJECT, ONELEVEL, SUBTREE
-ldap_search_scope=ONELEVEL
-
-# Ldap auth type(NONE, SEARCHANDBIND, SIMPLEBIND)
-# When using SIMPLEBIND a simple bind is performed on the LDAP server to check user authentication
-# When using NONE, the Ldap server is not used for authentication
-ldap_auth_type=SIMPLEBIND
-
-# userDN format, will be used to bind if ldap_auth_type=SIMPLEBIND
-# might be used to get provisionningDn in case ldap_auth_type=NONE
-ldap_userdn_format=uid=%s,OU=Company,DC=medint,DC=local
-
-# Ldap provisioning type(NONE, AUTOCREATE, AUTOUPDATE)
-ldap_provisionning=AUTOCREATE
-
-# Ldap deref mode (never, searching, finding, always)
-ldap_deref_mode=always
-
-# Set this to 'true' if you want to use admin_dn to get user attributes
-# If any other value is set, user_dn will be used
-ldap_use_admin_to_get_attrs=true
-
-# Ldap-password synchronization to OM DB
-# Set this to 'true' if you want OM to synchronize the user Ldap-password to OM's internal DB
-# If you want to disable the feature, set this to any other string.
-# Defautl value is 'true'
-ldap_sync_password_to_om=true
-
-# Ldap group mode (NONE, ATTRIBUTE, QUERY)
-# NONE means group associations will be ignored
-# ATTRIBUTE means group associations will be taken from 'ldap_group_attr' attribute (M$ AD mode)
-# QUERY means group associations will be taken as a result of 'ldap_group_query' query
-ldap_group_mode=NONE
-
-ldap_group_query=(&(memberUid=%s)(objectClass=posixGroup))
-
-# Ldap user attributes mapping
-# Set the following internal OM user attributes to their corresponding Ldap-attribute
-ldap_user_attr_login=uid
-ldap_user_attr_lastname=sn
-ldap_user_attr_firstname=givenName
-ldap_user_attr_mail=mail
-ldap_user_attr_street=streetAddress
-ldap_user_attr_additionalname=description
-ldap_user_attr_fax=facsimileTelephoneNumber
-ldap_user_attr_zip=postalCode
-ldap_user_attr_country=co
-ldap_user_attr_town=l
-ldap_user_attr_phone=telephoneNumber
-ldap_group_attr=memberOf
-
-# optional, only absolute URLs make sense
-#ldap_user_picture_uri=picture_uri
-
-# optional
-# the timezone has to match any timezone available in Java, otherwise the timezone defined in the value of
-# the conf_key "default.timezone" in OpenMeetings "configurations" table
-#ldap_user_timezone=timezone
-
-# Ldap ignore upper/lower case, convert all input to lower case
-ldap_use_lower_case=false
-
-# Ldap import query, this query should retrieve all LDAP users
-ldap_import_query=(objectClass=inetOrgPerson)
+#
+# 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.
+#
+#ConfigurationFile for LDAP Auth
+#ConfigKey 'ldap_config_path' must be set in DataBase Configration of OM and point to this file
+#o.becherer,14.01.2009
+
+#LDAP URL
+# This is the URL used to access your LDAP server.
+# if you want to use "ldaps://" links, please be aware that you need to import your CA certificate
+# to a java keystore and add the -Djavax.net.ssl.keyStore, -Djavax.net.ssl.keyStorePassword,
+# -Djavax.net.ssl.trustStore and -Djavax.net.ssl.trustStorePassword parameters to your
+# JAVA_OPT environment
+ldap_conn_host=dc2.medint.local
+ldap_conn_port=389
+ldap_conn_secure=false
+
+# Login distinguished name (DN) for Authentication on LDAP Server - keep empty if not required
+# Use full qualified LDAP DN
+ldap_admin_dn=CN=dummy,OU=Company,DC=medint,DC=local
+
+# Loginpass for Authentication on LDAP Server - keep empty if not required
+ldap_passwd=dummy07
+
+# base to search for userdata(of user, that wants to login)
+ldap_search_base=OU=Company,DC=medint,DC=local
+
+# Fieldnames (can differ between Ldap servers)
+ldap_search_query=(uid=%s)
+
+# the scope of the search might be: OBJECT, ONELEVEL, SUBTREE
+ldap_search_scope=ONELEVEL
+
+# Ldap auth type(NONE, SEARCHANDBIND, SIMPLEBIND)
+# When using SIMPLEBIND a simple bind is performed on the LDAP server to check user authentication
+# When using NONE, the Ldap server is not used for authentication
+ldap_auth_type=SIMPLEBIND
+
+# userDN format, will be used to bind if ldap_auth_type=SIMPLEBIND
+# might be used to get provisionningDn in case ldap_auth_type=NONE
+ldap_userdn_format=uid=%s,OU=Company,DC=medint,DC=local
+
+# Ldap provisioning type(NONE, AUTOCREATE, AUTOUPDATE)
+ldap_provisionning=AUTOCREATE
+
+# Ldap deref mode (never, searching, finding, always)
+ldap_deref_mode=always
+
+# Set this to 'true' if you want to use admin_dn to get user attributes
+# If any other value is set, user_dn will be used
+ldap_use_admin_to_get_attrs=true
+
+# Ldap-password synchronization to OM DB
+# Set this to 'true' if you want OM to synchronize the user Ldap-password to OM's internal DB
+# If you want to disable the feature, set this to any other string.
+# Defautl value is 'true'
+ldap_sync_password_to_om=true
+
+# Ldap group mode (NONE, ATTRIBUTE, QUERY)
+# NONE means group associations will be ignored
+# ATTRIBUTE means group associations will be taken from 'ldap_group_attr' attribute (M$ AD mode)
+# QUERY means group associations will be taken as a result of 'ldap_group_query' query
+ldap_group_mode=NONE
+
+ldap_group_query=(&(memberUid=%s)(objectClass=posixGroup))
+
+# Ldap user attributes mapping
+# Set the following internal OM user attributes to their corresponding Ldap-attribute
+ldap_user_attr_login=uid
+ldap_user_attr_lastname=sn
+ldap_user_attr_firstname=givenName
+ldap_user_attr_mail=mail
+ldap_user_attr_street=streetAddress
+ldap_user_attr_additionalname=description
+ldap_user_attr_fax=facsimileTelephoneNumber
+ldap_user_attr_zip=postalCode
+ldap_user_attr_country=co
+ldap_user_attr_town=l
+ldap_user_attr_phone=telephoneNumber
+ldap_group_attr=memberOf
+
+# optional, only absolute URLs make sense
+#ldap_user_picture_uri=picture_uri
+
+# optional
+# the timezone has to match any timezone available in Java, otherwise the timezone defined in the value of
+# the conf_key "default.timezone" in OpenMeetings "configurations" table
+#ldap_user_timezone=timezone
+
+# Ldap ignore upper/lower case, convert all input to lower case
+ldap_use_lower_case=false
+
+# Ldap import query, this query should retrieve all LDAP users
+ldap_import_query=(objectClass=inetOrgPerson)
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/webapp/languages/errorvalues.xsd
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/webapp/languages/errorvalues.xsd b/openmeetings-web/src/main/webapp/languages/errorvalues.xsd
index 66f06d1..5acb78a 100644
--- a/openmeetings-web/src/main/webapp/languages/errorvalues.xsd
+++ b/openmeetings-web/src/main/webapp/languages/errorvalues.xsd
@@ -1,41 +1,41 @@
-<?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.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="ROOT">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" ref="row"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="row">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" ref="field"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="field">
- <xs:complexType mixed="true">
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- </xs:complexType>
- </xs:element>
-</xs:schema>
+<?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.
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="ROOT">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="row"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="row">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="field"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="field">
+ <xs:complexType mixed="true">
+ <xs:attribute name="name" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/site/site.xml
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/site/site.xml b/openmeetings-web/src/site/site.xml
index b7a0eae..dd3dc53 100644
--- a/openmeetings-web/src/site/site.xml
+++ b/openmeetings-web/src/site/site.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
- -->
-<project xmlns="http://maven.apache.org/DECORATION/1.7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.7.0 http://maven.apache.org/xsd/decoration-1.7.0.xsd"
- name="Apache OpenMeetings Project">
-
- <body>
- <menu ref="parent"/>
- <menu name="Project">
- <item name="About" href="/index.html" />
- <item name="Info" href="/project-info.html" />
- <item name="Summary" href="/project-summary.html" />
- <item name="License" href="/license.html" />
- <item name="Dependencies" href="/dependencies.html" />
- <item name="Dependency Convergence" href="/dependency-convergence.html" />
- <item name="RAT Report" href="/rat-report.html" />
- </menu>
- </body>
- <custom>
- <reflowSkin>
- <bottomNav maxSpan="12">
- <column>Parent Project</column>
- <column>Project</column>
- </bottomNav>
- </reflowSkin>
- </custom>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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.
+ -->
+<project xmlns="http://maven.apache.org/DECORATION/1.7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.7.0 http://maven.apache.org/xsd/decoration-1.7.0.xsd"
+ name="Apache OpenMeetings Project">
+
+ <body>
+ <menu ref="parent"/>
+ <menu name="Project">
+ <item name="About" href="/index.html" />
+ <item name="Info" href="/project-info.html" />
+ <item name="Summary" href="/project-summary.html" />
+ <item name="License" href="/license.html" />
+ <item name="Dependencies" href="/dependencies.html" />
+ <item name="Dependency Convergence" href="/dependency-convergence.html" />
+ <item name="RAT Report" href="/rat-report.html" />
+ </menu>
+ </body>
+ <custom>
+ <reflowSkin>
+ <bottomNav maxSpan="12">
+ <column>Parent Project</column>
+ <column>Project</column>
+ </bottomNav>
+ </reflowSkin>
+ </custom>
+</project>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/test/java/org/apache/openmeetings/test/AbstractWicketTester.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/test/java/org/apache/openmeetings/test/AbstractWicketTester.java b/openmeetings-web/src/test/java/org/apache/openmeetings/test/AbstractWicketTester.java
index 8775f82..bcf8aad 100644
--- a/openmeetings-web/src/test/java/org/apache/openmeetings/test/AbstractWicketTester.java
+++ b/openmeetings-web/src/test/java/org/apache/openmeetings/test/AbstractWicketTester.java
@@ -1,77 +1,77 @@
-/*
- * 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.test;
-
-import static org.apache.openmeetings.db.util.ApplicationHelper.getWicketTester;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.openmeetings.db.entity.user.User.Type;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.wicket.util.lang.Args;
-import org.apache.wicket.util.tester.WicketTester;
-import org.junit.After;
-
-import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog;
-import com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior;
-
-public class AbstractWicketTester extends AbstractJUnitDefaults {
- protected WicketTester tester;
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- tester = getWicketTester();
- assertNotNull("Web session should not be null", WebSession.get());
- }
-
- public void login(String login, String password) {
- if (login != null && password != null) {
- WebSession.get().signIn(login, password, Type.user, null);
- } else {
- WebSession.get().signIn(username, userpass, Type.user, null);
- }
- assertTrue("Web session is not signed in for user: " + (login != null ? login : username), WebSession.get().isSignedIn());
- }
-
- @After
- public void tearDown() {
- if (tester != null) {
- //can be null in case exception on initialization
- tester.destroy();
- }
- }
-
- public <T extends Serializable> ButtonAjaxBehavior getButtonBehavior(String path, String name) {
- Args.notNull(path, "path");
- Args.notNull(name, "name");
- @SuppressWarnings("unchecked")
- AbstractDialog<T> dialog = (AbstractDialog<T>)tester.getComponentFromLastRenderedPage(path);
- List<ButtonAjaxBehavior> bl = dialog.getBehaviors(ButtonAjaxBehavior.class);
- for (ButtonAjaxBehavior bb : bl) {
- if (name.equals(bb.getButton().getName())) {
- return bb;
- }
- }
- return null;
- }
-}
+/*
+ * 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.test;
+
+import static org.apache.openmeetings.db.util.ApplicationHelper.getWicketTester;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.openmeetings.db.entity.user.User.Type;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.util.lang.Args;
+import org.apache.wicket.util.tester.WicketTester;
+import org.junit.After;
+
+import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog;
+import com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior;
+
+public class AbstractWicketTester extends AbstractJUnitDefaults {
+ protected WicketTester tester;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ tester = getWicketTester();
+ assertNotNull("Web session should not be null", WebSession.get());
+ }
+
+ public void login(String login, String password) {
+ if (login != null && password != null) {
+ WebSession.get().signIn(login, password, Type.user, null);
+ } else {
+ WebSession.get().signIn(username, userpass, Type.user, null);
+ }
+ assertTrue("Web session is not signed in for user: " + (login != null ? login : username), WebSession.get().isSignedIn());
+ }
+
+ @After
+ public void tearDown() {
+ if (tester != null) {
+ //can be null in case exception on initialization
+ tester.destroy();
+ }
+ }
+
+ public <T extends Serializable> ButtonAjaxBehavior getButtonBehavior(String path, String name) {
+ Args.notNull(path, "path");
+ Args.notNull(name, "name");
+ @SuppressWarnings("unchecked")
+ AbstractDialog<T> dialog = (AbstractDialog<T>)tester.getComponentFromLastRenderedPage(path);
+ List<ButtonAjaxBehavior> bl = dialog.getBehaviors(ButtonAjaxBehavior.class);
+ for (ButtonAjaxBehavior bb : bl) {
+ if (name.equals(bb.getButton().getName())) {
+ return bb;
+ }
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/test/java/org/apache/openmeetings/test/backup/TestOldBackups.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/test/java/org/apache/openmeetings/test/backup/TestOldBackups.java b/openmeetings-web/src/test/java/org/apache/openmeetings/test/backup/TestOldBackups.java
index 4ea4078..c3914a6 100644
--- a/openmeetings-web/src/test/java/org/apache/openmeetings/test/backup/TestOldBackups.java
+++ b/openmeetings-web/src/test/java/org/apache/openmeetings/test/backup/TestOldBackups.java
@@ -1,128 +1,128 @@
-/*
- * 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.test.backup;
-
-import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT_KEY;
-import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.openmeetings.backup.BackupImport;
-import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
-import org.apache.openmeetings.db.dao.calendar.MeetingMemberDao;
-import org.apache.openmeetings.db.dao.room.RoomDao;
-import org.apache.openmeetings.db.dao.room.RoomGroupDao;
-import org.apache.openmeetings.db.dao.user.GroupDao;
-import org.apache.openmeetings.db.dao.user.UserDao;
-import org.apache.openmeetings.db.entity.basic.Configuration;
-import org.apache.openmeetings.test.AbstractJUnitDefaults;
-import org.junit.After;
-import org.junit.Test;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class TestOldBackups extends AbstractJUnitDefaults {
- private static final Logger log = Red5LoggerFactory.getLogger(TestOldBackups.class, webAppRootKey);
-
- @Autowired
- private BackupImport backupController;
- @Autowired
- private GroupDao groupDao;
- @Autowired
- private UserDao userDao;
- @Autowired
- private RoomDao roomDao;
- @Autowired
- private AppointmentDao appointmentDao;
- @Autowired
- private MeetingMemberDao meetingMemberDao;
- @Autowired
- private RoomGroupDao roomGroupDao;
- private String cryptClass = null;
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- // Crypt class need to be preserved here to avoid overriding by backup import
- cryptClass = cfgDao.getCryptKey();
- }
-
- @After
- public void tearDown() {
- List<Configuration> cfgs = cfgDao.get(CONFIG_CRYPT_KEY);
- assertNotNull("Not null list should be returned", cfgs);
- assertEquals("There should be exactly 1 item", 1, cfgs.size());
- Configuration c = cfgs.get(0);
- c.setValue(cryptClass);
- cfgDao.update(c, null);
- }
-
- @Test
- public void importOldVersions() {
- String backupsDir = System.getProperty("backups.dir", ".");
- File backupsHome = new File(backupsDir);
-
- if (!backupsHome.exists() || !backupsHome.isDirectory()) {
- fail("Invalid directory is specified for backup files: " + backupsDir);
- }
- long groupCount = 0;
- long userCount = 0;
- long roomCount = 0;
- long roomGroupCount = 0;
- long apptCount = 0;
- long meetingMembersCount = 0;
- for (File backup : backupsHome.listFiles()) {
- String name = backup.getName();
- log.debug("Import of backup file : '" + name + "' is started ...");
- try (InputStream is = new FileInputStream(backup)) {
- backupController.performImport(is);
- long newGroupCount = groupDao.count();
- long newUserCount = userDao.count();
- long newRoomCount = roomDao.count();
- long newRoomGroupCount = roomGroupDao.get().size();
- long newApptCount = appointmentDao.get().size();
- long newMeetingMembersCount = meetingMemberDao.getMeetingMembers().size();
- assertTrue("Zero groups were imported from " + name, newGroupCount > groupCount);
- assertTrue("Zero users were imported from " + name, newUserCount > userCount);
- assertTrue("Zero rooms were imported from " + name, newRoomCount > roomCount);
- assertTrue("Zero room groups were imported from " + name, newRoomGroupCount > roomGroupCount);
- assertTrue("Zero appointments were imported from " + name, newApptCount > apptCount);
- assertTrue("Zero meeting members were imported from " + name, newMeetingMembersCount > meetingMembersCount);
-
- groupCount = newGroupCount;
- userCount = newUserCount;
- roomCount = newRoomCount;
- roomGroupCount = newRoomGroupCount;
- apptCount = newApptCount;
- meetingMembersCount = newMeetingMembersCount;
- } catch (Exception e) {
- throw new RuntimeException("Unexpected exception while importing backup: " + name, e);
- }
- log.debug("... Done.");
- }
- }
-}
+/*
+ * 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.test.backup;
+
+import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT_KEY;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.openmeetings.backup.BackupImport;
+import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
+import org.apache.openmeetings.db.dao.calendar.MeetingMemberDao;
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.dao.room.RoomGroupDao;
+import org.apache.openmeetings.db.dao.user.GroupDao;
+import org.apache.openmeetings.db.dao.user.UserDao;
+import org.apache.openmeetings.db.entity.basic.Configuration;
+import org.apache.openmeetings.test.AbstractJUnitDefaults;
+import org.junit.After;
+import org.junit.Test;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class TestOldBackups extends AbstractJUnitDefaults {
+ private static final Logger log = Red5LoggerFactory.getLogger(TestOldBackups.class, webAppRootKey);
+
+ @Autowired
+ private BackupImport backupController;
+ @Autowired
+ private GroupDao groupDao;
+ @Autowired
+ private UserDao userDao;
+ @Autowired
+ private RoomDao roomDao;
+ @Autowired
+ private AppointmentDao appointmentDao;
+ @Autowired
+ private MeetingMemberDao meetingMemberDao;
+ @Autowired
+ private RoomGroupDao roomGroupDao;
+ private String cryptClass = null;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ // Crypt class need to be preserved here to avoid overriding by backup import
+ cryptClass = cfgDao.getCryptKey();
+ }
+
+ @After
+ public void tearDown() {
+ List<Configuration> cfgs = cfgDao.get(CONFIG_CRYPT_KEY);
+ assertNotNull("Not null list should be returned", cfgs);
+ assertEquals("There should be exactly 1 item", 1, cfgs.size());
+ Configuration c = cfgs.get(0);
+ c.setValue(cryptClass);
+ cfgDao.update(c, null);
+ }
+
+ @Test
+ public void importOldVersions() {
+ String backupsDir = System.getProperty("backups.dir", ".");
+ File backupsHome = new File(backupsDir);
+
+ if (!backupsHome.exists() || !backupsHome.isDirectory()) {
+ fail("Invalid directory is specified for backup files: " + backupsDir);
+ }
+ long groupCount = 0;
+ long userCount = 0;
+ long roomCount = 0;
+ long roomGroupCount = 0;
+ long apptCount = 0;
+ long meetingMembersCount = 0;
+ for (File backup : backupsHome.listFiles()) {
+ String name = backup.getName();
+ log.debug("Import of backup file : '" + name + "' is started ...");
+ try (InputStream is = new FileInputStream(backup)) {
+ backupController.performImport(is);
+ long newGroupCount = groupDao.count();
+ long newUserCount = userDao.count();
+ long newRoomCount = roomDao.count();
+ long newRoomGroupCount = roomGroupDao.get().size();
+ long newApptCount = appointmentDao.get().size();
+ long newMeetingMembersCount = meetingMemberDao.getMeetingMembers().size();
+ assertTrue("Zero groups were imported from " + name, newGroupCount > groupCount);
+ assertTrue("Zero users were imported from " + name, newUserCount > userCount);
+ assertTrue("Zero rooms were imported from " + name, newRoomCount > roomCount);
+ assertTrue("Zero room groups were imported from " + name, newRoomGroupCount > roomGroupCount);
+ assertTrue("Zero appointments were imported from " + name, newApptCount > apptCount);
+ assertTrue("Zero meeting members were imported from " + name, newMeetingMembersCount > meetingMembersCount);
+
+ groupCount = newGroupCount;
+ userCount = newUserCount;
+ roomCount = newRoomCount;
+ roomGroupCount = newRoomGroupCount;
+ apptCount = newApptCount;
+ meetingMembersCount = newMeetingMembersCount;
+ } catch (Exception e) {
+ throw new RuntimeException("Unexpected exception while importing backup: " + name, e);
+ }
+ log.debug("... Done.");
+ }
+ }
+}