org.ow2.weblab.content.api
Class ContentManager

java.lang.Object
  extended by org.ow2.weblab.content.api.ContentManager

public class ContentManager
extends java.lang.Object


Field Summary
static java.lang.String CONTENT_MANAGER_PROPERTIES_FILE
           
protected static ContentManager instance
           
protected static java.lang.Boolean loaded
           
protected  org.apache.commons.logging.Log logger
           
protected static ContentReader reader
           
static java.lang.String READER_DEFAULT_IMPLEMENTATION
           
static java.lang.String READER_IMPLEMENTATION
           
protected static ContentWriter writer
           
static java.lang.String WRITER_DEFAULT_IMPLEMENTATION
           
static java.lang.String WRITER_IMPLEMENTATION
           
 
Method Summary
static ContentManager getInstance()
          Default starting method to get the ContentManager instance.
 java.io.File readNativeContent(org.ow2.weblab.core.model.Resource res)
          Read annotation on the input resource and get access to its native content through a JAVA file.
 java.io.File readNormalisedContent(org.ow2.weblab.core.model.Resource res)
          Read annotation on the input resource and get access to its normalised content through a JAVA file.
 java.net.URI writeNativeContent(java.io.InputStream content, org.ow2.weblab.core.model.Resource res)
          Write the input stream to the content manager and annotate the WebLab resource to link it to the native content
 java.net.URI writeNormalisedContent(java.io.InputStream content, org.ow2.weblab.core.model.Resource res)
          Write the input stream to the content manager and annotate the WebLab resource to link it to the normalised content
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_MANAGER_PROPERTIES_FILE

public static final java.lang.String CONTENT_MANAGER_PROPERTIES_FILE
See Also:
Constant Field Values

READER_IMPLEMENTATION

public static final java.lang.String READER_IMPLEMENTATION
See Also:
Constant Field Values

READER_DEFAULT_IMPLEMENTATION

public static final java.lang.String READER_DEFAULT_IMPLEMENTATION
See Also:
Constant Field Values

WRITER_IMPLEMENTATION

public static final java.lang.String WRITER_IMPLEMENTATION
See Also:
Constant Field Values

WRITER_DEFAULT_IMPLEMENTATION

public static final java.lang.String WRITER_DEFAULT_IMPLEMENTATION
See Also:
Constant Field Values

loaded

protected static java.lang.Boolean loaded

instance

protected static ContentManager instance

writer

protected static ContentWriter writer

reader

protected static ContentReader reader

logger

protected final org.apache.commons.logging.Log logger
Method Detail

getInstance

public static ContentManager getInstance()
Default starting method to get the ContentManager instance.

Returns:
the ContentManager instance

writeNativeContent

public java.net.URI writeNativeContent(java.io.InputStream content,
                                       org.ow2.weblab.core.model.Resource res)
                                throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Write the input stream to the content manager and annotate the WebLab resource to link it to the native content

Parameters:
res - standard WebLab Resource
content - an InputStream which could be consumed to get the raw content
Returns:
the URI of the content (for information)
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

writeNormalisedContent

public java.net.URI writeNormalisedContent(java.io.InputStream content,
                                           org.ow2.weblab.core.model.Resource res)
                                    throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Write the input stream to the content manager and annotate the WebLab resource to link it to the normalised content

Parameters:
res - standard WebLab Resource
content - an InputStream which could be consumed to get the raw content
Returns:
the URI of the content (for information)
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

readNativeContent

public java.io.File readNativeContent(org.ow2.weblab.core.model.Resource res)
                               throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Read annotation on the input resource and get access to its native content through a JAVA file. Only read access are guaranted on the returned File

Parameters:
a - standard WebLab Resource
Returns:
a java File object with read rights
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

readNormalisedContent

public java.io.File readNormalisedContent(org.ow2.weblab.core.model.Resource res)
                                   throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Read annotation on the input resource and get access to its normalised content through a JAVA file. Only read access are guaranted on the returned File

Parameters:
a - standard WebLab Resource
Returns:
a java File object with read rights
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException


Copyright © 2004-2011. All Rights Reserved.