Package com.jalios.jcms.member.csvimport
Class MemberImport
java.lang.Object
com.jalios.jcms.member.csvimport.MemberImport
- All Implemented Interfaces:
MemberImportConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Stringprotected Collection<String> A collection of Group's id.protected booleanTrue if any error.protected booleanprotected Stringprotected Stringprotected Stringprotected StringThe information message.protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected StringThe source line.protected ControllerStatusA custom integrity error message, or a JCMS integrity message.protected Stringprotected StringFields inherited from interface com.jalios.jcms.member.csvimport.MemberImportConstants
ADMIN_USERS_MEMBER_ACL, COMMENT_CHARACTER, DEFAULT_AS_GUESTS, DEFAULT_DBMEMBER, DEFAULT_DEFERR_EMAILS, DEFAULT_USAGE, EMAIL_BATCH_DEFERR_SECONDS_PROP, IS_IMPORT_ENABLED_PROP, MAX_ERROR_PER_IMPORT_PROP, MAX_MEMBER_PER_IMPORT_PROP, MEMBER_DC_SRC_COLUMNS_KEY, MEMBER_IMPORT_PROCESS_ATTR, WORKSPACE_ROOT_CATEGORY_VID_PROP -
Constructor Summary
ConstructorsConstructorDescriptionMemberImport(int line, String sourceLine, String separator, String userLang) Constructor used to keep trace of the source informations.MemberImport(com.csvreader.CsvReader csvReader) Constructor used to setthis's members from a CsvReader. -
Method Summary
Modifier and TypeMethodDescriptiongetEmail()intgetLine()getLogin()getName()getPhone()getPoBox()intgetUsage()booleanbooleanbooleanisCreate()booleanbooleanisError()booleanbooleanIf import was successfull.booleanisUpdate()booleanperformSave(Member opAuthor) CallsData.performCreate(Member, java.util.Map), orMember.performUpdate(Member, java.util.Map), depending on the Member already exist.voidvoidsetCountry(String country) voidsetDBMemberImport(boolean isDBMemberImport) voidsetDepartment(String department) voidvoidsetError(boolean isError) voidsetFirstName(String firstName) voidsetGroupIds(Collection<String> groupIds) voidsetJobTitle(String jobTitle) voidsetLine(int line) voidsetLocality(String locality) voidvoidvoidsetMessage(String message) voidvoidvoidsetOrganization(String organization) voidvoidvoidsetPostalCode(String postalCode) voidvoidsetSimulation(boolean isSimulation) voidsetSourceLine(String sourceLine) voidsetStatus(ControllerStatus status) voidvoidsetSuccess(boolean success) voidsetUsage(int usage) toString()Used for debug purpose.voidUpdates the associated Member's fields if mock Member's values are not empty.
If account creation case :
Sets a DISABLED_PASSWORD to the new member.protected voidAdd the Member to the optional Groups.
-
Field Details
-
isSimulation
protected boolean isSimulation -
isError
protected boolean isErrorTrue if any error. -
status
A custom integrity error message, or a JCMS integrity message. -
message
The information message. -
sourceLine
The source line. -
name
-
firstName
-
email
-
login
-
organization
-
department
-
jobTitle
-
phone
-
mobile
-
street
-
postalCode
-
poBox
-
region
-
locality
-
country
-
userLang
-
groupIds
A collection of Group's id.- Since:
- jcms-10.0.8
-
-
Constructor Details
-
MemberImport
Constructor used to keep trace of the source informations.- Parameters:
line- : the corresponding line number in the .csv file.sourceLine- : the corresponding line as source in the .csv file.separator- The separator used to split CSV.userLang- the user lang to use.- Since:
- jcms-10.0.8
-
MemberImport
Constructor used to setthis's members from a CsvReader.- Parameters:
csvReader- the csv reader to use.- Throws:
IOException- if an exception occurs on readingcsvReader.- Since:
- jcms-10.0.8
-
-
Method Details
-
isSimulation
public boolean isSimulation()- Returns:
- the isSimulation
- Since:
- jcms-10.0.8
-
setSimulation
public void setSimulation(boolean isSimulation) - Parameters:
isSimulation- the isSimulation to set- Since:
- jcms-10.0.8
-
isCreate
public boolean isCreate()- Returns:
- the isCreate
- Since:
- jcms-10.0.8
-
isUpdate
public boolean isUpdate()- Returns:
- the isUpdate
- Since:
- jcms-10.0.8
-
isError
public boolean isError()- Returns:
- the isError
- Since:
- jcms-10.0.8
-
setError
public void setError(boolean isError) - Parameters:
isError- the isError to set- Since:
- jcms-10.0.8
-
getStatus
- Returns:
- the status
- Since:
- jcms-10.0.8
-
setStatus
- Parameters:
status- the status to set- Since:
- jcms-10.0.8
-
getLine
public int getLine()- Returns:
- the line
- Since:
- jcms-10.0.8
-
setLine
public void setLine(int line) - Parameters:
line- the line to set- Since:
- jcms-10.0.8
-
getSourceLine
- Returns:
- the sourceLine
- Since:
- jcms-10.0.8
-
setSourceLine
- Parameters:
sourceLine- the sourceLine to set- Since:
- jcms-10.0.8
-
getName
- Returns:
- the name
- Since:
- jcms-10.0.8
-
setName
- Parameters:
name- the name to set- Since:
- jcms-10.0.8
-
getFirstName
- Returns:
- the firstName
- Since:
- jcms-10.0.8
-
setFirstName
- Parameters:
firstName- the firstName to set- Since:
- jcms-10.0.8
-
getEmail
- Returns:
- the email
- Since:
- jcms-10.0.8
-
setEmail
- Parameters:
email- the email to set- Since:
- jcms-10.0.8
-
getLogin
- Returns:
- the login
- Since:
- jcms-10.0.8
-
setLogin
- Parameters:
login- the login to set- Since:
- jcms-10.0.8
-
getOrganization
- Returns:
- the organization
- Since:
- jcms-10.0.8
-
setOrganization
- Parameters:
organization- the organization to set- Since:
- jcms-10.0.8
-
getDepartment
- Returns:
- the department
- Since:
- jcms-10.0.8
-
setDepartment
- Parameters:
department- the department to set- Since:
- jcms-10.0.8
-
getJobTitle
- Returns:
- the jobTitle
- Since:
- jcms-10.0.8
-
setJobTitle
- Parameters:
jobTitle- the jobTitle to set- Since:
- jcms-10.0.8
-
getPhone
- Returns:
- the phone
- Since:
- jcms-10.0.8
-
setPhone
- Parameters:
phone- the phone to set- Since:
- jcms-10.0.8
-
getMobile
- Returns:
- the mobile
- Since:
- jcms-10.0.8
-
setMobile
- Parameters:
mobile- the mobile to set- Since:
- jcms-10.0.8
-
getStreet
- Returns:
- the street
-
setStreet
- Parameters:
street- the street to set
-
getPostalCode
- Returns:
- the postalCode
-
setPostalCode
- Parameters:
postalCode- the postalCode to set
-
getPoBox
- Returns:
- the poBox
-
setPoBox
- Parameters:
poBox- the poBox to set
-
getRegion
- Returns:
- the region
-
setRegion
- Parameters:
region- the region to set
-
getLocality
- Returns:
- the locality
-
setLocality
- Parameters:
locality- the locality to set
-
getCountry
- Returns:
- the country
-
setCountry
- Parameters:
country- the country to set
-
getMessage
- Returns:
- the message
- Since:
- jcms-10.0.8
-
setMessage
- Parameters:
message- the message to set- Since:
- jcms-10.0.8
-
getMember
- Returns:
- the member the member to createn or an update instance of existing member to update.
- Since:
- jcms-10.0.8
-
setMember
- Parameters:
member- the member to set- Since:
- jcms-10.0.8
-
getGroupIds
- Returns:
- the groupIds
- Since:
- jcms-10.0.8
-
setGroupIds
- Parameters:
groupIds- the groupIds to set- Since:
- jcms-10.0.8
-
isDBMemberImport
public boolean isDBMemberImport()- Returns:
- the member type to use
- Since:
- jcms-10.0.8
-
setDBMemberImport
public void setDBMemberImport(boolean isDBMemberImport) - Parameters:
isDBMemberImport- member type to set- Since:
- jcms-10.0.8
-
getUsage
public int getUsage()- Returns:
- the usage (Account or contact) for members to create.
- Since:
- jcms-10.0.8
-
setUsage
public void setUsage(int usage) - Parameters:
usage- the usage (Account or contact) for members to create to set.- Since:
- jcms-10.0.8
-
isAccount
public boolean isAccount()- Returns:
- true if Account.
- Since:
- jcms-10.0.8
-
isContact
public boolean isContact()- Returns:
- true if contact.
- Since:
- jcms-10.0.8
-
setSuccess
public void setSuccess(boolean success) - Parameters:
success- the success to set- Since:
- jcms-10.0.8
-
isSuccess
public boolean isSuccess()If import was successfull.- Returns:
- the success
- Since:
- jcms-10.0.8
-
updateMember
public void updateMember()Updates the associated Member's fields if mock Member's values are not empty.
If account creation case :
- Sets a DISABLED_PASSWORD to the new member.
- Since:
- jcms-10.0.8
-
updateMemberGroups
protected void updateMemberGroups()Add the Member to the optional Groups.- Since:
- jcms-10.0.8
-
performSave
CallsData.performCreate(Member, java.util.Map), orMember.performUpdate(Member, java.util.Map), depending on the Member already exist.- Parameters:
opAuthor- the Member performing the operation.- Returns:
- true if operation was successfull.
- Since:
- jcms-10.0.8
-
getDataControllerContext
-
getAuthor
- Returns:
- the author
- Since:
- 10.0.8 JCMS-9383
-
setAuthor
- Parameters:
author- the author to set- Since:
- 10.0.8 JCMS-9383
-
toString
Used for debug purpose.
-