Package com.jalios.jcms.member.csvimport
Class MemberImport
- java.lang.Object
-
- com.jalios.jcms.member.csvimport.MemberImport
-
- All Implemented Interfaces:
MemberImportConstants
public class MemberImport extends java.lang.Object implements MemberImportConstants
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
country
protected java.lang.String
department
protected java.lang.String
email
protected java.lang.String
firstName
protected java.util.Collection<java.lang.String>
groupIds
A collection of Group's id.protected boolean
isError
True if any error.protected boolean
isSimulation
protected java.lang.String
jobTitle
protected java.lang.String
locality
protected java.lang.String
login
protected java.lang.String
message
The information message.protected java.lang.String
mobile
protected java.lang.String
name
protected java.lang.String
organization
protected java.lang.String
phone
protected java.lang.String
poBox
protected java.lang.String
postalCode
protected java.lang.String
region
protected java.lang.String
sourceLine
The source line.protected ControllerStatus
status
A custom integrity error message, or a JCMS integrity message.protected java.lang.String
street
protected java.lang.String
userLang
-
Fields 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
Constructors Constructor Description MemberImport(int line, java.lang.String sourceLine, java.lang.String separator, java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Member
getAuthor()
java.lang.String
getCountry()
protected java.util.Map<java.lang.String,java.lang.Object>
getDataControllerContext()
java.lang.String
getDepartment()
java.lang.String
getEmail()
java.lang.String
getFirstName()
java.util.Collection<java.lang.String>
getGroupIds()
java.lang.String
getJobTitle()
int
getLine()
java.lang.String
getLocality()
java.lang.String
getLogin()
Member
getMember()
java.lang.String
getMessage()
java.lang.String
getMobile()
java.lang.String
getName()
java.lang.String
getOrganization()
java.lang.String
getPhone()
java.lang.String
getPoBox()
java.lang.String
getPostalCode()
java.lang.String
getRegion()
java.lang.String
getSourceLine()
ControllerStatus
getStatus()
java.lang.String
getStreet()
int
getUsage()
boolean
isAccount()
boolean
isContact()
boolean
isCreate()
boolean
isDBMemberImport()
boolean
isError()
boolean
isSimulation()
boolean
isSuccess()
If import was successfull.boolean
isUpdate()
boolean
performSave(Member opAuthor)
CallsData.performCreate(Member, java.util.Map)
, orMember.performUpdate(Member, java.util.Map)
, depending on the Member already exist.void
setAuthor(Member author)
void
setCountry(java.lang.String country)
void
setDBMemberImport(boolean isDBMemberImport)
void
setDepartment(java.lang.String department)
void
setEmail(java.lang.String email)
void
setError(boolean isError)
void
setFirstName(java.lang.String firstName)
void
setGroupIds(java.util.Collection<java.lang.String> groupIds)
void
setJobTitle(java.lang.String jobTitle)
void
setLine(int line)
void
setLocality(java.lang.String locality)
void
setLogin(java.lang.String login)
void
setMember(Member member)
void
setMessage(java.lang.String message)
void
setMobile(java.lang.String mobile)
void
setName(java.lang.String name)
void
setOrganization(java.lang.String organization)
void
setPhone(java.lang.String phone)
void
setPoBox(java.lang.String poBox)
void
setPostalCode(java.lang.String postalCode)
void
setRegion(java.lang.String region)
void
setSimulation(boolean isSimulation)
void
setSourceLine(java.lang.String sourceLine)
void
setStatus(ControllerStatus status)
void
setStreet(java.lang.String street)
void
setSuccess(boolean success)
void
setUsage(int usage)
java.lang.String
toString()
Used for debug purpose.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.protected void
updateMemberGroups()
Add the Member to the optional Groups.
-
-
-
Field Detail
-
isSimulation
protected boolean isSimulation
-
isError
protected boolean isError
True if any error.
-
status
protected ControllerStatus status
A custom integrity error message, or a JCMS integrity message.
-
message
protected java.lang.String message
The information message.
-
sourceLine
protected java.lang.String sourceLine
The source line.
-
name
protected java.lang.String name
-
firstName
protected java.lang.String firstName
-
email
protected java.lang.String email
-
login
protected java.lang.String login
-
organization
protected java.lang.String organization
-
department
protected java.lang.String department
-
jobTitle
protected java.lang.String jobTitle
-
phone
protected java.lang.String phone
-
mobile
protected java.lang.String mobile
-
street
protected java.lang.String street
-
postalCode
protected java.lang.String postalCode
-
poBox
protected java.lang.String poBox
-
region
protected java.lang.String region
-
locality
protected java.lang.String locality
-
country
protected java.lang.String country
-
userLang
protected java.lang.String userLang
-
groupIds
protected java.util.Collection<java.lang.String> groupIds
A collection of Group's id.- Since:
- jcms-10.0.8
-
-
Constructor Detail
-
MemberImport
public MemberImport(int line, java.lang.String sourceLine, java.lang.String separator, java.lang.String userLang)
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
public MemberImport(com.csvreader.CsvReader csvReader) throws java.io.IOException
Constructor used to setthis
's members from a CsvReader.- Parameters:
csvReader
- the csv reader to use.- Throws:
java.io.IOException
- if an exception occurs on readingcsvReader
.- Since:
- jcms-10.0.8
-
-
Method Detail
-
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
public ControllerStatus getStatus()
- Returns:
- the status
- Since:
- jcms-10.0.8
-
setStatus
public void setStatus(ControllerStatus status)
- 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
public java.lang.String getSourceLine()
- Returns:
- the sourceLine
- Since:
- jcms-10.0.8
-
setSourceLine
public void setSourceLine(java.lang.String sourceLine)
- Parameters:
sourceLine
- the sourceLine to set- Since:
- jcms-10.0.8
-
getName
public java.lang.String getName()
- Returns:
- the name
- Since:
- jcms-10.0.8
-
setName
public void setName(java.lang.String name)
- Parameters:
name
- the name to set- Since:
- jcms-10.0.8
-
getFirstName
public java.lang.String getFirstName()
- Returns:
- the firstName
- Since:
- jcms-10.0.8
-
setFirstName
public void setFirstName(java.lang.String firstName)
- Parameters:
firstName
- the firstName to set- Since:
- jcms-10.0.8
-
getEmail
public java.lang.String getEmail()
- Returns:
- the email
- Since:
- jcms-10.0.8
-
setEmail
public void setEmail(java.lang.String email)
- Parameters:
email
- the email to set- Since:
- jcms-10.0.8
-
getLogin
public java.lang.String getLogin()
- Returns:
- the login
- Since:
- jcms-10.0.8
-
setLogin
public void setLogin(java.lang.String login)
- Parameters:
login
- the login to set- Since:
- jcms-10.0.8
-
getOrganization
public java.lang.String getOrganization()
- Returns:
- the organization
- Since:
- jcms-10.0.8
-
setOrganization
public void setOrganization(java.lang.String organization)
- Parameters:
organization
- the organization to set- Since:
- jcms-10.0.8
-
getDepartment
public java.lang.String getDepartment()
- Returns:
- the department
- Since:
- jcms-10.0.8
-
setDepartment
public void setDepartment(java.lang.String department)
- Parameters:
department
- the department to set- Since:
- jcms-10.0.8
-
getJobTitle
public java.lang.String getJobTitle()
- Returns:
- the jobTitle
- Since:
- jcms-10.0.8
-
setJobTitle
public void setJobTitle(java.lang.String jobTitle)
- Parameters:
jobTitle
- the jobTitle to set- Since:
- jcms-10.0.8
-
getPhone
public java.lang.String getPhone()
- Returns:
- the phone
- Since:
- jcms-10.0.8
-
setPhone
public void setPhone(java.lang.String phone)
- Parameters:
phone
- the phone to set- Since:
- jcms-10.0.8
-
getMobile
public java.lang.String getMobile()
- Returns:
- the mobile
- Since:
- jcms-10.0.8
-
setMobile
public void setMobile(java.lang.String mobile)
- Parameters:
mobile
- the mobile to set- Since:
- jcms-10.0.8
-
getStreet
public java.lang.String getStreet()
- Returns:
- the street
-
setStreet
public void setStreet(java.lang.String street)
- Parameters:
street
- the street to set
-
getPostalCode
public java.lang.String getPostalCode()
- Returns:
- the postalCode
-
setPostalCode
public void setPostalCode(java.lang.String postalCode)
- Parameters:
postalCode
- the postalCode to set
-
getPoBox
public java.lang.String getPoBox()
- Returns:
- the poBox
-
setPoBox
public void setPoBox(java.lang.String poBox)
- Parameters:
poBox
- the poBox to set
-
getRegion
public java.lang.String getRegion()
- Returns:
- the region
-
setRegion
public void setRegion(java.lang.String region)
- Parameters:
region
- the region to set
-
getLocality
public java.lang.String getLocality()
- Returns:
- the locality
-
setLocality
public void setLocality(java.lang.String locality)
- Parameters:
locality
- the locality to set
-
getCountry
public java.lang.String getCountry()
- Returns:
- the country
-
setCountry
public void setCountry(java.lang.String country)
- Parameters:
country
- the country to set
-
getMessage
public java.lang.String getMessage()
- Returns:
- the message
- Since:
- jcms-10.0.8
-
setMessage
public void setMessage(java.lang.String message)
- Parameters:
message
- the message to set- Since:
- jcms-10.0.8
-
getMember
public Member getMember()
- Returns:
- the member the member to createn or an update instance of existing member to update.
- Since:
- jcms-10.0.8
-
setMember
public void setMember(Member member)
- Parameters:
member
- the member to set- Since:
- jcms-10.0.8
-
getGroupIds
public java.util.Collection<java.lang.String> getGroupIds()
- Returns:
- the groupIds
- Since:
- jcms-10.0.8
-
setGroupIds
public void setGroupIds(java.util.Collection<java.lang.String> groupIds)
- 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
public boolean performSave(Member opAuthor)
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
protected java.util.Map<java.lang.String,java.lang.Object> getDataControllerContext()
-
getAuthor
public Member getAuthor()
- Returns:
- the author
- Since:
- 10.0.8 JCMS-9383
-
setAuthor
public void setAuthor(Member author)
- Parameters:
author
- the author to set- Since:
- 10.0.8 JCMS-9383
-
toString
public java.lang.String toString()
Used for debug purpose.- Overrides:
toString
in classjava.lang.Object
- Since:
- jcms-10.0.8
-
-