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
ID, PERMISSION, PERMISSIONS
PARAM_CONTEXT, PARAM_DMSID
Constructor and Description |
---|
OwAbstractAnnotationInfoProvider() |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
public void handleRequest(OwInfoRequest req, OutputStream answer) throws OwException, IOException
OwInfoProvider
handleRequest
in interface OwInfoProvider
req
- OwInformationRequest to processanswer
- OutputStream to write back answerIOException
- if problems with any I/O handlingOwException
protected void sendAnswer(OutputStream answerStream, String message) throws UnsupportedEncodingException, IOException
answerStream
- OutputStream to send the answermessage
- String message to be sendIOException
- If could not send data through output streamUnsupportedEncodingException
- if message could not be converted into UTF-8 representationprotected abstract String getId(T annotObj)
OwAnnotResultsEnum.DEFAULT_ID
) can be used.annotObj
- T the current object representing the annotationprotected abstract List<T> getAnnotations(String objDMSID)
objDMSID
- String DMSIDprotected abstract String getAnnotationInfo(T annotation, String annotInfoType)
annotation
- T the annotation object for which information is requestedannotInfoType
- String representing the information type (see also OwAnnotInfoEnum
)OwAnnotResultsEnum
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.