public class SoftwareServerRestlet
extends org.restlet.resource.ServerResource
Constructor and Description |
---|
SoftwareServerRestlet() |
Modifier and Type | Method and Description |
---|---|
static String |
createHTMLList(String list,
String link,
boolean APPEND,
String title)
Convert a line separated list into an HTML list of links.
|
void |
executeTask(int session,
String application_alias,
String task_string,
String file,
String format)
Execute a task.
|
void |
executeTaskLater(int session,
String application_alias,
String task_string,
String file,
String format)
Execute a task asynchronously.
|
String |
getApplications()
Get the applications available.
|
String |
getApplicationStack()
Get an icon representation of the available software.
|
String |
getApplicationTaskInputs(String alias,
String task)
Get the input formats supported by the given task.
|
String |
getApplicationTaskInputsOutputs(String alias,
String task)
Get the input and output formats supported by the given task.
|
String |
getApplicationTaskOutputs(String alias,
String task)
Get the output formats supported by the given task.
|
String |
getApplicationTasks(String alias)
Get the tasks available for the given application.
|
String |
getConvertForm()
Get a web form interface for converting via this restful service.
|
String |
getForm()
Get a web form interface for this restful service.
|
String |
getForm(boolean POST_UPLOADS,
String selected_application,
boolean HIDE_APPLICATIONS)
Get a web form interface for this restful service.
|
Vector<SoftwareServerAuxiliary.Subtask> |
getTask(String application_alias,
String task_string,
String filename,
String output_format)
Get the task involved in using the given applications to convert the given file to the specified output format.
|
org.restlet.representation.Representation |
httpGetHandler() |
org.restlet.representation.Representation |
httpPostHandler(org.restlet.representation.Representation entity) |
static void |
initialize()
Initialize.
|
static boolean |
isJSONRequest(org.restlet.Request request)
Check if the given request is for json only.
|
static boolean |
isPlainRequest(org.restlet.Request request)
Check if the given request is for plain text only.
|
static void |
main(String[] args)
Start the restful service.
|
static String |
queryEndpoint(String url)
Query an endpoint.
|
static String |
removeParameters(String url)
Remove parameters from a URL.
|
void |
stop()
Stop the REST interface and underlying Software Server.
|
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
doError, doInit, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toObject, toRepresentation, toString
public static void initialize()
public String getApplications()
public String getApplicationTasks(String alias)
alias
- the application aliaspublic String getApplicationTaskOutputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic String getApplicationTaskInputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic String getApplicationTaskInputsOutputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic String getApplicationStack()
public String getForm(boolean POST_UPLOADS, String selected_application, boolean HIDE_APPLICATIONS)
POST_UPLOADS
- true if this form should use POST rather than GET for uploading filesselected_application
- the default applicationHIDE_APPLICATIONS
- true if applications menu should be hiddenpublic String getForm()
public String getConvertForm()
public Vector<SoftwareServerAuxiliary.Subtask> getTask(String application_alias, String task_string, String filename, String output_format)
application_alias
- the alias of the application to use.task_string
- the task to performfilename
- the file name of the cached file to convertoutput_format
- the output formatpublic void executeTask(int session, String application_alias, String task_string, String file, String format)
session
- the session id to use while executing the taskapplication_alias
- the application to usetask_string
- the task to perform (nothing assumed to be a conversion)file
- the URL of the file to convertformat
- the output formatpublic void executeTaskLater(int session, String application_alias, String task_string, String file, String format)
session
- the session id to use while executing the taskapplication_alias
- the application to usetask_string
- the task to perform (nothing assumed to be a conversion)file
- the URL of the input fileformat
- the output format@Get public org.restlet.representation.Representation httpGetHandler()
@Post public org.restlet.representation.Representation httpPostHandler(org.restlet.representation.Representation entity)
public void stop()
public static String queryEndpoint(String url)
url
- the URL of the endpointpublic static boolean isPlainRequest(org.restlet.Request request)
request
- the requestpublic static boolean isJSONRequest(org.restlet.Request request)
request
- the requestpublic static String createHTMLList(String list, String link, boolean APPEND, String title)
list
- the line separated list of itemslink
- the URL baseAPPEND
- true if list items should be appended to the end of linktitle
- the title of the generated HTML page (can be null)public static String removeParameters(String url)
url
- the URL of a filepublic static void main(String[] args)
args
- the input argumentsCopyright © 2014. All rights reserved.