/// <summary>
 /// Synchronizes the email templates from source to destination.
 /// </summary>
 /// <param name="context">The context.</param>
 public override void ExecuteProcess(XrmActivityContext context)
 {
     AddComponentsToSolution(context, 
       EntityName.template,
       SolutionPackageType.Entity, 
       ComponentType.EmailTemplate);
 }
Ejemplo n.º 2
0
   /// <summary>
   /// Synchronizes the plugins from source to destination.
   /// </summary>
   /// <param name="context">The context.</param>
 
   public override void ExecuteProcess(XrmActivityContext context)
   {
      AddComponentsToSolution(
        context,
        EntityName.pluginassembly, 
        SolutionPackageType.Plugins, 
        ComponentType.PluginAssembly
       );
   }
Ejemplo n.º 3
0
 /// <summary>
 /// Synchronizes the webresources from source to destination.
 /// </summary>
 /// <param name="context">The context.</param>
 public override void ExecuteProcess(XrmActivityContext context)
 {
     AddComponentsToSolution
     (
          context,
          EntityName.webresource,
          SolutionPackageType.Webresources,
          ComponentType.WebResource
     );
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Synchronizes the security roles from source to destination.
 /// </summary>
 /// <param name="context">The context.</param>
 public override void ExecuteProcess(XrmActivityContext context)
 {
     AddComponentsToSolution
     (
         context, 
         EntityName.role,
         SolutionPackageType.SecurityRoles,
         ComponentType.Role
     );
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Synchronizes the reports from source to destination.
 /// </summary>
 /// <param name="context">The context.</param>
 public override void ExecuteProcess(XrmActivityContext context)
 {
     AddComponentsToSolution
     (
         context,
      EntityName.report, 
      SolutionPackageType.Report, 
      ComponentType.Report
     );
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Synchronizes the plugin steps from source to destination.
        /// </summary>
        /// <param name="context">The context.</param>
        public override void ExecuteProcess(XrmActivityContext context)
        {
            var sourcePlugins = XrmHelperFunctions.GetPluginsSteps(context.Source).Entities.ToDictionary(c => c.Id);
            var destinationPlugins = XrmHelperFunctions.GetPluginsSteps(context.Destination).Entities.ToDictionary(c => c.Id);

            AddComponentsToSolution
            (
                context,
                sourcePlugins, 
                destinationPlugins,
                SolutionPackageType.Plugins, 
                ComponentType.SdkMessageProcessingStep
            );
        }
Ejemplo n.º 7
0
        public void ExtractEntities(XrmActivityContext context)
        {
            var destinationService = context.XrmServices[Destination];
            var sourceService = context.XrmServices[Source];

            var sourceEntitities = XrmMetadataHelperFunctions.GetAllEntityMetadataDictionary(sourceService,
                EntityFilters.Attributes);
            var destinationEntities = XrmMetadataHelperFunctions.GetAllEntityMetadataDictionary(destinationService,
                EntityFilters.Attributes);

            XrmMetadataHelperFunctions.ProcessTask(sourceEntitities,
                () => new XrmConnectionManager().GetConnection(context.Configuration.DataSources[Destination]),
                sourceEntity =>
                {
                    if (sourceEntity.IsCustomEntity != null && !sourceEntity.IsCustomEntity.Value) return;
                    if (sourceEntity.IsIntersect != null && sourceEntity.IsIntersect.Value) return;
                    if (sourceEntity.MetadataId != null &&
                        XrmHelperFunctions.IsExcemptedFromProcessing(sourceEntity.LogicalName,
                            sourceEntity.MetadataId.Value,
                            context.Configuration.Exceptions)) return;

                    "create entity {0}".Trace(sourceEntity.LogicalName);

                    var destinationEntity = destinationEntities.ContainsKey(sourceEntity.LogicalName)
                        ? destinationEntities[sourceEntity.LogicalName]
                        : null;


                    if (destinationEntity != null) return;
                    var request = new CreateEntityRequest()
                    {
                        Entity = sourceEntity,
                        PrimaryAttribute = (StringAttributeMetadata)  sourceEntity.Attributes.FirstOrDefault(c => c.IsPrimaryName != null && c.IsPrimaryName.Value)
                    };

                    destinationService.Execute(request);
                },
                null,
                context.Configuration.Threads);
        }