BrightSide Workbench Full Report + Source Code
org.turro.publication.zul.ctrl.PublicationComposer Class Reference
Inheritance diagram for org.turro.publication.zul.ctrl.PublicationComposer:
Collaboration diagram for org.turro.publication.zul.ctrl.PublicationComposer:

Public Member Functions

void onPreview ()
 
void onAuthor (InputEvent event)
 
void onTitle (InputEvent event)
 
void onSummary (InputEvent event)
 
void onBody (InputEvent event)
 
void onWikiSummary (InputEvent event)
 
void onWikiBody (InputEvent event)
 
void doFinally () throws Exception
 
void afterSave ()
 
- Public Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
final void onChange (Event event)
 
final void onSave ()
 
final void onDelete ()
 
Object getEntity ()
 
Object getWrapper ()
 
void doBeforeComposeChildren (Component comp) throws Exception
 
void doAfterCompose (Component comp) throws Exception
 

Protected Member Functions

String getAttributeName ()
 
Publication getEntityInstance (Long id)
 
DaoEntity getWrapperInstance (Component comp)
 
boolean beforeSave ()
 
boolean shouldBeSaved ()
 
boolean inSaveRole ()
 
boolean inDeleteRole ()
 
void doOnDelete ()
 
- Protected Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
abstract E getEntityInstance (ID id)
 
void doOnSave ()
 
boolean beforeDelete ()
 
void afterDelete ()
 
void doOnChange ()
 
boolean hasChanged ()
 
void retrieveEntity ()
 
boolean canClose ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.jpa.composer.EntityComposer< E, ID >
entity
 
DaoEntity wrapper
 

Detailed Description

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

Definition at line 51 of file PublicationComposer.java.

Member Function Documentation

◆ afterSave()

void org.turro.publication.zul.ctrl.PublicationComposer.afterSave ( )

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 225 of file PublicationComposer.java.

225  {
226  if(entity != null) {
227  PublicationMenu.showPublication(entity.getId());
228  }
229  }
Here is the call graph for this function:

◆ beforeSave()

boolean org.turro.publication.zul.ctrl.PublicationComposer.beforeSave ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 202 of file PublicationComposer.java.

202  {
203  if(modified && !Application.getApplication().isInRole("publication:accept")) {
204  entity.setAccepted(false);
205  }
206  return super.beforeSave();
207  }
Here is the call graph for this function:

◆ doFinally()

void org.turro.publication.zul.ctrl.PublicationComposer.doFinally ( ) throws Exception

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 169 of file PublicationComposer.java.

169  {
170  super.doFinally();
171  author.setValue(entity.getAuthor());
172 // sender.setObjectValue(Contacts.getContactById(entity.getSenderId()));
173  pubDate.setValue(entity.getDate());
174  retainTill.setValue(entity.getRetainTill());
175  pubGroup.setGroup(entity.getPublicationGroup());
176  pubCategory.setCategory(entity.getPublicationCategory());
177  pubLang.setObjectValue(entity.getLang());
178  pubTitle.setValue(entity.getUnescapedTitle());
179  pubWikiSummary.setValue(entity.getWikiSummary());
180  pubWikiBody.setValue(entity.getWikiBody());
181  accepted.setChecked(entity.isAccepted());
182  sent.setChecked(entity.isSent());
183  if(!Application.getApplication().isInRole("publication:accept")) {
184  sent.setDisabled(true);
185  accepted.setDisabled(true);
186  }
187  if(Strings.isBlank(pubWikiSummary.getImageFolder())) {
188  pubWikiSummary.setImageFolder(RepositoriesTree.REPOSITORY_PUBLICATION + "/Image");
189  }
190  if(Strings.isBlank(pubWikiBody.getImageFolder())) {
191  pubWikiBody.setImageFolder(RepositoriesTree.REPOSITORY_PUBLICATION + "/Image");
192  }
193  if(Strings.isBlank(pubWikiSummary.getFileFolder())) {
194  pubWikiSummary.setFileFolder(RepositoriesTree.REPOSITORY_PUBLICATION + "/File");
195  }
196  if(Strings.isBlank(pubWikiBody.getFileFolder())) {
197  pubWikiBody.setFileFolder(RepositoriesTree.REPOSITORY_PUBLICATION + "/File");
198  }
199  }
void setCategory(PublicationCategory category)
void setGroup(PublicationGroup group)
void setImageFolder(String folder)
void setValue(String value)
Definition: WikiEditor.java:98
void setFileFolder(String folder)
Here is the call graph for this function:

◆ doOnDelete()

void org.turro.publication.zul.ctrl.PublicationComposer.doOnDelete ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 232 of file PublicationComposer.java.

232  {
233  Messages.confirmDeletion().show(() -> {
234  PublicationComposer.super.doOnDelete();
235  });
236  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttributeName()

String org.turro.publication.zul.ctrl.PublicationComposer.getAttributeName ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 143 of file PublicationComposer.java.

143  {
144  return "publication";
145  }

◆ getEntityInstance()

Publication org.turro.publication.zul.ctrl.PublicationComposer.getEntityInstance ( Long  id)
protected

Definition at line 148 of file PublicationComposer.java.

148  {
149  if(id == null) {
150  entity = new Publication();
151  entity.setCreation(new Date());
152  entity.setDate(entity.getCreation());
153  entity.setContactAuthor(Authentication.getIContact());
154  } else {
155  entity = new PublicationPU().find(Publication.class, id);
156  }
157  return entity;
158  }
Here is the call graph for this function:

◆ getWrapperInstance()

DaoEntity org.turro.publication.zul.ctrl.PublicationComposer.getWrapperInstance ( Component  comp)
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 161 of file PublicationComposer.java.

161  {
162  PublicationWrapper w = new PublicationWrapper(entity);
163  Framework.getCurrent().setSelectedLabel(w.getTabLabel());
164  Framework.getCurrent().setSelectedTooltiptext(w.getTooltiptext());
165  return w;
166  }
Here is the call graph for this function:

◆ inDeleteRole()

boolean org.turro.publication.zul.ctrl.PublicationComposer.inDeleteRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 220 of file PublicationComposer.java.

220  {
221  return Application.getApplication().isInRole("publication:delete");
222  }
Here is the call graph for this function:

◆ inSaveRole()

boolean org.turro.publication.zul.ctrl.PublicationComposer.inSaveRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 215 of file PublicationComposer.java.

215  {
216  return Application.getApplication().isInRole("publication:edit");
217  }
Here is the call graph for this function:

◆ onAuthor()

void org.turro.publication.zul.ctrl.PublicationComposer.onAuthor ( InputEvent  event)

Definition at line 101 of file PublicationComposer.java.

101  {
102  entity.setAuthor(event.getValue());
103  modified = true;
104  }

◆ onBody()

void org.turro.publication.zul.ctrl.PublicationComposer.onBody ( InputEvent  event)

Definition at line 125 of file PublicationComposer.java.

125  {
126  entity.setBody(event.getValue());
127  modified = true;
128  }

◆ onPreview()

void org.turro.publication.zul.ctrl.PublicationComposer.onPreview ( )

Definition at line 92 of file PublicationComposer.java.

92  {
93  try {
94  PublicationMenu.previewPublication(entity);
95  } catch (InterruptedException ex) {
96  Logger.getLogger(PublicationComposer.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
97  }
98  }
Here is the call graph for this function:

◆ onSummary()

void org.turro.publication.zul.ctrl.PublicationComposer.onSummary ( InputEvent  event)

Definition at line 119 of file PublicationComposer.java.

119  {
120  entity.setSummary(event.getValue());
121  modified = true;
122  }

◆ onTitle()

void org.turro.publication.zul.ctrl.PublicationComposer.onTitle ( InputEvent  event)

Definition at line 113 of file PublicationComposer.java.

113  {
114  entity.setTitle(event.getValue());
115  modified = true;
116  }

◆ onWikiBody()

void org.turro.publication.zul.ctrl.PublicationComposer.onWikiBody ( InputEvent  event)

Definition at line 137 of file PublicationComposer.java.

137  {
138  entity.setWikiBody(event.getValue());
139  modified = true;
140  }

◆ onWikiSummary()

void org.turro.publication.zul.ctrl.PublicationComposer.onWikiSummary ( InputEvent  event)

Definition at line 131 of file PublicationComposer.java.

131  {
132  entity.setWikiSummary(event.getValue());
133  modified = true;
134  }

◆ shouldBeSaved()

boolean org.turro.publication.zul.ctrl.PublicationComposer.shouldBeSaved ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 210 of file PublicationComposer.java.

210  {
211  return !entity.isEmpty() && super.shouldBeSaved();
212  }

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