19 package org.turro.elephant.entities.web;
21 import java.io.Serializable;
22 import java.util.Objects;
23 import javax.persistence.AttributeOverride;
24 import javax.persistence.AttributeOverrides;
25 import javax.persistence.Column;
26 import javax.persistence.Embedded;
27 import javax.persistence.Entity;
28 import javax.persistence.Id;
29 import org.turro.elephant.context.Application;
30 import org.turro.elephant.context.IConstructor;
31 import org.turro.elephant.web.actions.WebActions;
32 import org.turro.elephant.web.actions.WebLink;
33 import org.turro.jpa.embeddables.Wiki;
34 import org.turro.jpa.entity.IDaoEntity;
35 import org.turro.string.Phrases;
36 import org.turro.string.Strings;
45 @Id
private String goalAction;
47 private String caption;
52 @AttributeOverride( name =
"text", column = @Column(name =
"summary")),
53 @AttributeOverride( name =
"wiki", column = @Column(name =
"wsummary"))
59 @AttributeOverride( name =
"text", column = @Column(name =
"description")),
60 @AttributeOverride( name =
"wiki", column = @Column(name =
"wdescription"))
62 private Wiki description =
new Wiki();
69 this.goalAction = goalAction;
77 this.caption = caption;
85 this.ordering = ordering;
89 if(summary ==
null) summary =
new Wiki();
94 this.summary = summary;
98 if(description ==
null) description =
new Wiki();
103 this.description = description;
109 return summary ==
null ?
"" : summary.
getText();
113 return description ==
null ?
"" : description.
getText();
125 return Phrases.start(caption).add(goalAction,
"()").toString();
130 if(constructor !=
null) {
139 hash = 97 * hash + Objects.hashCode(this.goalAction);
151 if (getClass() != obj.getClass()) {
155 return Objects.
equals(this.goalAction, other.goalAction);
167 return Strings.isBlank(goalAction) || Strings.isBlank(caption);
IConstructor getConstructor()
static Application getApplication()
void setGoalAction(String goalAction)
void setDescription(Wiki description)
void setSummary(Wiki summary)
void setOrdering(int ordering)
void setCaption(String caption)
boolean equals(Object obj)
static WebActions of(String action)
static WebLink from(WebLink webLink, String newCaption)
void compose(IConstructor constructor)