November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
If you look at this post
http://world.episerver.com/Blogs/Anders-Hattestad/Dates/2010/9/Shame-on-you-Mr-EPiServer/
you will se an reply that stats that DataFactory event will be triggered when a page is created by the mirroring service. So I guess you could remove those properties on a PageSaving event, based on the site id or something. Havent tried it myself thou
a
I need to remove the properties before mirroring.So I would have to override on the source side.
Any further comments/examples on which events to attach to appreciated.
If anybody have a demo-plugin (example to dump into the mirroring-bin folder) I would be very happy.
What you could do is to write a module that hooks up to the event ExportPropertyEvent on type EPiServer.Enterprise.Mirroring.MirroringDataExporter.
In the eventhandler you could do something like:
public static void ExportEventHandler(object sender, TransformPropertyEventArgs e)
{
//Here you should make sure it is correct property
if (e.IsHandled || e.PropertySource == null || !String.Equals(e.PropertySource.Name, "YourPropName"))
{ return; }
//Clear or modify data as you like
e.PropertySource.Value = String.Empty;
e.IsHandled = true;
}
The module should have InitializableModule attribute and hookup to the event in its Initialize method. The module should then be deployed to the bin folder for the mirroring service on the source side (typically in folder MirroringService\bin under site root).
Found similar example in SDK, and it should probably do the job.
Since you don't mention any other eventhookups I expect that ExportEventHandler was what I was looking for.
I made a module, and placed in the source bin folder.
Unfortunately, I cannot see that the module is activated (Not logging).
Log4Net output:
[InitializableModule]
public class DataExporterModule : IInitializableModule
{
private static readonly ILog Logger = LogManager.GetLogger(typeof(DataExporterModule));
#region IInitializableModule Members
public void Initialize(InitializationEngine context)
{
Logger.Debug("Initialize");
MirroringDataExporter.ExportPropertyEvent += DataExporterPropertyEventHandler;
}
public void Preload(string[] parameters)
{ }
public void Uninitialize(InitializationEngine context)
{
DataExporter.ExportPropertyEvent -= DataExporterPropertyEventHandler;
Logger.Debug("Uninitialize");
}
#endregion
private static void DataExporterPropertyEventHandler(object sender, TransformPropertyEventArgs e)
{
Logger.Debug("Triggered DataExporterPropertyEventHandler");
}
}
Any idea what I am missing?
One mistake I made was to remove my dll for the scanAssembly node. You can find this configuration option in EPiServerFramework.config. By default the node scanAssembly doesn't exist though.
You can read about it more in this blog: http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2011/1/Starting-a-CMS-6-sites-faster-after-build/
I may not have mentioned that the mirroring service is installed as a separate IIS application, and is working for standard mirroring.
No EPiServerFramework.config does exist in this folder.
That said, I haven't removed dll's from EPiServerFramework.config (yet)
Each mirroring job will execute in an own AppDomain (to make it possible to run several jobs in parallell without interference). What you see in your log comes from the main appdomain. What probably happen in your case is that the main AppDomain will lock the logfile and thereby prevent the AppDomain that executes the job from writing tho the logfile. It should be possible to configure log4net so both AppDomains can log to same file. See for example following link for configuration
Added <lockingModel type=”log4net.Appender.FileAppender+MinimalLock” /> and tried once more.
A lot of other logentries appeared but sadly my module still wasn't one of the initializing modules listed in the log.
Maybe there is something wrong with my classlibrary ?
My module is the only class(file) in the classlibrary, targeting .net 3.5
Apart from that nothing special is done.
I am sure the problem relates to a minor mistake (probably done by me), but it is frustrating :-)
Have you tried to attach a debugger (e.g. Visual Studio to the mirroring service process)? Then you could see if your module is loaded, (e.g. by clicking break all and then view Debug/Windows/Modules).
During the mirroring job a config file used for the appdomain is saved to disk in the root folder for the mirroring service (called something like <siteId>.config). That file is a merged config file (of web, episerver and framework.config) open that file and ensure that your module is not excluded (or not included) in the episerver.framework section in that config file.
The merged config file contained <scanAssembly forceBinFolderScan="false" />
Checked EPiServerFramework.config in the episite, and there it was.
Setting value to true in the EPiServerFramework.config fixed my problem.
I am about to change the Mirroring 2.0 behaviour for mirroring pages.
My "mission" is to remove values from certain pageproperties that contains confidential information before mirroring the content to the other site.
I was wondering if anyone have any tip on how to do this, and what not to do.
Preferably by an example (basic extension), but any help appreciated.