Try our conversational search powered by Generative AI!

I do not quite get the VirtualPathMappedProvider

Vote:
 

I do not quite get the VirtualPathMappedProvider.

 

Here's one example of how to use it that I've found:

 

<providers>

<add showInFileManager="false"

virtualName="AdminMapping"

virtualPath="~/your/relative/path/to/ui/admin/AdminGroup.aspx"

bypassAccessCheck="false"

name="AdminMapping"

type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />

</providers>

 

<virtualPathMappings>

<add url="~/your/relative/path/to/ui/admin/AdminGroup.aspx"

mappedUrl="~/customadmin/AdminGroup.aspx" />

</virtualPathMappings>

 

 

But when I try it out myself the only thing necessary to get it to work seems to be:

 

<providers>

<add name="CustomEditUrlMapping"

type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />

</providers>

 

Then I can add:

<virtualPathMappings>

<add url="~/epi/edit/workspace.aspx"

mappedUrl="~/CommonCode/Plugin/CustomWorkspace.aspx" />

<add url="~/epi/edit/XFormEdit.aspx"

mappedUrl="~/epiCustom/edit/XFormEdit.aspx" />

</virtualPathMappings>

and whatever other mappings I want and all seems to work out just fine.

 

So why do I find virtualPath and the other parameters in the examples of how to use VirtualPathMappedProvider?

What do virtualPath do and is it necessary?

 

Best regards Stefan

 

#41789
Jul 28, 2010 10:41
Vote:
 

I had the same question a while back, and used Reflector on the class. If I recall correctly, the config parameters were stored in a NameValueCollection and then used for precisely nothing at all.
I may (likely) have missed something, though...

#41793
Jul 28, 2010 11:06
Vote:
 

Just as I thought, thanks Jørgen. 

#41840
Jul 30, 2010 10:08
Vote:
 

I came across the VirtualPathPageMappingProvider when I did an upgrade from EPiServer 4 to 5, I don't know if it's related but here's some info about it...

In version 4 I had an "upload" virtual path which was used for page files and global uploads. As part of the upgrade I separated the page files into their own folder with their own virtual path (/pages/). This creates a problem because all the links in content still point at /upload/ for page files. So you need to add:

<unifiedFileSystem>
	<mappings>
		<map fromPath="/upload" toPath="/pages" type="EPiServer.FileSystem.Mapping.PageDirectoryMapping,EPiServer" />

More info here: http://world.episerver.com/en/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2/EPiServer-CMS-Migration-Tool-11/#Prerequisites

Then during the upgrade that mapping gets converted to something like this:

<add toPath="~/pages/" fromPath="~/upload/" name="Mapping0" type="EPiServer.Web.Hosting.VirtualPathPageMappingProvider,EPiServer.Legacy4" />

So the VirtualPahPageMappingProvider is mapping requests for the path /upload/ to path /pages/, it should be last in the list of providers in the configuration if you have another provider handling the /upload/ path.

#43015
Edited, Sep 08, 2010 22:57
* 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.