BrightSide Workbench Full Report + Source Code
org.turro.publication.entity.Publication Class Reference
Inheritance diagram for org.turro.publication.entity.Publication:
Collaboration diagram for org.turro.publication.entity.Publication:

Public Member Functions

boolean isAccepted ()
 
void setAccepted (boolean accepted)
 
String getAuthor ()
 
void setAuthor (String author)
 
String getBody ()
 
void setBody (String body)
 
Date getCreation ()
 
void setCreation (Date creation)
 
Date getDate ()
 
String getDateStr ()
 
void setDate (Date date)
 
Date getRetainTill ()
 
void setRetainTill (Date retainTill)
 
Long getId ()
 
void setId (Long id)
 
String getIdContact ()
 
void setIdContact (String idContact)
 
PublicationCategory getPublicationCategory ()
 
void setPublicationCategory (PublicationCategory publicationCategory)
 
PublicationGroup getPublicationGroup ()
 
void setPublicationGroup (PublicationGroup publicationGroup)
 
long getReadings ()
 
void setReadings (long readings)
 
boolean isSent ()
 
void setSent (boolean sent)
 
String getSummary ()
 
void setSummary (String summary)
 
String getTitle ()
 
void setTitle (String title)
 
String getUnescapedTitle ()
 
String getLang ()
 
void setLang (String lang)
 
String getWikiSummary ()
 
void setWikiSummary (String wikiSummary)
 
String getWikiBody ()
 
void setWikiBody (String wikiBody)
 
String getSenderId ()
 
void setSenderId (String senderId)
 
void updateReadings (Dao dao)
 
Object entityId ()
 
boolean isEmpty ()
 
String getContent ()
 
String getSummary (int max)
 
String getPlainSummary (int max)
 
IContact getContactAuthor ()
 
void setContactAuthor (IContact contact)
 
IContact getSender ()
 
void setSender (IContact contact)
 
MappingSet getSerializerMappings ()
 
- Public Member Functions inherited from org.turro.jpa.entity.IDaoEntity
default boolean isNew ()
 
default void prepareSave ()
 
default void prepareDelete ()
 
default void removeEmpties ()
 
default Collection< Collection > collections ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 47 of file Publication.java.

Member Function Documentation

◆ entityId()

Object org.turro.publication.entity.Publication.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 270 of file Publication.java.

270  {
271  return id;
272  }

◆ getAuthor()

String org.turro.publication.entity.Publication.getAuthor ( )

Definition at line 106 of file Publication.java.

106  {
107  return author;
108  }
Here is the caller graph for this function:

◆ getBody()

String org.turro.publication.entity.Publication.getBody ( )

Definition at line 114 of file Publication.java.

114  {
115  return body;
116  }
Here is the caller graph for this function:

◆ getContactAuthor()

IContact org.turro.publication.entity.Publication.getContactAuthor ( )

Definition at line 299 of file Publication.java.

299  {
300  if(_contact == null) {
301  _contact = Contacts.getContactById(idContact);
302  }
303  return _contact;
304  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContent()

String org.turro.publication.entity.Publication.getContent ( )

Helpers

Definition at line 282 of file Publication.java.

282  {
283  return (Strings.isBlank(summary) ? "" : summary) +
284  (Strings.isBlank(body) ? "" : body);
285  }

◆ getCreation()

Date org.turro.publication.entity.Publication.getCreation ( )

Definition at line 122 of file Publication.java.

122  {
123  return creation;
124  }

◆ getDate()

Date org.turro.publication.entity.Publication.getDate ( )

Definition at line 130 of file Publication.java.

130  {
131  return date;
132  }
Here is the caller graph for this function:

◆ getDateStr()

String org.turro.publication.entity.Publication.getDateStr ( )

Definition at line 134 of file Publication.java.

134  {
135  return DateFormats.format(date, true);
136  }
Here is the call graph for this function:

◆ getId()

Long org.turro.publication.entity.Publication.getId ( )

Definition at line 150 of file Publication.java.

150  {
151  return id;
152  }
Here is the caller graph for this function:

◆ getIdContact()

String org.turro.publication.entity.Publication.getIdContact ( )

Definition at line 158 of file Publication.java.

158  {
159  return idContact;
160  }
Here is the caller graph for this function:

◆ getLang()

String org.turro.publication.entity.Publication.getLang ( )

Definition at line 219 of file Publication.java.

219  {
220  return lang;
221  }

◆ getPlainSummary()

String org.turro.publication.entity.Publication.getPlainSummary ( int  max)

Definition at line 291 of file Publication.java.

291  {
292  return HtmlContent.plain(summary, max);
293  }

◆ getPublicationCategory()

PublicationCategory org.turro.publication.entity.Publication.getPublicationCategory ( )

Definition at line 167 of file Publication.java.

167  {
168  return publicationCategory;
169  }
Here is the caller graph for this function:

◆ getPublicationGroup()

PublicationGroup org.turro.publication.entity.Publication.getPublicationGroup ( )

Definition at line 175 of file Publication.java.

175  {
176  return publicationGroup;
177  }

◆ getReadings()

long org.turro.publication.entity.Publication.getReadings ( )

Definition at line 183 of file Publication.java.

183  {
184  return readings;
185  }

◆ getRetainTill()

Date org.turro.publication.entity.Publication.getRetainTill ( )

Definition at line 142 of file Publication.java.

142  {
143  return retainTill;
144  }

◆ getSender()

IContact org.turro.publication.entity.Publication.getSender ( )

Definition at line 318 of file Publication.java.

318  {
319  if(_sender == null) {
320  _sender = Contacts.getContactById(senderId);
321  }
322  return _sender;
323  }
Here is the call graph for this function:

◆ getSenderId()

String org.turro.publication.entity.Publication.getSenderId ( )

Definition at line 251 of file Publication.java.

251  {
252  return senderId;
253  }

◆ getSerializerMappings()

MappingSet org.turro.publication.entity.Publication.getSerializerMappings ( )

Definition at line 332 of file Publication.java.

332  {
333  MappingSet set = new MappingSet();
334  set.addMapping(Publication.class, 1,
335  new String[] { "id", "creation", "date", "retainTill", "idContact",
336  "author", "senderId", "accepted", "sent" },
337  new String[] { "title", "lang", "summary", "body", "wikiSummary",
338  "wikiBody", "publicationGroup", "publicationCategory" });
339  set.addMapping(PublicationGroup.class, 2,
340  new String[] { "id", "name" },
341  null);
342  set.addMapping(PublicationCategory.class, 2,
343  new String[] { "id", "name" },
344  null);
345  return set;
346  }

◆ getSummary() [1/2]

String org.turro.publication.entity.Publication.getSummary ( )

Definition at line 199 of file Publication.java.

199  {
200  return summary;
201  }
Here is the caller graph for this function:

◆ getSummary() [2/2]

String org.turro.publication.entity.Publication.getSummary ( int  max)

Definition at line 287 of file Publication.java.

287  {
288  return HtmlContent.truncate(summary, max);
289  }

◆ getTitle()

String org.turro.publication.entity.Publication.getTitle ( )

Definition at line 207 of file Publication.java.

207  {
208  return title;
209  }
Here is the caller graph for this function:

◆ getUnescapedTitle()

String org.turro.publication.entity.Publication.getUnescapedTitle ( )

Definition at line 215 of file Publication.java.

215  {
216  return HTMLEntities.unescape(title);
217  }
Here is the call graph for this function:

◆ getWikiBody()

String org.turro.publication.entity.Publication.getWikiBody ( )

Definition at line 239 of file Publication.java.

239  {
240  if(Strings.isBlank(wikiBody) && !Strings.isBlank(body)) {
241  wikiBody = "$no_wiki\n" + body;
242  }
243  return wikiBody;
244  }

◆ getWikiSummary()

String org.turro.publication.entity.Publication.getWikiSummary ( )

Definition at line 227 of file Publication.java.

227  {
228  if(Strings.isBlank(wikiSummary) && !Strings.isBlank(summary)) {
229  wikiSummary = "$no_wiki\n" + summary;
230  }
231  return wikiSummary;
232  }

◆ isAccepted()

boolean org.turro.publication.entity.Publication.isAccepted ( )

Definition at line 98 of file Publication.java.

98  {
99  return accepted;
100  }

◆ isEmpty()

boolean org.turro.publication.entity.Publication.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 275 of file Publication.java.

275  {
276  return publicationCategory == null || publicationGroup == null || Strings.isBlank(title) ||
277  (Strings.isBlank(summary) && Strings.isBlank(wikiSummary));
278  }
Here is the caller graph for this function:

◆ isSent()

boolean org.turro.publication.entity.Publication.isSent ( )

Definition at line 191 of file Publication.java.

191  {
192  return sent;
193  }

◆ setAccepted()

void org.turro.publication.entity.Publication.setAccepted ( boolean  accepted)

Definition at line 102 of file Publication.java.

102  {
103  this.accepted = accepted;
104  }

◆ setAuthor()

void org.turro.publication.entity.Publication.setAuthor ( String  author)

Definition at line 110 of file Publication.java.

110  {
111  this.author = author;
112  }
Here is the caller graph for this function:

◆ setBody()

void org.turro.publication.entity.Publication.setBody ( String  body)

Definition at line 118 of file Publication.java.

118  {
119  this.body = body;
120  }

◆ setContactAuthor()

void org.turro.publication.entity.Publication.setContactAuthor ( IContact  contact)

Definition at line 306 of file Publication.java.

306  {
307  _contact = contact;
308  idContact = _contact != null ? _contact.getId() : null;
309  author = _contact != null ? _contact.getName() : null;
310  }
Here is the call graph for this function:

◆ setCreation()

void org.turro.publication.entity.Publication.setCreation ( Date  creation)

Definition at line 126 of file Publication.java.

126  {
127  this.creation = creation;
128  }

◆ setDate()

void org.turro.publication.entity.Publication.setDate ( Date  date)

Definition at line 138 of file Publication.java.

138  {
139  this.date = date;
140  }
Here is the caller graph for this function:

◆ setId()

void org.turro.publication.entity.Publication.setId ( Long  id)

Definition at line 154 of file Publication.java.

154  {
155  this.id = id;
156  }

◆ setIdContact()

void org.turro.publication.entity.Publication.setIdContact ( String  idContact)

Definition at line 162 of file Publication.java.

162  {
163  this.idContact = idContact;
164  resetIContact();
165  }

◆ setLang()

void org.turro.publication.entity.Publication.setLang ( String  lang)

Definition at line 223 of file Publication.java.

223  {
224  this.lang = lang;
225  }

◆ setPublicationCategory()

void org.turro.publication.entity.Publication.setPublicationCategory ( PublicationCategory  publicationCategory)

Definition at line 171 of file Publication.java.

171  {
172  this.publicationCategory = publicationCategory;
173  }
Here is the caller graph for this function:

◆ setPublicationGroup()

void org.turro.publication.entity.Publication.setPublicationGroup ( PublicationGroup  publicationGroup)

Definition at line 179 of file Publication.java.

179  {
180  this.publicationGroup = publicationGroup;
181  }
Here is the caller graph for this function:

◆ setReadings()

void org.turro.publication.entity.Publication.setReadings ( long  readings)

Definition at line 187 of file Publication.java.

187  {
188  this.readings = readings;
189  }

◆ setRetainTill()

void org.turro.publication.entity.Publication.setRetainTill ( Date  retainTill)

Definition at line 146 of file Publication.java.

146  {
147  this.retainTill = retainTill;
148  }

◆ setSender()

void org.turro.publication.entity.Publication.setSender ( IContact  contact)

Definition at line 325 of file Publication.java.

325  {
326  _sender = contact;
327  senderId = _sender != null ? _sender.getId() : null;
328  }
Here is the call graph for this function:

◆ setSenderId()

void org.turro.publication.entity.Publication.setSenderId ( String  senderId)

Definition at line 255 of file Publication.java.

255  {
256  this.senderId = senderId;
257  }

◆ setSent()

void org.turro.publication.entity.Publication.setSent ( boolean  sent)

Definition at line 195 of file Publication.java.

195  {
196  this.sent = sent;
197  }

◆ setSummary()

void org.turro.publication.entity.Publication.setSummary ( String  summary)

Definition at line 203 of file Publication.java.

203  {
204  this.summary = summary;
205  }

◆ setTitle()

void org.turro.publication.entity.Publication.setTitle ( String  title)

Definition at line 211 of file Publication.java.

211  {
212  this.title = HTMLEntities.escape(title);
213  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWikiBody()

void org.turro.publication.entity.Publication.setWikiBody ( String  wikiBody)

Definition at line 246 of file Publication.java.

246  {
247  this.wikiBody = wikiBody;
248  this.body = WikiCompiler.source(wikiBody).html();
249  }
Here is the caller graph for this function:

◆ setWikiSummary()

void org.turro.publication.entity.Publication.setWikiSummary ( String  wikiSummary)

Definition at line 234 of file Publication.java.

234  {
235  this.wikiSummary = wikiSummary;
236  this.summary = WikiCompiler.source(wikiSummary).html();
237  }
Here is the caller graph for this function:

◆ updateReadings()

void org.turro.publication.entity.Publication.updateReadings ( Dao  dao)

Readings

Definition at line 261 of file Publication.java.

261  {
262  dao.executeUpdate(
263  "update Publication set readings = readings + 1 where id = ? and accepted = TRUE",
264  new Object[] { id });
265  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: