org.activemath.content.items
Class DynamicItemText

java.lang.Object
  extended by org.activemath.content.items.Item
      extended by org.activemath.content.items.DynamicItem
          extended by org.activemath.content.items.DynamicItemText
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DynamicItemTCTA

public class DynamicItemText
extends DynamicItem

Dynamic Item for dynamic text. Generates a omtext element according to the given parameters. A normal text has the omtext type "narrative", a link has the omtext type "remark".

See Also:
Serialized Form

Field Summary
protected  List<OJElement> cmpList
           
protected static String DESCRIPTION
           
protected static String ITEM
           
protected  OJElement omtext
          Contains the most information of this object.
protected static String ServiceNameLink
           
protected static String ServiceNameNLG
           
protected static String TITLE
           
protected static String TYPE
          This might be defined by OJConstants, because in JShopUtil this is defined again.
protected  String url
           
protected static String URL
           
 
Fields inherited from class org.activemath.content.items.DynamicItem
log, queryName, queryParameters, references, serializedNumber, serviceName, type, userId
 
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
 
Method Summary
 void addContentMapFromPhrase(String phrase)
          Add content map into the text.
protected  void buildDOM()
          Here the omtext DOM object is built.
 OJElement getTextualDOM()
          We can get the specialised DOM text as result here.
protected  void initMetadata()
           
 void initTitles(String userId)
          For this kind of DynamicItem, there are two ways to get the title: One is to use the NLG to get the textMap, which will call the mediator to get the Titel Map from Repository.
 List instanciateDynamicItem(String userId)
          Here we execute the DynamicItemText.
 void setHelpLink(String url)
          We build up the Link for Help for the item here.
 void setLink(String url)
           
 void setText(String text, String lang)
           
 void setTitle(String title, String lang)
           
 
Methods inherited from class org.activemath.content.items.DynamicItem
getCopyrightData, getCopyrightElement, getForId, getForIds, getIncomingRelations, getMetadata, getMetadataElement, getOutgoingRelations, getQueryName, getQueryParameters, getReferences, getSerializedNumber, getServiceName, getTitles, getType, hasFlavors, initQueryParameters, isLazyTask, isNLGText, isServiceCall, isText, setLink, toOJDynamicItem, toString
 
Methods inherited from class org.activemath.content.items.Item
equals, getDependsOn, getDifficulty, getFlavorSet, getFullDOM, getId, getMBaseId, getNumWords, getOmdocTag, getOmdocType, getRelatedTo, getSystemId, getTheoryId, getTitle, getTitle, getTitle, getTitles, hashCode, setUseTitleFromID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

protected static final String TYPE
This might be defined by OJConstants, because in JShopUtil this is defined again.

See Also:
Constant Field Values

ServiceNameNLG

protected static final String ServiceNameNLG
See Also:
Constant Field Values

ServiceNameLink

protected static final String ServiceNameLink
See Also:
Constant Field Values

URL

protected static final String URL
See Also:
Constant Field Values

TITLE

protected static final String TITLE
See Also:
Constant Field Values

DESCRIPTION

protected static final String DESCRIPTION
See Also:
Constant Field Values

ITEM

protected static final String ITEM
See Also:
Constant Field Values

omtext

protected OJElement omtext
Contains the most information of this object. Method getTextualDOM() return this member.


cmpList

protected List<OJElement> cmpList

url

protected String url
Method Detail

instanciateDynamicItem

public List instanciateDynamicItem(String userId)
Here we execute the DynamicItemText. Actually, we have to do this by instanciating time. Here we also initiate the titles and Metadata.

Specified by:
instanciateDynamicItem in class DynamicItem
Parameters:
userId -
Returns:
an empty ArrayList. we don't actually need to result anything. And if null returned, the Id of the DynamicItem will be als result added to itemIds in page.

initTitles

public void initTitles(String userId)
For this kind of DynamicItem, there are two ways to get the title: One is to use the NLG to get the textMap, which will call the mediator to get the Titel Map from Repository. (This is used by NLG service) The other is to use the NLG to get the TitleMap, which will gether the titlemap from i18n Phrases. (This is used by Link service)

Specified by:
initTitles in class DynamicItem
Parameters:
userId -

buildDOM

protected void buildDOM()
Here the omtext DOM object is built.


addContentMapFromPhrase

public void addContentMapFromPhrase(String phrase)
Add content map into the text. It's flexible to add the content before or after the initialising time of the DynamicItemText.

Parameters:
phrase - (fullname of the phrase)

setText

public void setText(String text,
                    String lang)

setTitle

public void setTitle(String title,
                     String lang)

initMetadata

protected void initMetadata()

getTextualDOM

public OJElement getTextualDOM()
We can get the specialised DOM text as result here. It looks like the following example: Why is the mathematical content presented in this book important? The following section tries to answer that question. Warum sind die in diesem Buch behandelten mathematischen Inhalte wichtig? In diesem Abschnitt wird versucht, darauf eine Antwort zu geben.

Overrides:
getTextualDOM in class Item
Returns:
this item in its textual DOM representation, or null if there is a problem.

setHelpLink

public void setHelpLink(String url)
We build up the Link for Help for the item here. The type of the link is "helplink", which refers to the openHelp() method.

Parameters:
url -

setLink

public void setLink(String url)