Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.crm
Class ListMember

    java.lang.Object
      com.knowgate.crm.ListMember

    public class ListMember

extends java.lang.Object

List Member

List Members are kept at database differently depending on the type of list they belong to.
For Members of Dynamic Lists (k_lists.tp_list=2) no member record is explicitly stored at database, but members are dynamically extracted from k_member_address view each time that the DistributionList is used.
For Members of Static Lists (k_lists.tp_list=1) a record is stored at k_x_list_members table. Members of Static Lists can be Companies from k_companies table of Contacts from k_contacts table. If Member is a Company then tp_member is set to 91 and gu_company is set to Company GUID. If Member is a Contact then tp_member is set to 90 and gu_contact is set to Contact GUID.
For Members of Direct and Black Lists (k_lists.tp_list=3 and k_lists.tp_list=4) tp_member is set to 95. One record is stored at k_x_list_members table and another record is stored at k_list_members. There is one unique record per Member at k_list_members and one record per member and list at k_x_list_members.
List Member Storage Summary

List Type | k_lists.tp_member | k_x_list_member.gu_contact | k_x_list_member.gu_company | k_list_member.gu_member
DYNAMIC | 90 or 91 | NONE | NONE | NONE
STATIC | 90 or 91 | References k_contacts if tp_member=90 | References k_companies if tp_member=91 | NONE
DIRECT | 95 | References k_list_members | NULL | Member GUID

Field Summary
`static short` | `ClassId`

Constructor Summary
`ListMember()`
`ListMember(JDCConnection oConn, java.lang.String sMemberId, java.lang.String sListGUID)` Create ListMember and load its fields from database.

Method Summary
`void` | `block(JDCConnection oConn, java.lang.String sListGUID)` Block Member Add member to Black List associated to Base List.
`boolean` | `delete(JDCConnection oConn)` Remove Member from all DistributionList.
`boolean` | `delete(JDCConnection oConn, java.lang.String sListId)` Remove Member from a DistributionList.
`java.util.Date` | `getDate(java.lang.String sKey)`
`java.lang.String` | `getDateFormated(java.lang.String sKey, java.lang.String sFormat)`
`short` | `getShort(java.lang.String sKey)`
`java.lang.String` | `getString(java.lang.String sKey)`
`java.lang.String` | `getStringNull(java.lang.String sKey, java.lang.String sDefault)`
`boolean` | `isBlocked(JDCConnection oConn)` Get whether or not a List Member is Blocked Blocked Members are those present on the associated black list.
`boolean` | `isNull(java.lang.String sColumnName)`
`DBPersist` | `member()` Internal DBPersist object reference for k_list_members register.
`void` | `put(java.lang.String sKey, java.util.Date dtVal)`
`void` | `put(java.lang.String sKey, java.lang.Object oObj)`
`void` | `put(java.lang.String sKey, short iVal)`
`void` | `put(java.lang.String sKey, java.lang.String sVal)`
`void` | `remove(java.lang.String sKey)`
`void` | `replace(java.lang.String sKey, java.lang.Object oObj)`
`void` | `replace(java.lang.String sKey, short iVal)`
`boolean` | `store(JDCConnection oConn, java.lang.String sListGUID)` Store Member at a DistributionList Automatically generates gu_member GUID for Direct List Members and dt_modified DATE if not explicitly set.
`void` | `unblock(JDCConnection oConn, java.lang.String sListGUID)` Unblock Member Remove member from Black List associated to Base List.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ClassId

    public static final short ClassId

See Also:
  Constant Field Values

Constructor Detail

### ListMember

    public ListMember()

### ListMember

    public ListMember(JDCConnection oConn,
                      java.lang.String sMemberId,
                      java.lang.String sListGUID)
               throws java.sql.SQLException

  Create ListMember and load its fields from database. ListMember with given GUID or e-mail is seeked at k_x_list_members table.

  Parameters:
    `oConn` - Database Connection
    `sMemberId` - One of: GUID for Contact, GUID for Company or Member e-mail.
    `sListGUID` - DistributionList GUID
  Throws:
    `java.sql.SQLException`

Method Detail

### member

    public DBPersist member()

  Internal DBPersist object reference for k_list_members register.

### getDate

    public java.util.Date getDate(java.lang.String sKey)

### getDateFormated

    public java.lang.String getDateFormated(java.lang.String sKey,
                                            java.lang.String sFormat)

### getShort

    public short getShort(java.lang.String sKey)
                   throws java.lang.NullPointerException

  Throws:
    `java.lang.NullPointerException`

### getString

    public java.lang.String getString(java.lang.String sKey)
                               throws java.lang.NullPointerException

  Throws:
    `java.lang.NullPointerException`

### getStringNull

    public java.lang.String getStringNull(java.lang.String sKey,
                                          java.lang.String sDefault)

### isNull

    public boolean isNull(java.lang.String sColumnName)

### put

    public void put(java.lang.String sKey,
                    java.lang.String sVal)

### put

    public void put(java.lang.String sKey,
                    short iVal)

### put

    public void put(java.lang.String sKey,
                    java.util.Date dtVal)

### put

    public void put(java.lang.String sKey,
                    java.lang.Object oObj)

### replace

    public void replace(java.lang.String sKey,
                        java.lang.Object oObj)

### replace

    public void replace(java.lang.String sKey,
                        short iVal)

### remove

    public void remove(java.lang.String sKey)

### isBlocked

    public boolean isBlocked(JDCConnection oConn)
                      throws java.sql.SQLException

  Get whether or not a List Member is Blocked

  Blocked Members are those present on the associated black list.
  Companies and Contacts are considered to be in the black list if its gu_company or gu_contact is into black list register at k_x_list_members
  Direct List Members are considered to be in the black list if its tx_email is into black list register at k_x_list_members
  This way, by searching Companies and Contacts by GUID and Direct Members by e-mail, a Contact or Company may have several e-mail addresses all of them blocked by a single black list entry.
  This method calls stored procedures: k_sp_company_blocked, k_sp_contact_blocked and k_sp_email_blocked

  Parameters:
    `oConn` - Database Connection
  Returns:
    true if member is blocked (present at associated black list for this list) false otherwise.
  Throws:
    `java.sql.SQLException`

### delete

    public boolean delete(JDCConnection oConn,
                          java.lang.String sListId)
                   throws java.sql.SQLException

  Remove Member from a DistributionList.

  Member is also removed from associated black list.

  Parameters:
    `oConn` - Database Connection
    `sListId` - GUID of DistributionList from witch Member is to be removed.
  Throws:
    `java.sql.SQLException`

### delete

    public boolean delete(JDCConnection oConn)
                   throws java.sql.SQLException

  Remove Member from all DistributionList.

  Parameters:
    `oConn` - Database Connection
  Throws:
    `java.sql.SQLException`

### store

    public boolean store(JDCConnection oConn,
                         java.lang.String sListGUID)
                  throws java.lang.ClassCastException,
                         java.lang.NoSuchFieldException,
                         java.sql.SQLException

  Store Member at a DistributionList

  Automatically generates gu_member GUID for Direct List Members and dt_modified DATE if not explicitly set.

  Parameters:
    `oConn` - Database Connection
    `sListGUID` - GUID of Distribution List
  Throws:
    `java.lang.ClassCastException` - If sListId type is DYNAMIC.
    `java.lang.NoSuchFieldException` - If List is Static and gu_member field is not set
    `java.sql.SQLException`

### block

    public void block(JDCConnection oConn,
                      java.lang.String sListGUID)
               throws java.sql.SQLException,
                      java.lang.NoSuchFieldException

  Block Member

  Add member to Black List associated to Base List.

  Parameters:
    `oConn` - Database Connection
    `sListGUID` - Base List GUID
  Throws:
    `java.sql.SQLException`
    `java.lang.NoSuchFieldException`

### unblock

    public void unblock(JDCConnection oConn,
                        java.lang.String sListGUID)
                 throws java.sql.SQLException

  Unblock Member

  Remove member from Black List associated to Base List.

  Parameters:
    `oConn` - Database Connection
    `sListGUID` - Base List GUID
  Throws:
    `java.sql.SQLException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD