BrightSide Workbench Full Report + Source Code
org.turro.dossier.util.WorksheetUtil Class Reference

Static Public Member Functions

static Collection< WorksheetgetWorksheet (String idContact)
 
static Collection< IssuegetIssues (String idContact, String searchValue)
 
static List< IssueWrappergetIssueWrappersForNow (IContact contact, String searchValue)
 
static List< IssueWrappergetIssueWrappers (IContact contact, String searchValue)
 
static Collection< IssueWrappergetNotIn (IContact contact, Collection< IssueWrapper > listws)
 
static void removeWorksheet (String idContact)
 
static void removeWorksheet (Long idIssue)
 
static Collection< String > getResponsibles ()
 
static boolean cleared (Worksheet worksheet, IContact contact)
 
static void clearDone (List< Worksheet > list, IContact contact)
 

Detailed Description

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

Definition at line 41 of file WorksheetUtil.java.

Member Function Documentation

◆ clearDone()

static void org.turro.dossier.util.WorksheetUtil.clearDone ( List< Worksheet list,
IContact  contact 
)
static

Definition at line 146 of file WorksheetUtil.java.

146  {
147  Dao dao = new DossierPU();
148  Iterator<Worksheet> it = list.iterator();
149  while(it.hasNext()) {
150  Worksheet worksheet = it.next();
151  if(isDone(worksheet, contact)) {
152  dao.deleteObject(worksheet);
153  it.remove();
154  }
155  }
156  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleared()

static boolean org.turro.dossier.util.WorksheetUtil.cleared ( Worksheet  worksheet,
IContact  contact 
)
static

Definition at line 137 of file WorksheetUtil.java.

137  {
138  Dao dao = new DossierPU();
139  if(isDone(worksheet, contact)) {
140  dao.deleteObject(worksheet);
141  return true;
142  }
143  return false;
144  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIssues()

static Collection<Issue> org.turro.dossier.util.WorksheetUtil.getIssues ( String  idContact,
String  searchValue 
)
static

Definition at line 52 of file WorksheetUtil.java.

52  {
53  Dao dao = new DossierPU();
54  if(!Strings.isBlank(searchValue)) {
55  return dao.getResultList(
56  "select w.issue from Worksheet as w " +
57  "where w.idContact = ? " +
58  "and w.issue.description like ? " +
59  "order by w.sheetOrder",
60  new Object[] { idContact, "%" + searchValue + "%" });
61  } else {
62  return dao.getResultList(
63  "select w.issue from Worksheet as w " +
64  "where w.idContact = ? " +
65  "order by w.sheetOrder",
66  new Object[] { idContact });
67  }
68  }
Here is the caller graph for this function:

◆ getIssueWrappers()

static List<IssueWrapper> org.turro.dossier.util.WorksheetUtil.getIssueWrappers ( IContact  contact,
String  searchValue 
)
static

Definition at line 79 of file WorksheetUtil.java.

79  {
80  ArrayList<IssueWrapper> list = new ArrayList<>();
81  for(Issue issue : getIssues(contact.getId(), searchValue)) {
82  IssueWrapper iw = new IssueWrapper(issue, contact);
83  list.add(iw);
84  }
85  return list;
86  }
static Collection< Issue > getIssues(String idContact, String searchValue)
Here is the call graph for this function:

◆ getIssueWrappersForNow()

static List<IssueWrapper> org.turro.dossier.util.WorksheetUtil.getIssueWrappersForNow ( IContact  contact,
String  searchValue 
)
static

Definition at line 70 of file WorksheetUtil.java.

70  {
71  ArrayList<IssueWrapper> list = new ArrayList<>();
72  for(Issue issue : getIssues(contact.getId(), searchValue)) {
73  IssueWrapper iw = new IssueWrapper(issue, contact);
74  list.add(iw);
75  }
76  return list;
77  }
Here is the call graph for this function:

◆ getNotIn()

static Collection<IssueWrapper> org.turro.dossier.util.WorksheetUtil.getNotIn ( IContact  contact,
Collection< IssueWrapper listws 
)
static

Definition at line 88 of file WorksheetUtil.java.

88  {
89  ArrayList<IssueWrapper> list = new ArrayList<>();
90  if(contact.isValid()) {
91  IssueResults results = new IssueResults();
92  results.setByParticipant(contact);
93  results.setDossierId(0L);
94  for(IssueWrapper iw : results.getIssueList()) {
95  if(iw.getRelevanceOrderByContact() == 1) {
96  boolean exists = false;
97  for(IssueWrapper liw : listws) {
98  if(Objects.equals(liw.getIssue().getId(), iw.getIssue().getId())) {
99  exists = true;
100  break;
101  }
102  }
103  if(!exists) {
104  list.add(iw);
105  }
106  }
107  }
108  }
109  return list;
110  }
Here is the call graph for this function:

◆ getResponsibles()

static Collection<String> org.turro.dossier.util.WorksheetUtil.getResponsibles ( )
static

Definition at line 128 of file WorksheetUtil.java.

128  {
129  Dao dao = new DossierPU();
130  return dao.getResultList(
131  "select p.idContact from IssueParticipant as p " +
132  "where p.role = ? " +
133  "and p.issue.status <> ?",
134  new Object[] { IssueParticipantRole.ISSUE_RESPONSIBLE, IssueStatus.STATUS_CLOSED });
135  }

◆ getWorksheet()

static Collection<Worksheet> org.turro.dossier.util.WorksheetUtil.getWorksheet ( String  idContact)
static

Definition at line 43 of file WorksheetUtil.java.

43  {
44  Dao dao = new DossierPU();
45  return dao.getResultList(
46  "select w from Worksheet as w " +
47  "where w.idContact = ? " +
48  "order by w.sheetOrder",
49  new Object[] { idContact });
50  }
Here is the caller graph for this function:

◆ removeWorksheet() [1/2]

static void org.turro.dossier.util.WorksheetUtil.removeWorksheet ( Long  idIssue)
static

Definition at line 120 of file WorksheetUtil.java.

120  {
121  Dao dao = new DossierPU();
122  dao.executeUpdate(
123  "delete from Worksheet " +
124  "where issue.id = ? ",
125  new Object[] { idIssue });
126  }
Here is the call graph for this function:

◆ removeWorksheet() [2/2]

static void org.turro.dossier.util.WorksheetUtil.removeWorksheet ( String  idContact)
static

Definition at line 112 of file WorksheetUtil.java.

112  {
113  Dao dao = new DossierPU();
114  dao.executeUpdate(
115  "delete from Worksheet " +
116  "where idContact = ? ",
117  new Object[] { idContact });
118  }
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: