Class UserProvider
- Namespace
- Dynamicweb.DataIntegration.Providers.UserProvider
- Assembly
- Dynamicweb.DataIntegration.dll
[AddInName("Dynamicweb.DataIntegration.Providers.Provider")]
[AddInLabel("User Provider")]
[AddInDescription("User provider")]
[AddInIgnore(false)]
public class UserProvider : BaseSqlProvider, IParameterizedDestination, IParameterOptions, ISource, IDestination, IDisposable
- Inheritance
-
UserProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
UserProvider()
public UserProvider()
UserProvider(XmlNode)
public UserProvider(XmlNode xmlNode)
Parameters
xmlNodeXmlNode
Properties
AddUsersToAccountsByCustomerNumber
[AddInParameter("Add users to accounts by customer number")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, active users with a customer number in the import are added to every account with the same customer number after the import, if they are not already members. Memberships removed in the administration are added again while the user keeps the customer number. Skipped when Replace current group membership is ON. Requires User Accounts to be enabled")]
[AddInParameterGroup("Destination")]
public bool AddUsersToAccountsByCustomerNumber { get; set; }
Property Value
AllowEmail
public bool AllowEmail { get; set; }
Property Value
DeactivateMissingUsers
[AddInParameter("Deactivate missing users")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When this option is ON, all users which are not present in the source data are set to inactive (AccessUserActive equals false)")]
[AddInParameterGroup("Destination")]
public bool DeactivateMissingUsers { get; set; }
Property Value
DeleteOnlyFromGroupsThatAreImportedTo
[AddInParameter("Delete users only from groups that are imported to")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=If Remove missing users is ON, and you import to a user group, users which are not in that user group will be removed. Only used in conjunction with Remove missing users – otherwise ignored")]
[AddInParameterGroup("Destination")]
public bool DeleteOnlyFromGroupsThatAreImportedTo { get; set; }
Property Value
DestinationGroup
[AddInParameter("Destination group")]
[AddInParameterEditor(typeof(UserGroupParameterEditor), "")]
[AddInParameterGroup("Destination")]
public string? DestinationGroup { get; set; }
Property Value
DiscardDuplicates
[AddInParameter("Discard duplicates")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, duplicate rows are ignored")]
[AddInParameterGroup("Destination")]
public bool DiscardDuplicates { get; set; }
Property Value
EmailConfigurationLabel
[AddInParameter("E-mail configuration:")]
[AddInParameterEditor(typeof(LabelParameterEditor), "")]
[AddInParameterGroup("Destination")]
public static string EmailConfigurationLabel { get; }
Property Value
EmailTemplate
[AddInParameter("E-mail Template")]
[AddInParameterEditor(typeof(TemplateParameterEditor), "folder=Templates/UserManagement/UserProvider")]
[AddInParameterGroup("Destination")]
public string? EmailTemplate { get; set; }
Property Value
EncryptUserPasswords
[AddInParameter("Encrypt passwords")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Encrypts passwords present in the source data, and passwords generated for new users using the Generate passwords for users option. If Generate passwords for users is ON, they are also encrypted")]
[AddInParameterGroup("Destination")]
public bool EncryptUserPasswords { get; set; }
Property Value
ExportNotExportedAfter
[AddInParameter("Export users that have been added or edited after")]
[AddInLabel("Export users created or edited after selected date time")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual bool ExportNotExportedAfter { get; set; }
Property Value
ExportNotExportedAfterDate
[AddInParameter("Not exported after")]
[AddInLabel("")]
[AddInParameterEditor(typeof(DateTimeParameterEditor), "")]
[AddInParameterGroup("Source")]
public virtual DateTime ExportNotExportedAfterDate { get; set; }
Property Value
ExportNotExportedUsers
[AddInParameter("Export users created and edited since last export")]
[AddInLabel("Export users created or edited since last export")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=This option takes precedence")]
[AddInParameterGroup("Source")]
public virtual bool ExportNotExportedUsers { get; set; }
Property Value
GenerateUserPasswords
[AddInParameter("Generate passwords for users")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Generates a password for imported users, provided that the user is new (not already in the Dynamicweb database) and the source data contains either no password or a NULL or empty string in the password column. If the user is already in the database and has NULL or an empty string as a password, a password will also be generated")]
[AddInParameterGroup("Destination")]
public bool GenerateUserPasswords { get; set; }
Property Value
ImportUsersBelongExactlyImportGroups
[AddInParameter("Replace current group membership")]
[AddInParameterEditor(typeof(YesNoParameterEditor), Explanation = "Import users belong exactly import groups")]
[AddInParameterGroup("Destination")]
public bool ImportUsersBelongExactlyImportGroups { get; set; }
Property Value
IsFirstJobRun
public bool IsFirstJobRun { get; set; }
Property Value
MailSubject
[AddInParameter("Mail Subject")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
[AddInParameterGroup("Destination")]
public string? MailSubject { get; set; }
Property Value
MatchParentGroupByDisplayName
[AddInParameter("Match parent group by display name")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, the AccessGroupParentGroupName mapping value is matched against the group display name (AccessUserName) instead of the login name (AccessUserUserName). Use this if groups may be renamed after import.")]
[AddInParameterGroup("Destination")]
public bool MatchParentGroupByDisplayName { get; set; }
Property Value
MatchUserGroupsByExternalId
[AddInParameter("Match user groups by external ID")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When ON, non-numeric AccessUserGroups values are matched against the group external ID (AccessUserExternalID) instead of the group name (AccessUserUserName). Numeric values still match the group ID. Use this when groups are identified by an ERP code, so the group name can stay readable.")]
[AddInParameterGroup("Destination")]
public bool MatchUserGroupsByExternalId { get; set; }
Property Value
RemoveMissingAddresses
[AddInParameter("Remove missing addresses")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Removes adresses not present in the source data")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingAddresses { get; set; }
Property Value
RemoveMissingGroups
[AddInParameter("Remove missing groups")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Removes user groups not present in the source data")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingGroups { get; set; }
Property Value
RemoveMissingImpersonation
[AddInParameter("Remove missing impersonation")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Removes impersonation rows not present in the source data")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingImpersonation { get; set; }
Property Value
RemoveMissingUsers
[AddInParameter("Remove missing users")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=When this option is ON, non-system users not in the source data are removed")]
[AddInParameterGroup("Destination")]
public bool RemoveMissingUsers { get; set; }
Property Value
SenderEmail
[AddInParameter("Sender E-mail")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
[AddInParameterGroup("Destination")]
public string? SenderEmail { get; set; }
Property Value
SkipFailingRows
[AddInParameter("Persist successful rows and skip failing rows")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Checking this box allows the activity to do partial imports by skipping problematic records and keeping the succesful ones")]
[AddInParameterGroup("Destination")]
[AddInParameterOrder(100)]
public bool SkipFailingRows { get; set; }
Property Value
SourceGroup
[AddInParameter("Source group")]
[AddInParameterEditor(typeof(UserGroupParameterEditor), "")]
[AddInParameterGroup("Source")]
public string? SourceGroup { get; set; }
Property Value
UseEmailForUsername
[AddInParameter("Use email for username")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "Tooltip=Assigns email adresses as usernames for all imported users. When this option is ON, newly imported users will use the value from AccessUserEmail as the AccessUserUserName. Existing users will not have their user names updated, and will be updated only if the username field is empty")]
[AddInParameterGroup("Destination")]
public bool UseEmailForUsername { get; set; }
Property Value
UserKeyField
[AddInParameter("User key field")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=true;SortBy=Key;")]
[AddInParameterGroup("Destination")]
public string UserKeyField { get; set; }
Property Value
Methods
Close()
Closes the provider when the job has finished, releasing connections and other resources. Called on both the source and the destination provider. Must be overridden; the base implementation throws NotImplementedException.
public override void Close()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
GetOriginalDestinationSchema()
Gets the unmodified schema as read from the underlying destination, ignoring any user edits. Used by the job editor to reset or compare schemas. Must be overridden by destination providers; the base implementation throws NotImplementedException.
public override Schema GetOriginalDestinationSchema()
Returns
- Schema
The original destination schema.
GetOriginalSourceSchema()
Gets the unmodified schema as read from the underlying source, ignoring any user edits. Used by the job editor to reset or compare schemas. Must be overridden by source providers; the base implementation throws NotImplementedException.
public override Schema GetOriginalSourceSchema()
Returns
- Schema
The original source schema.
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring
Returns
GetReader(Mapping)
Creates a reader that returns the source rows for a table mapping. Called by the destination provider's RunJob(Job) once per active mapping when this provider is the source of the job; the returned reader is drained via IsDone()/GetNext() and disposed afterwards. Must be overridden by source providers; the base implementation throws NotImplementedException.
public override ISourceReader GetReader(Mapping mapping)
Parameters
mappingMappingThe table mapping to read source rows for.
Returns
- ISourceReader
A reader positioned at the first row of the mapped source table.
GetSchema()
Gets the schema (tables and columns) the provider currently exposes, including any user edits when
SchemaIsEditable is true. Used by the job editor to build table and column mappings.
Must be overridden by every provider; the base implementation throws NotImplementedException.
public override Schema GetSchema()
Returns
- Schema
The current schema of the provider.
LoadSettings(Job)
Called before the job runs to let the provider read settings from the job it participates in. Override to pick up job-level configuration; the default implementation does nothing.
public override void LoadSettings(Job job)
Parameters
jobJobThe job the provider is the source or destination of.
OrderTablesInJob(Job, bool)
Reorders the job's table mappings so tables referenced by foreign keys are processed before the tables that reference them. Called by the administration UI when table mappings are saved. The base implementation opens a connection to the Dynamicweb database and delegates to OrderTablesByConstraints(Job, SqlConnection, bool); override it to use the provider's own connection, or to enforce a provider-specific order as the Ecom, Order and User providers do.
public override void OrderTablesInJob(Job job, bool isSource)
Parameters
jobJobThe job whose mappings are reordered in place.
isSourcebooltrueto order by source table names; otherwise by destination table names.
OverwriteDestinationSchemaToOriginal()
Discards user edits to the destination schema and reverts to GetOriginalDestinationSchema(). Must be overridden by destination providers; the base implementation throws NotImplementedException.
public override void OverwriteDestinationSchemaToOriginal()
OverwriteSourceSchemaToOriginal()
Discards user edits to the source schema and reverts to GetOriginalSourceSchema(). Must be overridden by source providers; the base implementation throws NotImplementedException.
public override void OverwriteSourceSchemaToOriginal()
RunJob(Job)
Executes the job with this provider as the destination. Called once by the job engine; the implementation
loops the active table mappings, reads the rows from job.Source via
GetReader(Mapping), processes each row with
ProcessInputRow(Dictionary<string, object>, Mapping) and writes it to the destination.
Must be overridden by destination providers; the base implementation throws
NotImplementedException.
public override bool RunJob(Job job)
Parameters
jobJobThe job to run.
Returns
SaveAsXml(XmlTextWriter)
Writes the provider configuration as XML when the job definition is saved. Must round-trip with the
Ctor(XmlNode) constructor that recreates the provider when the job is loaded. Must be overridden;
the base implementation throws NotImplementedException.
public override void SaveAsXml(XmlTextWriter textWriter)
Parameters
textWriterXmlTextWriterThe writer positioned inside the job definition document.
Serialize()
Serializes the provider configuration to an XML fragment string, used when the provider settings are stored
as part of a job definition. Must round-trip with the Ctor(XmlNode) constructor. The base
implementation throws NotImplementedException.
public override string Serialize()
Returns
- string
The provider configuration as an XML string.
UpdateDestinationSettings(IDestination)
Copies the settings of another instance of the same provider into this instance, used when the job editor saves updated destination settings onto an existing job. Must be overridden by destination providers; the base implementation throws NotImplementedException.
public override void UpdateDestinationSettings(IDestination destination)
Parameters
destinationIDestinationThe instance holding the new settings; cast to the concrete provider type.
UpdateSourceSettings(ISource)
Copies the settings of another instance of the same provider into this instance, used when the job editor saves updated source settings onto an existing job. Must be overridden by source providers; the base implementation throws NotImplementedException.
public override void UpdateSourceSettings(ISource source)
Parameters
sourceISourceThe instance holding the new settings; cast to the concrete provider type.
ValidateDestinationSettings()
Validates the destination settings. Used to validate properties when created by the AddinSelector.
public override string ValidateDestinationSettings()
Returns
ValidateSourceSettings()
Validates the source settings when the provider is configured as a source in the job editor. Override to check connectivity, file existence and similar; return an error description to show the user, or a non-error string when valid.
public override string ValidateSourceSettings()
Returns
- string
A validation message; the default implementation performs no validation.