enterprise-info.jsp 11 KB
Newer Older
1
<%--
Matt Tucker's avatar
Matt Tucker committed
2
  - Copyright (C) 2005-2007 Jive Software. All rights reserved.
3 4 5 6 7 8 9
  -
  - This software is published under the terms of the GNU Public License (GPL),
  - a copy of which is included in this distribution.
--%>

<%@ page import="org.jivesoftware.util.*,
                 java.util.*,
10 11 12 13
                 org.jivesoftware.openfire.*,
                 org.jivesoftware.openfire.update.UpdateManager,
                 org.jivesoftware.openfire.update.AvailablePlugin,
                 org.jivesoftware.openfire.container.PluginManager"
14 15 16 17 18 19 20
    errorPage="error.jsp"
%>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

<%
21 22 23 24 25 26 27
    // It's possible for the page to still be displayed after Enterprise
    // has been downloaded, like when the user has not done a page refresh.
    // Detect that case and do a re-direct.
    PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
    boolean pluginExists = pluginManager != null && pluginManager.getPlugin("enterprise") != null;
    if (pluginExists) {
        // Redirect to the main Enterprise page.
28
        response.sendRedirect("/plugins/enterprise/stats-dashboard.jsp");
29 30
        return;
    }
31 32 33 34

    boolean downloadRequested = request.getParameter("download") != null;
    String url = request.getParameter("url");

35 36 37 38 39 40 41
    boolean disable = request.getParameter("disable") != null;
    if(disable){
        JiveGlobals.setProperty("enterpriseInfoEnabled", "false");
        response.sendRedirect("/index.jsp");
        return;
    }

42 43 44 45
    UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager();
    List<AvailablePlugin> plugins = updateManager.getNotInstalledPlugins();

    // Sort plugins alphabetically
46 47 48
    Collections.sort(plugins, new Comparator<AvailablePlugin>() {
        public int compare(AvailablePlugin o1, AvailablePlugin o2) {
            return o1.getName().compareTo(o2.getName());
49 50 51 52 53 54 55 56 57 58 59 60
        }
    });

    if (downloadRequested) {
        // Download and install new plugin
        updateManager.downloadPlugin(url);
    }

%>

<html>
<head>
61
<title>Try Openfire Enterprise</title>
62 63 64 65 66 67 68 69 70 71
<meta name="pageID" content="enterprise-info"/>

<script src="dwr/engine.js" type="text/javascript"></script>
<script src="dwr/util.js" type="text/javascript"></script>
<script src="dwr/interface/downloader.js" type="text/javascript"></script>
<script type="text/javascript">

    var downloading;
    function downloadPlugin(url, id) {
        downloading = true;
72 73 74
        document.getElementById("install-button").style.display = 'none';
        document.getElementById("installing-button").style.display = '';
        document.getElementById("installed").style.display = 'none';
75 76 77 78 79 80 81 82 83 84
        setTimeout("startDownload('" + url + "','" + id + "')", 5000);
    }

    function startDownload(url, id) {
        downloader.installPlugin(downloadComplete, url, id);
    }

    function downloadComplete(status) {
        downloading = false;
        if (!status.successfull) {
85 86 87 88
            document.getElementById("install-button").style.display = '';
            document.getElementById("installing-button").style.display = 'none';
            document.getElementById("installed").style.display = 'none';
            document.getElementById("error-message").style.display = '';
89 90
        }
        else {
91 92 93 94
            document.getElementById("install-button").style.display = 'none';
            document.getElementById("installing-button").style.display = 'none';
            document.getElementById("installed").style.display = '';
            setTimeout("gotoEnterprise()", 5000);
95 96 97
        }
    }

98
    function gotoEnterprise(){
99
        window.location.href = "plugins/enterprise/stats-dashboard.jsp";
100 101
    }

102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
    function closeErrorMessage(){
        Effect.Fade("errorMessage");
    }

    function fadeIt(id) {
        Effect.Fade(id + "-row");
    }


    DWREngine.setErrorHandler(handleError);

    function handleError(error) {
    }

    // Handle leaving of page validation.
    window.onbeforeunload = function (evt) {
        if (!downloading) {
            return;
        }
        var message = '<fmt:message key="plugin.available.cancel.redirect" />';
        if (typeof evt == 'undefined') {
            evt = window.event;
        }
        if (evt) {
            evt.returnValue = message;
        }
        return message;
    }

    function updatePluginsList(){
        document.getElementById("reloaderID").innerHTML = '<img src="images/working-16x16.gif" border="0"/>';
        downloader.updatePluginsList(pluginsListUpdated);
    }

    function updatePluginsListNow(){
        document.getElementById("reloader2").innerHTML = '<img src="images/working-16x16.gif" border="0"/>';
        downloader.updatePluginsList(pluginsListUpdated);
    }

    function pluginsListUpdated(){
        window.location.href = "enterprise-info.jsp";
    }


</script>
</head>

<style type="text/css">

.light-gray-border {
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 1px 1px 1px;
    padding: 5px;
	-moz-border-radius: 3px;
}

.table-header {
    text-align: left;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 8pt;
    font-weight: bold;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 0px 1px 0px;
    padding: 5px;
}

.table-header-align-right {
    text-align: right;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 8pt;
    font-weight: bold;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 0px 1px 0px;
    padding: 5px;
}

.row-header {
    text-align: left;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 8pt;
    font-weight: bold;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 1px 1px 0px;
    padding: 5px;
}

.table-header-left {
    text-align: left;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 8pt;
    font-weight: bold;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 0px 1px 1px;
    padding: 5px;

}

.table-header-right {
    text-align: left;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 8pt;
    font-weight: bold;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px 1px 1px 0px;
    padding: 5px;
}

.line-bottom-border {
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 9pt;
    border-color: #e3e3e3;
    border-style: solid;
    border-width: 0px 0px 1px 0px;
    padding: 5px;
}
</style>
<body>

226
<span class="jive-enterprise-info">
227

228
    <img src="images/enterprise.png" alt="Openfire Enterprise" hspace="10" vspace="10" width="200" height="197" border="0" align="right" />
Matt Tucker's avatar
Matt Tucker committed
229

230
    <h3>What is it?</h3>
Matt Tucker's avatar
Matt Tucker committed
231

232
    <ul>
Matt Tucker's avatar
Matt Tucker committed
233
        <li>A commercial edition of Openfire that provides practical and valuable features along with professional support.</li>
234 235
        <li>Delivered as a plugin that extends the Open Source edition.</li>
        <li>Affordable <a href="http://www.jivesoftware.com/pricing/clearspacepricing.jsp">per-user pricing</a> and the option of special bundled pricing with <a href="http://www.jivesoftware.com/products/clearspace/">Clearspace</a>.</li>
236
    </ul>
Matt Tucker's avatar
Matt Tucker committed
237

238 239 240
    <h3>Why use it?</h3>
    <ul>
        <li><b>Reporting:</b> What manager wouldn't love graphs like the one pictured to the right?</li>
241 242
        <li><b>Advanced VoIP:</b> Integrate with your corporate phone system to place and receive SIP phone calls from inside Spark.</li>
        <li><b>Browser-based IM Client:</b> Use the AJAX-based SparkWeb client on any web browser.</li>
243 244
        <li><b>Client Control:</b> Stop the client madness -- take control of versions, features and more.</li>
        <li><b>Archiving:</b> If "compliance" is a word your organization uses, you need this feature.</li>
Matt Tucker's avatar
Matt Tucker committed
245 246
        <li><b>Customer Chat:</b> Add click-to-chat to your website to generate leads, close sales,
            route questions -- your sales and support people will love this feature.</li>
247 248
        <li><b>Support.</b> Professional support by the hard-working and friendly Jive Software team.</li>
        <li>Best of all, by using Enterprise, you're directly supporting the Open Source project.</li>
Matt Tucker's avatar
Matt Tucker committed
249

250
        <p>Interested? See the full <a href="http://www.jivesoftware.com/products/openfire/featuretour.jsp">feature overview</a>.</p>
251
    </ul>
Matt Tucker's avatar
Matt Tucker committed
252 253


254

255 256
    <h3>How to get started:</h3>
    <ol>
Matt Tucker's avatar
Matt Tucker committed
257
        <li>Install the Enterprise edition via the plugin (no re-start necessary).</li>
258 259 260 261 262
        <li>Get an evaluation license file (you'll be prompted after install).</li>
    </ol>


</span>
263 264 265 266


<%if(plugins.size() == 0){ %>
<div style="padding:10px;background:#FFEBB5;border:1px solid #DEB24A;width:75%;">
267
    <fmt:message key="plugin.available.no.plugin" />&nbsp;<span id="reloaderID"><a href="javascript:updatePluginsList();"><fmt:message key="plugin.available.list" /></a></span>
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
</div>
<br/>
<div style="width:75%;">
    <p>
   <fmt:message key="plugin.available.no.list.description" />
</p>

<% if(!updateManager.isServiceEnabled()){ %>
<fmt:message key="plugin.available.auto.update.currently" /> <b><fmt:message key="plugin.available.auto.update.currently.disabled" /></b>. <a href="manage-updates.jsp"><fmt:message key="plugin.available.click.here" /></a> <fmt:message key="plugin.available.change" />
<% } %>
</div>
<% } else {%>


<div id="errorMessage" class="error" style="display:none;">
    <fmt:message key="plugin.available.error.downloading" />
</div>


<%
    for (AvailablePlugin plugin : plugins) {
        String pluginName = plugin.getName();
        String pluginVersion = plugin.getLatestVersion();
        ByteFormat byteFormat = new ByteFormat();
        String fileSize = byteFormat.format(plugin.getFileSize());

294
        if (!plugin.isCommercial() || !pluginName.equals("Openfire Enterprise")) {
295 296 297 298 299 300 301 302 303 304 305
            continue;
        }
%>
        <%
            String updateURL = plugin.getURL();
            if (updateManager.isPluginDownloaded(updateURL)) {
        %>
        &nbsp;
        <%  }
        else { %>

306 307 308
        <div id="error-message" class="error" style="display:none;">
           <fmt:message key="plugin.enterprise.download.error" />
        </div>
309 310


311 312 313 314 315 316
        <div id="install-button" class="jive-enterprise-info-install">
            <a href="javascript:downloadPlugin('<%=updateURL%>', '<%= plugin.hashCode()%>')" class="jive-enterprise-info-install-btn">Install Enterprise Plugin</a>
            <p>Version <%= pluginVersion%> - <%= fileSize%><br>
            <a href="<%=plugin.getReadme()%>" target=_blank>Readme</a> &nbsp;|&nbsp; <a href="<%= plugin.getChangelog()%>" target=_blank>ChangeLog</a></p>
            <div class="jive-enterprise-info-close"><a href="enterprise-info.jsp?disable=true"><fmt:message key="plugin.enterprise.dont.show" /></a></div>
            </div>
317 318


319 320 321
        <div id="installing-button" class="jive-enterprise-info-wait" style="display:none;">
           <img src="images/wait24trans.gif" alt="" align="left">    <strong><fmt:message key="plugin.enterprise.installing" /></strong>
        </div>
322

323 324 325
         <div id="installed" class="jive-enterprise-info-success" style="display:none;">
          <strong><fmt:message key="plugin.enterprise.installed" /></strong>
         </div>
326

327
        <% } } } %>
328 329
</body>
</html>