public class WaianaService extends AbstractTopicWebApp
WaianaService implements an API used to store and retrieve topic maps via JSON fragments submitted over HTTP. The service stores topic maps as XTM files into the directory of service. The API mimics Maiana API (http://projects.topicmapslab.de/projects/maiana/wiki/API_Controller) created in Topic Maps Labs (http://www.topicmapslab.de/).
Wandora features separate import and export tools that use original Maiana API, that can be used to import and export topic maps into Waiana too. These import and export tools locate in the org.wandora.application.tools.maiana package.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
WaianaService.WaianaAPIRequestUtils |
class |
WaianaService.WaianaStorage |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
allowURLParameterUsage |
protected static java.text.DateFormat |
df |
private WaianaService.WaianaStorage |
storage |
tmManagerappStartPage, topicRequestKey, webAppNameactionParamKey, handledActions, httpHeaders, isDefaultAction, replacements, replacementsInitialized, servletModuleengine, initScript, persistentObjects, scriptManager, startScript, stopScriptautoStart, isInitialized, isRunning, logging, loggingModule, moduleManager| Constructor and Description |
|---|
WaianaService() |
| Modifier and Type | Method and Description |
|---|---|
protected static org.json.JSONObject |
createReply(int code,
java.lang.String msg) |
protected static org.json.JSONObject |
createReply(int code,
java.lang.String msg,
java.lang.String data) |
protected static java.lang.String |
getDateString() |
java.util.Collection<Module> |
getDependencies(ModuleManager manager)
Returns all the modules this module depends on.
|
protected org.json.JSONObject |
getRequestJSON(javax.servlet.http.HttpServletRequest request) |
boolean |
handleAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModulesServlet.HttpMethod _method,
java.lang.String _action,
User user)
Handles this action.
|
void |
init(ModuleManager manager,
java.util.HashMap<java.lang.String,java.lang.Object> settings)
Initialises the module.
|
(package private) static java.lang.String |
readFile(java.lang.String path) |
void |
start(ModuleManager manager)
Starts the module.
|
void |
stop(ModuleManager manager)
Stops the module.
|
protected static void |
writeFile(java.lang.String fname,
java.lang.String data) |
protected static void |
writeStringToResponse(javax.servlet.http.HttpServletResponse response,
java.lang.String str) |
resolveTopicgetAppName, getAppStartPage, getAppTopicPageaddHandledAction, doReplacements, handleRequest, isHandleAction, setActionParamKey, setHttpHeadersgetScriptEngineisInitialized, isRunning, requireLogging, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisInitialized, isRunningprivate WaianaService.WaianaStorage storage
private boolean allowURLParameterUsage
protected static java.text.DateFormat df
public void init(ModuleManager manager, java.util.HashMap<java.lang.String,java.lang.Object> settings) throws ModuleException
ModuleInitialises the module. After constructor, this is the first method called in the life cycle of a module. It should not perform anything time consuming or anything with notable outside side effects. It should only read the parameters and initialise the module so that it can later be started. Note that a module being initialised doesn't mean that it necessarily will ever be started.
A ModuleException may be thrown if something vital is missing from the parameters or they are not sensible. In some cases you may not want to throw an exception even if vital initialisation information is missing. If, for example, it is possible that the module is initialised in some other way between the init and the start method calls. A ModuleException may also be thrown at the start method if the module is still not initialised.
init in interface Moduleinit in class AbstractWebAppmanager - The module manager handling this module. You may keep a
reference to it if needed.ModuleExceptionpublic void stop(ModuleManager manager)
Modulestop in interface Modulestop in class AbstractTopicWebAppmanager - The module manager handling this module.public void start(ModuleManager manager) throws ModuleException
Modulestart in interface Modulestart in class AbstractTopicWebAppmanager - The module manager handling this module.ModuleExceptionpublic java.util.Collection<Module> getDependencies(ModuleManager manager) throws ModuleException
ModulegetDependencies in interface ModulegetDependencies in class AbstractTopicWebAppmanager - The module manager handling this module.ModuleExceptionpublic boolean handleAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModulesServlet.HttpMethod _method,
java.lang.String _action,
User user)
throws javax.servlet.ServletException,
java.io.IOException,
ActionException
AbstractActionhandleAction in class AbstractActionrequest - The HTTP Request.response - The HTTP response._method - The HTTP method of the request._action - The parsed action id.user - The logged in user, or null if not applicable.javax.servlet.ServletExceptionjava.io.IOExceptionActionExceptionprotected org.json.JSONObject getRequestJSON(javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
java.io.IOExceptionprotected static org.json.JSONObject createReply(int code,
java.lang.String msg,
java.lang.String data)
protected static org.json.JSONObject createReply(int code,
java.lang.String msg)
protected static java.lang.String getDateString()
protected static void writeStringToResponse(javax.servlet.http.HttpServletResponse response,
java.lang.String str)
protected static void writeFile(java.lang.String fname,
java.lang.String data)
throws java.io.IOException
java.io.IOExceptionstatic java.lang.String readFile(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionCopyright 2004-2015 Wandora Team