fr.paris.lutece.portal.service.admin
Class ImportAdminUserService

java.lang.Object
  extended by fr.paris.lutece.portal.service.csv.CSVReaderService
      extended by fr.paris.lutece.portal.service.admin.ImportAdminUserService

public class ImportAdminUserService
extends CSVReaderService

Class to import Admin Users from CSV files.


Constructor Summary
ImportAdminUserService()
           
 
Method Summary
protected  List<CSVMessageDescriptor> checkLineOfCSVFile(String[] strLineDataArray, int nLineNumber, Locale locale)
          Check the line of the CSV file.
 Character getAttributesSeparator()
          Get the separator used for attributes of admin users.
protected  List<CSVMessageDescriptor> getEndOfProcessMessages(int nNbLineParses, int nNbLinesWithoutErrors, Locale locale)
          Get messages after the process is completed.
 boolean getUpdateExistingUsers()
          Get the update users flag
protected  List<CSVMessageDescriptor> readLineOfCSVFile(String[] strLineDataArray, int nLineNumber, Locale locale, String strBaseUrl)
          Read a line of the CSV file.
 void setUpdateExistingUsers(boolean bUpdateExistingUsers)
          Set the update users flag
 
Methods inherited from class fr.paris.lutece.portal.service.csv.CSVReaderService
checkCSVFileValidity, checkCSVLineColumnNumber, getCSVEscapeCharacter, getCSVSeparator, getDefaultCSVEscapeCharacter, getDefaultCSVSeparator, readCSVFile, readCSVFile, readCSVFile, readCSVFile, readCSVFile, setCSVEscapeCharacter, setCSVSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportAdminUserService

public ImportAdminUserService()
Method Detail

readLineOfCSVFile

protected List<CSVMessageDescriptor> readLineOfCSVFile(String[] strLineDataArray,
                                                       int nLineNumber,
                                                       Locale locale,
                                                       String strBaseUrl)
Read a line of the CSV file.

Specified by:
readLineOfCSVFile in class CSVReaderService
Parameters:
strLineDataArray - The content of the line of the CSV file.
nLineNumber - Number of the current line
locale - the locale
strBaseUrl - The base URL
Returns:
Returns the list of messages associated with the line.

checkLineOfCSVFile

protected List<CSVMessageDescriptor> checkLineOfCSVFile(String[] strLineDataArray,
                                                        int nLineNumber,
                                                        Locale locale)
Check the line of the CSV file. This method is called once on each line of the file if the number of columns is correct. If the file is entirely checked before processing, then this method is called before any line is processed. Otherwise it is called just before the processing of the line.

Specified by:
checkLineOfCSVFile in class CSVReaderService
Parameters:
strLineDataArray - The content of the line of the CSV file.
nLineNumber - Number of the current line
locale - the locale
Returns:
The list of messages of the lines. Lines that contain messages with messages levels other than INFO will NOT be processed, and the global processing may stop if the ExitOnError flag has been set to true !

getEndOfProcessMessages

protected List<CSVMessageDescriptor> getEndOfProcessMessages(int nNbLineParses,
                                                             int nNbLinesWithoutErrors,
                                                             Locale locale)
Get messages after the process is completed.

Specified by:
getEndOfProcessMessages in class CSVReaderService
Parameters:
nNbLineParses - The number of lines parses. If the first line was skipped, it is not counted.
nNbLinesWithoutErrors - the number of lines parses whitout error.
locale - The locale
Returns:
A list of messages.

getAttributesSeparator

public Character getAttributesSeparator()
Get the separator used for attributes of admin users.

Returns:
The separator

getUpdateExistingUsers

public boolean getUpdateExistingUsers()
Get the update users flag

Returns:
True if existing users should be updated, false if they should be ignored.

setUpdateExistingUsers

public void setUpdateExistingUsers(boolean bUpdateExistingUsers)
Set the update users flag

Parameters:
bUpdateExistingUsers - True if existing users should be updated, false if they should be ignored.


Copyright © 2014 Mairie de Paris. All Rights Reserved.