com.wewebu.ow.server.ui.viewer
Class OwAbstractAnnotationInfoProvider<T>

java.lang.Object
  extended by com.wewebu.ow.server.ui.viewer.OwAbstractAnnotationInfoProvider<T>
All Implemented Interfaces:
OwAnnotationInfoProvider, OwInfoProvider

public abstract class OwAbstractAnnotationInfoProvider<T>
extends Object
implements OwAnnotationInfoProvider

Abstract OwAnnotationProvider. Implements the default handling for annotation information requests, and creating corresponding response.

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.2.0.0

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.ui.viewer.OwAnnotationInfoProvider
ID, PERMISSION, PERMISSIONS
 
Fields inherited from interface com.wewebu.ow.server.ui.viewer.OwInfoProvider
PARAM_CONTEXT, PARAM_DMSID
 
Constructor Summary
OwAbstractAnnotationInfoProvider()
           
 
Method Summary
protected abstract  String getAnnotationInfo(T annotation, String annotInfoType)
          Request the information of a specific type.
protected abstract  List<T> getAnnotations(String objDMSID)
          Get a list of Annotation object for current DMSID, this id represents the specific content object of the ECM system.
protected abstract  String getId(T annotObj)
          Return the Id of provided Annotation object, or by default (see also OwAnnotResultsEnum.DEFAULT_ID) can be used.
 void handleRequest(OwInfoRequest req, OutputStream answer)
          Method called to be process a request.
protected  void sendAnswer(OutputStream answerStream, String message)
          (overridable) Called only if the object has annotation, and the process of the message was correct.
 
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

OwAbstractAnnotationInfoProvider

public OwAbstractAnnotationInfoProvider()
Method Detail

handleRequest

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

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

sendAnswer

protected void sendAnswer(OutputStream answerStream,
                          String message)
                   throws UnsupportedEncodingException,
                          IOException
(overridable) Called only if the object has annotation, and the process of the message was correct.

Parameters:
answerStream - OutputStream to send the answer
message - String message to be send
Throws:
IOException - If could not send data through output stream
UnsupportedEncodingException - if message could not be converted into UTF-8 representation

getId

protected abstract String getId(T annotObj)
Return the Id of provided Annotation object, or by default (see also OwAnnotResultsEnum.DEFAULT_ID) can be used.

Parameters:
annotObj - T the current object representing the annotation
Returns:
String representing the Id

getAnnotations

protected abstract List<T> getAnnotations(String objDMSID)
Get a list of Annotation object for current DMSID, this id represents the specific content object of the ECM system.

Parameters:
objDMSID - String DMSID
Returns:
List of annotations, or empty list

getAnnotationInfo

protected abstract String getAnnotationInfo(T annotation,
                                            String annotInfoType)
Request the information of a specific type.

Parameters:
annotation - T the annotation object for which information is requested
annotInfoType - String representing the information type (see also OwAnnotInfoEnum)
Returns:
String representing the result (see also OwAnnotResultsEnum


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.