I'm trying to export a Catalog.xml file with a product catalog using the Commerce Manager. The functionality seems to work very well, but the exported file is placed in this directory: \ImportExportRepository\ECApplication\catalog
Is it possible to specify another location for the exported file? Preferably somewhere outside the website root.
I haven't been able to find any documentation on where to change the location, but perhaps I haven't looked in the right page.
Thank you for your help.
You can have an appSetting section with the key of ECF.ImportExportFolder, points to the folder you want to save the catalog - it will be <your-dir>\ImportExportRepository\ECApplication\catalog
Make sure to set the permissions on that folder to your IIS user account.
I tried to set the path to C:\temp, but got the error below.
It seems to me that you are using the System.Web.HttpServerUtility.MapPath method. The Remarks to this method contains this sentence: "However, you cannot specify a path outside of the Web application.".
I would very much like to be able to export the files to a location outside of the web application, so that we can separate the webapplication from all other files like e.g. logfiles and catalog exports.
[HttpException (0x80004005): 'C:/temp/ECApplication/catalog/' is a physical path, but a virtual path was expected.] System.Web.Util.UrlPath.CheckValidVirtualPath(String path) +11948079 System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +141 System.Web.VirtualPath.Combine(VirtualPath relativePath) +185 System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +105 System.Web.HttpServerUtility.MapPath(String path) +128 Mediachase.Web.Console.Common.ManagementHelper.GetImportExportFolderPath(String appFolder) +394 Mediachase.Commerce.Manager.Catalog.Tabs.CatalogExportTab.OnInit(EventArgs e) +218 System.Web.UI.Control.InitRecursive(Control namingContainer) +166 System.Web.UI.Control.InitRecursive(Control namingContainer) +379 System.Web.UI.Control.AddedControl(Control control, Int32 index) +215 Mediachase.Commerce.Manager.Core.Controls.EditViewControl.CreateTabs() +1121 Mediachase.Commerce.Manager.Core.Controls.EditViewControl.CreateChildControls() +30 System.Web.UI.Control.EnsureChildControls() +115 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnInitComplete(EventArgs e) +11892713 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +595
I missed " Preferably somewhere outside the website root" - That's not possible with the default implementation because it uses Server.MapPath on the value you set for ECF.ImportExportFolder. However you can still replace the default implementation with your own to lift that restriction. The question is if you would go that way ...
How woud I go about implementing my own solution to lift the restriction?
I guess that I could use the Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport class and call the Export(...) method myself. In that way, I would need to make my own user interface to start the export, and then I can specify my own export path.
I guess that wouldn't be dificult, but is it woth the effort just to ensure that the catalog is exported outside the website root? That is something that I need to discuss with my project manager :-)
Thank you for your help and clarifications.
You can technically modify Apps\Catalog\Config\View\Catalog-Export.xml to let it use your own ascx instead of the default one. Mind you it can be a bit troubling when it comes to upgrade :)
Yes, I guess that would also be possible. However I haven't tried to modify the Commerce Manager UI before, so I don't think we would go that way. And as you say, there may be upgrade issues as well. I think it would be more likely that we would add an export page to the CMS->Admin -> Tools section instead. At least that is something we have tried before :)
But still, this is only something we expect to use once in a while, so I don't know if it is relevant to spend time working on.