Class MemberImport


  • public class MemberImport
    extends java.lang.Object
    Represents a Member during CSV Member import.
    Since:
    jcms-8
    Version:
    $Revision: 135454 $
    Author:
    Sylvain Devaux
    • Field Detail

      • isSimulation

        protected boolean isSimulation
      • isError

        protected boolean isError
        True if any error.
      • isBlockingError

        protected boolean isBlockingError
        True if any blocking 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-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-8
      • MemberImport

        public MemberImport​(com.csvreader.CsvReader csvReader)
                     throws java.io.IOException
        Constructor used to set this's members from a CsvReader.
        Parameters:
        csvReader - the csv reader to use.
        Throws:
        java.io.IOException - if an exception occurs on reading csvReader.
        Since:
        jcms-8
    • Method Detail

      • isSimulation

        public boolean isSimulation()
        Returns:
        the isSimulation
        Since:
        jcms-8
      • setSimulation

        public void setSimulation​(boolean isSimulation)
        Parameters:
        isSimulation - the isSimulation to set
        Since:
        jcms-8
      • isCreate

        public boolean isCreate()
        Returns:
        the isCreate
        Since:
        jcms-8
      • isUpdate

        public boolean isUpdate()
        Returns:
        the isUpdate
        Since:
        jcms-8
      • isError

        public boolean isError()
        Returns:
        the isError
        Since:
        jcms-8
      • setError

        public void setError​(boolean isError)
        Parameters:
        isError - the isError to set
        Since:
        jcms-8
      • isBlockingError

        public boolean isBlockingError()
        Returns:
        the isBlockingError
        Since:
        jcms-8
      • setBlockingError

        public void setBlockingError​(boolean isBlockingError)
        Parameters:
        isBlockingError - the isBlockingError to set
        Since:
        jcms-8
      • getStatus

        public ControllerStatus getStatus()
        Returns:
        the status
        Since:
        jcms-8
      • setStatus

        public void setStatus​(ControllerStatus status)
        Parameters:
        status - the status to set
        Since:
        jcms-8
      • getLine

        public int getLine()
        Returns:
        the line
        Since:
        jcms-8
      • setLine

        public void setLine​(int line)
        Parameters:
        line - the line to set
        Since:
        jcms-8
      • getSourceLine

        public java.lang.String getSourceLine()
        Returns:
        the sourceLine
        Since:
        jcms-8
      • setSourceLine

        public void setSourceLine​(java.lang.String sourceLine)
        Parameters:
        sourceLine - the sourceLine to set
        Since:
        jcms-8
      • getName

        public java.lang.String getName()
        Returns:
        the name
        Since:
        jcms-8
      • setName

        public void setName​(java.lang.String name)
        Parameters:
        name - the name to set
        Since:
        jcms-8
      • getFirstName

        public java.lang.String getFirstName()
        Returns:
        the firstName
        Since:
        jcms-8
      • setFirstName

        public void setFirstName​(java.lang.String firstName)
        Parameters:
        firstName - the firstName to set
        Since:
        jcms-8
      • getEmail

        public java.lang.String getEmail()
        Returns:
        the email
        Since:
        jcms-8
      • setEmail

        public void setEmail​(java.lang.String email)
        Parameters:
        email - the email to set
        Since:
        jcms-8
      • getLogin

        public java.lang.String getLogin()
        Returns:
        the login
        Since:
        jcms-8
      • setLogin

        public void setLogin​(java.lang.String login)
        Parameters:
        login - the login to set
        Since:
        jcms-8
      • getOrganization

        public java.lang.String getOrganization()
        Returns:
        the organization
        Since:
        jcms-8
      • setOrganization

        public void setOrganization​(java.lang.String organization)
        Parameters:
        organization - the organization to set
        Since:
        jcms-8
      • getDepartment

        public java.lang.String getDepartment()
        Returns:
        the department
        Since:
        jcms-8
      • setDepartment

        public void setDepartment​(java.lang.String department)
        Parameters:
        department - the department to set
        Since:
        jcms-8
      • getJobTitle

        public java.lang.String getJobTitle()
        Returns:
        the jobTitle
        Since:
        jcms-8
      • setJobTitle

        public void setJobTitle​(java.lang.String jobTitle)
        Parameters:
        jobTitle - the jobTitle to set
        Since:
        jcms-8
      • getPhone

        public java.lang.String getPhone()
        Returns:
        the phone
        Since:
        jcms-8
      • setPhone

        public void setPhone​(java.lang.String phone)
        Parameters:
        phone - the phone to set
        Since:
        jcms-8
      • getMobile

        public java.lang.String getMobile()
        Returns:
        the mobile
        Since:
        jcms-8
      • setMobile

        public void setMobile​(java.lang.String mobile)
        Parameters:
        mobile - the mobile to set
        Since:
        jcms-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-8
      • setMessage

        public void setMessage​(java.lang.String message)
        Parameters:
        message - the message to set
        Since:
        jcms-8
      • getMember

        public Member getMember()
        Returns:
        the member the member to createn or an update instance of existing member to update.
        Since:
        jcms-8
      • setMember

        public void setMember​(Member member)
        Parameters:
        member - the member to set
        Since:
        jcms-8
      • getGroupIds

        public java.util.Collection<java.lang.String> getGroupIds()
        Returns:
        the groupIds
        Since:
        jcms-8
      • setGroupIds

        public void setGroupIds​(java.util.Collection<java.lang.String> groupIds)
        Parameters:
        groupIds - the groupIds to set
        Since:
        jcms-8
      • isUseMemberClass

        public boolean isUseMemberClass()
        Returns:
        the useMemberClass
        Since:
        jcms-8.0.1
      • setUseMemberClass

        public void setUseMemberClass​(boolean useMemberClass)
        Parameters:
        useMemberClass - true to use Member.class, false to use DBMember.class.
        Since:
        jcms-8.0.1
      • getUsage

        public int getUsage()
        Returns:
        the usage (Account or contact) for members to create.
        Since:
        jcms-8.0.1
      • setUsage

        public void setUsage​(int usage)
        Parameters:
        usage - the usage (Account or contact) for members to create to set.
        Since:
        jcms-8.0.1
      • isAccount

        public boolean isAccount()
        Returns:
        true if Account.
        Since:
        jcms-8.0.1
      • isContact

        public boolean isContact()
        Returns:
        true if contact.
        Since:
        jcms-8.0.1
      • setSuccess

        public void setSuccess​(boolean success)
        Parameters:
        success - the success to set
        Since:
        jcms-8.0.1
      • isSuccess

        public boolean isSuccess()
        If import was successfull.
        Returns:
        the success
        Since:
        jcms-8.0.1
      • 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-8
      • updateMemberGroups

        protected void updateMemberGroups()
        Add the Member to the optional Groups.
        Since:
        jcms-8
      • getDataControllerContext

        protected java.util.Map<java.lang.String,​java.lang.Object> getDataControllerContext()
      • getAuthor

        public Member getAuthor()
        Returns:
        the author
        Since:
        10.0.7 JCMS-9383
      • setAuthor

        public void setAuthor​(Member author)
        Parameters:
        author - the author to set
        Since:
        10.0.7 JCMS-9383
      • toString

        public java.lang.String toString()
        Used for debug purpose.
        Overrides:
        toString in class java.lang.Object
        Since:
        jcms-8