BrightSide Workbench Full Report + Source Code
org.turro.publication.util.PublicationUtil Class Reference

Static Public Member Functions

static boolean getChecked (IContact contact, PublicationCategory v)
 
static void setChecked (IContact contact, PublicationCategory v, boolean checked)
 
static void subscribeAll (IContact contact, boolean checked)
 

Detailed Description

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

Definition at line 32 of file PublicationUtil.java.

Member Function Documentation

◆ getChecked()

static boolean org.turro.publication.util.PublicationUtil.getChecked ( IContact  contact,
PublicationCategory  v 
)
static

Definition at line 34 of file PublicationUtil.java.

34  {
35  List l = new PublicationPU().getResultList(
36  "select pubsubs from PublicationSubscription as pubsubs " +
37  "where pubsubs.publicationCategory = ? " +
38  "and pubsubs.idContact = ?",
39  new Object[] { v, contact.getId() }
40  );
41  return l != null && !l.isEmpty();
42  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChecked()

static void org.turro.publication.util.PublicationUtil.setChecked ( IContact  contact,
PublicationCategory  v,
boolean  checked 
)
static

Definition at line 44 of file PublicationUtil.java.

44  {
45  if(checked && !getChecked(contact, v)) {
46  PublicationSubscription ps = new PublicationSubscription();
47  ps.setCreation(new Date());
48  ps.setIdContact(contact.getId());
49  ps.setPublicationCategory(v);
50  new PublicationPU().saveObject(ps);
51  } else if(!checked) {
52  new PublicationPU().executeUpdate(
53  "delete from PublicationSubscription " +
54  "where publicationCategory = ? " +
55  "and idContact = ?",
56  new Object[] { v, contact.getId() }
57  );
58  }
59  }
static boolean getChecked(IContact contact, PublicationCategory v)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ subscribeAll()

static void org.turro.publication.util.PublicationUtil.subscribeAll ( IContact  contact,
boolean  checked 
)
static

Definition at line 61 of file PublicationUtil.java.

61  {
62  for(PublicationCategory pc : PublicationCategories.getPublicCategories(contact)) {
63  setChecked(contact, pc, checked);
64  }
65  }
static void setChecked(IContact contact, PublicationCategory v, boolean checked)
Here is the call graph for this function:

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