org.activemath.tutor.control
Class BookGenerator

java.lang.Object
  extended by org.activemath.tutor.control.BookGenerator

public class BookGenerator
extends Object

Generate a book with help of course generator.


Field Summary
protected  Book book
           
static String BOOKGENERATOR_KEY
           
protected  Exception exception
           
protected  TutorialControl tutorialControl
           
 
Constructor Summary
BookGenerator(String userId, String bookId)
           
 
Method Summary
 Book getBook()
          Get the book object of the planned book.
 String getBookId()
           
 boolean getChaptersOnly()
           
 String getDescription()
           
 Exception getException()
           
 String[] getGoals()
           
 String getGrouping()
           
 String getGroupingName()
           
 Map getInitialWorldState()
           
 int getProgress()
           
 String getScenario()
           
 String getSessionId()
           
protected  int getStatus()
           
 String getTitle()
           
 String getUserId()
           
 void run()
           
 void setChaptersOnly(boolean b)
           
 void setDescription(String string)
           
 void setGoals(String[] strings)
           
 void setGrouping(String string)
           
 void setGroupingName(String string)
           
 void setInitialWorldState(Map initialWorldState)
           
 void setScenario(String string)
           
 void setSessionId(String sessionId)
           
 void setTitle(String string)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOKGENERATOR_KEY

public static final String BOOKGENERATOR_KEY
See Also:
Constant Field Values

exception

protected Exception exception

book

protected Book book

tutorialControl

protected TutorialControl tutorialControl
Constructor Detail

BookGenerator

public BookGenerator(String userId,
                     String bookId)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getProgress

public int getProgress()
Returns:
planning progress (0-100)

getException

public Exception getException()

getStatus

protected int getStatus()

run

public void run()

getUserId

public String getUserId()

getBookId

public String getBookId()

getTitle

public String getTitle()

setTitle

public void setTitle(String string)

getDescription

public String getDescription()

setDescription

public void setDescription(String string)

getGroupingName

public String getGroupingName()

setGroupingName

public void setGroupingName(String string)

getGrouping

public String getGrouping()

setGrouping

public void setGrouping(String string)

getScenario

public String getScenario()

setScenario

public void setScenario(String string)

getGoals

public String[] getGoals()

setChaptersOnly

public void setChaptersOnly(boolean b)

getChaptersOnly

public boolean getChaptersOnly()

setGoals

public void setGoals(String[] strings)

getBook

public Book getBook()
Get the book object of the planned book.

This method will clear the reference to the book once it has been fetched successfully in order to avoid possible memory leaks.

Returns:
the newly created book, or null if still planning.
Throws:
IllegalStateException - if book has already been fetched.

getSessionId

public String getSessionId()
Returns:
Returns the sessionId.

setSessionId

public void setSessionId(String sessionId)
Parameters:
sessionId - The sessionId to set.

setInitialWorldState

public void setInitialWorldState(Map initialWorldState)
Parameters:
initialWorldState - the initialWorldState to set

getInitialWorldState

public Map getInitialWorldState()
Returns:
the initialWorldState