C# Class SIL.FieldWorks.FDO.DomainServices.DataMigration.DataMigrationServices

Class that performs services for data migrations.
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Private Methods

Method Description
ChangeClass ( DomainObjectDTO target, string oldClass, string newClass ) : void

Does two components of changing the class of a DTO representation of the object: Fixes the class attribute, and fixes the Classname of the DTO. Caller should arrange to move it from one list to another, and fix the embedded elements (see e.g. ChangeToSubClass).

ChangeGuid ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO dto, string newGuid, IEnumerable possibleReferrers ) : void

Changes the GUID of the specified DTO. It updates the owner and all specified referrers to point to the new GUID.

ChangeToSubClass ( DomainObjectDTO target, string oldClass, string newClass ) : void

Change class of object to a new subclass of the original class. Caller still needs to move it from one collection to another in the repository.

CheckVersionNumber ( IDomainObjectDTORepository dtoRepos, int expectedStartingModelVersionNumber ) : void

Check the current verison number in the Repository against the given version number.

CreateObjSurElement ( string guid, ObjSurType type ) : System.Xml.Linq.XElement
CreateOwningObjSurElement ( string guid ) : System.Xml.Linq.XElement

Given the guid, return a new 'objsur' XElement.

CreateReferenceObjSurElement ( string guid ) : System.Xml.Linq.XElement

Given the guid, return a new 'objsur' XElement.

Delint ( IDomainObjectDTORepository dtoRepos ) : void

1. Remove objects (zombies) that: A. claim to have owners, but the owners do not exist, or B. owners don't know they own it, or C. objects with no owners that are not supported as allowing no owners. 2. Remove 'dangling' references to objects that no longer exist. 3. Remove properties that have no attributes or content.

ExtractReferencedObjects ( DomainObjectDTO dto ) : string[]
GetBackReferences ( IEnumerable referencedObjects ) : List>.Dictionary

Given the referencedObjects forward reference data, extract related back reference information

This method does not worry about ownership as a reference property, even though formally ownership is a special kind of reference.

GetOwnees ( byte xmlBytes ) : HashSet
IncrementVersionNumber ( IDomainObjectDTORepository dtoRepos ) : void

Increment the model version number for the repository.

RemoveDanglingReferences ( IDomainObjectDTORepository dtoRepos, IEnumerable allDtos ) : void
RemoveEmptyPropertyElements ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO currentDto, System.Xml.Linq.XContainer rtElement ) : bool
RemoveEmptyPropertyElements ( IDomainObjectDTORepository dtoRepos, IEnumerable allInstancesWithValidClasses ) : void
RemoveIncludingOwnedObjects ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO goner, bool removeFromOwner ) : void

Remove goner and everything it owns. Be sure to include removing goner from its optional owning property.

RemoveMultipleIncludingOwnedObjects ( IDomainObjectDTORepository dtoRepos, List goners, DomainObjectDTO ownerDto ) : void

Remove a number of objects with a common owner, and everything they own.

RemoveZombies ( IDomainObjectDTORepository dtoRepos, IList allDtos ) : void
UpdateDTO ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO dirtball, byte newXmlBytes ) : void

Rest the xml in the DTO and register the DTO as udated with the repository. Use this overload only if the class name is NOT changing.

There is no validation of the xml, other than making sure it is not null, or an emty string.

UpdateDTO ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO dirtball, string newXmlValue ) : void

Rest the xml in the DTO and register the DTO as udated with the repository. Use this overload only if the class name is NOT changing.

There is no validation of the xml, other than making sure it is not null, or an emty string.

UpdateDTO ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO dirtball, string newXmlValue, string oldClassName ) : void

Reset the xml in the DTO and register the DTO as updated with the repository. Use this overload if the class name is changing.

There is no validation of the xml, other than making sure it is not null, or an emty string.

UpdateObjSurElement ( IDomainObjectDTORepository dtoRepos, DomainObjectDTO dto, string oldGuid, string newGuid ) : void