C# 클래스 DataMigration.CompiledXforms

Compiled xforms. This is an instance of IMethodResolver, which has compiled C# functions that actually live in the DataMigration assembly. IMethodResolvers can be external, and they don't have to be compiled (although support for scripted methods hasn't been added yet).
상속: IMethodResolver, ILitmusTestResolver, IPostRowProcessorResolver
파일 보기 프로젝트 열기: scoutmedia/DataMigration

공개 메소드들

메소드 설명
CalcCreateDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

Just generates the current datetime. Parameters are described at DataMigration.TransformMethod

CalculateActiveFlag ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

CalculateActiveFlag looks at the Subscription Status column first; if value is Life it sets ActiveFlag to true, if Cancelled, then false, if neither, it checks the expiryDate. If it's parseble and in the past, it returns false. If none of these cases apply, it returns true. Parameters are described at DataMigration.TransformMethod

CalculateExpireDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

CalculateExpireDate makes sure we can parse the expire date into a valid date, otherwise, it returns null. If user is a LIFE member, then they also get a null expire date. If the subStatus is CANCELLED, we set expire date to NOW. Technically this is unnecessary if this is an initial import; CalculateActiveFlag will set the subscription to inactive. But in the case of a subscription changing from Regular or Life to Cancelled, this is important as we rely on the offline recurring billing task to actually set the ActiveFlag to 0, and it does this by looking for expired subscriptions. Parameters are described at DataMigration.TransformMethod

DefaultToUSCountryId ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This function attempts to get a valid country id for the row, but if the data is incomplete, or we don't have a row for it, will use US. Parameters are described at DataMigration.TransformMethod

EnsureEmailIsNotInMembersTable ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool

Ensure the email does not exist in member table already. Parameters and return are described at DataMigration.LitmusTest

EnsureEmailUniqueWithinFeed ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool

Ensures the email has not been seen in the feed so far. Parameters and return are described at DataMigration.LitmusTest

EnsureEmailWasntInFirstPass ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool

Ensures that the email wasn't in there the first time we processed it.

EnsureValidEmail ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool

Ensures the email is properly formed. Parameters and return are described at DataMigration.LitmusTest

EnsureValidEmailPassThroughBlanks ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
EnsureValidSubscriptionDates ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool

The spreadsheet for BAM Magazine-only subscriptions has some rows that are messed up; there's no way we can process those rows. This litmus test in particular will try to parse out dates from three columns we have to have; they may be blank, but if they have non-blank non-date data in them, then we're hopelessly lost with processing this row.

MakeFullName ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This function combines first and last name. Parameters are described at DataMigration.TransformMethod

MemberIdFromEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This function is for the scenario where we want to create a subscription for the person, but not a row in the member table, if their email is already in the member table. We're going to look up their id from the member table, stick it in the Staging table, and therefore refrain from doing a member table insertion in post processing. Parameters are described at DataMigration.TransformMethod

OnlyPassThroughValidEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This function is for the scenario where we want to keep the row, even if it has an invalid email. If the email *is* invalid, we're going to null it out, though. Parameters are described at DataMigration.TransformMethod

PassThroughUserName ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

PassThroughUserName. It just looks for empty strings or null, and returns null, otherwise passing through the username with whitespace trimmed off both ends. Parameters are described at DataMigration.TransformMethod

ResolveLitmusTest ( String litmusTestName ) : LitmusTest

Given a Litmus Test name, returns the actual delegate method.

ResolvePostRowProcessor ( string postRowProcessorName ) : PostRowProcessor
ResolveTransformationMethod ( String xformName ) : TransformMethod

Given a transformation name, returns the actual delegate method.

UnixTimeToDateTime ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This is for making sure we only pass through valid dates or blanks. Parameters are described at DataMigration.TransformMethod

UseCreateDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

Uses the create date created earlier. Has a PreCondition that it comes after a transformMap with a destColumn of "CreateDateTime". Parameters are described at DataMigration.TransformMethod

UseLoadNum ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

Just returns the load number passed in. Parameters are described at DataMigration.TransformMethod

ValidateDateTolerateBlanks ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This is for making sure we only pass through valid dates or blanks. Parameters are described at DataMigration.TransformMethod

ValidateEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string

This function ensures that an email string exists, that it doesn't exceed our table length, and that it has an '@' sign in it. It throws BadRowExceptions if the provided email fails. Parameters are described at DataMigration.TransformMethod

비공개 메소드들

메소드 설명
DateValidatorHelper ( string dateString ) : bool

Returns true for blank string, or parseable date, false otherwise. This is for detecting rows where the columns are messed up, and the dates are not where they're supposed to be.

GetDateHelper ( string expireDateString ) : DateTime?

GetDateHelper tries to parse date for you, and returns null if it can't.

ValidateEmailHelper ( string email ) : string

Helper function that checks various busines rules for emails.

메소드 상세

CalcCreateDate() 공개 정적인 메소드

Just generates the current datetime. Parameters are described at DataMigration.TransformMethod
public static CalcCreateDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

CalculateActiveFlag() 공개 정적인 메소드

CalculateActiveFlag looks at the Subscription Status column first; if value is Life it sets ActiveFlag to true, if Cancelled, then false, if neither, it checks the expiryDate. If it's parseble and in the past, it returns false. If none of these cases apply, it returns true. Parameters are described at DataMigration.TransformMethod
public static CalculateActiveFlag ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

CalculateExpireDate() 공개 정적인 메소드

CalculateExpireDate makes sure we can parse the expire date into a valid date, otherwise, it returns null. If user is a LIFE member, then they also get a null expire date. If the subStatus is CANCELLED, we set expire date to NOW. Technically this is unnecessary if this is an initial import; CalculateActiveFlag will set the subscription to inactive. But in the case of a subscription changing from Regular or Life to Cancelled, this is important as we rely on the offline recurring billing task to actually set the ActiveFlag to 0, and it does this by looking for expired subscriptions. Parameters are described at DataMigration.TransformMethod
public static CalculateExpireDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

DefaultToUSCountryId() 공개 정적인 메소드

This function attempts to get a valid country id for the row, but if the data is incomplete, or we don't have a row for it, will use US. Parameters are described at DataMigration.TransformMethod
public static DefaultToUSCountryId ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

EnsureEmailIsNotInMembersTable() 공개 정적인 메소드

Ensure the email does not exist in member table already. Parameters and return are described at DataMigration.LitmusTest
public static EnsureEmailIsNotInMembersTable ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

EnsureEmailUniqueWithinFeed() 공개 정적인 메소드

Ensures the email has not been seen in the feed so far. Parameters and return are described at DataMigration.LitmusTest
public static EnsureEmailUniqueWithinFeed ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

EnsureEmailWasntInFirstPass() 공개 정적인 메소드

Ensures that the email wasn't in there the first time we processed it.
public static EnsureEmailWasntInFirstPass ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

EnsureValidEmail() 공개 정적인 메소드

Ensures the email is properly formed. Parameters and return are described at DataMigration.LitmusTest
public static EnsureValidEmail ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

EnsureValidEmailPassThroughBlanks() 공개 정적인 메소드

public static EnsureValidEmailPassThroughBlanks ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

EnsureValidSubscriptionDates() 공개 정적인 메소드

The spreadsheet for BAM Magazine-only subscriptions has some rows that are messed up; there's no way we can process those rows. This litmus test in particular will try to parse out dates from three columns we have to have; they may be blank, but if they have non-blank non-date data in them, then we're hopelessly lost with processing this row.
public static EnsureValidSubscriptionDates ( ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, IList arguments ) : bool
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
arguments IList
리턴 bool

MakeFullName() 공개 정적인 메소드

This function combines first and last name. Parameters are described at DataMigration.TransformMethod
public static MakeFullName ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

MemberIdFromEmail() 공개 정적인 메소드

This function is for the scenario where we want to create a subscription for the person, but not a row in the member table, if their email is already in the member table. We're going to look up their id from the member table, stick it in the Staging table, and therefore refrain from doing a member table insertion in post processing. Parameters are described at DataMigration.TransformMethod
public static MemberIdFromEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

OnlyPassThroughValidEmail() 공개 정적인 메소드

This function is for the scenario where we want to keep the row, even if it has an invalid email. If the email *is* invalid, we're going to null it out, though. Parameters are described at DataMigration.TransformMethod
public static OnlyPassThroughValidEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

PassThroughUserName() 공개 정적인 메소드

PassThroughUserName. It just looks for empty strings or null, and returns null, otherwise passing through the username with whitespace trimmed off both ends. Parameters are described at DataMigration.TransformMethod
public static PassThroughUserName ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

ResolveLitmusTest() 공개 메소드

Given a Litmus Test name, returns the actual delegate method.
public ResolveLitmusTest ( String litmusTestName ) : LitmusTest
litmusTestName String Litmus test name.
리턴 LitmusTest

ResolvePostRowProcessor() 공개 메소드

public ResolvePostRowProcessor ( string postRowProcessorName ) : PostRowProcessor
postRowProcessorName string
리턴 PostRowProcessor

ResolveTransformationMethod() 공개 메소드

Given a transformation name, returns the actual delegate method.
public ResolveTransformationMethod ( String xformName ) : TransformMethod
xformName String Xform name.
리턴 TransformMethod

UnixTimeToDateTime() 공개 정적인 메소드

This is for making sure we only pass through valid dates or blanks. Parameters are described at DataMigration.TransformMethod
public static UnixTimeToDateTime ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

UseCreateDate() 공개 정적인 메소드

Uses the create date created earlier. Has a PreCondition that it comes after a transformMap with a destColumn of "CreateDateTime". Parameters are described at DataMigration.TransformMethod
public static UseCreateDate ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

UseLoadNum() 공개 정적인 메소드

Just returns the load number passed in. Parameters are described at DataMigration.TransformMethod
public static UseLoadNum ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

ValidateDateTolerateBlanks() 공개 정적인 메소드

This is for making sure we only pass through valid dates or blanks. Parameters are described at DataMigration.TransformMethod
public static ValidateDateTolerateBlanks ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string

ValidateEmail() 공개 정적인 메소드

This function ensures that an email string exists, that it doesn't exceed our table length, and that it has an '@' sign in it. It throws BadRowExceptions if the provided email fails. Parameters are described at DataMigration.TransformMethod
public static ValidateEmail ( int loadNumber, ILookup>.IDictionary lookups, IExistence>.IDictionary existenceObjects, string>.IDictionary rowInProgress, IList arguments ) : string
loadNumber int
lookups ILookup>.IDictionary
existenceObjects IExistence>.IDictionary
rowInProgress string>.IDictionary
arguments IList
리턴 string