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
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
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()
Close the provider and release resources (connections, file handles, etc.). Should be safe to call multiple times (idempotent).
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 schema from the Destination Source
public override Schema GetOriginalDestinationSchema()
Returns
GetOriginalSourceSchema()
Fetch the most recent schema directly from the source (unmodified, live).
This should return a fresh representation of the source structure and may perform expensive I/O. Use it when you explicitly need the authoritative source schema regardless of any cached/persisted schema.
public override Schema GetOriginalSourceSchema()
Returns
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring
Returns
GetReader(Mapping)
Create and return an ISourceReader for the provided mapping.
The returned reader must be initialized and ready to enumerate rows for the mapping. Implementations are responsible for any resource allocation; callers will close the reader.
public override ISourceReader GetReader(Mapping mapping)
Parameters
mappingMappingMapping that configures what/how to read.
Returns
- ISourceReader
An ISourceReader instance.
GetSchema()
Return the live Schema (tables + columns) for this source.
Implementer guidance:
- Return a thread-safe, non-mutating Schema instance (or a defensive copy).
- Prefer cached or lightweight responses to avoid repeated expensive I/O.
- This method should reflect the source structure at the time of the call.
Note: schema access is centralized via GetSchema(ISource?). That service consults the SchemaManagementFeature and may use a persisted schema instead of invoking this method. Call this directly only when you need the live schema.
public override Schema GetSchema()
Returns
LoadSettings(Job)
Apply runtime settings from the job prior to execution.
Called when a job runs and allows the provider to adjust settings from the job context before any reading/writing occurs.
public override void LoadSettings(Job job)
Parameters
jobJobJob containing runtime settings and context.
OrderTablesInJob(Job, bool)
public override void OrderTablesInJob(Job job, bool isSource)
Parameters
OverwriteDestinationSchemaToOriginal()
Replace the destination's current/cached schema with the latest schema from the destination.
Implementations should update any internal schema cache/state so subsequent calls to GetSchema() reflect the original schema returned by GetOriginalDestinationSchema().
public override void OverwriteDestinationSchemaToOriginal()
OverwriteSourceSchemaToOriginal()
Replace the provider's current/cached schema with the latest schema from the source.
Implementations should update any internal schema cache/state so subsequent calls to GetSchema() reflect the original schema returned by GetOriginalSourceSchema().
public override void OverwriteSourceSchemaToOriginal()
RunJob(Job)
Execute the job against this destination. The implementation performs the write/insert/update operations required by the job and returns true on success.
Implementations should be robust: validate inputs, log errors, and leave destination in a consistent state or perform appropriate rollback where applicable.
public override bool RunJob(Job job)
Parameters
jobJobJob to execute.
Returns
- bool
True if the job completed successfully; otherwise false.
SaveAsXml(XmlTextWriter)
Persist provider settings to the supplied System.Xml.XmlTextWriter.
Implementations should write their configuration elements but must not close or dispose the writer.
public override void SaveAsXml(XmlTextWriter textWriter)
Parameters
textWriterXmlTextWriterXml writer to write settings into.
Serialize()
Serialize provider settings for use by AddinSelectors.
Output must be of the format <xxx>yyy</xxx>, where xxx is the parameter name (as defined by the decoration) and yyy is the value.
public override string Serialize()
Returns
- string
XML fragment describing configured addin parameters.
UpdateDestinationSettings(IDestination)
Update this instance's settings to match the provided destination.
Used to copy settings between provider instances (for example when restoring from saved configuration).
public override void UpdateDestinationSettings(IDestination destination)
Parameters
destinationIDestinationDestination instance to copy settings from.
UpdateSourceSettings(ISource)
Update this instance's settings to match the provided source.
Used to copy settings between provider instances (for example when restoring from saved configuration).
public override void UpdateSourceSettings(ISource source)
Parameters
sourceISourceSource instance to copy settings from.
ValidateDestinationSettings()
Validates the destination settings. Used to validate properties when created by the AddinSelector.
public override string ValidateDestinationSettings()
Returns
ValidateSourceSettings()
Validate the source configuration.
Return an empty string for a valid configuration; otherwise return a human-readable error/validation message describing the problem.
public override string ValidateSourceSettings()
Returns
- string
Empty string if valid; otherwise a validation error message.