com.objectplanet.survey.plugin.api
Class CSVExportParameters

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.CSVExportParameters

public class CSVExportParameters
extends java.lang.Object

This class represents the parameters for a CSV export.

Author:
Torgeir Lund

Constructor Summary
CSVExportParameters(long surveyId, java.io.File zipFile)
          Creates a CSVExportParameters object.
 
Method Summary
 void addRespondentAttributeToIncludeInExport(java.lang.String attribute)
          Add an attribute to the current list of respondent attributes to include in the export.
 CallBack getCallBackObj()
          Gets the callback object used for this export.
 long getFromCompletedDate()
          Gets the completed date that the export will begin from (inclusive).
 long getFromRespondentId()
          Gets the respondent id that the export will start from (inclusive)
 long getFromStartDate()
          Gets the start date that the export will begin from (inclusive).
 java.util.Locale getLocale()
          Gets the current set locale
 long getReportId()
          Set the report that this export will use for settings.
 java.util.ArrayList<java.lang.String> getRespondentAttributesToIncludeInExport()
          Gets the names of the attributes to include in the export.
 long getSurveyId()
          Get the current set surveyId
 long getToCompletedDate()
          Gets the completed date that the export will end with (inclusive).
 long getToRespondentId()
          Gets the respondent id that the export will stop at (inclusive), if specified.
 long getToStartDate()
          Gets the start date that the export will end with (inclusive).
 java.io.File getZipFile()
          Gets the zip file name/path that the export will be written to.
 boolean isInviteeEmailIncluded()
          Get the flag to indicate if invitee email is to be included in the export.
 boolean isInviteeIdIncluded()
          Get the flag to indicate if invitee id is to be included in the export.
 boolean isInviteeNameIncluded()
          Get the flag to indicate if invitee name is to be included in the export.
 boolean isRespondentAttributesIncluded()
          Get the flag that indicates respondent attributes are to be included in the export.
 void setCallBackObj(CallBack callBackObj)
          Sets a callback that, if specified, will be called on completion of the export.
 void setFromCompletedDate(long fromCompletedDate)
          Sets the respondent completed date that the export will begin from (inclusive).
 void setFromRespondentId(long fromRespondentId)
          Sets the respondent id that the export will start after.
 void setFromStartDate(long fromStartDate)
          Sets the start date that the export will begin from (inclusive).
 void setInviteeEmailIncluded(boolean inviteeEmailIncluded)
          Set the flag to indicate if invitee email address is to be included in the export.
 void setInviteeIdIncluded(boolean inviteeIdIncluded)
          Set the flag to indicate if invitee ID is to be included in the export.
 void setInviteeNameIncluded(boolean inviteeNameIncluded)
          Set the flag to indicate if invitee name is to be included in the export.
 void setLocale(java.util.Locale locale)
          Set the locale for this export.
 void setReportId(long reportId)
          Set the report that this export will use for settings.
 void setRespondentAttributesIncluded(boolean respondentAttributesIncluded)
          Set the flag to indicate if all attributes are to be included in the export.
 void setRespondentAttributesToIncludeInExport(java.lang.String[] attributesToInclude)
          This sets the attributes to include in the export.
 void setSurveyId(long surveyId)
          Set the id of the survey containing the data.
 void setToCompletedDate(long toCompletedDate)
          Sets the completed date that the export will end with (inclusive).
 void setToRespondentId(long toRespondentId)
          Sets the respondentId that the export will stop at (inclusive).
 void setToStartDate(long toStartDate)
          Sets the start date that the export will end with (inclusive).
 void setZipFile(java.io.File zipFile)
          Sets the zip file to export file to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVExportParameters

public CSVExportParameters(long surveyId,
                           java.io.File zipFile)
Creates a CSVExportParameters object. The only required values are the ones specified here. Optional values are set by using the set/add methods.

Parameters:
surveyId - id of the survey containing the data
zipFile - The file to export the data to. Will be created if it does not exist.
Method Detail

getSurveyId

public long getSurveyId()
Get the current set surveyId

Returns:
the surveyId

setSurveyId

public void setSurveyId(long surveyId)
Set the id of the survey containing the data.

Parameters:
surveyId - the survey id

getZipFile

public java.io.File getZipFile()
Gets the zip file name/path that the export will be written to.

Returns:
the file name/path of the file the export will be written to.

setZipFile

public void setZipFile(java.io.File zipFile)
Sets the zip file to export file to. This is just a file name with path.

Parameters:
zipFile - The file to export the data to. Will be created if it does not exist.

getFromRespondentId

public long getFromRespondentId()
Gets the respondent id that the export will start from (inclusive)


setFromRespondentId

public void setFromRespondentId(long fromRespondentId)
Sets the respondent id that the export will start after.

Parameters:
fromRespondentId - Include respondents with ID starting from, but not including this value

getToRespondentId

public long getToRespondentId()
Gets the respondent id that the export will stop at (inclusive), if specified. If it returns 0, it means that this value is not set.


setToRespondentId

public void setToRespondentId(long toRespondentId)
Sets the respondentId that the export will stop at (inclusive).

Parameters:
toRespondentId - the respondent id that the export will stop at (inclusive).

getFromStartDate

public long getFromStartDate()
Gets the start date that the export will begin from (inclusive).


setFromStartDate

public void setFromStartDate(long fromStartDate)
Sets the start date that the export will begin from (inclusive). The export will not include respondents with start date older than this date. Note that this will be ignored if the from/to respondent id is set to values greater than 0. If start dates are used, both from/to start dates will be used, so make sure you also call setToStartDate().

Parameters:
fromStartDate - the start date to begin export from

getToStartDate

public long getToStartDate()
Gets the start date that the export will end with (inclusive). In other words, respondents with "start date" up to and including this date will be included in the export.


setToStartDate

public void setToStartDate(long toStartDate)
Sets the start date that the export will end with (inclusive). In other words, respondents with "start date" up to and including this date will be included in the export. Note that this will be ignored if the from/to respondent id is set to values greater than 0. If start dates are used, both from/to start dates will be used, so make sure you also call setFromStartDate().

Parameters:
toStartDate - the start date to end export with

getFromCompletedDate

public long getFromCompletedDate()
Gets the completed date that the export will begin from (inclusive).


setFromCompletedDate

public void setFromCompletedDate(long fromCompletedDate)
Sets the respondent completed date that the export will begin from (inclusive). The export will not include respondents with completed date older than this date. Note that this will be ignored if the from/to respondent id is set to values greater than 0, or if the from/to start dates are set (using setFromStartDate/setToStartDate). If completed dates are used, both from/to completed dates will be used, so make sure you also call setToCompletedDate().

Parameters:
fromCompletedDate - the completed date to begin export from

getToCompletedDate

public long getToCompletedDate()
Gets the completed date that the export will end with (inclusive). In other words, respondents with "completed date" up to and including this date will be included in the export.


setToCompletedDate

public void setToCompletedDate(long toCompletedDate)
Sets the completed date that the export will end with (inclusive). In other words, respondents with "completed date" up to and including this date will be included in the export. Note that this will be ignored if the from/to respondent id is set to values greater than 0, or if the from/to start dates are set (using setFromStartDate/setToStartDate). If completed dates are used, both from/to completed dates will be used, so make sure you also call setFromCompletedDate().

Parameters:
toCompletedDate - the completed date to end the export with

getCallBackObj

public CallBack getCallBackObj()
Gets the callback object used for this export.

Returns:
the callback object

setCallBackObj

public void setCallBackObj(CallBack callBackObj)
Sets a callback that, if specified, will be called on completion of the export. The export is done in a background thread, and if the export initiator needs a notification when it is complete, a callback must be specified. The caller should perform whatever work needed and complete. Do not keep the thread alive, because this is called by a new thread created for the export.

Parameters:
callBackObj - The object to call back once complete. Use null if no callback is needed (null is default).

addRespondentAttributeToIncludeInExport

public void addRespondentAttributeToIncludeInExport(java.lang.String attribute)
Add an attribute to the current list of respondent attributes to include in the export.

Parameters:
attribute - The attribute to add.

setRespondentAttributesToIncludeInExport

public void setRespondentAttributesToIncludeInExport(java.lang.String[] attributesToInclude)
This sets the attributes to include in the export. This will replace all previously set attributes.

Parameters:
attributesToInclude - Array of attribute names to include in the export. Attribute data will be exported in the order specified here. Use null/empty array if no attributes are needed in the export. null value is the default setting.

getRespondentAttributesToIncludeInExport

public java.util.ArrayList<java.lang.String> getRespondentAttributesToIncludeInExport()
Gets the names of the attributes to include in the export.

Returns:
The names of the attributes to include in the export.

isRespondentAttributesIncluded

public boolean isRespondentAttributesIncluded()
Get the flag that indicates respondent attributes are to be included in the export.

Returns:
True if all attributes are included, false otherwise.

setRespondentAttributesIncluded

public void setRespondentAttributesIncluded(boolean respondentAttributesIncluded)
Set the flag to indicate if all attributes are to be included in the export.

Parameters:
respondentAttributesIncluded - True will include respondent attributes, false will not include them, even if setRespondentAttributesToIncludeInExport() method is called. True will include all attributes unless they are specified with the setRespondentAttributesToIncludeInExport(). Default value is false, which means no respondent attributes are included.

isInviteeIdIncluded

public boolean isInviteeIdIncluded()
Get the flag to indicate if invitee id is to be included in the export. This will only apply if invitations are used in the survey.

Returns:
True if invitee ID is included in export, false otherwise.

setInviteeIdIncluded

public void setInviteeIdIncluded(boolean inviteeIdIncluded)
Set the flag to indicate if invitee ID is to be included in the export. This will only apply if invitations are used in the survey.

Parameters:
inviteeIdIncluded - Set to true to include invitee IDs in the export. False is default.

isInviteeEmailIncluded

public boolean isInviteeEmailIncluded()
Get the flag to indicate if invitee email is to be included in the export. This will only apply if invitations are used in the survey.

Returns:
True if invitee email address is included in export, false otherwise.

setInviteeEmailIncluded

public void setInviteeEmailIncluded(boolean inviteeEmailIncluded)
Set the flag to indicate if invitee email address is to be included in the export. This will only apply if invitations are used in the survey.

Parameters:
inviteeEmailIncluded - Set to true to include invitee email address in the export. False is default.

isInviteeNameIncluded

public boolean isInviteeNameIncluded()
Get the flag to indicate if invitee name is to be included in the export. This will only apply if invitations are used in the survey.

Returns:
True if invitee name is included in export, false otherwise.

setInviteeNameIncluded

public void setInviteeNameIncluded(boolean inviteeNameIncluded)
Set the flag to indicate if invitee name is to be included in the export. This will only apply if invitations are used in the survey.

Parameters:
inviteeNameIncluded - Set to true to include invitee name in the export. False is default.

setReportId

public void setReportId(long reportId)
Set the report that this export will use for settings. Default is to use no report for the export (default export settings).

Parameters:
reportId - the id of report to use for export settings

getReportId

public long getReportId()
Set the report that this export will use for settings.

Returns:
the id of report to use for export settings

getLocale

public java.util.Locale getLocale()
Gets the current set locale

Returns:
the locale

setLocale

public void setLocale(java.util.Locale locale)
Set the locale for this export. Will affect the date format.

Parameters:
locale - The new locale. If not set, default is Locale.US

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016