|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.content.items.Item
org.activemath.content.items.DynamicItem
public abstract class DynamicItem
This class defines a datatype DynamicItem, which supplies features for Dynamic Item.
The Datatype DynmaicItem is originally transformed from
OJDynamicItem. As the OJDynamicItem is an
OJElement, which is only visible internally, the Datatype
DynamicItem serves as an external interface to other packages and even
thirdparty programm like some kind of service Call and NLG Generator. Because
the class extends his parent class Item, it overwrite many method of its
parent too. As the class DynamicItem has an abstract method
executeDynamicItem(), the class is also an abstract class, which have
following Instances:
DynamicItemDynamicTask DynamicItemText DynamicItemLearningSystem
| Field Summary | |
|---|---|
protected static Category |
log
|
protected String |
queryName
the queryname or pedagogical Objective, like "introduction", "getexcersise" |
protected List |
queryParameters
A List, which contains property, value pairs as Lists. |
protected List<String> |
references
a List of all mbase references(String) |
protected static long |
serializedNumber
This is the static member for counting the generated Object. |
protected String |
serviceName
Actually this is only used for service like icmap. |
protected String |
type
The type of this Object, which can be one of the TYPE defined in his sub classes. |
protected String |
userId
Currently there's no case we need to store this information. |
| Fields inherited from class org.activemath.content.items.Item |
|---|
copyrights, dependsOn, factory, flavorSet, forId, forIds, id, mbaseId, metadata, omdocTag, omdocType, relatedTo, relationsIn, relationsOut, shouldUseTitleFromID, theoryId, title, titles |
| Constructor Summary | |
|---|---|
protected |
DynamicItem(OJDynamicItem ojitem,
String id)
This Constructor is a common constructor for each type of DynamicItem. |
| Method Summary | |
|---|---|
Map |
getCopyrightData()
|
OJElement |
getCopyrightElement()
|
String |
getForId()
|
List |
getForIds()
we don't have any for Ids for dynamic item. |
List |
getIncomingRelations()
|
Metadata |
getMetadata()
|
OJElement |
getMetadataElement()
|
List |
getOutgoingRelations()
Get or build outgoing relations for this item. |
String |
getQueryName()
|
List |
getQueryParameters()
|
List |
getReferences()
|
static long |
getSerializedNumber()
count up the number of object |
String |
getServiceName()
|
Map<String,String> |
getTitles(String userId)
|
String |
getType()
|
boolean |
hasFlavors()
|
protected List |
initQueryParameters(OJDynamicItem ojitem)
Initiate the member queryParameters |
abstract void |
initTitles(String userId)
|
abstract List |
instanciateDynamicItem(String userId)
This is a stratergie method for all kind of DynamicItem. |
boolean |
isLazyTask()
check if this Item is a kind of LazyTask |
boolean |
isNLGText()
check if the dynamic item is a NLGText by checking the servicename. |
boolean |
isServiceCall()
check if this Item is a serviceCall |
boolean |
isText()
check if this Item is a kind of NIText |
void |
setLink(String url,
String type,
int width,
int height,
Map<String,String> linkTextMap,
OJElement localOmdocElement)
We build up the hyperlink for the item here. |
OJDynamicItem |
toOJDynamicItem()
This method transfers a DynamicItem data object to a OJDynamicItem. |
String |
toString()
Return type + serviceName + queryName |
| Methods inherited from class org.activemath.content.items.Item |
|---|
equals, getDependsOn, getDifficulty, getFlavorSet, getFullDOM, getId, getMBaseId, getNumWords, getOmdocTag, getOmdocType, getRelatedTo, getSystemId, getTextualDOM, getTheoryId, getTitle, getTitle, getTitle, getTitles, hashCode, setUseTitleFromID |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static Category log
protected static long serializedNumber
protected String type
protected String serviceName
protected String queryName
protected List<String> references
protected List queryParameters
protected String userId
| Constructor Detail |
|---|
protected DynamicItem(OJDynamicItem ojitem,
String id)
id - ojitem - | Method Detail |
|---|
protected List initQueryParameters(OJDynamicItem ojitem)
queryParameters
public List getReferences()
public String getQueryName()
public List getQueryParameters()
public String getServiceName()
public String getType()
public boolean isLazyTask()
public boolean isServiceCall()
public boolean isText()
public abstract List instanciateDynamicItem(String userId)
List, e.g.
by LazyTask it is a list of mbase Ids; or they can put the result as the
first element of the list, if the service returns only one data object.
The concret implement is in seperate subclass descripted.
- Parameters:
userId - - may be null
- Returns:
- an empty List if the caller don't expect any result,
a list of mbase Ids for dynamicItemLazyTask as result,
null if there's something wrong with executing.
public abstract void initTitles(String userId)
public boolean isNLGText()
public void setLink(String url,
String type,
int width,
int height,
Map<String,String> linkTextMap,
OJElement localOmdocElement)
url - width - height - type - public OJDynamicItem toOJDynamicItem()
public Map<String,String> getTitles(String userId)
public String toString()
toString in class Itempublic static long getSerializedNumber()
public List getForIds()
getForIds in class Itempublic List getIncomingRelations()
getIncomingRelations in class Itempublic List getOutgoingRelations()
ItemRelation list is initialized lazily on first access.
Outgoing relations are based on MBaseRef.getDependencies(), whose result is turned into a list of ItemRelation objects.
getOutgoingRelations in class Itempublic Map getCopyrightData()
getCopyrightData in class Itempublic OJElement getCopyrightElement()
getCopyrightElement in class Itempublic String getForId()
getForId in class Itempublic boolean hasFlavors()
hasFlavors in class Itemtrue if flavors are available for this itempublic Metadata getMetadata()
getMetadata in class Itempublic OJElement getMetadataElement()
getMetadataElement in class Item
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||