|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.MemberImportManager
public class MemberImportManager
A manager to be instanciated to import Members from a CSV input file.
Field Summary | |
---|---|
static String |
COMMENT_CHARACTER
A character to use at start of a line to comment. |
protected int |
createCount
|
protected List<String> |
createdMembersIdList
The created members id list. |
protected File |
csvFile
|
protected com.csvreader.CsvReader |
csvReader
the reader that makes the parsing. |
protected Map<String,MemberImport> |
emailInfoMap
This map contains the Member objects parsed from CSV. |
protected long |
endTime
For debug purpose. |
protected int |
expectedColumnCout
Expected headers columns number. |
protected Collection<String> |
groupIds
|
protected boolean |
hasToSendEmail
|
protected Member |
importAuthor
|
protected String |
importPropertyKey
|
protected int |
invalidCount
|
protected boolean |
isAnyError
Is there any error during checking the csv file ? |
protected boolean |
isBlockingError
|
protected boolean |
isLimitReached
True when member limit is reached. |
protected boolean |
isSimulation
|
protected JcmsContext |
jcmsContext
|
static String |
LANG_PROPERTY_PREFIX
Property key prefix. |
protected Map<Integer,MemberImport> |
lineInfoMap
This map contains the Member objects parsed from CSV. |
static String |
MEMBER_DC_SRC_COLUMNS_KEY
A DataController contextMap key, which stores the sources columns of the csv file, as a String[]. |
protected List<MemberImport> |
memberImportList
The list containing each line. |
protected long |
previousTime
For debug purpose. |
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
static String |
REVISION
The class revision. |
String |
separator
The separator to use, may be selected by UI. |
protected long |
startTime
For debug purpose. |
protected int |
updateCount
|
protected List<String> |
updatedMembersIdList
The update members id list. |
protected String |
userLang
|
Constructor Summary | |
---|---|
MemberImportManager(JcmsContext jcmsContext)
|
Method Summary | |
---|---|
String[] |
filterGroupsToProposedWorkspaces(String[] chosenGroupIds,
Set<Workspace> wsSet)
Utility method to control that all chosen groups belongs to given workspace Set. |
int |
getCreateCount()
|
File |
getCsvFile()
|
int |
getInvalidCount()
|
List<MemberImport> |
getMemberInfoList()
|
String |
getSeparator()
|
int |
getUpdateCount()
|
boolean |
hasToSendEmail()
|
boolean |
isAnyError()
|
boolean |
isBlockingError()
|
static boolean |
isEnabled()
|
boolean |
isSimulation()
|
boolean |
performImport()
Iterate on memberImportList , and create or update each member. |
void |
prepareImport()
Expected format : Name,First name,Email,Login,Organization,Department,JobTitle,Phone,Mobile May be called directly (in this case, isSimulation should be true). |
void |
setCsvFile(File csvFile)
|
void |
setGroupIds(Collection<String> groupIds)
|
void |
setHasToSendEmail(boolean hasToSendEmail)
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
|
void |
setResponse(javax.servlet.http.HttpServletResponse response)
|
void |
setSeparator(String separator)
|
void |
setSimulation(boolean isSimulation)
|
ControllerStatus |
validateCsvFile()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final String MEMBER_DC_SRC_COLUMNS_KEY
public static final String COMMENT_CHARACTER
protected boolean isSimulation
protected String importPropertyKey
protected Collection<String> groupIds
protected File csvFile
protected boolean isLimitReached
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
public static final String LANG_PROPERTY_PREFIX
protected int expectedColumnCout
protected Member importAuthor
protected boolean hasToSendEmail
protected long startTime
protected long endTime
protected long previousTime
protected com.csvreader.CsvReader csvReader
public String separator
protected JcmsContext jcmsContext
protected String userLang
protected Map<Integer,MemberImport> lineInfoMap
protected List<MemberImport> memberImportList
protected Map<String,MemberImport> emailInfoMap
protected int createCount
protected int updateCount
protected int invalidCount
protected boolean isBlockingError
protected boolean isAnyError
protected List<String> createdMembersIdList
protected List<String> updatedMembersIdList
Constructor Detail |
---|
public MemberImportManager(JcmsContext jcmsContext)
jcmsContext
- Method Detail |
---|
public boolean isSimulation()
public void setSimulation(boolean isSimulation)
isSimulation
- the isSimulation to setpublic File getCsvFile()
public void setCsvFile(File csvFile)
csvFile
- the csvFile to setpublic List<MemberImport> getMemberInfoList()
public boolean isAnyError()
public int getCreateCount()
public int getUpdateCount()
public int getInvalidCount()
public String getSeparator()
public boolean isBlockingError()
public void setRequest(javax.servlet.http.HttpServletRequest request)
request
- the request to setpublic void setResponse(javax.servlet.http.HttpServletResponse response)
response
- the response to setpublic void setSeparator(String separator)
separator
- the separator to setpublic static boolean isEnabled()
public boolean hasToSendEmail()
public void setHasToSendEmail(boolean hasToSendEmail)
hasToSendEmail
- the hasToSendEmail to setpublic void setGroupIds(Collection<String> groupIds)
groupIds
- the groupIds to setpublic void prepareImport() throws IOException
Name,First name,Email,Login,Organization,Department,JobTitle,Phone,Mobile
isSimulation
should be true).isSimulation
should be false).isSimulation
is true, a warning message about memberLimitController may be added to jcmsContext. Else, this message should be managed by #performSave(MemberImport)
.
IOException
public boolean performImport()
memberImportList
, and create or update each member.
public ControllerStatus validateCsvFile() throws IOException
IOException
public String[] filterGroupsToProposedWorkspaces(String[] chosenGroupIds, Set<Workspace> wsSet)
chosenGroupIds
- the Group ids to validate.wsSet
- the workspace Set of the loggedMember.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |