<%@ page contentType="text/html; charset=UTF-8" %> <%-- - - Copyright (C) 2004-2008 Jive Software, 2017-2025 Ignite Realtime Foundation. All rights reserved. - - 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. --%> <%@ page import="org.jivesoftware.util.*, org.jivesoftware.openfire.muc.MUCRoom, java.util.*, java.net.URLEncoder" errorPage="error.jsp" %> <%@ page import="org.jivesoftware.openfire.muc.MultiUserChatService" %> <%@ page import="org.xmpp.packet.JID" %> <%@ page import="java.util.stream.Collectors" %> <%@ page import="java.nio.charset.StandardCharsets" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib prefix="admin" uri="admin" %> <% webManager.init(request, response, session, application, out ); %> <% // Get parameters String mucname = ParamUtils.getParameter(request,"mucname"); String roomJIDStr = ParamUtils.getParameter(request,"roomJID"); JID roomJID = null; if (roomJIDStr != null) roomJID = new JID(roomJIDStr); MultiUserChatService mucService = null; if (roomJID != null) { mucService = webManager.getMultiUserChatManager().getMultiUserChatService(roomJID); } else if (mucname != null && webManager.getMultiUserChatManager().isServiceRegistered(mucname)) { mucService = webManager.getMultiUserChatManager().getMultiUserChatService(mucname); } else { for (MultiUserChatService muc : webManager.getMultiUserChatManager().getMultiUserChatServices()) { if (muc.isHidden()) { // Private and hidden, skip it. continue; } mucService = muc; break; } } if (mucService == null) { // No services exist, so redirect to where one can configure the services response.sendRedirect("muc-service-summary.jsp"); return; } // Get the rooms in the server final List names = mucService.getAllRoomNames().stream() .sorted(Comparator.comparing(String::toLowerCase)) .collect(Collectors.toList()); // paginator vars final ListPager listPager = new ListPager<>(request, response, names, "mucname"); %> <fmt:message key="muc.room.summary.title"/>

<%= StringUtils.escapeHTMLTags(mucService.getServiceDomain()) %>

<% if (request.getParameter("deletesuccess") != null) { %> <% } %>

: <%= listPager.getTotalItemCount() %>, <% if (listPager.getTotalPages() > 1) { %> <%= listPager.getFirstItemNumberOnPage() %>-<%= listPager.getLastItemNumberOnPage() %>, <% } %> <% if (webManager.getMultiUserChatManager().getMultiUserChatServicesCount() > 1) { %> -- : <% } %>

<% if (listPager.getTotalPages() > 1) { %>

: [ <%=listPager.getPageLinks() %> ]

<% } %>
<% // Print the list of rooms if (listPager.getTotalItemCount() < 1) { %> <% } final List itemsOnCurrentPage = listPager.getItemsOnCurrentPage(); int i = listPager.getFirstItemNumberOnPage(); for(String name : itemsOnCurrentPage) { MUCRoom room = mucService.getChatRoom(name); // This will load the room on-demand if it's not yet in memory. i++; %> <% } %>
 
<%= (i-1) %> <% if (room.getName().equals(room.getNaturalLanguageName())) { %> "> <%= StringUtils.escapeHTMLTags(room.getName()) %> <% } else { %> "> <%= StringUtils.escapeHTMLTags(room.getNaturalLanguageName()) %> (<%= StringUtils.escapeHTMLTags(room.getName()) %>) <% } %> <% if (!"".equals(room.getDescription())) { %> <%= StringUtils.escapeHTMLTags(room.getDescription()) %> <% } else { %>   <% } %> <% if (room.isPersistent()) { %> <fmt:message key="> <% } else { %> <fmt:message key="> <% } %> <% if (room.isLocked()) {%> <fmt:message key="> <% } else { %> <%= room.getOccupantsCount() %> <% if (room.getMaxUsers() > 0 ) { %> / <%= room.getMaxUsers() %> <% } %> <% } %> " >Edit " >Delete
<% if (listPager.getTotalPages() > 1) { %>

: [ <%=listPager.getPageLinks() %> ]

<% } %> <%=listPager.getJumpToPageForm()%>