It is a Java servlet implements a specialized chat. You can not only type your messages, but share documents (web pages, local files) also. How does it work? You can place on your web page (HTML page or WML page) a
hyperlink with the reference to this servlet. E.g. (for HTML):
<html> ... <a href="http://your_host/servlet/Community?acme" target="_blank">Acme Community</a> ... </html> or for creating a separate window:
<html> ... <a href="javascript:window.open('http://your_host/servlet/Community?acme', 'Community', 'width=250, height=300, location=no, toolbar=no,menubar=no,scrollbars=yes,resize=yes');" >Acme Community</a> ... </html> What is this for? From one side it is just a quick chat for your pages. But with the ability of sharing files (pages) you can also use this servlet as an online help for visitors. Some like 'call center' - you can answer questions in the real time, demonstrate slides (files) with some additional explanations etc. It is a pure HTML implementation, so this version is free from any firewall's restrictions. Servlet supports WAP/WML, so mobile users can join your community. How to use it: a) copy communityPackage.jar into WEB-INF/lib directory b) describe servlet in web.xml file. So for your web.xml you need to add some like this:
<servlet> <servlet-name>Community</servlet-name> <servlet-class>com.jsos.community.Community</servlet-class> </servlet> c) define a mapping:
<servlet-mapping> <servlet-name>Community</servlet-name> <url-pattern>/servlet/Community</url-pattern> </servlet-mapping> the usage is:
http://your_host/servlet/Community?unique_key Runs the community with the given key. The own unique
key will identify each community. You may choose any string for this
key. So the same servlet can support more than one community. E.g.:
Community?development Community?marketing etc. You must set common parameters for servlet in a configuration file.
You need to setup a full path to this file as an initial parameter for servlet.
Parameter's name is config:
<servlet> <servlet-name>Community</servlet-name> <servlet-class>com.jsos.community.Community</servlet-class> <init-param> <param-name>config</param-name> <param-value>path_to_your_configuration_file</param-value> </init-param> </servlet> Configuration file is a text file, each line describes one parameter in the form of param=value Empty lines and any line starts with # or // are ignored. Current version supports the following list of parameters: # work directory. Points to any existing directory on your server
# background color for messages screen.
# background color for command screen.
# foreground color for messages screen.
# foreground color for command screen.
# font size (by default is current browser's font)
#font face (by default is current browser's font settings)
# title. Default value is 'Coldbeans community'
# header. You can set here a path your file with HTML content.
# DHTML usage. By default is 1 (enable DHTML).
# Admin's password. Default value is welcome
# Share web sites. 1 - enable, 0 - disable.
# Share local files. 1 - enable, 0 - disable
# How to announce new shared site.
# How to announce new shared file.
# settings for new windows with shared sites.
# Messages format. How to output messages.
# Inactivity timeout for users (in seconds). User will be
# Messages timeout (in seconds).
# Session timeout (in seconds). Session will be closed if
# Size for input field
# Login procedure.
# Localization support. You can set encoding for input and output
Administrative mode You may run this servlet without keyword:
http://your_host/servlet/Community in this case you will be asked to enter administrative password (see parameter password) and servlet will provide forms for community monitoring. You will be able for example to search (see) all communities (chats, rooms) according to the given keyword pattern. Login procedure You can set your own HTML file for login dialog. You have to provide
a form that submits user's name for Community servlet. Parameter name
for the field is user.
<html> <form method="post" action="http://your_host/servlet/Community?acme"> Username: <input type="text" name="user"> <input type="submit" value="Submit"> </form> </html> You can even skip login dialog at all. You do not need to set parameter
login for this. Just create in your HTML (JSP) file a form with the hidden field
user, set an appropriate value for this field and submit this form through
JavaScript: document.yourform.submit();
<html> ... <form name=myform" method="post" action="http://your_host/servlet/Community?acme"> <input type="hidden" name="user"> </form> ... <script language="JavaScript"> document.myform.user.value='Guest'; document.myform.submit(); </script> </html> Notes: 1. Servlet's configuration file can be saved anywhere on your server. 2. Directory for temporary files can be created anywhere on your server.
For downloading: communityPackage.jar
© Coldbeans Software Comments? See also JSOS - the largest collection of servlets and filters.
|
Also in Coldtags:
|