BrightSide Workbench Full Report + Source Code
org.turro.elephant.impl.security.UserProfileMap Class Reference
Inheritance diagram for org.turro.elephant.impl.security.UserProfileMap:
Collaboration diagram for org.turro.elephant.impl.security.UserProfileMap:

Public Member Functions

void loadFromProfile (ProfileMap profiles, String profile)
 
void loadFrom (RoleAttribute attributes)
 
void loadAttribute (String name, RoleValue values)
 
- Public Member Functions inherited from org.turro.elephant.impl.security.RoleAttribute
boolean isInRole (String role)
 
void addFromElementChildren (List< Element > children)
 

Static Public Member Functions

static UserProfileMap loadFromUser (Element user) throws IOException
 
static UserProfileMap loadFromContact (IContact contact) throws IOException
 
- Static Public Member Functions inherited from org.turro.elephant.impl.security.RoleAttribute
static RoleAttribute loadFromElementChildren (List< Element > children)
 

Static Public Attributes

static final String USERS_CONFIGURATION = "/WEB-INF/elephant/conf/xpusers.xml"
 

Detailed Description

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

Definition at line 36 of file UserProfileMap.java.

Member Function Documentation

◆ loadAttribute()

void org.turro.elephant.impl.security.UserProfileMap.loadAttribute ( String  name,
RoleValue  values 
)

Definition at line 110 of file UserProfileMap.java.

110  {
111  if(!containsKey(name)) {
112  put(name, new RoleValue(new String[] {}));
113  }
114  get(name).loadFrom(values);
115  }
Here is the caller graph for this function:

◆ loadFrom()

void org.turro.elephant.impl.security.UserProfileMap.loadFrom ( RoleAttribute  attributes)

Definition at line 104 of file UserProfileMap.java.

104  {
105  for(String name : attributes.keySet()) {
106  loadAttribute(name, attributes.get(name));
107  }
108  }
void loadAttribute(String name, RoleValue values)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromContact()

static UserProfileMap org.turro.elephant.impl.security.UserProfileMap.loadFromContact ( IContact  contact) throws IOException
static

Definition at line 54 of file UserProfileMap.java.

54  {
55  ProfileMap pm = ProfileMap.loadProfiles();
56  UserProfileMap upm = new UserProfileMap();
57  if(contact.isValid()) {
58  for(String role : contact.getRoles()) {
59  upm.loadFromProfile(pm, role);
60  upm.put("#" + role, new RoleValue(new String[] { "on" }));
61  }
62  for(String syndication : contact.getSyndications()) {
63  upm.put("@" + syndication, new RoleValue(new String[] { "on" }));
64  }
65  if(contact.isUser()) {
66  IProfile profile = contact.getProfile();
67  if(contact.isAdmin()) {
68  upm.put("@admin", new RoleValue(new String[] { "is" }));
69  }
70  if(profile.isWorker()) {
71  upm.put("@worker", new RoleValue(new String[] { "is" }));
72  }
73  if(profile.isStudent()) {
74  upm.put("@student", new RoleValue(new String[] { "is" }));
75  }
76  if(profile.isResponsible()) {
77  upm.put("@responsible", new RoleValue(new String[] { "is" }));
78  }
79  if(profile.isHHRR()) {
80  upm.put("@hhrr", new RoleValue(new String[] { "is" }));
81  }
82  if(profile.isCompanyHHRR()) {
83  upm.put("@companyhhrr", new RoleValue(new String[] { "is" }));
84  }
85  if(profile.isCenterHHRR()) {
86  upm.put("@centerhhrr", new RoleValue(new String[] { "is" }));
87  }
88  if(profile.isCenterHHRR()) {
89  upm.put("@translator", new RoleValue(new String[] { "is" }));
90  }
91  }
92  }
93  return upm;
94  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromProfile()

void org.turro.elephant.impl.security.UserProfileMap.loadFromProfile ( ProfileMap  profiles,
String  profile 
)

Definition at line 96 of file UserProfileMap.java.

96  {
97  if(profiles != null) {
98  if(profiles.containsKey(profile)) {
99  loadFrom(profiles.get(profile));
100  }
101  }
102  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromUser()

static UserProfileMap org.turro.elephant.impl.security.UserProfileMap.loadFromUser ( Element  user) throws IOException
static

Definition at line 40 of file UserProfileMap.java.

40  {
41  ProfileMap pm = ProfileMap.loadProfiles();
42  UserProfileMap upm = new UserProfileMap();
43  try {
44  List<Element> roles = XPath.selectNodes(user, "role");
45  for(Element el : roles) {
46  upm.loadFromProfile(pm, el.getAttributeValue("name"));
47  }
48  } catch (JDOMException ex) {
49  Logger.getLogger(UserProfileMap.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
50  }
51  return upm;
52  }
Here is the call graph for this function:

Member Data Documentation

◆ USERS_CONFIGURATION

final String org.turro.elephant.impl.security.UserProfileMap.USERS_CONFIGURATION = "/WEB-INF/elephant/conf/xpusers.xml"
static

Definition at line 38 of file UserProfileMap.java.


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