BrightSide Workbench Full Report + Source Code
org.turro.jobboard.EditPracticalWorkControl Class Reference
Inheritance diagram for org.turro.jobboard.EditPracticalWorkControl:
Collaboration diagram for org.turro.jobboard.EditPracticalWorkControl:

Public Member Functions

void onTitle ()
 
void onBusiness ()
 
void onResponsible ()
 
void onType ()
 
void onZipCode ()
 
void onRelatedUrl ()
 
void onStart ()
 
void onEnd ()
 
void onTax ()
 
void onPrice ()
 
void onImmediate ()
 
void onText ()
 
void onSendTest ()
 
void onSave ()
 
void onCancel ()
 
void onPublish ()
 
void onDelete ()
 
String getContextPath ()
 
void setContextPath (String contextPath)
 
void setResponse (PracticalWork practicalWork)
 
PracticalWork getPracticalWork ()
 
String createRef (IConstructor constructor, PracticalWork practicalWork, IContact contact) throws Exception
 
String createRef (IConstructor constructor, String redir) throws Exception
 
- Public Member Functions inherited from org.turro.elephant.TemplateControl
void setRootTmpl (String rootTmpl)
 
void setTmpl (String tmpl)
 
void afterCompose ()
 

Protected Member Functions

void doFinally ()
 

Detailed Description

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

Definition at line 61 of file EditPracticalWorkControl.java.

Member Function Documentation

◆ createRef() [1/2]

String org.turro.jobboard.EditPracticalWorkControl.createRef ( IConstructor  constructor,
PracticalWork  practicalWork,
IContact  contact 
) throws Exception

Definition at line 281 of file EditPracticalWorkControl.java.

281  {
282  return createRef(constructor, practicalWork.isPublished() ?
283  Entities.getController(practicalWork).getEntityUrl() :
284  Entities.getController(practicalWork).getMemberUrl());
285  }
String createRef(IConstructor constructor, PracticalWork practicalWork, IContact contact)
Here is the call graph for this function:

◆ createRef() [2/2]

String org.turro.jobboard.EditPracticalWorkControl.createRef ( IConstructor  constructor,
String  redir 
) throws Exception

Definition at line 287 of file EditPracticalWorkControl.java.

287  {
288  return "{liveref:" + redir + "}";
289  }

◆ doFinally()

void org.turro.jobboard.EditPracticalWorkControl.doFinally ( )
protected

Reimplemented from org.turro.elephant.TemplateControl.

Definition at line 267 of file EditPracticalWorkControl.java.

267  {
268  super.doFinally();
269  IAgreements agreements = Plugins.loadImplementation(IAgreements.class, "agreements");
270  agreements.setContact(Authentication.getIContact());
271  if(!agreements.canAct("practicalwork-new")) {
272  Application.getApplication().sendRedirect(agreements.getPendingActURL("practicalwork-new"));
273  } else {
274  checkPracticalWork();
275  initComponents();
276  }
277  }
Here is the call graph for this function:

◆ getContextPath()

String org.turro.jobboard.EditPracticalWorkControl.getContextPath ( )

Definition at line 249 of file EditPracticalWorkControl.java.

249  {
250  return contextPath;
251  }

◆ getPracticalWork()

PracticalWork org.turro.jobboard.EditPracticalWorkControl.getPracticalWork ( )

Definition at line 261 of file EditPracticalWorkControl.java.

261  {
262  checkPracticalWork();
263  return practicalWork;
264  }

◆ onBusiness()

void org.turro.jobboard.EditPracticalWorkControl.onBusiness ( )

Definition at line 88 of file EditPracticalWorkControl.java.

88  {
89  practicalWork.setIContact(business.getObjectValue());
90  responsible.setContact(business.getObjectValue());
91  responsible.setObjectValue(null);
92  practicalWork.setRoleByContact();
93  role.setObjectValue(practicalWork.getRole());
94  immediate.setDisabled(PracticalWorkRole.PRACTICALWORK_DEMAND.equals(practicalWork.getRole()));
95  if(immediate.isDisabled()) immediate.setChecked(false);
96  }
Here is the call graph for this function:

◆ onCancel()

void org.turro.jobboard.EditPracticalWorkControl.onCancel ( )

Definition at line 199 of file EditPracticalWorkControl.java.

199  {
200  if(practicalWork.getId() != null) {
201  Application.getApplication().sendRedirect(contextPath + "?" +
202  MarkerHelper.setObfuscatedRightNowPars("item=" + practicalWork.getId()));
203  } else {
204  Application.getApplication().sendRedirect(contextPath);
205  }
206  }
Here is the call graph for this function:

◆ onDelete()

void org.turro.jobboard.EditPracticalWorkControl.onDelete ( )

Definition at line 239 of file EditPracticalWorkControl.java.

239  {
240  if(practicalWork.getId() != null) {
241  Messages.confirmDeletion().add(practicalWork.getTitle()).show(() -> {
242  PracticalWorkWrapper wrapper = new PracticalWorkWrapper(practicalWork);
243  wrapper.delete();
244  Application.getApplication().sendRedirect(contextPath);
245  });
246  }
247  }
Here is the call graph for this function:

◆ onEnd()

void org.turro.jobboard.EditPracticalWorkControl.onEnd ( )

Definition at line 134 of file EditPracticalWorkControl.java.

134  {
135  practicalWork.setEndDate(end.getValue());
136  }
Here is the call graph for this function:

◆ onImmediate()

void org.turro.jobboard.EditPracticalWorkControl.onImmediate ( )

Definition at line 151 of file EditPracticalWorkControl.java.

151  {
152  practicalWork.setImmediate(immediate.isChecked());
153  }
Here is the call graph for this function:

◆ onPrice()

void org.turro.jobboard.EditPracticalWorkControl.onPrice ( )

Definition at line 145 of file EditPracticalWorkControl.java.

145  {
146  practicalWork.setPrice(price.getDoubleValue());
147  price.setValue(practicalWork.getPrice());
148  }
Here is the call graph for this function:

◆ onPublish()

void org.turro.jobboard.EditPracticalWorkControl.onPublish ( )

Definition at line 209 of file EditPracticalWorkControl.java.

209  {
210  if(!practicalWork.isEmpty()) {
211  practicalWork.setPublished(!practicalWork.isPublished());
212  onSave();
213  if(practicalWork.isPublished()) {
214  HashMap args = new HashMap();
215  args.put("practicalWork", practicalWork);
216  args.put("wrapper", new PracticalWorkWrapper(practicalWork));
217  args.put("notifier", this);
218  if(practicalWork.getId() > 0) {
219  args.put("link", Entities.getController(practicalWork).getEntityUrl());
220  }
221  try {
222  MailSenders.getPool()
223  .addAdministrators()
224  .addByEntity(practicalWork, null)
225  .setRoot("/practicalworks")
226  .putAll(args)
227  .sendTemplate("practicalwork-published", composeSubject(practicalWork));
228  } catch (EmailException ex) {
229  Logger.getLogger(EditPracticalWorkControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
230  }
231  Application.getApplication().sendRedirect(contextPath + "?" +
232  MarkerHelper.setObfuscatedRightNowPars("item=" + practicalWork.getId()));
233  new PublishPracticalWorkNotification(practicalWork).sendNotification();
234  }
235  }
236  }
Here is the call graph for this function:

◆ onRelatedUrl()

void org.turro.jobboard.EditPracticalWorkControl.onRelatedUrl ( )

Definition at line 114 of file EditPracticalWorkControl.java.

114  {
115  String relUrl = relatedUrl.getValue();
116  if(!Strings.isBlank(relUrl)) {
117  if(relUrl.contains("@")) {
118  practicalWork.setRelatedURL(UrlCompose.fillMailGaps(relUrl));
119  } else {
120  practicalWork.setRelatedURL(UrlCompose.fillWebGaps(relUrl));
121  }
122  } else {
123  practicalWork.setRelatedURL(null);
124  }
125  relatedUrl.setValue(practicalWork.getRelatedURL());
126  }
Here is the call graph for this function:

◆ onResponsible()

void org.turro.jobboard.EditPracticalWorkControl.onResponsible ( )

Definition at line 99 of file EditPracticalWorkControl.java.

99  {
100  practicalWork.setIResponsible(responsible.getObjectValue());
101  }
void setIResponsible(IContact responsible)
Here is the call graph for this function:

◆ onSave()

void org.turro.jobboard.EditPracticalWorkControl.onSave ( )

Definition at line 187 of file EditPracticalWorkControl.java.

187  {
188  if(!practicalWork.isEmpty()) {
189  PracticalWorkWrapper wrapper = new PracticalWorkWrapper(practicalWork);
190  practicalWork = wrapper.save();
191  Application.getApplication().sendRedirect(contextPath + "?" +
192  MarkerHelper.setObfuscatedRightNowPars("item=" + practicalWork.getId()));
193  } else {
194  Clients.showNotification(I_.get("Fill required fields"));
195  }
196  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSendTest()

void org.turro.jobboard.EditPracticalWorkControl.onSendTest ( )

Definition at line 161 of file EditPracticalWorkControl.java.

161  {
162  if(!practicalWork.isEmpty()) {
163  HashMap args = new HashMap();
164  args.put("practicalWork", practicalWork);
165  args.put("wrapper", new PracticalWorkWrapper(practicalWork));
166  args.put("notifier", this);
167  if(practicalWork.getId() != null) {
168  args.put("link", Entities.getController(practicalWork).getEntityUrl());
169  }
170  try {
171  MailSenders.getPool()
172  .addAdministrators()
173  .addByEntity(practicalWork, null)
174  .setRoot("/practicalworks")
175  .putAll(args)
176  .sendTemplate("practicalwork-test", composeSubject(practicalWork));
177  Clients.showNotification(I_.get("Test sent"));
178  } catch (EmailException ex) {
179  Logger.getLogger(EditPracticalWorkControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
180  }
181  } else {
182  Clients.showNotification(I_.get("Fill required fields"));
183  }
184  }
Here is the call graph for this function:

◆ onStart()

void org.turro.jobboard.EditPracticalWorkControl.onStart ( )

Definition at line 129 of file EditPracticalWorkControl.java.

129  {
130  practicalWork.setStartDate(start.getValue());
131  }
Here is the call graph for this function:

◆ onTax()

void org.turro.jobboard.EditPracticalWorkControl.onTax ( )

Definition at line 139 of file EditPracticalWorkControl.java.

139  {
140  practicalWork.setHours(hours.getDoubleValue());
141  hours.setValue(practicalWork.getHours());
142  }
Here is the call graph for this function:

◆ onText()

void org.turro.jobboard.EditPracticalWorkControl.onText ( )

Definition at line 156 of file EditPracticalWorkControl.java.

156  {
157  practicalWork.setWiki(text.getValue());
158  }
Here is the call graph for this function:

◆ onTitle()

void org.turro.jobboard.EditPracticalWorkControl.onTitle ( )

Definition at line 83 of file EditPracticalWorkControl.java.

83  {
84  practicalWork.setTitle(title.getValue());
85  }
Here is the call graph for this function:

◆ onType()

void org.turro.jobboard.EditPracticalWorkControl.onType ( )

Definition at line 104 of file EditPracticalWorkControl.java.

104  {
105  practicalWork.setType(type.getObjectValue());
106  }
Here is the call graph for this function:

◆ onZipCode()

void org.turro.jobboard.EditPracticalWorkControl.onZipCode ( )

Definition at line 109 of file EditPracticalWorkControl.java.

109  {
110  practicalWork.setZipCode(zipCode.getValue());
111  }
Here is the call graph for this function:

◆ setContextPath()

void org.turro.jobboard.EditPracticalWorkControl.setContextPath ( String  contextPath)

Definition at line 253 of file EditPracticalWorkControl.java.

253  {
254  this.contextPath = contextPath;
255  }

◆ setResponse()

void org.turro.jobboard.EditPracticalWorkControl.setResponse ( PracticalWork  practicalWork)

Definition at line 257 of file EditPracticalWorkControl.java.

257  {
258  this.practicalWork = practicalWork;
259  }

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