AI OnAI Off
Incase anyone comes across this in the future, the solution I came up with after a little reflection is:
[InitializableModule]
[ModuleDependency(typeof(InitializableModule))]
public class MirroringInitialization : IInitializableModule
{
private static readonly ILog logger = LogManager.GetLogger(typeof(MirroringInitialization));
public void Preload(string[] parameters){}
public void Uninitialize(EPiServer.Framework.Initialization.InitializationEngine context)
{
DataExporter.PageExporting -= DataExporter_PageExporting;
}
public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context)
{
DataExporter.PageExporting += DataExporter_PageExporting;
}
void DataExporter_PageExporting(DataExporter dataExporting, EPiServer.Enterprise.Enterprise.PageExportingEventArgs e)
{
var pageReference = e.PageReference;
if (pageReference == PageReference.EmptyReference || PageReference.IsNullOrEmpty(pageReference))
{
e.Cancel = true;
}
var pageProvider = DataFactory.Instance.GetPageProvider(pageReference);
if (pageProvider.Name == "XMLPageProvider")
{
e.Cancel = true;
}
}
}
Hope it helps
Al
Hi all,
I've been asked to investigate some mirroring issues on an existing site we have recently taken on, which is running on CMS 6 R2 with Composer.
The issue is that the site is using the XMLPage provider, and during mirroring there is always an error thrown along the lines of:
Mirroring state: Failure during export
The following errors occured:
[Exporting page 2277__Members] Exception: Object reference not set to an instance of an object.[]
SourceService: Exported 2253 pages
TargetService: Imported 0 pages, moved 0 pages, deleted 0 pages
The odd thing is that there is no page with the page reference id 2277 - it could perhaps be a composer object?
So, im wondering either:
- How to find out what this 2277 refers to, or:
- How to exclude certain page types from being mirrored. We do have an instance of the XMLPageProvider which pulls in Members, which sounds like the error message being thrown. So im wondering if I could igore all page types which are used for the page provider entry point?
Any help would be appreciated
Thanks in advance
Al