org.activemath.presentation.preproc
Class OmletExpresserTask

java.lang.Object
  extended by org.activemath.presentation.preproc.OmletExpresserTask
All Implemented Interfaces:
Task

public class OmletExpresserTask
extends Object
implements Task

This task changes all the omlet tags for which a proxy-factory exists and calls the correspond org.activemath.proxies.ProxyFactory#getTagInPage replacing the complete omlet element by the returned HTML text. This text will hopefully be promoted to real HTML once the XSL process is performed.

Note that this pre-processor task requires the item JDOM nodes to be of class OJItem as otherwise the exoID value of the created link will be null.

Currently stops at metadata and OMOBJ.

This task uses the user and session parameters expected from the properties.

Version:

Field Summary
static String CVS_ID
           
static boolean DEBUG
           
static org.jdom.output.XMLOutputter debugOutputter
           
static TaskFactory factory
           
static OmletExpresserTask soleInstance
          Missing description of the Field
protected static Logger thisLogCat
           
 
Constructor Summary
OmletExpresserTask(MBaseRef mbaseRef)
           
 
Method Summary
 void close()
          no-op
static TaskFactory giveFactory()
          Simply returns the same factory which, itself, returns the only task instance as this task is purely functional.
 void open()
          no-op
 boolean perform(ListIterator listIt, org.jdom.Element elt, Map properties)
          Invoked by the pre-processor on an element elt to be processed by the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_ID

public static final String CVS_ID
See Also:
Constant Field Values

thisLogCat

protected static Logger thisLogCat

DEBUG

public static final boolean DEBUG

debugOutputter

public static final org.jdom.output.XMLOutputter debugOutputter

factory

public static final TaskFactory factory

soleInstance

public static final OmletExpresserTask soleInstance
Missing description of the Field

Constructor Detail

OmletExpresserTask

public OmletExpresserTask(MBaseRef mbaseRef)
Method Detail

giveFactory

public static TaskFactory giveFactory()
Simply returns the same factory which, itself, returns the only task instance as this task is purely functional.


open

public void open()
no-op

Specified by:
open in interface Task

close

public void close()
no-op

Specified by:
close in interface Task

perform

public boolean perform(ListIterator listIt,
                       org.jdom.Element elt,
                       Map properties)
Description copied from interface: Task
Invoked by the pre-processor on an element elt to be processed by the task.

Modifications like replacing, removing or adding an element to the parent of elt should only be performed using the currentPos list-iterator (and, as of this writing, such an operation would fail with JDOM b7 unless your element objects are OJElements. This will be fixed in further release of JDOM).

A task performance should not throw an exception unless the task cannot continue walking the subelements.

Specified by:
perform in interface Task
Parameters:
listIt - the iterator of all elements child of the same parent, currently enumerating this element may be null in which case the parent was not enumerated (i.e. when elt is the element called on PreProcessor.run(org.jdom.Element, java.util.Map).
elt - the element to process
properties - An object that lives during the performance and can be used to extract and store states and parameters for the processing action. Typical values include the user and session (as string in keys and value). Properties are passed at startup (i.e. in TaskFactory.make(org.jdom.Element, java.util.Map) and at each perform, they are the same object throughout.