Commit 8a5af7ed authored by Matt Tucker's avatar Matt Tucker Committed by matt

Additional Sitemesh integration work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@2938 b35dd754-fafc-0310-a699-88a17e54d16e
parent 44bc928a
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<exclude-exploded /> <exclude-exploded />
<content url="file://$MODULE_DIR$/src/plugins"> <content url="file://$MODULE_DIR$/src/plugins">
<sourceFolder url="file://$MODULE_DIR$/src/plugins/broadcast/src/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/plugins/broadcast/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/contentFilter/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/presence/src/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/plugins/presence/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/registration/src/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/plugins/registration/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/search/src/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/plugins/search/src/java" isTestSource="false" />
...@@ -51,6 +52,16 @@ ...@@ -51,6 +52,16 @@
<SOURCES /> <SOURCES />
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="module" module-name="Admin" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/commons-fileupload-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties /> <orderEntryProperties />
</component> </component>
</module> </module>
......
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
<mkdir dir="${war.dest.dir}/build"/> <mkdir dir="${war.dest.dir}/build"/>
<!-- Make a new web.xml file in the build dir --> <!-- Make a new web.xml file in the build dir -->
<copy file="${webapp.dest.dir}/WEB-INF/web.xml" toFile="${war.dest.dir}/build/web.xml" overwrite="${overwrite}"/> <copy file="${webapp.dest.dir}/WEB-INF/web.xml" toFile="${war.dest.dir}/build/web.xml" overwrite="${overwrite}"/>
<!-- TODO: copy in decorators.xml --> <!-- TODO: copy in decorators.xml and sitemesh.xml -->
<!-- Make the war --> <!-- Make the war -->
<war destfile="${war.dest.dir}/${war.name}" basedir="${web.dir}" <war destfile="${war.dest.dir}/${war.name}" basedir="${web.dir}"
webxml="${war.dest.dir}/build/web.xml"> webxml="${war.dest.dir}/build/web.xml">
...@@ -461,11 +461,15 @@ ...@@ -461,11 +461,15 @@
</filterset> </filterset>
</copy> </copy>
<!-- Copy over decorators file. --> <!-- Copy over Sitemesh files. -->
<copy file="${web.dir}/WEB-INF/decorators.xml" <copy file="${web.dir}/WEB-INF/decorators.xml"
toFile="${webapp.dest.dir}/WEB-INF/decorators.xml" toFile="${webapp.dest.dir}/WEB-INF/decorators.xml"
overwrite="true"> overwrite="true">
</copy> </copy>
<copy file="${web.dir}/WEB-INF/sitemesh.xml"
toFile="${webapp.dest.dir}/WEB-INF/sitemesh.xml"
overwrite="true">
</copy>
<!-- Create a jar of compiled servlets --> <!-- Create a jar of compiled servlets -->
<jar jarfile="${jspc.dest.dir}/${jspc.jar.name}"> <jar jarfile="${jspc.dest.dir}/${jspc.jar.name}">
......
<%@ page import="java.util.*, <%@ page import="java.util.*,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.XMPPServer, org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.messenger.user.*, org.jivesoftware.messenger.user.*,
org.jivesoftware.messenger.plugin.ContentFilterPlugin, org.jivesoftware.messenger.plugin.ContentFilterPlugin,
org.jivesoftware.util.*" org.jivesoftware.util.*"
errorPage="error.jsp"
%> %>
<%@ page import="java.util.regex.Pattern"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<c:set var="admin" value="${admin.manager}" />
<% admin.init(request, response, session, application, out ); %>
<% <%
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean success = request.getParameter("success") != null; boolean success = request.getParameter("success") != null;
...@@ -38,18 +33,19 @@ ...@@ -38,18 +33,19 @@
ContentFilterPlugin plugin = (ContentFilterPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("contentfilter"); ContentFilterPlugin plugin = (ContentFilterPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("contentfilter");
//input validation //input validation
Map errors = new HashMap(); Map<String, String> errors = new HashMap<String, String>();
if (save) { if (save) {
if (patterns == null) { if (patterns == null) {
errors.put("missingPatterns", "missingPatterns"); errors.put("missingPatterns", "missingPatterns");
} else { }
else {
String[] data = patterns.split(","); String[] data = patterns.split(",");
try { try {
for (int i = 0; i < data.length; i++) { for (String aData : data) {
java.util.regex.Pattern.compile(data[i]); Pattern.compile(aData);
} }
} catch (java.util.regex.PatternSyntaxException e) { } catch (java.util.regex.PatternSyntaxException e) {
errors.put("patternSyntaxException", e.getMessage()); errors.put("patternSyntaxException", e.getMessage());
} }
...@@ -110,16 +106,12 @@ ...@@ -110,16 +106,12 @@
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% <head>
String title = "Content Filter"; <title>Content Filter</title>
pageinfo.setTitle(title); <meta name="pageID" content="contentfilter-props-edit-form"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "contentfilter-props-edit-form.jsp")); <body>
pageinfo.setPageID("contentfilter-props-edit-form");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p> <p>
Use the form below to edit content filter settings.<br> Use the form below to edit content filter settings.<br>
...@@ -218,7 +210,7 @@ Use the form below to edit content filter settings.<br> ...@@ -218,7 +210,7 @@ Use the form below to edit content filter settings.<br>
<tbody> <tbody>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="maskenabled" value="false" id="not01" <input type="radio" name="maskenabled" value="false" id="not03"
<%= ((maskEnabled) ? "" : "checked") %>> <%= ((maskEnabled) ? "" : "checked") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -227,7 +219,7 @@ Use the form below to edit content filter settings.<br> ...@@ -227,7 +219,7 @@ Use the form below to edit content filter settings.<br>
</tr> </tr>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="maskenabled" value="true" id="not02" <input type="radio" name="maskenabled" value="true" id="not04"
<%= ((maskEnabled) ? "checked" : "") %>> <%= ((maskEnabled) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -266,7 +258,7 @@ Use the form below to edit content filter settings.<br> ...@@ -266,7 +258,7 @@ Use the form below to edit content filter settings.<br>
<tbody> <tbody>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="rejectionnotificationenabled" value="false" id="not01" <input type="radio" name="rejectionnotificationenabled" value="false" id="not05"
<%= ((rejectionNotificationEnabled) ? "" : "checked") %>> <%= ((rejectionNotificationEnabled) ? "" : "checked") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -275,7 +267,7 @@ Use the form below to edit content filter settings.<br> ...@@ -275,7 +267,7 @@ Use the form below to edit content filter settings.<br>
</tr> </tr>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="rejectionnotificationenabled" value="true" id="not02" <input type="radio" name="rejectionnotificationenabled" value="true" id="not06"
<%= ((rejectionNotificationEnabled) ? "checked" : "") %>> <%= ((rejectionNotificationEnabled) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -313,7 +305,7 @@ Use the form below to edit content filter settings.<br> ...@@ -313,7 +305,7 @@ Use the form below to edit content filter settings.<br>
<tbody> <tbody>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="notificationenabled" value="false" id="not01" <input type="radio" name="notificationenabled" value="false" id="not07"
<%= ((notificationEnabled) ? "" : "checked") %>> <%= ((notificationEnabled) ? "" : "checked") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -322,7 +314,7 @@ Use the form below to edit content filter settings.<br> ...@@ -322,7 +314,7 @@ Use the form below to edit content filter settings.<br>
</tr> </tr>
<tr> <tr>
<td width="1%"> <td width="1%">
<input type="radio" name="notificationenabled" value="true" id="not02" <input type="radio" name="notificationenabled" value="true" id="not08"
<%= ((notificationEnabled) ? "checked" : "") %>> <%= ((notificationEnabled) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
...@@ -332,7 +324,7 @@ Use the form below to edit content filter settings.<br> ...@@ -332,7 +324,7 @@ Use the form below to edit content filter settings.<br>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td align="left">Username:&nbsp; <td align="left">Username:&nbsp;
<input type="text" size="100" maxlength="100" name="contactname" <input type="text" size="20" maxlength="100" name="contactname"
value="<%= (contactName != null ? contactName : "") %>">@<%= XMPPServer.getInstance().getServerInfo().getName() %> value="<%= (contactName != null ? contactName : "") %>">@<%= XMPPServer.getInstance().getServerInfo().getName() %>
<% if (errors.containsKey("missingContactName")) { %> <% if (errors.containsKey("missingContactName")) { %>
<span class="jive-error-text"> <span class="jive-error-text">
...@@ -355,4 +347,5 @@ Use the form below to edit content filter settings.<br> ...@@ -355,4 +347,5 @@ Use the form below to edit content filter settings.<br>
<input type="submit" value="Save Properties"> <input type="submit" value="Save Properties">
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
\ No newline at end of file
<%@ page import="java.util.*, <%@ page import="java.util.*,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.XMPPServer, org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.util.*, org.jivesoftware.util.*,
org.jivesoftware.messenger.plugin.PresencePlugin" org.jivesoftware.messenger.plugin.PresencePlugin"
...@@ -9,41 +8,29 @@ ...@@ -9,41 +8,29 @@
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%-- Define Administration Bean --%>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<c:set var="admin" value="${admin.manager}" />
<% admin.init(request, response, session, application, out ); %>
<% // Get parameters <% // Get parameters
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean success = request.getParameter("success") != null; boolean success = request.getParameter("success") != null;
boolean presencePublic = ParamUtils.getBooleanParameter(request, "presencePublic"); boolean presencePublic = ParamUtils.getBooleanParameter(request, "presencePublic");
PresencePlugin plugin = (PresencePlugin) XMPPServer.getInstance().getPluginManager().getPlugin("presence"); PresencePlugin plugin = (PresencePlugin)XMPPServer.getInstance().getPluginManager().getPlugin("presence");
// Handle a save // Handle a save
Map errors = new HashMap();
if (save) { if (save) {
if (errors.size() == 0) { plugin.setPresencePublic(presencePublic);
plugin.setPresencePublic(presencePublic); response.sendRedirect("presence-service.jsp?success=true");
response.sendRedirect("presence-service.jsp?success=true"); return;
return;
}
} }
presencePublic = plugin.isPresencePublic(); presencePublic = plugin.isPresencePublic();
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% <head>
String title = "Presence Service Properties"; <title>Presence Service Properties</title>
pageinfo.setTitle(title); <meta name="pageID" content="presence-service"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "../../index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "presence-service.jsp")); <body>
pageinfo.setPageID("presence-service");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p> <p>
Use the form below to configure user presence visibility. By default, user Use the form below to configure user presence visibility. By default, user
...@@ -104,4 +91,5 @@ presence should only be visible to those users that are authorized.<br> ...@@ -104,4 +91,5 @@ presence should only be visible to those users that are authorized.<br>
<input type="submit" value="Save Properties"> <input type="submit" value="Save Properties">
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
\ No newline at end of file
...@@ -8,26 +8,10 @@ ...@@ -8,26 +8,10 @@
org.jivesoftware.util.*" org.jivesoftware.util.*"
errorPage="error.jsp"%> errorPage="error.jsp"%>
<script lang="JavaScript" type="text/javascript">
function addIMContact() {
document.regform.addIM.value = 'true';
document.regform.submit();
}
function addEmailContact() {
document.regform.addEmail.value = 'true';
document.regform.submit();
}
</script>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<c:set var="admin" value="${admin.manager}" />
<% <%
admin.init(request, response, session, application, out);
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean saveWelcome = request.getParameter("savemessage") != null; boolean saveWelcome = request.getParameter("savemessage") != null;
boolean saveGroup = request.getParameter("savegroup") != null; boolean saveGroup = request.getParameter("savegroup") != null;
...@@ -59,7 +43,7 @@ function addEmailContact() { ...@@ -59,7 +43,7 @@ function addEmailContact() {
contactIM = contactIM.trim().toLowerCase(); contactIM = contactIM.trim().toLowerCase();
try { try {
admin.getUserManager().getUser(contactIM); XMPPServer.getInstance().getUserManager().getUser(contactIM);
plugin.addIMContact(contactIM); plugin.addIMContact(contactIM);
response.sendRedirect("registration-props-form.jsp?addSuccess=true"); response.sendRedirect("registration-props-form.jsp?addSuccess=true");
return; return;
...@@ -110,7 +94,7 @@ function addEmailContact() { ...@@ -110,7 +94,7 @@ function addEmailContact() {
} }
try { try {
admin.getGroupManager().getGroup(group); GroupManager.getInstance().getGroup(group);
} }
catch (Exception e) { catch (Exception e) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
...@@ -140,7 +124,7 @@ function addEmailContact() { ...@@ -140,7 +124,7 @@ function addEmailContact() {
} }
try { try {
admin.getGroupManager().getGroup(group); GroupManager.getInstance().getGroup(group);
} }
catch (Exception e) { catch (Exception e) {
errors.put("groupNotFound", "groupNotFound"); errors.put("groupNotFound", "groupNotFound");
...@@ -167,16 +151,24 @@ function addEmailContact() { ...@@ -167,16 +151,24 @@ function addEmailContact() {
group = plugin.getGroup(); group = plugin.getGroup();
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% <head>
String title = "User Registration"; <title>User Registration</title>
pageinfo.setTitle(title); <meta name="pageID" content="registration-props-form"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "registration-props-form.jsp")); <body>
pageinfo.setPageID("registration-props-form");
%> <script language="JavaScript" type="text/javascript">
<jsp:include page="top.jsp" flush="true" /> function addIMContact() {
<jsp:include page="title.jsp" flush="true" /> document.regform.addIM.value = 'true';
document.regform.submit();
}
function addEmailContact() {
document.regform.addEmail.value = 'true';
document.regform.submit();
}
</script>
<p>Use the form below to edit user registration settings.</p> <p>Use the form below to edit user registration settings.</p>
...@@ -495,4 +487,5 @@ function addEmailContact() { ...@@ -495,4 +487,5 @@ function addEmailContact() {
</fieldset> </fieldset>
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
\ No newline at end of file
...@@ -3,20 +3,25 @@ ...@@ -3,20 +3,25 @@
org.jivesoftware.util.*, org.jivesoftware.util.*,
org.jivesoftware.messenger.PresenceManager, org.jivesoftware.messenger.PresenceManager,
org.jivesoftware.messenger.user.*, org.jivesoftware.messenger.user.*,
org.jivesoftware.admin.*, org.jivesoftware.messenger.XMPPServer,
org.xmpp.packet.Presence" org.xmpp.packet.Presence"
%> %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager"/> <html>
<% webManager.init(request, response, session, application, out); <head>
<title>User Search</title>
<meta name="pageID" content="advance-user-search"/>
</head>
<body>
<%
String criteria = ParamUtils.getParameter(request, "criteria"); String criteria = ParamUtils.getParameter(request, "criteria");
boolean moreOptions = ParamUtils.getBooleanParameter(request, "moreOptions", false); boolean moreOptions = ParamUtils.getBooleanParameter(request, "moreOptions", false);
UserManager userManager = webManager.getUserManager(); UserManager userManager = UserManager.getInstance();
Set<String> searchFields = userManager.getSearchFields(); Set<String> searchFields = userManager.getSearchFields();
List<String> selectedFields = new ArrayList<String>(); List<String> selectedFields = new ArrayList<String>();
...@@ -24,36 +29,22 @@ ...@@ -24,36 +29,22 @@
if (criteria != null) { if (criteria != null) {
for (String searchField : searchFields) { for (String searchField : searchFields) {
boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false); boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false);
if (!moreOptions || searchValue) { if (!moreOptions || searchValue) {
selectedFields.add(searchField); selectedFields.add(searchField);
Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria); Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria);
//filter out duplicate users //filter out duplicate users
for (User user : foundUsers) { for (User user : foundUsers) {
if (!users.contains(user)) { if (!users.contains(user)) {
users.add(user); users.add(user);
} }
} }
} }
} }
} }
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean"/>
<%
String title = "Advance User Search";
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "../../index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "advance-user-search.jsp"));
pageinfo.setPageID("advance-user-search");
%>
<jsp:include page="top.jsp" flush="true">
<jsp:param name="helpPage" value="advanced_searching.html" />
</jsp:include>
<jsp:include page="title.jsp" flush="true"/>
<form name="f" action="advance-user-search.jsp"> <form name="f" action="advance-user-search.jsp">
<input type="hidden" name="search" value="true"/> <input type="hidden" name="search" value="true"/>
...@@ -97,6 +88,7 @@ ...@@ -97,6 +88,7 @@
</tr> </tr>
<% } %> <% } %>
</table> </table>
</div>
</fieldset> </fieldset>
</form> </form>
...@@ -115,7 +107,7 @@ Users Found: <%=users.size() %> ...@@ -115,7 +107,7 @@ Users Found: <%=users.size() %>
<th nowrap><fmt:message key="user.create.name" /></th> <th nowrap><fmt:message key="user.create.name" /></th>
<th nowrap><fmt:message key="user.summary.created" /></th> <th nowrap><fmt:message key="user.summary.created" /></th>
<th nowrap><fmt:message key="user.summary.edit" /></th> <th nowrap><fmt:message key="user.summary.edit" /></th>
<th nowrap><fmt:message key="user.summary.delete" /></th> <th nowrap><fmt:message key="global.delete" /></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -128,7 +120,7 @@ Users Found: <%=users.size() %> ...@@ -128,7 +120,7 @@ Users Found: <%=users.size() %>
<% <%
} else { } else {
int i = 0; int i = 0;
PresenceManager presenceManager = webManager.getPresenceManager(); PresenceManager presenceManager = XMPPServer.getInstance().getPresenceManager();
for (User user : users) { for (User user : users) {
i++; i++;
...@@ -174,12 +166,12 @@ Users Found: <%=users.size() %> ...@@ -174,12 +166,12 @@ Users Found: <%=users.size() %>
</td> </td>
<td width="1%" align="center"> <td width="1%" align="center">
<a href="../../user-edit-form.jsp?username=<%= URLEncoder.encode(user.getUsername(), "UTF-8") %>" <a href="../../user-edit-form.jsp?username=<%= URLEncoder.encode(user.getUsername(), "UTF-8") %>"
title="<fmt:message key="user.summary.click_edit" />" title="<fmt:message key="global.click_edit" />"
><img src="images/edit-16x16.gif" width="17" height="17" border="0"></a> ><img src="images/edit-16x16.gif" width="17" height="17" border="0"></a>
</td> </td>
<td width="1%" align="center" style="border-right:1px #ccc solid;"> <td width="1%" align="center" style="border-right:1px #ccc solid;">
<a href="../../user-delete.jsp?username=<%= URLEncoder.encode(user.getUsername(), "UTF-8") %>" <a href="../../user-delete.jsp?username=<%= URLEncoder.encode(user.getUsername(), "UTF-8") %>"
title="<fmt:message key="user.summary.click_delete" />" title="<fmt:message key="global.click_delete" />"
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a> ><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
</td> </td>
</tr> </tr>
...@@ -198,4 +190,5 @@ Users Found: <%=users.size() %> ...@@ -198,4 +190,5 @@ Users Found: <%=users.size() %>
document.f.criteria.focus(); document.f.criteria.focus();
</script> </script>
<jsp:include page="bottom.jsp" flush="true"/> </body>
</html>
\ No newline at end of file
<%@ page import="java.util.*, <%@ page import="java.util.*,
org.jivesoftware.admin.*,
org.jivesoftware.messenger.XMPPServer, org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.messenger.plugin.SearchPlugin, org.jivesoftware.messenger.plugin.SearchPlugin,
org.jivesoftware.util.*" org.jivesoftware.util.*"
errorPage="error.jsp"
%> %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%-- Define Administration Bean --%>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<c:set var="admin" value="${admin.manager}" />
<% admin.init(request, response, session, application, out ); %>
<% // Get parameters <% // Get parameters
boolean save = request.getParameter("save") != null; boolean save = request.getParameter("save") != null;
boolean success = request.getParameter("success") != null; boolean success = request.getParameter("success") != null;
...@@ -47,16 +40,12 @@ ...@@ -47,16 +40,12 @@
searchEnabled = plugin.getServiceEnabled(); searchEnabled = plugin.getServiceEnabled();
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% <head>
String title = "Search Service Properties"; <title>Search Service Properties</title>
pageinfo.setTitle(title); <meta name="pageID" content="search-props-edit-form"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "../../index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "search-props-edit-form.jsp")); <body>
pageinfo.setPageID("search-props-edit-form");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p> <p>
Use the form below to edit search service settings, these settings do not affect the user search in the admin console.<br> Use the form below to edit search service settings, these settings do not affect the user search in the admin console.<br>
...@@ -155,4 +144,5 @@ Use the form below to edit search service settings, these settings do not affect ...@@ -155,4 +144,5 @@ Use the form below to edit search service settings, these settings do not affect
<input type="submit" value="Save Properties"> <input type="submit" value="Save Properties">
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
\ No newline at end of file
<%@ page import="java.io.OutputStream, <%@ page import="java.io.OutputStream,
org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.messenger.plugin.ImportExportPlugin" org.jivesoftware.messenger.plugin.ImportExportPlugin"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<% <%
admin.init(request, response, session, application, out);
String fileName = request.getParameter("fileName"); String fileName = request.getParameter("fileName");
response.setContentType("application/x-download"); response.setContentType("application/x-download");
response.setHeader("Content-Disposition","attachment;filename="+fileName+".xml"); response.setHeader("Content-Disposition","attachment;filename="+fileName+".xml");
ImportExportPlugin plugin = (ImportExportPlugin) admin.getXMPPServer().getPluginManager().getPlugin("userimportexport"); ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
byte[] content = plugin.exportUsersToFile(); byte[] content = plugin.exportUsersToFile();
OutputStream os = response.getOutputStream(); OutputStream os = response.getOutputStream();
......
<%@ page import="java.io.IOException, <%@ page import="java.io.IOException,
java.util.*, java.util.*,
org.jivesoftware.admin.AdminPageBean,
org.jivesoftware.messenger.plugin.ImportExportPlugin, org.jivesoftware.messenger.plugin.ImportExportPlugin,
org.jivesoftware.messenger.XMPPServer, org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.util.ParamUtils" org.jivesoftware.util.ParamUtils"
...@@ -9,15 +8,13 @@ ...@@ -9,15 +8,13 @@
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <%
<%
admin.init(request, response, session, application, out);
boolean exportUsers = request.getParameter("exportUsers") != null; boolean exportUsers = request.getParameter("exportUsers") != null;
boolean success = request.getParameter("success") != null; boolean success = request.getParameter("success") != null;
boolean exportToFile = ParamUtils.getBooleanParameter(request, "exporttofile", true); boolean exportToFile = ParamUtils.getBooleanParameter(request, "exporttofile", true);
ImportExportPlugin plugin = (ImportExportPlugin) admin.getXMPPServer().getPluginManager().getPlugin("userimportexport"); ImportExportPlugin plugin = (ImportExportPlugin)XMPPServer.getInstance().getPluginManager(
).getPlugin("userimportexport");
String exportText = ""; String exportText = "";
...@@ -43,16 +40,12 @@ ...@@ -43,16 +40,12 @@
} }
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% // Title of this page and breadcrumbs <head>
String title = "Export User Data"; <title>Export User Data</title>
pageinfo.setTitle(title); <meta name="pageID" content="import-export-selection"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "../../index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "export-user-data.jsp")); <body>
pageinfo.setPageID("import-export-selection");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<% if (errors.size() > 0) { %> <% if (errors.size() > 0) { %>
...@@ -127,4 +120,5 @@ ...@@ -127,4 +120,5 @@
<input type="submit" value="Export"> <input type="submit" value="Export">
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
\ No newline at end of file
<%@ page import="org.jivesoftware.admin.AdminPageBean, <%@ page import="org.jivesoftware.messenger.plugin.ImportExportPlugin,
org.jivesoftware.messenger.plugin.ImportExportPlugin,
org.jivesoftware.messenger.XMPPServer" org.jivesoftware.messenger.XMPPServer"
%> %>
<html>
<head>
<title>Import/Export Selection</title>
<meta name="pageID" content="import-export-selection"/>
</head>
<body>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<% // Title of this page and breadcrumbs <%
String title = "Import/Export Selection";
pageinfo.setTitle(title);
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "../../index.jsp"));
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "import-export-selection.jsp"));
pageinfo.setPageID("import-export-selection");
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport"); ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
%> %>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<p> <p>
...@@ -34,4 +32,5 @@ data from your Jive Messenger installation. ...@@ -34,4 +32,5 @@ data from your Jive Messenger installation.
<% } %> <% } %>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
...@@ -3,19 +3,16 @@ ...@@ -3,19 +3,16 @@
org.dom4j.DocumentException, org.dom4j.DocumentException,
org.apache.commons.fileupload.DiskFileUpload, org.apache.commons.fileupload.DiskFileUpload,
org.apache.commons.fileupload.FileItem, org.apache.commons.fileupload.FileItem,
org.jivesoftware.admin.AdminPageBean,
org.jivesoftware.messenger.plugin.ImportExportPlugin, org.jivesoftware.messenger.plugin.ImportExportPlugin,
org.jivesoftware.messenger.XMPPServer,
org.jivesoftware.util.ParamUtils" org.jivesoftware.util.ParamUtils"
%> %>
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <%
<%
admin.init(request, response, session, application, out);
boolean importUsers = request.getParameter("importUsers") != null; boolean importUsers = request.getParameter("importUsers") != null;
boolean success = request.getParameter("success") != null; boolean success = request.getParameter("success") != null;
ImportExportPlugin plugin = (ImportExportPlugin) admin.getXMPPServer().getPluginManager().getPlugin("userimportexport"); ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
List<String> duplicateUsers = new ArrayList<String>(); List<String> duplicateUsers = new ArrayList<String>();
Map<String, String> errors = new HashMap<String, String>(); Map<String, String> errors = new HashMap<String, String>();
...@@ -60,16 +57,12 @@ ...@@ -60,16 +57,12 @@
} }
%> %>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <html>
<% // Title of this page and breadcrumbs <head>
String title = "Import User Data"; <title>Import User Data</title>
pageinfo.setTitle(title); <meta name="pageID" content="import-export-selection"/>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb("Main", "../../index.jsp")); </head>
pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "import-user-data.jsp")); <body>
pageinfo.setPageID("import-export-selection");
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />
<% if (errors.size() > 0) { %> <% if (errors.size() > 0) { %>
...@@ -124,30 +117,35 @@ ...@@ -124,30 +117,35 @@
<% } %> <% } %>
Use the form below to import a user data XML file.
<form action="import-user-data.jsp?importUsers" method="post" enctype="multipart/form-data"> <form action="import-user-data.jsp?importUsers" method="post" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend>Import</legend> <legend>Import</legend>
<div> <div>
<p> <p>
Use the Browse button to select the file that conatians the Jive Messenger user data to be imported, then click on the Import button. Choose a file to import:</p>
</p> <input type="file" name="thefile">
<input type="file" name="thefile"><input type="submit" value="Import">
<br><br><br> <br><br><br>
<p> <p>
<b>Optional</b> - Use the field below to replace the domain name of user roster entries with the current hostname. <b>Optional</b> - Use the field below to replace the domain name of user roster entries with the current hostname.
See the migration section of the <a href="../../plugin-admin.jsp?plugin=userimportexport&showReadme=true">readme</a> for details. See the migration section of the <a href="../../plugin-admin.jsp?plugin=userimportexport&showReadme=true&decorator=none">readme</a> for details.
</p> </p>
Existing Domain:<input type="text" size="20" maxlength="150" name="previousDomain" value=""/> Replace Domain: <input type="text" size="20" maxlength="150" name="previousDomain" value=""/>
</div> </div>
</fieldset> </fieldset>
<br><br>
<input type="submit" value="Import">
</form> </form>
<jsp:include page="bottom.jsp" flush="true" /> </body>
</html>
<%! <%!
public boolean isEmpty(String s) { public boolean isEmpty(String s) {
......
<decorators defaultdir="/decorators"> <decorators defaultdir="/decorators">
<decorator name="main" page="main.jsp"> <decorator name="main" page="main.jsp">
<pattern>/*.jsp</pattern> <pattern>/*.jsp</pattern>
<pattern>/plugins</pattern>
</decorator> </decorator>
<decorator name="none"/>
<excludes> <excludes>
<pattern>/setup/*</pattern> <pattern>/setup/*</pattern>
<pattern>/login.jsp*</pattern> <pattern>/login.jsp*</pattern>
<pattern>/plugin-icon.jsp*</pattern>
</excludes> </excludes>
</decorators> </decorators>
\ No newline at end of file
<sitemesh>
<property name="decorators-file" value="/WEB-INF/decorators.xml" />
<excludes file="${decorators-file}" />
<page-parsers>
<parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.FastPageParser" />
</page-parsers>
<decorator-mappers>
<mapper class="com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper">
<param name="property.1" value="meta.decorator" />
<param name="property.2" value="decorator" />
</mapper>
<mapper class="com.opensymphony.module.sitemesh.mapper.ParameterDecoratorMapper">
<param name="decorator.parameter" value="decorator" />
</mapper>
<mapper class="com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper">
<param name="decorator" value="printable" />
<param name="parameter.name" value="printable" />
<param name="parameter.value" value="true" />
</mapper>
<mapper class="com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper" />
<mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
<param name="config" value="${decorators-file}" />
</mapper>
</decorator-mappers>
</sitemesh>
\ No newline at end of file
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<jsp:useBean id="info" scope="request" class="org.jivesoftware.admin.AdminPageBean" /> <jsp:useBean id="info" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out); %> <% webManager.init(request, response, session, application, out); %>
<decorator:usePage id="decoratedPage" /> <decorator:usePage id="decoratedPage" />
...@@ -36,15 +36,6 @@ ...@@ -36,15 +36,6 @@
request.setAttribute("extraParams", decoratedPage.getProperty("meta.extraParams")); request.setAttribute("extraParams", decoratedPage.getProperty("meta.extraParams"));
%> %>
<%
// If the page has instructed that no decorator should be applied, include the original
// page content and return.
if("false".equals(decoratedPage.getProperty("meta.decorator"))) {
decoratedPage.writePage(out);
return;
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
...@@ -104,7 +95,7 @@ ...@@ -104,7 +95,7 @@
</div> </div>
</td> </td>
<td width="1%" id="jive-logout" nowrap> <td width="1%" id="jive-logout" nowrap>
<a href="<%= path %>/index.jsp?logout=true"><%= LocaleUtils.getLocalizedString("global.logout") %> [<%= StringUtils.escapeHTMLTags(admin.getUser().getUsername()) %>]</a> <a href="<%= path %>/index.jsp?logout=true"><%= LocaleUtils.getLocalizedString("global.logout") %> [<%= StringUtils.escapeHTMLTags(webManager.getUser().getUsername()) %>]</a>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
</tr> </tr>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<html> <html>
<head> <head>
<title><%= log %></title> <title><%= log %></title>
<meta name="decorator" content="false"/> <meta name="decorator" content="none"/>
<style type="text/css"> <style type="text/css">
.log TABLE { .log TABLE {
border : 1px #ccc solid; border : 1px #ccc solid;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" /> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>
<% <%
String deletePlugin = ParamUtils.getParameter(request, "deleteplugin"); String deletePlugin = ParamUtils.getParameter(request, "deleteplugin");
...@@ -121,56 +120,6 @@ ...@@ -121,56 +120,6 @@
return; return;
} }
%> %>
<% if (showIcon) {
String pluginName = ParamUtils.getParameter(request, "plugin");
Plugin plugin = pluginManager.getPlugin(pluginName);
if (plugin != null) {
// Try looking for PNG file first then default to GIF.
File icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.png");
boolean isPng = true;
if (!icon.exists()) {
icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.gif");
isPng = false;
}
if (icon.exists()) {
// Clear any empty line added by the JSP declaration. This is required to show
// the image in resin!!!!!
response.reset();
if (isPng) {
response.setContentType("image/png");
}
else {
response.setContentType("image/gif");
}
InputStream in = null;
OutputStream ost = null;
try {
in = new FileInputStream(icon);
ost = response.getOutputStream();
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) >= 0) {
ost.write(buf,0,len);
}
ost.flush();
}
catch (IOException ioe) {
}
finally {
if (in != null) {
try { in.close(); } catch (Exception e) { }
}
if (ost != null) {
try { ost.close(); } catch (Exception e) { }
}
}
}
}
return;
}
%>
<html> <html>
<head> <head>
...@@ -274,7 +223,7 @@ ...@@ -274,7 +223,7 @@
<tr class="jive-<%= (((count%2)==0) ? "even" : "odd") %>"> <tr class="jive-<%= (((count%2)==0) ? "even" : "odd") %>">
<td width="1%"> <td width="1%">
<% if (icon.exists()) { %> <% if (icon.exists()) { %>
<img src="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showIcon=true" width="16" height="16" alt="Plugin"> <img src="plugin-icon.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showIcon=true&decorator=none" width="16" height="16" alt="Plugin">
<% } else { %> <% } else { %>
<img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin"> <img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin">
<% } %> <% } %>
...@@ -289,11 +238,11 @@ ...@@ -289,11 +238,11 @@
</td> </td>
<td nowrap> <td nowrap>
<% if (readmeExists) { %> <% if (readmeExists) { %>
<a href="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showReadme=true" <a href="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showReadme=true&decorator=none"
><img src="images/doc-readme-16x16.gif" width="16" height="16" border="0" alt="README"></a> ><img src="images/doc-readme-16x16.gif" width="16" height="16" border="0" alt="README"></a>
<% } else { %> &nbsp; <% } %> <% } else { %> &nbsp; <% } %>
<% if (changelogExists) { %> <% if (changelogExists) { %>
<a href="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showChangelog=true" <a href="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showChangelog=true&decorator=none"
><img src="images/doc-changelog-16x16.gif" width="16" height="16" border="0" alt="changelog"></a> ><img src="images/doc-changelog-16x16.gif" width="16" height="16" border="0" alt="changelog"></a>
<% } else { %> &nbsp; <% } %> <% } else { %> &nbsp; <% } %>
</td> </td>
......
<%@ page import="org.jivesoftware.util.ParamUtils"%>
<%@ page import="org.jivesoftware.messenger.container.Plugin"%>
<%@ page import="java.io.*"%>
<%@ page import="org.jivesoftware.messenger.container.PluginManager"%>
<%@ page import="org.jivesoftware.messenger.XMPPServer"%>
<%
String pluginName = ParamUtils.getParameter(request, "plugin");
PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
Plugin plugin = pluginManager.getPlugin(pluginName);
if (plugin != null) {
// Try looking for PNG file first then default to GIF.
File icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.png");
boolean isPng = true;
if (!icon.exists()) {
icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.gif");
isPng = false;
}
if (icon.exists()) {
// Clear any empty lines added by the JSP declaration. This is required to show
// the image in resin!
response.reset();
if (isPng) {
response.setContentType("image/png");
}
else {
response.setContentType("image/gif");
}
InputStream in = null;
OutputStream ost = null;
try {
in = new FileInputStream(icon);
ost = response.getOutputStream();
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) >= 0) {
ost.write(buf,0,len);
}
ost.flush();
}
catch (IOException ioe) {
}
finally {
if (in != null) {
try { in.close(); } catch (Exception e) { }
}
if (ost != null) {
try { ost.close(); } catch (Exception e) { }
}
}
}
}
%>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment