BrightSide Workbench Full Report + Source Code
org.turro.contacts.Grouped Class Reference
Inheritance diagram for org.turro.contacts.Grouped:
Collaboration diagram for org.turro.contacts.Grouped:

Public Member Functions

String getId ()
 
void setId (String id)
 
GroupIt getParent ()
 
void setParent (GroupIt parent)
 
String getPath ()
 
void setPath (String path)
 
String getCategory ()
 
void setCategory (String category)
 
boolean isValid ()
 

Static Public Member Functions

static Collection< Groupedgroups (Object entity, String category)
 
static Collection< Groupedgroups (String path, String category)
 
static Collection< Groupedgroups (Object entity)
 
static Collection< Groupedgroups (String path)
 
static Collection< String > paths (String path, String selectedGroup, String selectedCategory, boolean exact)
 
static Collection< String > pathsFromCategory (String path, String category)
 

Detailed Description

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

Definition at line 41 of file Grouped.java.

Member Function Documentation

◆ getCategory()

String org.turro.contacts.Grouped.getCategory ( )

Definition at line 82 of file Grouped.java.

82  {
83  if(category == null && parent != null) {
84  category = parent.getCategory();
85  }
86  return category;
87  }
Here is the caller graph for this function:

◆ getId()

String org.turro.contacts.Grouped.getId ( )

Definition at line 54 of file Grouped.java.

54  {
55  return id;
56  }
Here is the caller graph for this function:

◆ getParent()

GroupIt org.turro.contacts.Grouped.getParent ( )

Definition at line 62 of file Grouped.java.

62  {
63  return parent;
64  }
Here is the caller graph for this function:

◆ getPath()

String org.turro.contacts.Grouped.getPath ( )

Definition at line 70 of file Grouped.java.

70  {
71  return path;
72  }

◆ groups() [1/4]

static Collection<Grouped> org.turro.contacts.Grouped.groups ( Object  entity)
static

Definition at line 117 of file Grouped.java.

117  {
118  String path = Entities.getController(entity).getPath();
119  if(path != null) {
120  return groups(path);
121  }
122  return new ArrayList<>();
123  }
static Collection< Grouped > groups(Object entity, String category)
Definition: Grouped.java:98
Here is the call graph for this function:

◆ groups() [2/4]

static Collection<Grouped> org.turro.contacts.Grouped.groups ( Object  entity,
String  category 
)
static

Definition at line 98 of file Grouped.java.

98  {
99  String path = Entities.getController(entity).getPath();
100  if(path != null) {
101  return groups(path, category);
102  }
103  return new ArrayList<>();
104  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ groups() [3/4]

static Collection<Grouped> org.turro.contacts.Grouped.groups ( String  path)
static

Definition at line 125 of file Grouped.java.

125  {
126  Dao dao = new ContactsPU();
127  return dao.getResultList(
128  " select g from Grouped g " +
129  " where g.path = ? " +
130  " order by g.parent.category, g.parent.name ",
131  new Object[] { path }
132  );
133  }

◆ groups() [4/4]

static Collection<Grouped> org.turro.contacts.Grouped.groups ( String  path,
String  category 
)
static

Definition at line 106 of file Grouped.java.

106  {
107  Dao dao = new ContactsPU();
108  return dao.getResultList(
109  " select g from Grouped g " +
110  " where g.parent.category = ? " +
111  " and g.path = ? " +
112  " order by g.parent.category, g.parent.name ",
113  new Object[] { category, path }
114  );
115  }

◆ isValid()

boolean org.turro.contacts.Grouped.isValid ( )

Definition at line 93 of file Grouped.java.

93  {
94  return parent != null &&
95  !Strings.isBlank(path);
96  }
Here is the caller graph for this function:

◆ paths()

static Collection<String> org.turro.contacts.Grouped.paths ( String  path,
String  selectedGroup,
String  selectedCategory,
boolean  exact 
)
static

Definition at line 135 of file Grouped.java.

135  {
136  Dao dao = new ContactsPU();
137  WhereClause wc = new WhereClause();
138  wc.addClause("select g.path from Grouped g");
139  wc.addClause("where g.path like :path");
140  wc.addNamedValue("path", path + "/%");
141  if(Strings.isBlank(selectedGroup)) {
142  selectedGroup = "";
143  }
144  if(exact) {
145  wc.addClause("and g.parent.pathName = :pathName01");
146  wc.addNamedValue("pathName01", selectedGroup);
147  } else {
148  wc.addClause("and (g.parent.pathName = :pathName01 or g.parent.pathName like :pathName02)");
149  wc.addNamedValue("pathName01", selectedGroup);
150  wc.addNamedValue("pathName02", selectedGroup + "%");
151  }
152  wc.addClause("and g.parent.category = :category");
153  wc.addNamedValue("category", selectedCategory);
154  return dao.getResultList(wc);
155  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pathsFromCategory()

static Collection<String> org.turro.contacts.Grouped.pathsFromCategory ( String  path,
String  category 
)
static

Definition at line 157 of file Grouped.java.

157  {
158  Dao dao = new ContactsPU();
159  return dao.getResultList(
160  " select g.path from Grouped g " +
161  " where g.path like ? " +
162  " and g.parent.category = ?",
163  new Object[] { path + "/%", category }
164  );
165  }
Here is the caller graph for this function:

◆ setCategory()

void org.turro.contacts.Grouped.setCategory ( String  category)

Definition at line 89 of file Grouped.java.

89  {
90  this.category = category;
91  }

◆ setId()

void org.turro.contacts.Grouped.setId ( String  id)

Definition at line 58 of file Grouped.java.

58  {
59  this.id = id;
60  }

◆ setParent()

void org.turro.contacts.Grouped.setParent ( GroupIt  parent)

Definition at line 66 of file Grouped.java.

66  {
67  this.parent = parent;
68  }

◆ setPath()

void org.turro.contacts.Grouped.setPath ( String  path)

Definition at line 74 of file Grouped.java.

74  {
75  this.path = path;
76  }
Here is the caller graph for this function:

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