public class MembersCsvImportHandler extends EditDataHandler
This handler is used to perform Member CSV import through JCMS modal.
See alsoMemberImportManager
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADMIN_USERS_MEMBER_ACL |
protected java.lang.Class<? extends Publication> |
collaborativeSpaceClazz
The optional Collaborative Space class.
|
protected boolean |
collaborativeSpaceInitDone |
static java.lang.String |
CREATED_IDS_REQ_ATTR |
static java.lang.String |
CS_GROUP_ID_PARAM |
protected java.lang.String[] |
csGrpIds |
static java.lang.String |
CSV_COMMA_CHAR_SEP |
static java.lang.String |
CSV_FILE_HTML_PARAM |
static java.lang.String |
CSV_SEMICOLON_CHAR_SEP |
protected java.io.File |
csvFile
The uploaded csvFile.
|
static java.lang.String |
DBMEMBER_PARAM |
protected java.lang.String |
dbMembers
True to store as DBMember.class, false as Member.class.
|
protected DocUploadInfo |
docUploadInfo |
static java.lang.String |
EMAIL_SENT_REQ_ATTR |
protected long |
endTime
For debug purpose.
|
protected java.lang.String |
filename
Used to pass the fileDoc filename through different steps.
|
protected static java.lang.String |
FILENAME_HTML_PARAM |
protected boolean |
hasToSendEmail |
static java.lang.String |
IMPORT_DONE_REQ_ATTR |
protected MemberImportManager |
importManager |
protected boolean |
isBlockingError
Is there any blocking error during checking the csv file ?
|
protected java.util.List<MemberImport> |
memberInfoList
The list containing each line.
|
protected boolean |
opUpload |
static java.lang.String |
REVISION |
static java.lang.String |
SEND_EMAIL_HTML_PARAM |
protected java.lang.String |
sendEmail |
protected java.lang.String |
separator |
static java.lang.String |
SEPARATOR_HTML_PARAM |
protected long |
startTime
For debug purpose.
|
static int |
STEP_1_FILE |
static int |
STEP_2_PREVIEW |
static int |
STEP_3 |
static int |
STEP_4 |
static java.lang.String |
UPDATED_IDS_REQ_ATTR |
protected int |
usage
The usage to set for members to create.
|
static java.lang.String |
USAGE_PARAM |
protected boolean |
useDbMembers
Same as
dbMembers , as boolean. |
static java.lang.String |
WS_GROUP_ID_PARAM |
protected java.lang.String[] |
wsGrpIds |
extFormHandler, formStep, id, isDeleteForced, op, opCancel, opCreate, opDelete, opFinish, opNext, opPrevious, opRefresh, opUpdate, resultOpCreate, resultOpDelete, resultOpUpdate
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, workspaceForced
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADER
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
MembersCsvImportHandler()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
deleteCsvFile()
If the file exists, try to delete it.
|
boolean |
displayUsageOption() |
java.util.Set<Workspace> |
getCollaborativeSpaceSet()
Retrieve all the Collaborative workspaces as a Set, with the following conditions :
workspace's isCollaborativeSpace() method return true;
workspace is open
workspace is not a model
member belongs to worksapce, or collaborative space has public access.
|
int |
getCreateCount() |
java.lang.String[] |
getCsGrpIds() |
java.lang.Class<? extends Data> |
getDataClass()
Overriding EditDataHandler for Steps modal Form purpose, but not really editing a Data.
|
java.lang.String |
getFilename() |
int |
getFormStepCount()
The number of steps is dynamic, is minimum 2, and maximum 4.
|
java.lang.String |
getFormStepHiddenFields()
Stores through different steps the uploaded file path.
|
protected java.lang.String |
getHiddenField(java.lang.String htmlName,
java.io.File csvFile)
Specific method to put a file relative to JCMS temp dir as hidden modal field.
|
int |
getInvalidCount() |
java.util.List<MemberImport> |
getMemberInfoList() |
java.lang.String |
getSendEmail() |
java.lang.String |
getSeparator() |
int |
getUpdateCount() |
protected java.io.File |
getUploadDir() |
int |
getUsage() |
java.util.Set<Workspace> |
getWorkspaceSet()
Retrieve all the workspaces as a Set, with the following conditions :
workspace's getCatSet() contains the given root cat
the workspace is not a collaborative space;
the workspace is not a model
the workspace is open
the workspace does have at least one group
|
java.lang.String[] |
getWsGrpIds() |
boolean |
hasToSendEmail() |
protected void |
init()
Method to implement if you need to initialize your handler from parameter received,
prior to all security validation.
|
boolean |
isAccountMode()
Return true if import mode is Account.
|
boolean |
isAnyError() |
protected boolean |
isCollaborativeSpacePluginAvailable() |
boolean |
isCollaborativeSpaceStep() |
boolean |
isContactMode()
Return true if import mode is Contact.
|
boolean |
isWorkspaceStep() |
boolean |
processAction()
Performs the import (real or simulation) if a valid CSV file has been uploaded.
|
void |
setCsGrpIds(java.lang.String[] csGrpIds) |
void |
setDbMembers(java.lang.String dbMembers)
Set true to create Member in DataBase.
|
void |
setDocuments(java.lang.String[] v)
Moves the plupload uploaded file to JCMS temp directory in order the uploaded files to be cleaned periodically by JCMS.
|
void |
setFilename(java.lang.String filename) |
void |
setOpUpload(java.lang.String upload) |
void |
setSendEmail(java.lang.String sendEmail) |
void |
setSeparator(java.lang.String separator) |
void |
setUsage(int usage) |
void |
setWsGrpIds(java.lang.String[] wsGrpIds) |
boolean |
showFinishButton()
Check if the "Finish" button should be displayed in step modal form.
|
boolean |
showNextButton()
Check if the "Next" button should be displayed in step modal form.
|
boolean |
showPreviousButton()
Check if the "Previous" button should be displayed in step modal form.
|
boolean |
useDbMembers() |
protected boolean |
validateFinish() |
protected boolean |
validatePrevious() |
boolean |
validateUpload()
Validates the file format to import.
|
afterValidation, createUploadedFileDocument, createUploadedFileDocument, createUploadedFileDocument, createUploadedFileDocument, getAvailableData, getAvailableDataArray, getAvailableExtraDataMap, getAvailableExtraDBDataMap, getControllerContext, getExtFormHandler, getFormStep, getId, handleRestResponse, isFirstAccess, performCancel, performCreateExtension, performFinish, performNext, performPrevious, performRefresh, performUpdateExtension, processDataId, processDataIds, processDataIds, processMLData, processMLDataArray, restValidation, sendRedirect, setExtFormHandler, setExtraDBKeys, setExtraDBValues, setExtraKeys, setExtraValues, setFields, setForceDelete, setFormStep, setId, setOpCancel, setOpCreate, setOpDelete, setOpFinish, setOpNext, setOpPrevious, setOpRefresh, setOpUpdate, showCancelButton, validateCancel, validateCreateExtension, validateNext, validateRefresh, validateUpdateExtension, validateUploadedFileDocument, validateUploadedFileDocument, validateUploadedFileDocument, validateUploadedFileDocument
checkMissingField, getEditFieldSet, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenFieldML, getMainLangValue, getMainLangValueArray, getMLMap, getMLMapArray, getRedirect, getRedirectOnClosePopup, getWorkspace, isFieldEdition, isFieldMissing, isPartialFieldEdition, isPopupEdition, isWorkspaceForced, processStatus, sendRedirect, sendRedirect, setEditField, setNoRedirect, setNoSendRedirect, setPopupEdition, setRedirect, setRedirectOnClosePopup, setWorkspace, setWs, updateUploadedField, updateUploadedFields, validate
addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addPrefetchHeader, addStyleHeader, addStyleHeader, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSMap, getFinalJavaScriptSet, getFormElementCount, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHttpEquivHeaders, getHttpNameHeaders, getJavaScriptCodeSet, getJavaScriptSet, getJSONBridge, getPackVersion, getPageContext, getPageTitle, getPageZone, getPortal, getPortalCategory, getPortlet, getPublication, getStyleHeaders, getTemplateUsage, internalSetupEmptyHeader, isEditIcon, isEditIcon, isPrintView, registerDisplayContext, removeAjaxRequestAttribute, setAjaxRequestAttribute, setAjaxRequestId, setAllHeadersDiffMap, setDocType, setEditIcon, setFormElementCount, setPageContext, setPageTitle, setPageZone, setShowEditIcon, setTemplateUsage, showEditIcon, showEditIcon, workaroundBrowserBaseHrefBug
addCookie, addMsg, addMsg, addMsgSession, addMsgSession, applySelector, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getUploadedFile, getUploadedFileList, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAjaxRequest, isDBMember, isDebug, isInFrontOffice, isLogged, isWebdavAccess, removeMessage, removeMessage, retrieveUploadedFile, select, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, validateRegexp, validateSchedule
public static final java.lang.String REVISION
public static final java.lang.String ADMIN_USERS_MEMBER_ACL
protected boolean opUpload
protected java.lang.String separator
protected java.lang.String sendEmail
protected boolean hasToSendEmail
protected java.lang.String[] wsGrpIds
protected java.lang.String[] csGrpIds
protected DocUploadInfo docUploadInfo
protected java.lang.String dbMembers
protected boolean useDbMembers
dbMembers
, as boolean.protected int usage
protected java.io.File csvFile
public static final java.lang.String CSV_SEMICOLON_CHAR_SEP
public static final java.lang.String CSV_COMMA_CHAR_SEP
public static final java.lang.String CSV_FILE_HTML_PARAM
public static final java.lang.String SEPARATOR_HTML_PARAM
public static final java.lang.String SEND_EMAIL_HTML_PARAM
public static final java.lang.String WS_GROUP_ID_PARAM
public static final java.lang.String CS_GROUP_ID_PARAM
public static final java.lang.String DBMEMBER_PARAM
public static final java.lang.String USAGE_PARAM
public static final java.lang.String IMPORT_DONE_REQ_ATTR
public static final java.lang.String CREATED_IDS_REQ_ATTR
public static final java.lang.String UPDATED_IDS_REQ_ATTR
public static final java.lang.String EMAIL_SENT_REQ_ATTR
protected static final java.lang.String FILENAME_HTML_PARAM
public static final int STEP_1_FILE
public static final int STEP_2_PREVIEW
public static final int STEP_3
public static final int STEP_4
protected long startTime
protected long endTime
protected boolean isBlockingError
protected java.lang.String filename
protected java.util.List<MemberImport> memberInfoList
protected MemberImportManager importManager
protected java.lang.Class<? extends Publication> collaborativeSpaceClazz
protected boolean collaborativeSpaceInitDone
public MembersCsvImportHandler()
public boolean processAction() throws java.io.IOException
processAction
in class EditDataHandler
java.io.IOException
protected void init()
JcmsFormHandler
You must absolutely not perform any action which modify data or site configuration.
Therefore it is strongly recommend NOT TO implement this method, or use very wisely.
init
in class JcmsFormHandler
JcmsFormHandler.init()
protected boolean isCollaborativeSpacePluginAvailable()
protected boolean validatePrevious() throws java.io.IOException
validatePrevious
in class EditDataHandler
java.io.IOException
public boolean validateUpload() throws java.io.IOException
java.io.IOException
- if an exception occurs while simulating import.protected boolean validateFinish() throws java.io.IOException
validateFinish
in class EditDataHandler
java.io.IOException
protected void deleteCsvFile()
MultipartFilter.initFileUpload()
).public boolean showPreviousButton()
EditDataHandler
The default implementation of this method is to return true
if the current step (as returned by EditDataHandler.getFormStep()
is higher than 0.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
showPreviousButton
in class EditDataHandler
public boolean showNextButton()
EditDataHandler
The default implementation of this method is to return true
unless the finish button is being displayed
by method EditDataHandler.showFinishButton()
.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
showNextButton
in class EditDataHandler
public boolean showFinishButton()
EditDataHandler
The default implementation of this method is to return true
if the current step (as returned by EditDataHandler.getFormStep()
is
the last one (as compared with EditDataHandler.getFormStepCount()
.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
showFinishButton
in class EditDataHandler
public java.lang.String getFormStepHiddenFields()
public int getFormStepCount()
getFormStepCount
in class EditDataHandler
EditDataHandler.getFormStepCount()
public boolean isWorkspaceStep()
getWorkspaceSet()
.public boolean isCollaborativeSpaceStep()
public java.util.Set<Workspace> getWorkspaceSet()
public java.util.Set<Workspace> getCollaborativeSpaceSet()
public void setDocuments(java.lang.String[] v)
v
- the documents argument from plupload.protected java.io.File getUploadDir()
public void setOpUpload(java.lang.String upload)
upload
- set the opUploadpublic java.lang.String getSeparator()
public void setSeparator(java.lang.String separator)
separator
- the separator to setpublic java.lang.String getSendEmail()
public void setSendEmail(java.lang.String sendEmail)
sendEmail
- the sendEmail to setpublic boolean hasToSendEmail()
public void setDbMembers(java.lang.String dbMembers)
dbMembers
- the dbMembers to setpublic boolean useDbMembers()
public int getCreateCount()
public int getUpdateCount()
public int getInvalidCount()
public java.util.List<MemberImport> getMemberInfoList()
public boolean isAnyError()
public java.lang.String[] getWsGrpIds()
public void setWsGrpIds(java.lang.String[] wsGrpIds)
wsGrpIds
- the wsGrpIds to setpublic java.lang.String[] getCsGrpIds()
public void setCsGrpIds(java.lang.String[] csGrpIds)
csGrpIds
- the csGrpIds to setpublic int getUsage()
public void setUsage(int usage)
usage
- the usage (Account or contact) for members to create to set.public boolean isAccountMode()
public boolean isContactMode()
public java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename
- the filename to setpublic java.lang.Class<? extends Data> getDataClass()
getDataClass
in class EditDataHandler
EditDataHandler.getDataClass()
protected java.lang.String getHiddenField(java.lang.String htmlName, java.io.File csvFile)
htmlName
- : the HTTP param name.csvFile
- : the File.public boolean displayUsageOption()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.