Package org.opensextant.xlayer.server
Class TaggerResource
java.lang.Object
org.restlet.resource.Resource
org.restlet.resource.ServerResource
org.opensextant.xlayer.server.TaggerResource
- Direct Known Subclasses:
XlayerControl
,XponentsGeotagger
public abstract class TaggerResource
extends org.restlet.resource.ServerResource
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
doInit()
operational parameter.void
fromArray
(org.json.JSONArray a) protected org.opensextant.processing.Parameters
fromRequest
(org.json.JSONObject inputs) protected org.opensextant.processing.Parameters
fromRequest
(org.restlet.data.Form inputs) Get parameters for processing? None currently, but may be: - lower case tagging or filtering - coordinate parsing on|off Get parameters for formatting.abstract org.opensextant.extraction.Extractor
getExtractor
(String xid) void
boolean
isDebug()
protected void
parseParameters
(org.opensextant.processing.Parameters p, Set<String> kv) org.restlet.representation.Representation
ping()
Ping.abstract org.restlet.representation.Representation
process
(org.opensextant.data.TextInput input, org.opensextant.processing.Parameters jobParams) Implement the processing of a single Input given some request parameters Based on the processing and the request, format response accordingly.protected void
resetParameters
(org.opensextant.processing.Parameters job) Convenience helper to reset data.protected org.restlet.ext.json.JsonRepresentation
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getDescription, getInfo, getInfo, getName, 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, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
Methods inherited from class org.restlet.resource.Resource
doError, 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, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
-
Field Details
-
GEO_TAGGER
- See Also:
-
POSTAL_TAGGER
- See Also:
-
DATE_TAGGER
- See Also:
-
TAXON_TAGGER
- See Also:
-
extractorSet
-
log
The log. -
operation
-
FLD_FEATURES
- See Also:
-
FLD_STATUS
- See Also:
-
-
Constructor Details
-
TaggerResource
public TaggerResource()
-
-
Method Details
-
doInit
public void doInit()operational parameter.- Overrides:
doInit
in classorg.restlet.resource.Resource
-
getProperty
-
ping
public org.restlet.representation.Representation ping()Ping. trivial thing for now.- Returns:
- status
-
getExtractor
-
process
public abstract org.restlet.representation.Representation process(org.opensextant.data.TextInput input, org.opensextant.processing.Parameters jobParams) Implement the processing of a single Input given some request parameters Based on the processing and the request, format response accordingly.- Parameters:
input
- signaljobParams
- controls- Returns:
- JSON or other formatted response.
-
fromRequest
protected org.opensextant.processing.Parameters fromRequest(org.restlet.data.Form inputs) Get parameters for processing? None currently, but may be: - lower case tagging or filtering - coordinate parsing on|off Get parameters for formatting. JSON, HTML, mainly. Output represents filters + format.- Parameters:
inputs
- arguments to RESTful request- Returns:
- Xponents Parameters
-
parseParameters
-
resetParameters
protected void resetParameters(org.opensextant.processing.Parameters job) Convenience helper to reset data.- Parameters:
job
- job parameters
-
fromArray
- Parameters:
a
- JSONArray- Returns:
-
fromRequest
protected org.opensextant.processing.Parameters fromRequest(org.json.JSONObject inputs) throws org.json.JSONException - Parameters:
inputs
- the inputs- Returns:
- job parameters
- Throws:
org.json.JSONException
- on error.
-
status
- Parameters:
status
- statuserror
- error msg- Returns:
- json formatted response
-
error
-
info
-
debug
-
isDebug
public boolean isDebug()
-