BrightSide Workbench Full Report + Source Code
org.turro.contacts.zul.register.AdminRegisterComposer Class Reference
Inheritance diagram for org.turro.contacts.zul.register.AdminRegisterComposer:
Collaboration diagram for org.turro.contacts.zul.register.AdminRegisterComposer:

Public Member Functions

void onRegister (Event event)
 

Static Public Member Functions

static boolean createContact (SignUp signUp) throws Exception
 

Detailed Description

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

Definition at line 63 of file AdminRegisterComposer.java.

Member Function Documentation

◆ createContact()

static boolean org.turro.contacts.zul.register.AdminRegisterComposer.createContact ( SignUp  signUp) throws Exception
static

Definition at line 156 of file AdminRegisterComposer.java.

156  {
157  if(Application.getApplication().isInRole("contact:new") && !existEmail(signUp.getEmail())) {
158  Contact contact = new Contact();
159  contact.setName(signUp.getName());
160  Connector email = new Connector();
161  email.setContact(contact);
162  email.setDescription(IUser.CONNECTOR_EMAIL);
163  email.setValue(signUp.getEmail());
164  contact.getConnectors().add(email);
165  if(!Strings.isBlank(ElephantContext.getSiteSyndicate())) {
166  String groups[] = ElephantContext.getSiteSyndicate().split(",");
167  SocialGroups.syndicate(List.of(contact), Set.of(groups), null);
168  contact = new ContactWrapper(contact).save();
169  }
170  new QueueManager().subscribeDefaults(contact.getIContact());
171  return true;
172  }
173  return false;
174  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onRegister()

void org.turro.contacts.zul.register.AdminRegisterComposer.onRegister ( Event  event)

Definition at line 74 of file AdminRegisterComposer.java.

74  {
75  SignUp su = new SignUp();
76  su.setName(name.getValue());
77  su.setEmail(email.getValue());
78  su.setComment("");
79  if(su.isValid()) {
80  if(existPending(su.getEmail())) {
81  ZkossUtils.confirmProcess(I_.get("Email pending to confirm") +
82  "\n\n" +
83  I_.get("Resend confirmation e-mail"), new Command() {
84  @Override
85  public Object execute(Context context) {
86  sendEmail(sue);
87  Clients.showNotification(I_.format("Confirmation e-mail has been sent to %s", sue.getEmail()));
88  return true;
89  }
90  });
91  } else if(existEmail(su.getEmail())) {
92  Clients.showNotification(I_.format("%s already exists", su.getEmail()));
93  } else {
94  try {
95  if(createContact(su)) {
96  su.setConfirmed(true);
97  su = new ContactsPU().saveObject(su);
98  sendMailToAdmin(su);
99  sendWelcomeMailToUser(su);
100  Clients.showNotification(I_.get("Created"));
101  }
102  } catch (Exception ex) {
103  Logger.getLogger(AdminRegisterComposer.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
104  }
105  }
106  } else {
107  Clients.showNotification("No valid values");
108  }
109  }
Here is the call graph for this function:

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