com.wewebu.ow.server.ui.viewer
Class OwAbstractInfoProvider

java.lang.Object
  extended by com.wewebu.ow.server.ui.viewer.OwAbstractInfoProvider
All Implemented Interfaces:
OwInfoProvider

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

Since:
3.1.0.0

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.ui.viewer.OwInfoProvider
PARAM_CONTEXT, PARAM_DMSID
 
Constructor Summary
OwAbstractInfoProvider()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.wewebu.ow.server.ui.viewer.OwInfoProvider
getContext
 

Constructor Detail

OwAbstractInfoProvider

public OwAbstractInfoProvider()
Method Detail

handleRequest

public void handleRequest(OwInfoRequest request_p,
                          OutputStream answer_p)
                   throws OwException,
                          IOException
Description copied from interface: OwInfoProvider
Method called to be process a request.

Specified by:
handleRequest in interface OwInfoProvider
Parameters:
request_p - OwInformationRequest to process
answer_p - OutputStream to write back answer
Throws:
IOException - if problems with any I/O handling
OwException

sendAnswer

protected void sendAnswer(String answer_p,
                          OutputStream sendStream_p)
                   throws UnsupportedEncodingException,
                          IOException
Method transform the given answer into a byte array (UTF-8) and sending through given OutputStream back.

Parameters:
answer_p - String answer to send
sendStream_p - OutputStream used for answering
Throws:
UnsupportedEncodingException - if conversion of String to UTF-8 byte array fails
IOException - if sending failed using the given OutputStream

process

protected abstract String process(Node item_p)
Process XML node (item) and return the String representation for the node to set.

A node could be: <prop>NumOfSegments</prop>

Attention returning null will create an empty node as response. (in this example <NumOfSegments />)

Parameters:
item_p - Node root of single item request
Returns:
null or String representing the value


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.