Difference between revisions of "ImportManager class"
CGHelpdesk (talk | contribs) |
|||
Line 13: | Line 13: | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>permissions</nowiki>|Description=<nowiki>Determine which groups should have access to the new users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>permissions</nowiki>|Description=<nowiki>Determine which groups should have access to the new users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} | ||
+ | |Description=<nowiki>OBSOLETE. Use the new overload with parentResourceId.</nowiki>}} | ||
+ | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=number|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource Id of the parent of the new users. Ignored if updating users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} | ||
|Description=<nowiki>Set specific options for importing new users or altering existing users</nowiki>}} | |Description=<nowiki>Set specific options for importing new users or altering existing users</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} |
Revision as of 09:19, 23 September 2014
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", 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.
- 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. 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.