BrightSide Workbench Full Report + Source Code
org.turro.elephant.signin.ImpersonateControl Class Reference
Inheritance diagram for org.turro.elephant.signin.ImpersonateControl:
Collaboration diagram for org.turro.elephant.signin.ImpersonateControl:

Public Member Functions

void onImpersonate (Event event) throws IOException
 
void onBackToSelf ()
 
void doFinally ()
 
- Public Member Functions inherited from org.turro.elephant.TemplateControl
void setRootTmpl (String rootTmpl)
 
void setTmpl (String tmpl)
 
void afterCompose ()
 

Additional Inherited Members

Detailed Description

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

Definition at line 42 of file ImpersonateControl.java.

Member Function Documentation

◆ doFinally()

void org.turro.elephant.signin.ImpersonateControl.doFinally ( )

Reimplemented from org.turro.elephant.TemplateControl.

Definition at line 96 of file ImpersonateControl.java.

96  {
97  impersonate.setVisible(Authentication.canImpersonate());
98  backtoself.setVisible(Authentication.isBehaving());
99  impersonateform.setVisible(impersonate.isVisible() || backtoself.isVisible());
100  }
Here is the call graph for this function:

◆ onBackToSelf()

void org.turro.elephant.signin.ImpersonateControl.onBackToSelf ( )

Definition at line 90 of file ImpersonateControl.java.

90  {
91  Authentication.impersonateIContact(null);
92  Application.getApplication().sendRedirect("/user");
93  }
Here is the call graph for this function:

◆ onImpersonate()

void org.turro.elephant.signin.ImpersonateControl.onImpersonate ( Event  event) throws IOException

Definition at line 54 of file ImpersonateControl.java.

54  {
55  InputDialog.getInput(
56  getPage(),
57  I_.get("Impersonate"),
58  new InputField[] {
59  new InputField("Contact", null, null, 0) {
60  @Override
61  protected HtmlBasedComponent createEditor() {
62  EntityCombobox ec = new EntityCombobox();
63  ec.setRoot("contact");
64  return ec;
65  }
66  @Override
67  protected Object getEditorValue() {
68  return ((EntityCombobox) editor).getObjectValue();
69  }
70  }
71  }, new Command() {
72  @Override
73  public Object execute(Context context) {
74  InputField[] fields = (InputField[]) context.get("fields");
75  if(fields.length > 0) {
76  for(InputField f : fields) {
77  if("Contact".equals(f.getLabel())) {
78  Authentication.impersonateContact(f.getValue());
79  Application.getApplication().sendRedirect("/user");
80  break;
81  }
82  }
83  }
84  return null;
85  }
86  });
87  }
Here is the call graph for this function:

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