|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.content.Book
public class Book
Describe me!
| Field Summary | |
|---|---|
protected ArrayList<String> |
allInstanciatedItems
|
protected String |
creator
|
protected OJDocument |
document
|
protected String |
id
|
protected String |
internalId
|
protected Map<String,List<Page>> |
item2pages
|
protected static Logger |
log
|
protected Metadata |
metadata
|
protected ArrayList<Page> |
pages
|
protected String |
title
|
protected Map<String,String> |
titles
|
protected Toc |
toc
|
protected static org.jdom.output.XMLOutputter |
xml
|
protected Page |
zeroPage
|
| Constructor Summary | |
|---|---|
protected |
Book()
No constructor, use @see createBook() instead |
| Method Summary | |
|---|---|
protected void |
buildPages()
Initialize the page and toc objects for this book. |
protected void |
buildPages0(OJElement elem)
Recursive page builder Will create a new @link Page when there is at least one "ref" child or "dynamic" child. |
protected Page |
buildZeroPage()
|
protected Page |
buildZeroPage(String userId)
Construct the zero page and instanciate all dynamic items on the way. |
int |
compareTo(Object o)
|
boolean |
containsDynamicItem()
Check if the book contains dynamicItems after it was instanciated once. |
static RecBook |
createBook(String recBookKey,
OJDocument document)
Create a RecBook from an OMDoc document. |
static UserBook |
createBook(String userId,
String bookId,
org.jdom.Document document,
String title,
String desc,
String scenario,
String[] goals)
Create a User Book from an OMDoc document. |
static UserBook |
createBook(String userId,
String bookId,
OJDocument document,
OJDocument skeleton)
Create a User Book from an OMDoc document and skeleton. |
static GapDetectionBook |
createGapDetectionBook(boolean store,
UserBook userBook)
Create a GapDetectionBook from a UserBook This is due to hibernate |
static org.activemath.content.TutorBook |
createTutorBook(String newId,
UserBook userBook)
Create a TutorBook from a UserBook |
boolean |
equals(Object o)
|
List<String> |
getAllInstanciatedItems()
|
List<String> |
getAllMBaseIDs()
Return a list of all Sting Ids of MbaseRefs in the UserBook. |
String |
getCollectionId()
|
static Comparator<Book> |
getComparator(String lang)
Return a Comparator for book titles in a language. |
String |
getCreator()
|
String |
getDescription(String lang)
|
Map<String,String> |
getDescriptions()
|
OJDocument |
getDocument()
Get the XML document defining this book. |
String |
getDocumentString()
Needed by Hibernate persistance |
String |
getId()
|
String |
getInternalId()
|
Metadata |
getMetadata()
|
int |
getNumExercises()
|
int |
getNumItems()
|
String |
getOwner()
Needed here so Velocity can work it out |
String |
getOwnerBookId()
|
Page |
getPage(int pageNum)
|
Page |
getPage(String pageId)
|
List<Page> |
getPages()
|
List<Page> |
getPagesContaining(String itemId)
|
String |
getTitle()
|
String |
getTitle(List languages)
Goes along the languages list and returns the first non-empty title, or any title. |
String |
getTitle(List languages,
boolean atLeastSomething)
Goes along the languages list and returns the first non-empty title. |
String |
getTitle(String lang)
Get localized Book title, without fallback to default language |
String |
getTitle(String lang,
String defaultLang)
Get localized Book title, with fallback to default language |
Map<String,String> |
getTitleMap()
|
TocEntry |
getToc()
|
TocEntry |
getTocEntry(String id)
|
TocEntry |
getTocEntryByPage(String pageId)
|
int |
hashCode()
|
boolean |
isTutorBook()
|
boolean |
isUserBook()
|
protected void |
setCreator(String creator)
|
void |
setDescription(String lang,
String desc)
|
void |
setDescriptions(Map map)
|
void |
setDocument(OJDocument document)
Set the XML document defining this book. |
void |
setDocumentString(String docString)
Needed by Hibernate persistance |
void |
setInternalId(String string)
|
void |
setNumExercises(int numExercises)
|
void |
setTitle(String string)
|
void |
setTitle(String lang,
String title)
Set book title for specific language. |
protected void |
setTitleMap(Map<String,String> titles)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Logger log
protected String id
protected String internalId
protected String title
protected Map<String,String> titles
protected String creator
protected Metadata metadata
protected OJDocument document
protected Page zeroPage
protected ArrayList<Page> pages
protected Toc toc
protected Map<String,List<Page>> item2pages
protected ArrayList<String> allInstanciatedItems
protected static org.jdom.output.XMLOutputter xml
| Constructor Detail |
|---|
protected Book()
| Method Detail |
|---|
public boolean isUserBook()
public boolean isTutorBook()
public String getOwner()
public String getOwnerBookId()
public static RecBook createBook(String recBookKey,
OJDocument document)
NullPointerException - when parameters are null,
or initializing document is garbage
public static UserBook createBook(String userId,
String bookId,
org.jdom.Document document,
String title,
String desc,
String scenario,
String[] goals)
NullPointerException - when parameters are null,
or initializing document is garbage
public static UserBook createBook(String userId,
String bookId,
OJDocument document,
OJDocument skeleton)
NullPointerException - when parameters are null,
or initializing document is garbage
public static org.activemath.content.TutorBook createTutorBook(String newId,
UserBook userBook)
public static GapDetectionBook createGapDetectionBook(boolean store,
UserBook userBook)
protected void buildPages()
protected Page buildZeroPage(String userId)
protected Page buildZeroPage()
protected void buildPages0(OJElement elem)
public String getId()
public String getCollectionId()
public String getInternalId()
public void setInternalId(String string)
public void setTitle(String string)
public String getTitle()
public Map<String,String> getTitleMap()
protected void setTitleMap(Map<String,String> titles)
public void setTitle(String lang,
String title)
public String getTitle(String lang)
public String getTitle(String lang,
String defaultLang)
lang - defaultLang -
public String getTitle(List languages,
boolean atLeastSomething)
languages - the list of languageatLeastSomething - fallback to use getTitle() which will return any title
nullpublic String getTitle(List languages)
languages - the list of language
nullpublic OJDocument getDocument()
Do not add
elements to it that are not of type OJElement.
public void setDocument(OJDocument document)
public String getDocumentString()
public void setDocumentString(String docString)
public Metadata getMetadata()
public Map<String,String> getDescriptions()
public String getDescription(String lang)
lang -
lang, or null.
public void setDescription(String lang,
String desc)
public void setDescriptions(Map map)
public TocEntry getToc()
public List<Page> getPages()
public List<Page> getPagesContaining(String itemId)
public Page getPage(int pageNum)
public Page getPage(String pageId)
pageId - a numeric string
public List<String> getAllInstanciatedItems()
public int getNumItems()
public int getNumExercises()
public void setNumExercises(int numExercises)
public TocEntry getTocEntry(String id)
null.public TocEntry getTocEntryByPage(String pageId)
null.protected void setCreator(String creator)
public String getCreator()
public int compareTo(Object o)
compareTo in interface ComparableComparable.compareTo(java.lang.Object)public boolean equals(Object o)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public static Comparator<Book> getComparator(String lang)
public boolean containsDynamicItem()
public List<String> getAllMBaseIDs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||