|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.context.JcmsContext
com.jalios.jcms.context.JcmsJspContext
com.jalios.jcms.handler.JcmsFormHandler
com.jalios.jcms.handler.EditDataHandler
com.jalios.jcms.handler.MembersCsvImportHandler
public class MembersCsvImportHandler
This handler is used to perform Member CSV import through JCMS modal.
Field Summary | |
---|---|
static String |
ADMIN_USERS_MEMBER_ACL
The ACL to have to access the feature. |
protected Class<? extends Publication> |
collaborativeSpaceClazz
The optional Collaborative Space class. |
protected boolean |
collaborativeSpaceInitDone
|
static String |
CREATED_IDS_REQ_ATTR
|
static String |
CS_GROUP_ID_PARAM
|
protected String[] |
csGrpIds
|
static String |
CSV_COMMA_CHAR_SEP
|
static String |
CSV_FILE_HTML_PARAM
|
static String |
CSV_SEMICOLON_CHAR_SEP
|
protected File |
csvFile
The uploaded csvFile. |
protected int |
documentsAddCount
|
static String |
EMAIL_SENT_REQ_ATTR
|
protected long |
endTime
For debug purpose. |
protected String |
filename
Used to pass the fileDoc filename through different steps. |
protected static String |
fnHtmlParam
The HTML input name of the temporary uploaded CSV file's filename. |
protected boolean |
hasToSendEmail
|
static String |
IMPORT_DONE_REQ_ATTR
|
protected MemberImportManager |
importManager
|
protected boolean |
isBlockingError
Is there any blocking error during checking the csv file ? |
protected List<MemberImport> |
memberInfoList
The list containing each line. |
static String |
REVISION
The class revision. |
static String |
SEND_EMAIL_HTML_PARAM
|
protected String |
sendEmail
|
protected String |
separator
|
static 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 String |
UPDATED_IDS_REQ_ATTR
|
static String |
WS_GROUP_ID_PARAM
|
protected String[] |
wsGrpIds
|
Fields inherited from class com.jalios.jcms.handler.EditDataHandler |
---|
extFormHandler, formStep, id, isDeleteForced, op, opCancel, opCreate, opDelete, opFinish, opNext, opPrevious, opRefresh, opUpdate, resultOpCreate, resultOpDelete, resultOpUpdate |
Fields inherited from class com.jalios.jcms.handler.JcmsFormHandler |
---|
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, workspaceForced |
Fields inherited from class com.jalios.jcms.context.JcmsJspContext |
---|
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 |
Fields inherited from class com.jalios.jcms.context.JcmsContext |
---|
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
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 Summary | |
---|---|
MembersCsvImportHandler()
The default constructor. |
Method Summary | |
---|---|
protected void |
deleteCsvFile()
If the file exists, try to delete it. |
Set<Workspace> |
getCollaborativeSpaceSet()
Retrieve all the Collaborative workspaces as a Set, with the following conditions : workspace's isCollaborativeSpace() method return true; workspace is open member belongs to worksapce, or collaborative space has public access. |
int |
getCreateCount()
|
String[] |
getCsGrpIds()
|
Class<? extends Data> |
getDataClass()
Overriding EditDataHandler for Steps modal Form purpose, but not really editing a Data. |
int |
getFormStepCount()
The number of steps is dynamic, is minimum 2, and maximum 4. |
String |
getFormStepHiddenFields()
Stores through different steps the uploaded file path. |
protected String |
getHiddenField(String htmlName,
File csvFile)
Specific method to put a file relative to JCMS temp dir as hidden modal field. |
int |
getInvalidCount()
|
List<MemberImport> |
getMemberInfoList()
|
String |
getSendEmail()
|
String |
getSeparator()
|
int |
getUpdateCount()
|
protected File |
getUploadDir()
|
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 |
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 |
isAnyError()
|
protected boolean |
isCollaborativeSpacePluginAvailable()
|
boolean |
isCollaborativeSpaceStep()
|
boolean |
isWorkspaceStep()
|
boolean |
processAction()
Performs the import (real or simulation) if a valid CSV file has been uploaded. |
void |
setCsGrpIds(String[] csGrpIds)
|
void |
setDocuments(String[] v)
Moves the plupload uploaded file to JCMS temp directory in order the uploaded files to be cleaned periodically by JCMS. |
void |
setFilename(String filename)
|
void |
setSendEmail(String sendEmail)
|
void |
setSeparator(String separator)
|
void |
setWsGrpIds(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. |
protected boolean |
validateFinish()
|
protected boolean |
validateNext()
|
protected boolean |
validatePrevious()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final String ADMIN_USERS_MEMBER_ACL
protected String separator
protected String sendEmail
protected boolean hasToSendEmail
protected String[] wsGrpIds
protected String[] csGrpIds
protected File csvFile
public static final String CSV_SEMICOLON_CHAR_SEP
public static final String CSV_COMMA_CHAR_SEP
public static final String CSV_FILE_HTML_PARAM
public static final String SEPARATOR_HTML_PARAM
public static final String SEND_EMAIL_HTML_PARAM
public static final String WS_GROUP_ID_PARAM
public static final String CS_GROUP_ID_PARAM
public static final String IMPORT_DONE_REQ_ATTR
public static final String CREATED_IDS_REQ_ATTR
public static final String UPDATED_IDS_REQ_ATTR
public static final String EMAIL_SENT_REQ_ATTR
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 String filename
protected static final String fnHtmlParam
protected List<MemberImport> memberInfoList
protected MemberImportManager importManager
protected Class<? extends Publication> collaborativeSpaceClazz
protected boolean collaborativeSpaceInitDone
protected int documentsAddCount
Constructor Detail |
---|
public MembersCsvImportHandler()
Method Detail |
---|
public boolean processAction() throws IOException
processAction
in class EditDataHandler
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 IOException
validatePrevious
in class EditDataHandler
IOException
protected boolean validateNext() throws IOException
validateNext
in class EditDataHandler
IOException
protected boolean validateFinish() throws IOException
validateFinish
in class EditDataHandler
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 String getFormStepHiddenFields()
public int getFormStepCount()
getFormStepCount
in class EditDataHandler
EditDataHandler.getFormStepCount()
public boolean isWorkspaceStep()
getWorkspaceSet()
.public boolean isCollaborativeSpaceStep()
public Set<Workspace> getWorkspaceSet()
public Set<Workspace> getCollaborativeSpaceSet()
public void setDocuments(String[] v)
JAVAX_SERVLET_CONTEXT_TEMPDIR
ServletContext attribute.
v
- the documents argument from plupload.protected File getUploadDir()
public String getSeparator()
public boolean hasToSendEmail()
public void setFilename(String filename)
filename
- the filename to setpublic void setSeparator(String separator)
separator
- the separator to setpublic void setSendEmail(String sendEmail)
sendEmail
- the sendEmail to setpublic String getSendEmail()
public int getCreateCount()
public int getUpdateCount()
public int getInvalidCount()
public List<MemberImport> getMemberInfoList()
public boolean isAnyError()
public String[] getWsGrpIds()
public void setWsGrpIds(String[] wsGrpIds)
wsGrpIds
- the wsGrpIds to setpublic String[] getCsGrpIds()
public void setCsGrpIds(String[] csGrpIds)
csGrpIds
- the csGrpIds to setpublic Class<? extends Data> getDataClass()
getDataClass
in class EditDataHandler
EditDataHandler.getDataClass()
protected String getHiddenField(String htmlName, File csvFile)
htmlName
- : the HTTP param name.csvFile
- : the File.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |