Direct Web Remoting
Community Engine uses a library called DWR to make Javascript talk to the server side Java API, much the same way you would do with a AJAX library such as jQuery. The difference with DWR, is that it maps everything to beautiful Java objects on the server side.
In order to use Community Engine DWR support, make sure that
your publication's webapp context (i.e. WEB-INF
) contains
dwr.xml
and community-plugin-beans.xml
.
For further details, see section Publication Context Configuration Files.
Furthermore, you must have the following Spring
configuration
in your web.xml
:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/community-plugin-beans.xml</param-value> </context-param>
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
Once you have configured Community Engine DWR support correctly, you may browse the classes that are available from JavaScript using the DWR servlet on your web site here: http://yoursite.com/your-publication/dwr/
To provide security when using DWR, Community
Engine provides a publication resource /escenic/plugin/community/security
file that
defines the prerequisites for using the DWR methods. The resource must be present for each publication running
Community Engine. Please see Securing DWR for a further
description of this resource.