BrightSide Workbench Full Report + Source Code
org.turro.dossier.zul.dossier.DossierComposer Class Reference
Inheritance diagram for org.turro.dossier.zul.dossier.DossierComposer:
Collaboration diagram for org.turro.dossier.zul.dossier.DossierComposer:

Public Member Functions

void onAddIssue ()
 
final void onSelectDescriptor (Event event)
 
void onWikiChange ()
 
void onAllParticipants ()
 
void afterSave ()
 
void doFinally () throws Exception
 
- 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 ()
 
Dossier getEntityInstance (Long id)
 
DaoEntity getWrapperInstance (Component comp)
 
boolean beforeSave ()
 
boolean shouldBeSaved ()
 
boolean inSaveRole ()
 
boolean inDeleteRole ()
 
- Protected Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
abstract E getEntityInstance (ID id)
 
void doOnSave ()
 
void doOnDelete ()
 
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 53 of file DossierComposer.java.

Member Function Documentation

◆ afterSave()

void org.turro.dossier.zul.dossier.DossierComposer.afterSave ( )

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

Definition at line 179 of file DossierComposer.java.

179  {
180  if(entity != null) {
181  for(Participant participant : entity.getParticipants()) {
182  new QueueManager().subscribeDefaults(ConstraintKeys.from(participant.getIContact()));
183  }
184  DossierMenu.showDossier(entity.getId());
185  }
186  }
Here is the call graph for this function:

◆ beforeSave()

boolean org.turro.dossier.zul.dossier.DossierComposer.beforeSave ( )
protected

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

Definition at line 162 of file DossierComposer.java.

162  {
163  if(entity != null && entity.getProject() != null) {
164  if(oldPhase != entity.getProject().getPhase()) {
165  entity.getProject().setChangePhase(new Date());
166  new ChangePhaseNotification(entity).sendNotification();
167  }
168  for(Participant participant : entity.getParticipants()) {
169  if(!participant.isEmpty() && !Strings.isBlank(participant.getDiscriminator()) &&
170  (participant.getId() == null || participant.getId() == 0L)) {
171  new NewParticipantNotification(entity, participant).sendNotification();
172  }
173  }
174  }
175  return super.beforeSave();
176  }
Here is the call graph for this function:

◆ doFinally()

void org.turro.dossier.zul.dossier.DossierComposer.doFinally ( ) throws Exception

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

Definition at line 189 of file DossierComposer.java.

189  {
190  super.doFinally();
191  onSelectDescriptor(null);
192  if(entity.getProject() != null) {
193  oldPhase = entity.getProject().getPhase();
194  }
195  }
Here is the call graph for this function:

◆ getAttributeName()

String org.turro.dossier.zul.dossier.DossierComposer.getAttributeName ( )
protected

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

Definition at line 137 of file DossierComposer.java.

137  {
138  return "dossier";
139  }

◆ getEntityInstance()

Dossier org.turro.dossier.zul.dossier.DossierComposer.getEntityInstance ( Long  id)
protected

Definition at line 142 of file DossierComposer.java.

142  {
143  if(id == null) {
144  entity = new Dossier();
145  entity.setPublishable(true);
146  entity.setType(DossierType.TYPE_DOSSIER);
147  } else {
148  entity = new DossierPU().find(Dossier.class, id);
149  }
150  return entity;
151  }

◆ getWrapperInstance()

DaoEntity org.turro.dossier.zul.dossier.DossierComposer.getWrapperInstance ( Component  comp)
protected

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

Definition at line 154 of file DossierComposer.java.

154  {
155  DossierWrapper w = new DossierWrapper(entity);
156  Framework.getCurrent().setSelectedLabel(w.getTabLabel());
157  Framework.getCurrent().setSelectedTooltiptext(w.getTooltiptext());
158  return w;
159  }
Here is the call graph for this function:

◆ inDeleteRole()

boolean org.turro.dossier.zul.dossier.DossierComposer.inDeleteRole ( )
protected

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

Definition at line 208 of file DossierComposer.java.

208  {
209  return Application.getApplication().isInRole("dossier:delete");
210  }
Here is the call graph for this function:

◆ inSaveRole()

boolean org.turro.dossier.zul.dossier.DossierComposer.inSaveRole ( )
protected

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

Definition at line 203 of file DossierComposer.java.

203  {
204  return Application.getApplication().isInRole("dossier:edit");
205  }
Here is the call graph for this function:

◆ onAddIssue()

void org.turro.dossier.zul.dossier.DossierComposer.onAddIssue ( )

Definition at line 65 of file DossierComposer.java.

65  {
66  DossierMenu.addDossierInformation(entity, new Command() {
67  @Override
68  public Object execute(Context context) {
69  Framework.getCurrent().closeSelected();
70  DossierMenu.showDossier(entity.getId());
71  return null;
72  }
73  });
74  }
Here is the call graph for this function:

◆ onAllParticipants()

void org.turro.dossier.zul.dossier.DossierComposer.onAllParticipants ( )

Definition at line 126 of file DossierComposer.java.

126  {
127  ParticipantGrid pg = new ParticipantGrid();
128  pg.setAddToolbar(false);
129  entity.resetParticipants();
130  pg.setDossier(entity);
131  SelectionDialog.showComponent(getPage(),
132  I_.get("All participants"),
133  pg, "90%", "90%", null);
134  }
Here is the call graph for this function:

◆ onSelectDescriptor()

final void org.turro.dossier.zul.dossier.DossierComposer.onSelectDescriptor ( Event  event)

Definition at line 77 of file DossierComposer.java.

77  {
78  if(entity.getId() != null && entity.getId() > 0 && descriptors != null) {
79  if(lastDD != null) {
80  DescriptorValue dv = lastDD.getValue();
81  if(dv == null) {
82  dv = new DescriptorValue();
83  dv.setDossier(entity);
84  entity.getDescriptors().add(dv);
85  lastDD.setValue(dv);
86  }
87  dv.setWiki(wiki.getValue());
88  dv.setText(wiki.getHtml());
89  }
90  DescriptorDefinition dd = descriptors.getObjectValue();
91  if(dd != null) {
92  wiki.setImageFolder("/_internal/files/dossier/" + entity.getId());
93  wiki.setFileFolder("/_internal/files/dossier/" + entity.getId());
94  wiki.setReadonly(false);
95  DescriptorValue dv = dd.getValue();
96  if(dv != null) {
97  wiki.setValue(dv.getWiki());
98  } else {
99  wiki.setValue(null);
100  }
101  } else {
102  wiki.setImageFolder("/_internal/files/dossier/empty");
103  wiki.setFileFolder("/_internal/files/dossier/empty");
104  wiki.setReadonly(true);
105  wiki.setValue(null);
106  }
107  lastDD = dd;
108  }
109  }
void setValue(DescriptorValue descriptorValue)
void setReadonly(boolean value)
void setImageFolder(String folder)
void setValue(String value)
Definition: WikiEditor.java:98
void setFileFolder(String folder)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onWikiChange()

void org.turro.dossier.zul.dossier.DossierComposer.onWikiChange ( )

Definition at line 112 of file DossierComposer.java.

112  {
113  DescriptorDefinition dd = descriptors.getObjectValue();
114  DescriptorValue dv = dd.getValue();
115  if(dv == null) {
116  dv = new DescriptorValue();
117  dv.setDossier(entity);
118  entity.getDescriptors().add(dv);
119  dd.setValue(dv);
120  }
121  dv.setWiki(wiki.getValue());
122  dv.setText(wiki.getHtml());
123  }
Here is the call graph for this function:

◆ shouldBeSaved()

boolean org.turro.dossier.zul.dossier.DossierComposer.shouldBeSaved ( )
protected

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

Definition at line 198 of file DossierComposer.java.

198  {
199  return !entity.isEmpty() && (entity.getId() == null || entity.getId() == 0) || super.shouldBeSaved();
200  }

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