BrightSide Workbench Full Report + Source Code
org.turro.contacts.profile.ProfileContext Class Reference

Static Public Member Functions

static String getAttribute (String attribute)
 
static String getAttribute (String attribute, String defaultValue)
 
static Boolean getAttribute (String attribute, Boolean defaultValue)
 
static boolean getWebOnUsers ()
 
static boolean getShowCompletion ()
 
static boolean getRequiresCompany ()
 
static String getNetworkingRoles ()
 
static String getPremiumNetworkingRoles ()
 
static boolean hasCompanies ()
 
static boolean hasCenters ()
 
static long countCompanies ()
 
static long countWorkers ()
 
static long countPossibleWorkers ()
 
static long countCenters ()
 
static long countStudents ()
 
static long countPossibleStudents ()
 

Detailed Description

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

Definition at line 34 of file ProfileContext.java.

Member Function Documentation

◆ countCenters()

static long org.turro.contacts.profile.ProfileContext.countCenters ( )
static

Definition at line 122 of file ProfileContext.java.

122  {
123  if(countCenters == null) {
124  countCenters = DaoUtil.count(new ContactsPU(), "Contact", "where type = ?", ContactType.CONTACT_LEARNINGCENTER);
125  }
126  return countCenters;
127  }
Here is the call graph for this function:

◆ countCompanies()

static long org.turro.contacts.profile.ProfileContext.countCompanies ( )
static

Definition at line 92 of file ProfileContext.java.

92  {
93  if(countCompanies == null) {
94  countCompanies = DaoUtil.count(new ContactsPU(), "Contact", "where type = ?", ContactType.CONTACT_COMPANY);
95  }
96  return countCompanies;
97  }
Here is the call graph for this function:

◆ countPossibleStudents()

static long org.turro.contacts.profile.ProfileContext.countPossibleStudents ( )
static

Definition at line 140 of file ProfileContext.java.

140  {
141  if(countPossibleStudents == null) {
142  WhereClause wc = new WhereClause();
143  wc.addClause("select count(conn) from Connector conn");
144  wc.addClause("left outer join BusinessRelation br on conn.contact = br.contact");
145  wc.addClause("where conn.description = 'su_student'");
146  wc.addClause("and br is null");
147  countPossibleStudents = DaoUtil.count(new ContactsPU(), wc);
148  }
149  return countPossibleStudents;
150  }
Here is the call graph for this function:

◆ countPossibleWorkers()

static long org.turro.contacts.profile.ProfileContext.countPossibleWorkers ( )
static

Definition at line 110 of file ProfileContext.java.

110  {
111  if(countPossibleWorkers == null) {
112  WhereClause wc = new WhereClause();
113  wc.addClause("select count(conn) from Connector conn");
114  wc.addClause("left outer join BusinessRelation br on conn.contact = br.contact");
115  wc.addClause("where conn.description = 'su_professional'");
116  wc.addClause("and br is null");
117  countPossibleWorkers = DaoUtil.count(new ContactsPU(), wc);
118  }
119  return countPossibleWorkers;
120  }
Here is the call graph for this function:

◆ countStudents()

static long org.turro.contacts.profile.ProfileContext.countStudents ( )
static

Definition at line 129 of file ProfileContext.java.

129  {
130  if(countStudents == null) {
131  WhereClause wc = new WhereClause();
132  wc.addClause("select count(br) from BusinessRelation br");
133  wc.addInRange("where", "br.startDate", "br.endDate", "date", new Date());
134  FuzzyRelationTypes.isStudent(wc, "and", "br");
135  countStudents = DaoUtil.count(new ContactsPU(), wc);
136  }
137  return countStudents;
138  }
Here is the call graph for this function:

◆ countWorkers()

static long org.turro.contacts.profile.ProfileContext.countWorkers ( )
static

Definition at line 99 of file ProfileContext.java.

99  {
100  if(countWorkers == null) {
101  WhereClause wc = new WhereClause();
102  wc.addClause("select count(br) from BusinessRelation br");
103  wc.addInRange("where", "br.startDate", "br.endDate", "date", new Date());
104  FuzzyRelationTypes.isWorker(wc, "and", "br");
105  countWorkers = DaoUtil.count(new ContactsPU(), wc);
106  }
107  return countWorkers;
108  }
Here is the call graph for this function:

◆ getAttribute() [1/3]

static String org.turro.contacts.profile.ProfileContext.getAttribute ( String  attribute)
static

Definition at line 38 of file ProfileContext.java.

38  {
39  return getAttribute(attribute, (String) null);
40  }
static String getAttribute(String attribute)

◆ getAttribute() [2/3]

static Boolean org.turro.contacts.profile.ProfileContext.getAttribute ( String  attribute,
Boolean  defaultValue 
)
static

Definition at line 46 of file ProfileContext.java.

46  {
47  return ElephantProperties.getContextProperty(PROFILE_CONTEXT, attribute, defaultValue);
48  }
Here is the call graph for this function:

◆ getAttribute() [3/3]

static String org.turro.contacts.profile.ProfileContext.getAttribute ( String  attribute,
String  defaultValue 
)
static

Definition at line 42 of file ProfileContext.java.

42  {
43  return ElephantProperties.getContextProperty(PROFILE_CONTEXT, attribute, defaultValue);
44  }
Here is the call graph for this function:

◆ getNetworkingRoles()

static String org.turro.contacts.profile.ProfileContext.getNetworkingRoles ( )
static

Definition at line 64 of file ProfileContext.java.

64  {
65  return getServiceContextAttribute("networking-roles", "@admin:is|@patron:on|@partner:on");
66  }
Here is the caller graph for this function:

◆ getPremiumNetworkingRoles()

static String org.turro.contacts.profile.ProfileContext.getPremiumNetworkingRoles ( )
static

Definition at line 68 of file ProfileContext.java.

68  {
69  return getServiceContextAttribute("premium-networking-roles", "@partner:on");
70  }
Here is the caller graph for this function:

◆ getRequiresCompany()

static boolean org.turro.contacts.profile.ProfileContext.getRequiresCompany ( )
static

Definition at line 60 of file ProfileContext.java.

60  {
61  return "true".equals(getServiceContextAttribute("requires-company", "true"));
62  }

◆ getShowCompletion()

static boolean org.turro.contacts.profile.ProfileContext.getShowCompletion ( )
static

Definition at line 56 of file ProfileContext.java.

56  {
57  return "true".equals(getServiceContextAttribute("show-completion", "true"));
58  }
Here is the caller graph for this function:

◆ getWebOnUsers()

static boolean org.turro.contacts.profile.ProfileContext.getWebOnUsers ( )
static

Definition at line 52 of file ProfileContext.java.

52  {
53  return "true".equals(getServiceContextAttribute("web-on-users", "true"));
54  }
Here is the caller graph for this function:

◆ hasCenters()

static boolean org.turro.contacts.profile.ProfileContext.hasCenters ( )
static

Definition at line 85 of file ProfileContext.java.

85  {
86  if(centers == null) {
87  centers = !DaoUtil.isEmpty(new ContactsPU(), "Contact", "where type = ?", ContactType.CONTACT_LEARNINGCENTER);
88  }
89  return centers;
90  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasCompanies()

static boolean org.turro.contacts.profile.ProfileContext.hasCompanies ( )
static

Definition at line 78 of file ProfileContext.java.

78  {
79  if(companies == null) {
80  companies = !DaoUtil.isEmpty(new ContactsPU(), "Contact", "where type = ?", ContactType.CONTACT_COMPANY);
81  }
82  return companies;
83  }
Here is the call graph for this function:
Here is the caller graph for this function:

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