public abstract class ElementController
extends java.lang.Object
ILearningAction
or a ILearningPath
Constructor and Description |
---|
ElementController(org.tencompetence.business.model.learningpath.ILPElement element,
boolean hasButton,
boolean showImage)
Instantiates a new element controller.
|
ElementController(org.tencompetence.business.model.learningpath.ILPElement element,
boolean hasButton,
boolean showImage,
boolean isPortfolioView)
Instantiates a new element controller.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
doClick()
The server faces action handler called when the action button is clicked.
|
java.lang.String |
doToggleDescription()
The server faces action handler for the show / hide description command.
|
java.lang.String |
doToggleMetadata()
The server faces action handler for the show / hide meta data command.
|
java.lang.String |
getButtonCaption()
Gets the internationalized text for the Subscribe / Unsubscribe button.
|
java.lang.String |
getDateCompleted()
Gets the date completed.
|
java.lang.String |
getDateSubscribed()
Gets the date of subscription.
|
java.lang.String |
getDescription()
Gets the description.
|
org.tencompetence.business.model.learningpath.ILPElement |
getElement()
Gets the element associated with this controller.
|
java.lang.String |
getImageUrl()
Gets the default (140x135) image url.
|
java.lang.String |
getImageUrl16()
Gets the 16x16 image url.
|
java.lang.String |
getImageUrl32()
Gets the 32x32 image url.
|
java.lang.String |
getImageUrl48()
Gets the 48x48 image url.
|
java.lang.String |
getLegenda()
Gets the legenda for the icon.
|
java.util.List<org.tencompetence.business.model.learningpath.MetaDataEntry> |
getMetadata()
Gets the meta data entries from the element.
|
java.lang.String |
getTitle()
Gets the title.
|
java.lang.String |
getToggleDescriptionText()
Gets the toggle description text.
|
java.lang.String |
getToggleMetadataDescription()
Gets the toggle meta data description.
|
abstract java.lang.String |
handleClickEvent(org.tencompetence.business.model.learningpath.ILPElement element)
Abstract method to handle the click event of the action button.
|
boolean |
isButtonRequired()
Checks if the facelet requires a action button.
|
boolean |
isLongDescription()
Checks if the description is longer than the threshold.
|
boolean |
isMetadataExpanded()
Checks if the meta data is shown.
|
boolean |
isPortfolioView()
Checks if is show title description.
|
boolean |
isShowImage()
Do we need to show the image ?
|
void |
setInput(org.tencompetence.business.model.learningpath.ILPElement input)
Sets the ILPElement input for this controller.
|
public ElementController(org.tencompetence.business.model.learningpath.ILPElement element, boolean hasButton, boolean showImage)
element
- the ILPElement that is shown in the facelet.hasButton
- when true the facelet may show the action buttonshowImage
- the show imagepublic ElementController(org.tencompetence.business.model.learningpath.ILPElement element, boolean hasButton, boolean showImage, boolean isPortfolioView)
element
- the ILPElement that is shown in the facelet.hasButton
- when true the facelet may show the action buttonshowImage
- the show imageisPortfolioView
- is the controller used in the portfolio portlet(s)public java.lang.String getTitle()
public java.lang.String getDescription()
public java.lang.String getImageUrl16()
public java.lang.String getImageUrl32()
public java.lang.String getImageUrl48()
public java.lang.String getImageUrl()
The correct icon is determined by the type of the element and whether it is completed or subscribed.
public java.lang.String getLegenda()
public java.lang.String getButtonCaption()
public java.util.List<org.tencompetence.business.model.learningpath.MetaDataEntry> getMetadata()
Returns an empty list if the element is null.
public java.lang.String getToggleDescriptionText()
public java.lang.String getToggleMetadataDescription()
public org.tencompetence.business.model.learningpath.ILPElement getElement()
public boolean isLongDescription()
public boolean isMetadataExpanded()
public boolean isButtonRequired()
public java.lang.String doClick()
This method calls the abstract handleClickEvent()
method to perform the actual handling.
handleSubscribeEvent
public java.lang.String doToggleDescription()
Toggles the state of the long description text.
public java.lang.String doToggleMetadata()
public void setInput(org.tencompetence.business.model.learningpath.ILPElement input)
This input should not be null, otherwise an IllegalArgumentException is thrown
input
- the new input for the controllerpublic boolean isPortfolioView()
public abstract java.lang.String handleClickEvent(org.tencompetence.business.model.learningpath.ILPElement element)
implementing classes should implement this method to do the actual handling of the event.
element
- the element of this controllerpublic boolean isShowImage()
public java.lang.String getDateSubscribed()
public java.lang.String getDateCompleted()