|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.webapp.ws.BookListResource
public class BookListResource
Simple wrapper of the ContentManager to represent itself
as resource for web-services that can use it to create links into ActiveMath.
Used into Moodle book-page-presentation menu.
TODO: refactor this class as a generic class "content-descripting-resource"
which has a similar lifecycle than, e.g., an RSS feed on content changes, or a map
of some sort about the content: it gets reset at every content change (or so)
but is otherwise highly static hence is stored on disk and delivered from there.
| Method Summary | |
|---|---|
static BookListResource |
getInstance()
|
int |
getLength()
To populate the Content-Length header. |
String |
getMimeTypeChosen(Iterator acceptedMimeType)
Chooses the appropriate mime-type from the list provided. |
long |
getModificationDate()
To be returned to answer such queries as HTTP HEAD queries. |
void |
onActivemathEvent(ActivemathEvent event)
Handle an Activemath event. |
void |
outputRepresentation(OutputStream response,
String mimeTypes)
Outputs content a descriptive state representation in the mime-type it recognizes as appropriate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public long getModificationDate()
ResourceHandler
getModificationDate in interface ResourceHandlerpublic static BookListResource getInstance()
public void outputRepresentation(OutputStream response,
String mimeTypes)
throws IOException
ResourceHandler
outputRepresentation in interface ResourceHandlerresponse - the response to output to, the content-length,
content-type and other headers should first be set.mimeTypes - the list of mime-types as received by the
Accept-Type http header.
IOExceptionpublic String getMimeTypeChosen(Iterator acceptedMimeType)
ResourceHandlerResourceHandler.outputRepresentation(java.io.OutputStream, java.lang.String).
getMimeTypeChosen in interface ResourceHandleracceptedMimeType - an iterator of mime-types (such as text/plain
possbly followed by a semicolon with a quality value)
public int getLength()
ResourceHandler
getLength in interface ResourceHandlerpublic void onActivemathEvent(ActivemathEvent event)
ActivemathEventListenerThis method must return as quickly as possible and must not block the calling thread for long.
onActivemathEvent in interface ActivemathEventListenerevent - the event to respond to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||