BrightSide Workbench Full Report + Source Code
org.turro.elephant.menu.UserMenu Class Reference
Collaboration diagram for org.turro.elephant.menu.UserMenu:

Public Member Functions

 UserMenu (IConstructor constructor)
 
Collection< IUserActiongetActions ()
 
Collection< IUserActiongetProfileActions ()
 
boolean isAllowed (IUserAction action)
 
IContact getUser ()
 
String getAvatar ()
 

Static Public Member Functions

static void executeAction (String idAction)
 

Detailed Description

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

Definition at line 41 of file menu/UserMenu.java.

Constructor & Destructor Documentation

◆ UserMenu()

org.turro.elephant.menu.UserMenu.UserMenu ( IConstructor  constructor)

Definition at line 46 of file menu/UserMenu.java.

46  {
47  this.constructor = constructor;
48  }

Member Function Documentation

◆ executeAction()

static void org.turro.elephant.menu.UserMenu.executeAction ( String  idAction)
static

Definition at line 93 of file menu/UserMenu.java.

93  {
94  if(_userActions != null) {
95  for(IUserAction userAction : _userActions) {
96  if(idAction.equals(userAction.getId())) {
97  userAction.execute();
98  return;
99  }
100  }
101  }
102  if(_profileActions != null) {
103  for(IUserAction userAction : _profileActions) {
104  if(idAction.equals(userAction.getId())) {
105  userAction.execute();
106  return;
107  }
108  }
109  }
110  }
Here is the caller graph for this function:

◆ getActions()

Collection<IUserAction> org.turro.elephant.menu.UserMenu.getActions ( )

Definition at line 50 of file menu/UserMenu.java.

50  {
51  if(constructor.isInRole("webmenu:out")) {
52  return noActions(constructor);
53  }
54  return userActions(constructor);
55  }
Here is the call graph for this function:

◆ getAvatar()

String org.turro.elephant.menu.UserMenu.getAvatar ( )

Definition at line 77 of file menu/UserMenu.java.

77  {
78  IContact contact = getUser();
79  if(contact != null) {
80  File favatar = new File(ElephantContext.getRealPath("/_internal/files/contact/" + contact.getId() + "/profile/face.png"));
81  if(favatar.exists()) {
82  return ElephantContext.getRootWebPath() + "/_internal/files/contact/" + contact.getId() + "/profile/face.png";
83  }
84  }
85  return null;
86  }
Here is the call graph for this function:

◆ getProfileActions()

Collection<IUserAction> org.turro.elephant.menu.UserMenu.getProfileActions ( )

Definition at line 57 of file menu/UserMenu.java.

57  {
58  return profileActions(constructor);
59  }

◆ getUser()

IContact org.turro.elephant.menu.UserMenu.getUser ( )

Definition at line 70 of file menu/UserMenu.java.

70  {
71  if(contact == null) {
72  contact = Contacts.getBehavingAs();
73  }
74  return contact;
75  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAllowed()

boolean org.turro.elephant.menu.UserMenu.isAllowed ( IUserAction  action)

Definition at line 61 of file menu/UserMenu.java.

61  {
62  if("/app/frame".equals(action.getLink())) {
63  if(!getUser().isWebapp()) {
64  return false;
65  }
66  }
67  return true;
68  }
Here is the call graph for this function:

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