ImportManager class

From Catglobe Wiki
Revision as of 11:08, 22 September 2011 by Dennis (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>ImportManager</nowiki> |Description=<nowiki>Import data and users.</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CG...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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", number 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
  • Empty SetDataImportOptions(number projectQuestionnaireResourceId "The resource Id of where the data should be added/updated", number 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 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", number parentResourceId "Resource Id of the parent of the new 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.