ImportManager class
Revision as of 06:30, 17 November 2016 by Nguyenduyan (talk | contribs)
ImportManager
Import data and users.
Constructors
- (array Headers "A list of string that are the header names", array data "Data to import. An array of arrays of equal length as the headers", bool advancedMode "Enable setting advanced settings - Requires special navigation access", int groupResourceId "Group to add users to new users to and/or sample rule. Set to 0 to not add to group") - Make a new import with the given data
Methods
- Empty Import() - Run the Import. Note that this will commit any pending changes
- Dictionary SetDataImportOptions(int projectQuestionnaireResourceId "The resource Id of where the data should be added/updated", int type "How to treat when already have existing answer sheets. 1 for Zero or One AnswerSheet, 2 for delete existing and create new, 3 for mapping to rpqIdColumnName", string rpqIdColumnName "Mapping for column name in case type is 3", bool isCommaSeparatedFormat "Import multi questions as comma separated format", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - Set specific options for importing data or altering existing data
- Empty SetDefaultNewUser(string languageIso "Default language", string cultureIso "Default culture", string currency "Default currency") - Defaults for new users. If empty or not set, uses the global defaults
- Empty SetUserImportOptions(string userIdColumnName "The header name of the userId column", string userNameMask "The mask used to create new usernames - an advanced setting", bool generatePasswords "Generate passwords during import", bool importUserInfo "Import or Update users", bool importPhoneNumber "Import or Update phonenumbers", bool importAddress "Import or Update addresses", bool importPoints "Import or Update points", bool importQualification "Import or Update qualifications", array permissions "Determine which groups should have access to the new users", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - OBSOLETE. Use the new overload with parentResourceId.
- Dictionary SetUserImportOptions(string userIdColumnName "The header name of the userId column", string userNameMask "The mask used to create new usernames - an advanced setting", bool generatePasswords "Generate passwords during import", bool importUserInfo "Import or Update users", bool importPhoneNumber "Import or Update phonenumbers", bool importAddress "Import or Update addresses", bool importPoints "Import or Update points", bool importQualification "Import or Update qualifications", int parentResourceId "Resource Id of the parent of the new users. Ignored if updating users", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - Set specific options for importing new users or altering existing users
- string ToString() - The string representation of the object.
- string Validate() - Same as Validate(true)
- string Validate(bool errorOnSemiOpenQuestion "Set to false if you need to import to questions with open parts and know that it may partially delete existing data") - Validate prior to actual importing. Throws if errors, otherwise returns warning.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- TypeInformation TypeInformation { get; } - Get information about this class.
- bool UseLoggedInUsersCultureDuringImport { get; set; } - Get/set if the culture used during import is the same as the logged in user or invariant culture. Default is invariant