|
Esri Geoportal Server 1.2.9
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.gpt.control.georss.ExtJsonFeedWriter
public class ExtJsonFeedWriter
JSON feed writer. Writes response in JSON (or pretty JSON) format.
Uses json.writer.className parameter from gpt.xml to create an instance. Creates default instance if parameter is empty. Default implementation uses json.predicate.banned parameter from gpt.xml, which is a regular expression used to stop printing certain fields. Note that fields beginning with "index.sys.xml" are not printed by default; the only way to have it printed is to specify them explicitely in outFields request parameter.
JsonSearchEngine
Field Summary | |
---|---|
protected RequestContext |
context
request context |
protected static IsoDateFormat |
DF
ISO date format |
protected static Logger |
LOG
Logger. |
protected MessageBroker |
messageBroker
message broker |
protected Map<String,String[]> |
parameterMap
parameter map |
protected Pattern |
predicateBanned
predicates |
protected RestQuery |
query
original query |
protected PrintWriter |
writer
print writer |
Constructor Summary | |
---|---|
ExtJsonFeedWriter(HttpServletRequest request,
RequestContext context,
PrintWriter writer,
RestQuery query,
Boolean pretty)
Creates instance of the feed. |
|
ExtJsonFeedWriter(Map<String,String[]> parameterMap,
RequestContext context,
PrintWriter writer,
RestQuery query,
Boolean pretty)
Creates instance of the feed. |
Method Summary | |
---|---|
protected Set<String> |
buildOutFieldsSet()
Builds collection of names of fields for output. |
protected boolean |
checkAttr(String attrName)
Checks if attribute of a given name can be printed. |
protected String |
coord(double x,
double y)
Makes coordinates. |
static ExtJsonFeedWriter |
createInstance(HttpServletRequest request,
RequestContext context,
PrintWriter writer,
RestQuery query,
Boolean pretty)
Creates instance of the feed writer. |
static ExtJsonFeedWriter |
createInstance(Map<String,String[]> parameterMap,
RequestContext context,
PrintWriter writer,
RestQuery query,
Boolean pretty)
Creates instance of the feed writer. |
protected static String |
getConfigParam(String paramName)
Gets configuration parameter. |
MessageBroker |
getMessageBroker()
Gets message broker |
protected String |
getOutputSpatialReference()
Gets output spatial reference. |
protected String |
getRequestParam(String paramName)
Gets request parameter. |
protected String |
guessServiceUrn(ResourceIdentifier ri,
ResourceLink link)
Guesses URN of resource link type. |
protected boolean |
hasRequestParam(String paramName)
Checks if parameter has even been supplied. |
protected void |
levelDown()
Decreases level of indentation. |
protected void |
levelUp()
Increases level of indentation. |
protected void |
print(boolean indent,
String text)
Prints a single line without ending it with a new line. |
protected void |
printAPI(boolean more)
Prints bottom links. |
protected void |
printArg(String argName,
Number argVal,
boolean more)
Prints argument. |
protected void |
printArg(String argName,
String argVal,
boolean more)
Prints argument. |
protected boolean |
printAttr(boolean before,
String argName,
long argVal)
Prints attribute. |
protected boolean |
printAttr(boolean before,
String argName,
String argVal)
Prints attribute. |
protected void |
printAttributes(String name,
IFeedRecord r,
boolean more)
Prints attributes. |
protected void |
printField(IFeedRecords.FieldMeta f,
boolean more)
Prints a field. |
protected void |
printGeometry(Envelope env,
boolean more)
Prints geometry. |
protected void |
printLink(ResourceIdentifier ri,
ResourceLink link,
boolean more)
Prints a link. |
protected void |
printLink(String url,
String tag,
String label,
String urn,
boolean more)
Prints link. |
protected void |
printLinks(ResourceLinks links,
boolean more)
Prints all links. |
protected void |
println(String text)
Prints a single line. |
protected void |
printPolygon(Envelope env)
Prints polygon. |
protected void |
printPolygonShape(String name,
Envelope env,
boolean more)
Prints a polygon. |
protected void |
printRecord(IFeedRecord r,
Envelope env,
boolean more)
Prints record. |
protected void |
printRecords(IFeedRecords records,
boolean more)
Prints all records. |
protected void |
printResources(ResourceLinks links,
boolean more)
Prints all resources. |
protected void |
printTab()
Prints tabulator. |
void |
setMessageBroker(MessageBroker messageBroker)
Sets message broker |
protected String |
sp()
Creates a single space. |
void |
write(IFeedRecords records)
Writers records. |
protected void |
writeCountOnly(int numberOfHits)
Writes number of matching records only. |
protected void |
writeIdsOnly(List<IFeedRecord> records)
Writes records ids only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOG
protected static final IsoDateFormat DF
protected Map<String,String[]> parameterMap
protected final RequestContext context
protected PrintWriter writer
protected RestQuery query
protected Pattern predicateBanned
protected MessageBroker messageBroker
Constructor Detail |
---|
public ExtJsonFeedWriter(HttpServletRequest request, RequestContext context, PrintWriter writer, RestQuery query, Boolean pretty)
request
- HTTP requestcontext
- request contextwriter
- writer to write feedquery
- querypretty
- true
to print pretty responsepublic ExtJsonFeedWriter(Map<String,String[]> parameterMap, RequestContext context, PrintWriter writer, RestQuery query, Boolean pretty)
parameterMap
- parameter mapcontext
- request contextwriter
- writer to write feedquery
- querypretty
- true
to print pretty responseMethod Detail |
---|
public static ExtJsonFeedWriter createInstance(Map<String,String[]> parameterMap, RequestContext context, PrintWriter writer, RestQuery query, Boolean pretty)
parameterMap
- parameter mapcontext
- request contextwriter
- writerquery
- querypretty
- true
for 'pretty' JSON output
ExtJsonFeedWriter
public static ExtJsonFeedWriter createInstance(HttpServletRequest request, RequestContext context, PrintWriter writer, RestQuery query, Boolean pretty)
request
- HTTP servlet requestcontext
- request contextwriter
- writerquery
- querypretty
- true
for 'pretty' JSON output
ExtJsonFeedWriter
public void setMessageBroker(MessageBroker messageBroker)
messageBroker
- the messageBroker to setpublic MessageBroker getMessageBroker()
public void write(IFeedRecords records)
FeedWriter
write
in interface FeedWriter
records
- records to writeprotected void writeCountOnly(int numberOfHits)
numberOfHits
- protected void writeIdsOnly(List<IFeedRecord> records)
records
- list of recordsprotected void printField(IFeedRecords.FieldMeta f, boolean more)
f
- fieldmore
- more fieldsprotected void printRecords(IFeedRecords records, boolean more)
records
- records to printmore
- true
if more info will be printed after that
sectionprotected void printRecord(IFeedRecord r, Envelope env, boolean more)
r
- record to printenv
- envelopemore
- true
if more info will be printed after that
sectionprotected void printAttributes(String name, IFeedRecord r, boolean more)
name
- namer
- recordmore
- true
if more info will be printed after that
sectionprotected void printGeometry(Envelope env, boolean more)
env
- geometrymore
- flag to indicate if there will be more argumentsprotected void printPolygonShape(String name, Envelope env, boolean more)
env
- protected void printPolygon(Envelope env)
env
- polygon to printprotected void printLinks(ResourceLinks links, boolean more)
links
- collection of resource linksmore
- flag to indicate if there will be more argumentsprotected void printResources(ResourceLinks links, boolean more)
links
- collection of resource linksmore
- flag to indicate if there will be more argumentsprotected final void printLink(ResourceIdentifier ri, ResourceLink link, boolean more)
ri
- resource identifierlink
- resource linkmore
- flag to indicate if there will be more argumentsprotected void printLink(String url, String tag, String label, String urn, boolean more)
url
- urltag
- taglabel
- labelurn
- classified as urnmore
- flag to indicate if there will be more argumentsprotected void printAPI(boolean more)
more
- more linksprotected String guessServiceUrn(ResourceIdentifier ri, ResourceLink link)
ri
- instance of resource identifierlink
- resource link
protected final void printArg(String argName, String argVal, boolean more)
argName
- argument nameargVal
- argument valuemore
- flag to indicate if there will be more argumentsprotected final void printArg(String argName, Number argVal, boolean more)
argName
- argument nameargVal
- argument valuemore
- flag to indicate if there will be more argumentsprotected final boolean printAttr(boolean before, String argName, String argVal)
before
- argName
- argument nameargVal
- argument value
true
if anything has been printedprotected final boolean printAttr(boolean before, String argName, long argVal)
before
- argName
- argument nameargVal
- argument value
true
if anything has been printedprotected String coord(double x, double y)
x
- x coordinatey
- y coordinate
protected boolean checkAttr(String attrName)
attrName
- attribute name
true
if attribute can be printedprotected Set<String> buildOutFieldsSet()
protected static String getConfigParam(String paramName)
paramName
- parameter name
protected String getRequestParam(String paramName)
paramName
- parameter name
protected boolean hasRequestParam(String paramName)
paramName
- parameter name
true
if parameter is present (even an empty string)protected String getOutputSpatialReference()
protected final void levelUp()
protected final void levelDown()
protected final void println(String text)
text
- text to printprotected final void print(boolean indent, String text)
indent
- true
to indent the linetext
- text to printprotected final void printTab()
protected final String sp()
|
Esri Geoportal Server 1.2.9
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |