BrightSide Workbench Full Report + Source Code
org.turro.user.content.UserContents Class Reference

Static Public Member Functions

static String parseContents (IConstructor constructor)
 
static Set< IElephantUserContentgetContents (IConstructor constructor, IContact contact)
 
static Set< IElephantUserContentgetContents (IConstructor constructor, IContact contact, boolean fresh)
 
static Set< String > getTags (IConstructor constructor, IContact contact)
 
static void reset ()
 
static void reset (IConstructor constructor, IContact contact)
 

Detailed Description

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

Definition at line 36 of file UserContents.java.

Member Function Documentation

◆ getContents() [1/2]

static Set<IElephantUserContent> org.turro.user.content.UserContents.getContents ( IConstructor  constructor,
IContact  contact 
)
static

Definition at line 45 of file UserContents.java.

45  {
46  return getContents(constructor, contact, false);
47  }
static Set< IElephantUserContent > getContents(IConstructor constructor, IContact contact)
Here is the caller graph for this function:

◆ getContents() [2/2]

static Set<IElephantUserContent> org.turro.user.content.UserContents.getContents ( IConstructor  constructor,
IContact  contact,
boolean  fresh 
)
static

Definition at line 49 of file UserContents.java.

49  {
50  if(contact == null || !contact.isValid()) return Collections.EMPTY_SET;
51  Set<IElephantUserContent> set = (Set<IElephantUserContent>) constructor.getSessionAttribute(USER_CONTENT_CONTEXT + contact.getId());
52  if(fresh || (set == null)) {
53  set = loadContents(contact);
54  constructor.setSessionAttribute(USER_CONTENT_CONTEXT + contact.getId(), set);
55  }
56  return set;
57  }
Here is the call graph for this function:

◆ getTags()

static Set<String> org.turro.user.content.UserContents.getTags ( IConstructor  constructor,
IContact  contact 
)
static

Definition at line 59 of file UserContents.java.

59  {
60  Set<String> set = new TreeSet<>();
61  for(IElephantUserContent euc : getContents(constructor, contact)) {
62  if(!Strings.isBlank(euc.render(constructor))) {
63  set.addAll(euc.getTags());
64  }
65  }
66  return set;
67  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseContents()

static String org.turro.user.content.UserContents.parseContents ( IConstructor  constructor)
static

Definition at line 40 of file UserContents.java.

40  {
41  ElephantMarker marker = new ElephantMarker(constructor);
42  return marker.parse("widgets/user", "userContent");
43  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset() [1/2]

static void org.turro.user.content.UserContents.reset ( )
static

Definition at line 69 of file UserContents.java.

69  {
70  reset(Application.getApplication().getConstructor(), (IContact) Application.getUser());
71  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset() [2/2]

static void org.turro.user.content.UserContents.reset ( IConstructor  constructor,
IContact  contact 
)
static

Definition at line 73 of file UserContents.java.

73  {
74  for(IElephantUserContent euc : getContents(constructor, contact)) {
75  if(euc instanceof AbstractUserContent) {
76  ((AbstractUserContent) euc).reset();
77  }
78  }
79  }
Here is the call graph for this function:

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