@Named(value="storyMB") @SessionScoped public class StoryManagedBean extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected es.uvigo.esei.dgss.teamc.microstories.entities.Story |
selectedStory |
protected es.uvigo.esei.dgss.teamc.microstories.service.StoryService |
storyService |
| Constructor and Description |
|---|
StoryManagedBean() |
| Modifier and Type | Method and Description |
|---|---|
String |
formatAttribute(String text)
Returns a string with first letter in caps
|
String |
formatEnum(String text)
Returns a string with first letter in replace '_' for ' '
|
String |
getContentPreview(String content,
int maxCharacter)
Returns a string limited to 60 characters avoiding cutting the last word
|
es.uvigo.esei.dgss.teamc.microstories.entities.Story |
getSelectedStory() |
Boolean |
hasTheme2(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
Returns true is the attribute Theme2 of the given story is not null
|
String |
nameImage(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
Returns the stories' theme1 name with the image extension (.jpeg)
|
String |
seeStory(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
Returns the path to the story's detail view
|
void |
setSelectedStory(es.uvigo.esei.dgss.teamc.microstories.entities.Story selectedStory) |
protected es.uvigo.esei.dgss.teamc.microstories.service.StoryService storyService
protected es.uvigo.esei.dgss.teamc.microstories.entities.Story selectedStory
public es.uvigo.esei.dgss.teamc.microstories.entities.Story getSelectedStory()
public void setSelectedStory(es.uvigo.esei.dgss.teamc.microstories.entities.Story selectedStory)
public String getContentPreview(String content, int maxCharacter)
content - The string to be limited to a length of 60 characters.public Boolean hasTheme2(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
story - Story to check if his attribute theme2 is nullpublic String nameImage(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
story - to retrieve the theme1's namepublic String formatAttribute(String text)
text - to capitalize the first letterpublic String formatEnum(String text)
text - to capitalize the first letterpublic String seeStory(es.uvigo.esei.dgss.teamc.microstories.entities.Story story)
story - Story to see in detailCopyright © 2021. All rights reserved.