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

Public Member Functions

Long getId ()
 
void setId (Long id)
 
Newsletter getNewsletter ()
 
void setNewsletter (Newsletter newsletter)
 
int getNewsOrder ()
 
void setNewsOrder (int newsOrder)
 
boolean isNewColumn ()
 
void setNewColumn (boolean newColumn)
 
boolean isUseAsTrigger ()
 
void setUseAsTrigger (boolean useAsTrigger)
 
boolean isHideIfEmpty ()
 
void setHideIfEmpty (boolean hideIfEmpty)
 
String getWidth ()
 
void setWidth (String width)
 
String getBanner ()
 
void setBanner (String banner)
 
NewsSectionType getType ()
 
void setType (NewsSectionType type)
 
String getBody ()
 
void setBody (String body)
 
String getWiki ()
 
void setWiki (String wiki)
 
Object entityId ()
 
boolean isEmpty ()
 
boolean canShow (IContact contact)
 
boolean isEmptyContent ()
 
void generateSection (Writer template) throws IOException
 
void loadBody (IContact contact)
 
String generateBody ()
 
void reset ()
 
void resetGlobalContext ()
 
String getUniqueId ()
 
int compareTo (NewsSection o)
 
- 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 44 of file NewsSection.java.

Member Function Documentation

◆ canShow()

boolean org.turro.publication.entity.NewsSection.canShow ( IContact  contact)

Helpers

Definition at line 176 of file NewsSection.java.

176  {
177  loadBody(contact);
178  return !(isHideIfEmpty() && isEmptyContent());
179  }
Here is the call graph for this function:

◆ compareTo()

int org.turro.publication.entity.NewsSection.compareTo ( NewsSection  o)

Compare

Definition at line 278 of file NewsSection.java.

278  {
279  int result = CompareUtil.compare(newsOrder, o.newsOrder);
280  if(result == 0 && id != null && o.id != null) {
281  result = CompareUtil.compare(id, o.id);
282  }
283  return result;
284  }

◆ entityId()

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

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 165 of file NewsSection.java.

165  {
166  return id;
167  }

◆ generateBody()

String org.turro.publication.entity.NewsSection.generateBody ( )

Definition at line 256 of file NewsSection.java.

256  {
257  if(NewsSectionType.NEWS_SECTION_EXTERNAL.equals(type)) {
258  return content != null ? content.execute() : "";
259  }
260  return "";
261  }
Here is the call graph for this function:

◆ generateSection()

void org.turro.publication.entity.NewsSection.generateSection ( Writer  template) throws IOException

Definition at line 188 of file NewsSection.java.

188  {
189  boolean firstColumn = false;
190  boolean lastColumn = false;
191  if(isNewColumn()) {
192  firstColumn = newsletter.checkStartRow(this);
193  lastColumn = newsletter.checkEndRow(this);
194  if(firstColumn) {
195  template.write("<@start_row/>\n");
196  template.write("<@start_column/>\n");
197  template.write("<@start_full_table \"0\" \"0\"/>\n");
198  template.write("<@start_row/>\n");
199  }
200  template.write("<@start_stackable style=\"width:" + getColumnWidth(this) + "\"/>\n");
201  } else {
202  template.write("<@start_row/>\n");
203  template.write("<@start_column/>\n");
204  }
205 
206  if(!Strings.isBlank(banner)) {
207  if(NewsSectionType.NEWS_SECTION_IMAGE.equals(type)) {
208  template.write("<a target='_blank' href='" + banner + "'>");
209  } else {
210  template.write(banner);
211  }
212  }
213 
214  if(NewsSectionType.NEWS_SECTION_EXTERNAL.equals(type)) {
215  template.write("${newsSection" + newsOrder + ".generateBody()}\n");
216  } else {
217  template.write("${newsSection" + newsOrder + ".body}\n");
218  }
219 
220  if(!Strings.isBlank(banner)) {
221  if(NewsSectionType.NEWS_SECTION_IMAGE.equals(type)) {
222  template.write("</a>");
223  }
224  }
225 
226  if(isNewColumn() && !lastColumn) {
227  template.write("<@stackable_divider/>");
228  }
229 
230  template.write("<@end_column/>\n");
231 
232  if(isNewColumn()) {
233  if(lastColumn) {
234  template.write("<@end_row/>\n");
235  template.write("<@end_table/>\n");
236  template.write("<@end_column/>\n");
237  template.write("<@end_row/>\n");
238  template.write("<@row_summary_divider height=\"20px\"/>");
239  }
240  } else {
241  template.write("<@end_row/>\n");
242  template.write("<@row_summary_divider height=\"20px\"/>");
243  }
244  }
boolean checkEndRow(NewsSection newsSection)
boolean checkStartRow(NewsSection newsSection)
Here is the call graph for this function:

◆ getBanner()

String org.turro.publication.entity.NewsSection.getBanner ( )

Definition at line 130 of file NewsSection.java.

130  {
131  return banner;
132  }

◆ getBody()

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

Definition at line 146 of file NewsSection.java.

146  {
147  return body;
148  }

◆ getId()

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

Definition at line 74 of file NewsSection.java.

74  {
75  return id;
76  }
Here is the caller graph for this function:

◆ getNewsletter()

Newsletter org.turro.publication.entity.NewsSection.getNewsletter ( )

Definition at line 82 of file NewsSection.java.

82  {
83  return newsletter;
84  }

◆ getNewsOrder()

int org.turro.publication.entity.NewsSection.getNewsOrder ( )

Definition at line 90 of file NewsSection.java.

90  {
91  return newsOrder;
92  }
Here is the caller graph for this function:

◆ getType()

NewsSectionType org.turro.publication.entity.NewsSection.getType ( )

Definition at line 138 of file NewsSection.java.

138  {
139  return type;
140  }

◆ getUniqueId()

String org.turro.publication.entity.NewsSection.getUniqueId ( )

Definition at line 271 of file NewsSection.java.

271  {
272  return "NewsSection" + getId();
273  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWidth()

String org.turro.publication.entity.NewsSection.getWidth ( )

Definition at line 122 of file NewsSection.java.

122  {
123  return width;
124  }

◆ getWiki()

String org.turro.publication.entity.NewsSection.getWiki ( )

Definition at line 154 of file NewsSection.java.

154  {
155  return wiki;
156  }

◆ isEmpty()

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

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 170 of file NewsSection.java.

170  {
171  return Strings.isBlank(body);
172  }
Here is the caller graph for this function:

◆ isEmptyContent()

boolean org.turro.publication.entity.NewsSection.isEmptyContent ( )

Definition at line 181 of file NewsSection.java.

181  {
182  if(NewsSectionType.NEWS_SECTION_EXTERNAL.equals(type)) {
183  return content != null ? content.getIterator().isEmpty() : true;
184  }
185  return isEmpty();
186  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isHideIfEmpty()

boolean org.turro.publication.entity.NewsSection.isHideIfEmpty ( )

Definition at line 114 of file NewsSection.java.

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

◆ isNewColumn()

boolean org.turro.publication.entity.NewsSection.isNewColumn ( )

Definition at line 98 of file NewsSection.java.

98  {
99  return newColumn;
100  }
Here is the caller graph for this function:

◆ isUseAsTrigger()

boolean org.turro.publication.entity.NewsSection.isUseAsTrigger ( )

Definition at line 106 of file NewsSection.java.

106  {
107  return useAsTrigger;
108  }

◆ loadBody()

void org.turro.publication.entity.NewsSection.loadBody ( IContact  contact)

Definition at line 250 of file NewsSection.java.

250  {
251  if(content == null && NewsSectionType.NEWS_SECTION_EXTERNAL.equals(type)) {
252  content = ContentProviders.loadCommand(body, contact, getUniqueId());
253  }
254  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void org.turro.publication.entity.NewsSection.reset ( )

Definition at line 263 of file NewsSection.java.

263  {
264  content = null;
265  }

◆ resetGlobalContext()

void org.turro.publication.entity.NewsSection.resetGlobalContext ( )

Definition at line 267 of file NewsSection.java.

267  {
268  ContentContext.removeContent(getUniqueId());
269  }
Here is the call graph for this function:

◆ setBanner()

void org.turro.publication.entity.NewsSection.setBanner ( String  banner)

Definition at line 134 of file NewsSection.java.

134  {
135  this.banner = banner;
136  }

◆ setBody()

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

Definition at line 150 of file NewsSection.java.

150  {
151  this.body = body;
152  }

◆ setHideIfEmpty()

void org.turro.publication.entity.NewsSection.setHideIfEmpty ( boolean  hideIfEmpty)

Definition at line 118 of file NewsSection.java.

118  {
119  this.hideIfEmpty = hideIfEmpty;
120  }

◆ setId()

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

Definition at line 78 of file NewsSection.java.

78  {
79  this.id = id;
80  }

◆ setNewColumn()

void org.turro.publication.entity.NewsSection.setNewColumn ( boolean  newColumn)

Definition at line 102 of file NewsSection.java.

102  {
103  this.newColumn = newColumn;
104  }

◆ setNewsletter()

void org.turro.publication.entity.NewsSection.setNewsletter ( Newsletter  newsletter)

Definition at line 86 of file NewsSection.java.

86  {
87  this.newsletter = newsletter;
88  }
Here is the caller graph for this function:

◆ setNewsOrder()

void org.turro.publication.entity.NewsSection.setNewsOrder ( int  newsOrder)

Definition at line 94 of file NewsSection.java.

94  {
95  this.newsOrder = newsOrder;
96  }
Here is the caller graph for this function:

◆ setType()

void org.turro.publication.entity.NewsSection.setType ( NewsSectionType  type)

Definition at line 142 of file NewsSection.java.

142  {
143  this.type = type;
144  }

◆ setUseAsTrigger()

void org.turro.publication.entity.NewsSection.setUseAsTrigger ( boolean  useAsTrigger)

Definition at line 110 of file NewsSection.java.

110  {
111  this.useAsTrigger = useAsTrigger;
112  }

◆ setWidth()

void org.turro.publication.entity.NewsSection.setWidth ( String  width)

Definition at line 126 of file NewsSection.java.

126  {
127  this.width = width;
128  }

◆ setWiki()

void org.turro.publication.entity.NewsSection.setWiki ( String  wiki)

Definition at line 158 of file NewsSection.java.

158  {
159  this.wiki = wiki;
160  }

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