|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.content.items.Item
public class Item
Java abstraction of a content item. Implements Serializable for use as cache objects in org.apache.cache.Cache. Since we are not using a persistent cache, no care has been taken to provide a custom serialization. See Chapter 10 of "Effective Java" by Joshua Bloch.
| Field Summary | |
|---|---|
protected Map<String,List<String>> |
copyrights
|
protected List<Dependency> |
dependsOn
|
protected ItemFactory |
factory
|
protected FlavorSet |
flavorSet
|
protected String |
forId
|
protected List<String> |
forIds
|
protected String |
id
|
protected static Logger |
log
|
protected MBaseID |
mbaseId
|
protected Metadata |
metadata
|
protected String |
omdocTag
|
protected String |
omdocType
|
protected List<Dependency> |
relatedTo
|
protected List<ItemRelation> |
relationsIn
|
protected List<ItemRelation> |
relationsOut
|
protected boolean |
shouldUseTitleFromID
|
protected String |
theoryId
|
protected String |
title
|
protected Map<String,String> |
titles
|
| Constructor Summary | |
|---|---|
Item(String id)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
Map<String,List<String>> |
getCopyrightData()
|
OJElement |
getCopyrightElement()
|
List<Dependency> |
getDependsOn()
Deprecated. use getOutgoingRelations() instead |
String |
getDifficulty()
Deprecated. use getMetadata().getDifficulty(), now depends on learning context. |
FlavorSet |
getFlavorSet()
|
String |
getForId()
|
List<String> |
getForIds()
|
OJElement |
getFullDOM()
Provide the full DOM tree for this item, wrapped in a theory element. |
String |
getId()
|
List<ItemRelation> |
getIncomingRelations()
|
MBaseID |
getMBaseId()
|
Metadata |
getMetadata()
|
OJElement |
getMetadataElement()
|
int |
getNumWords()
|
String |
getOmdocTag()
|
String |
getOmdocType()
|
List<ItemRelation> |
getOutgoingRelations()
Get or build outgoing relations for this item. |
List<Dependency> |
getRelatedTo()
Deprecated. use getIncomingRelations() instead |
String |
getSystemId()
|
OJElement |
getTextualDOM()
Construct the DOM tree for the textual representation of this item. |
String |
getTheoryId()
|
String |
getTitle()
Get "default" title, which is the first title we get from mbase.getCommonName(). |
String |
getTitle(String lang)
Get localized item title, without fallback to default language |
String |
getTitle(String lang,
String defaultLang)
Get localized item title, with fallback to default language |
Map<String,String> |
getTitles()
|
boolean |
hasFlavors()
|
int |
hashCode()
|
void |
setUseTitleFromID(boolean should)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static Logger log
protected ItemFactory factory
protected String id
protected MBaseID mbaseId
protected String title
protected boolean shouldUseTitleFromID
protected Map<String,String> titles
protected String omdocTag
protected String omdocType
protected Map<String,List<String>> copyrights
protected Metadata metadata
protected String forId
protected List<String> forIds
protected String theoryId
protected List<Dependency> dependsOn
protected List<Dependency> relatedTo
protected List<ItemRelation> relationsOut
protected List<ItemRelation> relationsIn
protected FlavorSet flavorSet
| Constructor Detail |
|---|
public Item(String id)
| Method Detail |
|---|
public int getNumWords()
public OJElement getTextualDOM()
metadataand CMP children are fetched from MBase and put
inside a theory element.
null if there is
a problem.public OJElement getFullDOM()
This code is very similar to getTextualDOM() but fetches everything in one go instead of first getting the metadata element and then only the CMP.
null if there is an
error.public String getSystemId()
public String getId()
public MBaseID getMBaseId()
public Map<String,String> getTitles()
public String getTitle()
mbase.getCommonName().
null.public void setUseTitleFromID(boolean should)
public String getTitle(String lang)
public String getTitle(String lang,
String defaultLang)
lang - defaultLang -
public String getOmdocTag()
public String getOmdocType()
public Metadata getMetadata()
public Map<String,List<String>> getCopyrightData()
public OJElement getMetadataElement()
public OJElement getCopyrightElement()
public String getTheoryId()
public String getDifficulty()
public List<ItemRelation> getOutgoingRelations()
Relation list is initialized lazily on first access.
Outgoing relations are based on MBaseRef.getDependencies(), whose result is turned into a list of ItemRelation objects.
public List<ItemRelation> getIncomingRelations()
public List<Dependency> getDependsOn()
public List<Dependency> getRelatedTo()
public List<String> getForIds()
public String getForId()
public FlavorSet getFlavorSet()
public boolean hasFlavors()
true if flavors are available for this itempublic String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||