public class DirectList extends DistributionList
DirectList
A subclass of DistributionList with methods for loading List Members from text files.
Copyright: Copyright (c) KnowGate 2003-2010
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_INVALID_EMAIL |
static int |
CHECK_INVALID_FORMAT |
static int |
CHECK_INVALID_INFO |
static int |
CHECK_INVALID_MOBILE |
static int |
CHECK_INVALID_NAME |
static int |
CHECK_INVALID_SALUTATION |
static int |
CHECK_INVALID_SURNAME |
static int |
CHECK_NAME_TOO_LONG |
static int |
CHECK_OK |
static int |
CHECK_SALUTATION_TOO_LONG |
static int |
CHECK_SURNAME_TOO_LONG |
static short |
ClassId |
TYPE_BLACK, TYPE_DIRECT, TYPE_DYNAMIC, TYPE_STATIC
Constructor and Description |
---|
DirectList()
Default constructor
|
DirectList(java.lang.String sCharSetName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
errorLine()
Get last error line
|
int |
getColumnPosition(java.lang.String sColumnName) |
java.lang.String |
getField(int iCol,
int iRow)
Get value for a field at a given row and column.
|
java.lang.String |
getField(java.lang.String sCol,
int iRow)
Get value for a field at a given row and column.
|
java.lang.String |
getLine(int iLine)
Get line from a parsed file.
|
int |
getLineCount()
Get line count after parsing a text file
|
int[] |
parseFile(java.lang.String sFilePath,
java.lang.String sFileDescriptor)
Parse a delimited text file
|
void |
removeFromList(JDCConnection oConn,
java.lang.String sListId)
Remove members from a Static, Direct or Black Distribution List.
|
void |
updateList(java.sql.Connection oConn,
java.lang.String sListId,
short iStatus)
Adds members to a Static, Direct or Black Distribution List.
|
activeCompanies, activeContacts, activeMembers, addCompany, addContact, append, blackList, clone, contains, delete, delete, deleteDuplicates, load, load, memberCount, overwrite, print, store, substract
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getIntArray, getInteger, getIntegerArray, getIntervalPart, getItemMap, getItems, getMoney, getPrimaryKey, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTime, getTimeOfDay, getTimestamp, isEmpty, isNull, iterator, keySet, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, setPrimaryKey, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
public static final int CHECK_OK
public static final int CHECK_INVALID_EMAIL
public static final int CHECK_NAME_TOO_LONG
public static final int CHECK_SURNAME_TOO_LONG
public static final int CHECK_INVALID_FORMAT
public static final int CHECK_SALUTATION_TOO_LONG
public static final int CHECK_INVALID_NAME
public static final int CHECK_INVALID_SURNAME
public static final int CHECK_INVALID_SALUTATION
public static final int CHECK_INVALID_MOBILE
public static final int CHECK_INVALID_INFO
public static final short ClassId
public DirectList()
public DirectList(java.lang.String sCharSetName)
String
- Name of character set to be used when parsing files (ISO-8859-1, UTF-8, etc.)public int errorLine()
public int getLineCount()
public int[] parseFile(java.lang.String sFilePath, java.lang.String sFileDescriptor) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NullPointerException, java.lang.IllegalArgumentException, java.io.UnsupportedEncodingException, java.io.IOException, java.io.FileNotFoundException
sFilePath
- File PathsFileDescriptor
- Delimited Column List.CHECK_OK | Line is OK |
CHECK_INVALID_EMAIL | tx_email is longer than 100 characters or it is rejected by method Gadgets.checkEMail() |
CHECK_NAME_TOO_LONG | tx_name is longer than 100 characters |
CHECK_INVALID_NAME | tx_name contains forbidden characters { ',' ';' '`' '¨' '?' '"' } |
CHECK_SURNAME_TOO_LONG | tx_surname is longer than 100 characters |
CHECK_INVALID_SURNAME | tx_surname contains forbidden characters { ',' ';' '`' '¨' '?' '"' } |
CHECK_INVALID_FORMAT | id_format is longer than 4 characters |
CHECK_SALUTATION_TOO_LONG | tx_salutation is longer than 16 characters |
CHECK_INVALID_SALUTATION | tx_salutation contains forbidden characters { ',' ';' '`' '¨' '?' '"' } |
java.lang.ArrayIndexOutOfBoundsException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.NullPointerException
java.io.UnsupportedEncodingException
CSVParser
public int getColumnPosition(java.lang.String sColumnName)
sColumnName
- Column Namepublic java.lang.String getLine(int iLine) throws java.lang.IllegalStateException
Get line from a parsed file.
Lines are delimited by the Line Feed (LF, CHAR(10), '\n') characteriLine
- Line Number [0..getLineCount()-1]java.lang.IllegalStateException
- If parseFile() has not been called prior to getLine()public java.lang.String getField(int iCol, int iRow) throws java.lang.ArrayIndexOutOfBoundsException
Get value for a field at a given row and column.
Column indexes are zero based. Row indexes range from 0 to getLineCount()-1.iCol
- Column IndexiRow
- Row Indexjava.lang.IllegalStateException
- If parseFile() method was not called prior to
getField()java.lang.ArrayIndexOutOfBoundsException
- If Column or Row Index is out of bounds.public java.lang.String getField(java.lang.String sCol, int iRow) throws java.lang.ArrayIndexOutOfBoundsException
Get value for a field at a given row and column.
sCol
- Column NameiRow
- Row Namejava.lang.ArrayIndexOutOfBoundsException
public void updateList(java.sql.Connection oConn, java.lang.String sListId, short iStatus) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.ClassCastException, java.sql.SQLException
Adds members to a Static, Direct or Black Distribution List.
oConn
- Database connectionsListId
- DistributionList GUIDiStatus
- 1 if loaded members are to be set as active, 0 if loaded member are to be set as unactive.java.lang.IllegalArgumentException
- If DistributionList does not exist.java.lang.ClassCastException
- If sListId type is DYNAMIC.java.lang.IllegalStateException
- If parseFile() has not been called prior to updateList()java.lang.StringIndexOutOfBoundsException
- If a row if malformedjava.sql.SQLException
public void removeFromList(JDCConnection oConn, java.lang.String sListId) throws java.lang.IllegalArgumentException, java.sql.SQLException, java.lang.ClassCastException
Remove members from a Static, Direct or Black Distribution List.
Members are matched by their e-mail address (tx_email column)oConn
- Database connectionsListId
- DistributionList GUIDjava.lang.IllegalArgumentException
- If DistributionList does not exist.java.lang.ClassCastException
- If sListId type is DYNAMICjava.lang.IllegalStateException
- If parseFile() has not been called prior to updateList()java.sql.SQLException