SaaS CMS has officially launched! Learn more now.

Mirroring is successful but no images are transferred.

Vote:
 

I have a site with several content channels defined and mirroring is activated manually.

The mirroring process completes successfully without any errors or warnings. The content channels report the correct number of changes and content is updated on the destination server.

The problem I'm having is that images in File Manager are not transferred.

The template in question uses a custom property type which holds an image and an alt text. If I edit the image property and save and publish the page, then run the mirroring job, the page on the destination is updated, the URL of the image is changed, but the image 404s. 

Shouldn't EPiServer automatically mirror the image from the VPP? 

Do I need to modify the property data to make EPiServer aware that it references files in the VPP?

Do I need to modify the mirroring job in some way to make it aware of the files in the VPP?

 

Thanks

#49356
Mar 14, 2011 13:06
Vote:
 

Mirroring will automatically fetch resource files from Vpps (e.g. an image) that are referenced by e.g. a PropertyXHtmlString or PropertyUrl (includign PropertyImageUrl and PropertyDocumentUrl).

Since it does not work for you I guess you have a custom property?

One option is to change the property to one of the built in, then you will get the mirroring support for free. If you want to use a custom property you need to write a transfer handler for your property (see e.g. http://sdk.episerver.com/library/cms5/Developers%20Guide/Copy%20functionality.htm#custom_properties). If your property stores data as a  url you can probably call generic method on PropertyUrlTransform to handle the transform like:

 public class CustomPropertylTransform
{
public static void ImportEventHandler(object sender, TransformPropertyEventArgs e)
{
PropertyUrlTransform.ImportEventHandler<CustomProperty>(sender, e);
}

public static void ExportEventHandler(object sender, TransformPropertyEventArgs e)
{
PropertyUrlTransform.ExportEventHandler<CustomProperty>(sender, e);
}
}

 If your property is inheriting PropertyXhtmlString you can look at implementation of EPiServer.Core.Transfer.PropertyXhtmlTransform.ExportEventHandler (through reflector) for an example.

In that implementation the call to ReplaceHtmlLinks is the part that parses through the string and find all linked resources and adds them to export package.

e.PropertySource.Value = new EPiServer.SpecializedProperties.PropertyXhtmlString().ReplaceHtmlLinks(e.PropertySource.Value, new LinkReplacer(transferContext).ExportLinksAndAddFiles);

#49590
Mar 24, 2011 7:24
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.