public abstract class OwAbstractInfoProvider extends Object implements OwInfoProvider
Abstract Information Provider. This implementation is based on a XML request and response.
In the handleRequest will be try to parse the request body as a
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
PARAM_CONTEXT, PARAM_DMSID
Constructor and Description |
---|
OwAbstractInfoProvider() |
Modifier and Type | Method and Description |
---|---|
void |
handleRequest(OwInfoRequest request_p,
OutputStream answer_p)
Method called to be process a request.
|
protected abstract String |
process(Node item_p)
Process XML node (item) and return the
String representation for the node to set.
|
protected void |
sendAnswer(String answer_p,
OutputStream sendStream_p)
Method transform the given answer into a byte array (UTF-8)
and sending through given OutputStream back.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
public void handleRequest(OwInfoRequest request_p, OutputStream answer_p) throws OwException, IOException
OwInfoProvider
handleRequest
in interface OwInfoProvider
request_p
- OwInformationRequest to processanswer_p
- OutputStream to write back answerIOException
- if problems with any I/O handlingOwException
protected void sendAnswer(String answer_p, OutputStream sendStream_p) throws UnsupportedEncodingException, IOException
answer_p
- String answer to sendsendStream_p
- OutputStream used for answeringUnsupportedEncodingException
- if conversion of String to UTF-8 byte array failsIOException
- if sending failed using the given OutputStreamprotected abstract String process(Node item_p)
A node could be:
<prop>NumOfSegments</prop>
Attention returning null will create an empty node
as response. (in this example <NumOfSegments />
)
item_p
- Node root of single item requestCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.