BrightSide Workbench Full Report + Source Code
org.turro.contacts.profile.EditProfileControl Class Reference
Inheritance diagram for org.turro.contacts.profile.EditProfileControl:
Collaboration diagram for org.turro.contacts.profile.EditProfileControl:

Public Member Functions

void onName ()
 
void onPhone ()
 
void onWeb ()
 
void onNetwork ()
 
void onEvent (UploadEvent t) throws Exception
 
void onSave ()
 
void onCancel ()
 
String getPath ()
 
void setPath (String path)
 
- 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 63 of file EditProfileControl.java.

Member Function Documentation

◆ doFinally()

void org.turro.contacts.profile.EditProfileControl.doFinally ( )
protected

Reimplemented from org.turro.elephant.TemplateControl.

Definition at line 162 of file EditProfileControl.java.

162  {
163  super.doFinally();
164  KeyValueMap kvm = Actions.getRightNowAction(Application.getApplication().getConstructor());
165  if(kvm != null && kvm.containsKey("contact")) {
166  contact = Contacts.getContactById(kvm.get("contact"));
167  } else {
168  contact = Authentication.getIContact();
169  }
170  initComponents();
171  }
Here is the call graph for this function:

◆ getPath()

String org.turro.contacts.profile.EditProfileControl.getPath ( )

Definition at line 153 of file EditProfileControl.java.

153  {
154  return path;
155  }

◆ onCancel()

void org.turro.contacts.profile.EditProfileControl.onCancel ( )

Definition at line 149 of file EditProfileControl.java.

149  {
150  Application.getApplication().sendRedirect(path);
151  }
Here is the call graph for this function:

◆ onEvent()

void org.turro.contacts.profile.EditProfileControl.onEvent ( UploadEvent  t) throws Exception

Definition at line 101 of file EditProfileControl.java.

101  {
102  FileAttach fileAttach = new FileAttach(ContactsPU.getObjectPath(contact.getContact()));
103  File newFile = new File(ElephantContext.getRealPath(fileAttach.getPublishable() + "/profile/face.png"));
104  if(!newFile.getParentFile().exists()) {
105  newFile.getParentFile().mkdirs();
106  }
107  Media media = t.getMedia();
108  if(media != null) {
109  Medias.toFile(media, newFile, Medias.scaling(600));
110  }
111  if(newFile.exists()) {
112  try {
113  face.setContent(new AImage(newFile.getAbsolutePath()));
114  } catch (IOException ex) {
115  Logger.getLogger(EditProfileControl.class.getName()).log(Level.SEVERE, null, ex);
116  }
117  } else {
118  face.setSrc(null);
119  }
120  }
Here is the call graph for this function:

◆ onName()

void org.turro.contacts.profile.EditProfileControl.onName ( )

Definition at line 81 of file EditProfileControl.java.

81  {
82  contact.setName(name.getValue());
83  }
Here is the call graph for this function:

◆ onNetwork()

void org.turro.contacts.profile.EditProfileControl.onNetwork ( )

Definition at line 96 of file EditProfileControl.java.

96  {
97  contact.setConnector(Profile.NETWORK, network.getValue());
98  }
void setConnector(String id, String value)
Here is the call graph for this function:

◆ onPhone()

void org.turro.contacts.profile.EditProfileControl.onPhone ( )

Definition at line 86 of file EditProfileControl.java.

86  {
87  contact.setConnector(Profile.PHONE, phone.getValue());
88  }
Here is the call graph for this function:

◆ onSave()

void org.turro.contacts.profile.EditProfileControl.onSave ( )

Definition at line 123 of file EditProfileControl.java.

123  {
124  if(contact.isWebUser()) {
125  Contact c = (Contact) contact.getContact();
126  if(available.isChecked()) {
127  JobBoard board = c.getJobBoard();
128  if(board == null) {
129  board = new JobBoard();
130  board.setContact(c);
131  c.setJobBoard(board);
132  }
133  board.setAvailable(true);
134  board.setOnline(online.isChecked());
135  board.setZipCode(zipCode.getValue());
136  Listitem li = commute.getSelectedItem();
137  if(li != null) board.setCommuting(Integer.valueOf(li.getValue()));
138  board.setUpdateDate(new Date());
139  } else {
140  c.setJobBoard(null);
141  }
142  new ContactWrapper(c).save();
143  Application.getApplication().sendRedirect(path);
144  sendNotification((Contact) contact.getContact());
145  }
146  }
Here is the call graph for this function:

◆ onWeb()

void org.turro.contacts.profile.EditProfileControl.onWeb ( )

Definition at line 91 of file EditProfileControl.java.

91  {
92  contact.setConnector(Profile.WEB, web.getValue());
93  }
Here is the call graph for this function:

◆ setPath()

void org.turro.contacts.profile.EditProfileControl.setPath ( String  path)

Definition at line 157 of file EditProfileControl.java.

157  {
158  this.path = path;
159  }

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