Class MemberImport

java.lang.Object
com.jalios.jcms.member.csvimport.MemberImport
All Implemented Interfaces:
MemberImportConstants

public class MemberImport extends Object implements MemberImportConstants
  • Field Details

    • 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 String message
      The information message.
    • sourceLine

      protected String sourceLine
      The source line.
    • name

      protected String name
    • firstName

      protected String firstName
    • email

      protected String email
    • login

      protected String login
    • organization

      protected String organization
    • department

      protected String department
    • jobTitle

      protected String jobTitle
    • phone

      protected String phone
    • mobile

      protected String mobile
    • street

      protected String street
    • postalCode

      protected String postalCode
    • poBox

      protected String poBox
    • region

      protected String region
    • locality

      protected String locality
    • country

      protected String country
    • userLang

      protected String userLang
    • groupIds

      protected Collection<String> groupIds
      A collection of Group's id.
      Since:
      jcms-10.0.8
  • Constructor Details

    • MemberImport

      public MemberImport(int line, String sourceLine, String separator, 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 IOException
      Constructor used to set this's members from a CsvReader.
      Parameters:
      csvReader - the csv reader to use.
      Throws:
      IOException - if an exception occurs on reading csvReader.
      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

      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 String getSourceLine()
      Returns:
      the sourceLine
      Since:
      jcms-10.0.8
    • setSourceLine

      public void setSourceLine(String sourceLine)
      Parameters:
      sourceLine - the sourceLine to set
      Since:
      jcms-10.0.8
    • getName

      public String getName()
      Returns:
      the name
      Since:
      jcms-10.0.8
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
      Since:
      jcms-10.0.8
    • getFirstName

      public String getFirstName()
      Returns:
      the firstName
      Since:
      jcms-10.0.8
    • setFirstName

      public void setFirstName(String firstName)
      Parameters:
      firstName - the firstName to set
      Since:
      jcms-10.0.8
    • getEmail

      public String getEmail()
      Returns:
      the email
      Since:
      jcms-10.0.8
    • setEmail

      public void setEmail(String email)
      Parameters:
      email - the email to set
      Since:
      jcms-10.0.8
    • getLogin

      public String getLogin()
      Returns:
      the login
      Since:
      jcms-10.0.8
    • setLogin

      public void setLogin(String login)
      Parameters:
      login - the login to set
      Since:
      jcms-10.0.8
    • getOrganization

      public String getOrganization()
      Returns:
      the organization
      Since:
      jcms-10.0.8
    • setOrganization

      public void setOrganization(String organization)
      Parameters:
      organization - the organization to set
      Since:
      jcms-10.0.8
    • getDepartment

      public String getDepartment()
      Returns:
      the department
      Since:
      jcms-10.0.8
    • setDepartment

      public void setDepartment(String department)
      Parameters:
      department - the department to set
      Since:
      jcms-10.0.8
    • getJobTitle

      public String getJobTitle()
      Returns:
      the jobTitle
      Since:
      jcms-10.0.8
    • setJobTitle

      public void setJobTitle(String jobTitle)
      Parameters:
      jobTitle - the jobTitle to set
      Since:
      jcms-10.0.8
    • getPhone

      public String getPhone()
      Returns:
      the phone
      Since:
      jcms-10.0.8
    • setPhone

      public void setPhone(String phone)
      Parameters:
      phone - the phone to set
      Since:
      jcms-10.0.8
    • getMobile

      public String getMobile()
      Returns:
      the mobile
      Since:
      jcms-10.0.8
    • setMobile

      public void setMobile(String mobile)
      Parameters:
      mobile - the mobile to set
      Since:
      jcms-10.0.8
    • getStreet

      public String getStreet()
      Returns:
      the street
    • setStreet

      public void setStreet(String street)
      Parameters:
      street - the street to set
    • getPostalCode

      public String getPostalCode()
      Returns:
      the postalCode
    • setPostalCode

      public void setPostalCode(String postalCode)
      Parameters:
      postalCode - the postalCode to set
    • getPoBox

      public String getPoBox()
      Returns:
      the poBox
    • setPoBox

      public void setPoBox(String poBox)
      Parameters:
      poBox - the poBox to set
    • getRegion

      public String getRegion()
      Returns:
      the region
    • setRegion

      public void setRegion(String region)
      Parameters:
      region - the region to set
    • getLocality

      public String getLocality()
      Returns:
      the locality
    • setLocality

      public void setLocality(String locality)
      Parameters:
      locality - the locality to set
    • getCountry

      public String getCountry()
      Returns:
      the country
    • setCountry

      public void setCountry(String country)
      Parameters:
      country - the country to set
    • getMessage

      public String getMessage()
      Returns:
      the message
      Since:
      jcms-10.0.8
    • setMessage

      public void setMessage(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 Collection<String> getGroupIds()
      Returns:
      the groupIds
      Since:
      jcms-10.0.8
    • setGroupIds

      public void setGroupIds(Collection<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)
      Parameters:
      opAuthor - the Member performing the operation.
      Returns:
      true if operation was successfull.
      Since:
      jcms-10.0.8
    • getDataControllerContext

      protected Map<String,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 String toString()
      Used for debug purpose.
      Overrides:
      toString in class Object
      Since:
      jcms-10.0.8