org.activemath.content
Class Page

java.lang.Object
  extended by org.activemath.content.Page
All Implemented Interfaces:
Cloneable

public class Page
extends Object
implements Cloneable

Content abstraction of a Page. Contains references to content Items


Field Summary
protected static Logger log
           
 
Method Summary
 void addItems(List itemsToAdd, String locationItemId)
          add a new List of content Ids (mbaseIds) after the given ItemId into the itemIds of this Page.
 Object clone()
           
 boolean containsDynamicItem()
           
 boolean containsDynamicTask()
           
 boolean containsNonInstantiatedDynamicItem()
           
 boolean dynamicItemWasDisplayed()
           
 Book getBook()
           
 List<String> getExerciseIds()
           
 String getId()
           
 List<String> getItemIds()
           
 int getNumber()
           
 String getTitle()
           
 String getUniqueId()
           
 void instantiateDynamicItems(String userId)
          Currently all the dynamicItem will be treated as non-instantiated, because the execution of part of kinds of dynamicItem occurs no more in logical level but in presentation level.
 boolean isDynamicItemInstanciated()
           
 void removeItem(String itemId)
          remove the given ItemId from the page and the relevant element from Omgroup.
 void setDynamicItemWasDisplayed(boolean flag)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static Logger log
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getId

public String getId()

getUniqueId

public String getUniqueId()

getTitle

public String getTitle()

getItemIds

public List<String> getItemIds()
Returns:
List of all content item Ids (String)

getExerciseIds

public List<String> getExerciseIds()
Returns:
List of all content item Ids that are *interactive* exercises (String)

getNumber

public int getNumber()

containsNonInstantiatedDynamicItem

public boolean containsNonInstantiatedDynamicItem()

getBook

public Book getBook()
Returns:

removeItem

public void removeItem(String itemId)
remove the given ItemId from the page and the relevant element from Omgroup.

Parameters:
itemId -

addItems

public void addItems(List itemsToAdd,
                     String locationItemId)
add a new List of content Ids (mbaseIds) after the given ItemId into the itemIds of this Page.

Parameters:
itemsToAdd - (List of mbase ids/String)
locationItemId -

instantiateDynamicItems

public void instantiateDynamicItems(String userId)
Currently all the dynamicItem will be treated as non-instantiated, because the execution of part of kinds of dynamicItem occurs no more in logical level but in presentation level. We just instance them to a link-like text item, then the presentation part will worry about the execution of such link. This method instantiated the DynamicItems on the Page. All items in this Page will be checked. There are 2 cases: All the dynamicItems will be only instantiated once, on other word, they will be executed once before the user see the page and only the result will be shown to the user. Meanwhile the result will be saved and the omgroup from the OJDocument will be updated accordingly.

Parameters:
userId -

dynamicItemWasDisplayed

public boolean dynamicItemWasDisplayed()
Returns:
Returns true if the dynamic items on this page were displayed

setDynamicItemWasDisplayed

public void setDynamicItemWasDisplayed(boolean flag)
Parameters:
dynamicItemWasDisplayed - The dynamicItemWasDisplayed to set.

containsDynamicTask

public boolean containsDynamicTask()
Returns:
Returns true, if the page contains a dynamic task

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

containsDynamicItem

public boolean containsDynamicItem()

isDynamicItemInstanciated

public boolean isDynamicItemInstanciated()