{"action":"created","issue":{"url":"https://api.github.com/repos/episerver/Quicksilver/issues/1","labels_url":"https://api.github.com/repos/episerver/Quicksilver/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/episerver/Quicksilver/issues/1/comments","events_url":"https://api.github.com/repos/episerver/Quicksilver/issues/1/events","html_url":"https://github.com/episerver/Quicksilver/issues/1","id":80121343,"number":1,"title":"Question: Product assets export","user":{"login":"jeroenslor","id":3592413,"avatar_url":"https://avatars.githubusercontent.com/u/3592413?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroenslor","html_url":"https://github.com/jeroenslor","followers_url":"https://api.github.com/users/jeroenslor/followers","following_url":"https://api.github.com/users/jeroenslor/following{/other_user}","gists_url":"https://api.github.com/users/jeroenslor/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenslor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenslor/subscriptions","organizations_url":"https://api.github.com/users/jeroenslor/orgs","repos_url":"https://api.github.com/users/jeroenslor/repos","events_url":"https://api.github.com/users/jeroenslor/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenslor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-24T10:35:13Z","updated_at":"2015-05-25T06:52:46Z","closed_at":null,"body":"Hi,\r\n\r\nOn the following code line you are importing product assets. How did you manage to export the assets from epi?\r\n\r\nhttps://github.com/episerver/Quicksilver/blob/72edc555a09e1bfa33e014eb353fa39e3232f4f9/Sources/EPiServer.Reference.Commerce.Site/Infrastructure/ImportSiteContent.cs#L59\r\n"},"comment":{"url":"https://api.github.com/repos/episerver/Quicksilver/issues/comments/105141791","html_url":"https://github.com/episerver/Quicksilver/issues/1#issuecomment-105141791","issue_url":"https://api.github.com/repos/episerver/Quicksilver/issues/1","id":105141791,"user":{"login":"quanmaiepi","id":9269455,"avatar_url":"https://avatars.githubusercontent.com/u/9269455?v=3","gravatar_id":"","url":"https://api.github.com/users/quanmaiepi","html_url":"https://github.com/quanmaiepi","followers_url":"https://api.github.com/users/quanmaiepi/followers","following_url":"https://api.github.com/users/quanmaiepi/following{/other_user}","gists_url":"https://api.github.com/users/quanmaiepi/gists{/gist_id}","starred_url":"https://api.github.com/users/quanmaiepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quanmaiepi/subscriptions","organizations_url":"https://api.github.com/users/quanmaiepi/orgs","repos_url":"https://api.github.com/users/quanmaiepi/repos","events_url":"https://api.github.com/users/quanmaiepi/events{/privacy}","received_events_url":"https://api.github.com/users/quanmaiepi/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T06:52:46Z","updated_at":"2015-05-25T06:52:46Z","body":"Hi,\r\nWe have a small tool to do that. Basically it’s an aspx file which needs to be copied to website root folder and run.\r\n\r\n<%@ Page Language=\"C#\" AutoEventWireup=\"true\" Inherits=\"System.Web.UI.Page\" %>\r\n<%@ Import Namespace=\"System.IO\" %>\r\n<%@ Import Namespace=\"EPiServer\" %>\r\n<%@ Import Namespace=\"EPiServer.Core\" %>\r\n<%@ Import Namespace=\"EPiServer.Core.Transfer\" %>\r\n<%@ Import Namespace=\"EPiServer.DataAbstraction\" %>\r\n<%@ Import Namespace=\"EPiServer.DataAccess\" %>\r\n<%@ Import Namespace=\"EPiServer.Enterprise\" %>\r\n<%@ Import Namespace=\"EPiServer.Implementation\" %>\r\n<%@ Import Namespace=\"EPiServer.ServiceLocation\" %>\r\n<%@ Import Namespace=\"EPiServer.Personalization.VisitorGroups\" %>\r\n<%@ Import Namespace=\"EPiServer.Framework.Cache\" %>\r\n<%@ Import Namespace=\"EPiServer.Framework.Blobs\" %>\r\n<script runat=\"server\">\r\n    private Injected<ITabDefinitionRepository> _tabDefinitionRepository;\r\n    private Injected<IPropertyDefinitionRepository> _propertyDefinitionRepository;\r\n    private Injected<ContentListDB> _contentListDB;\r\n    private static IContentRepository _contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();\r\n\r\n    private static DecoratedClassFactory CreateClassFactory(string type, string id)\r\n    {\r\n        Type concreteType = Type.GetType(type, true);\r\n        return Activator.CreateInstance(concreteType, new Object[] { id }) as DecoratedClassFactory;\r\n    }\r\n\r\n    private static void WriteError(System.Web.HttpResponse response, string errorMessage)\r\n    {\r\n        response.Clear();\r\n        response.Write(\"<span style=\\\"color: red;\\\">Error: \" + errorMessage + \"</span><br />\");\r\n        response.End();\r\n    }\r\n\r\n    private void Page_Load(object sender, System.EventArgs e)\r\n    {\r\n        DataExporter exporter = new DataExporter();\r\n\r\n        //Get all page references and data\r\n        List<PageReference> startPageReferenceList = new List<PageReference>();\r\n        List<ContentData> startPageDataList = new List<ContentData>();\r\n        ContentFolder rootFolder = _contentRepository.GetChildren<ContentFolder>(EPiServer.Web.SiteDefinition.Current.GlobalAssetsRoot).FirstOrDefault() as ContentFolder;\r\n\r\n        exporter.Frames.AddRange(Frame.List());\r\n        exporter.TabDefinitions.AddRange(_tabDefinitionRepository.Service.List());\r\n        foreach (var propertyDefinition in _propertyDefinitionRepository.Service.ListDynamic())\r\n        {\r\n            exporter.DynamicPropertyDefinitions.Add(propertyDefinition);\r\n        }\r\n        exporter.Categories.AddRange(Category.GetRoot().Categories);\r\n\r\n        //Set rootFolder to exporter\r\n        ExportSource sourceRoot = new ExportSource(rootFolder.ContentLink, EPiServer.Core.Transfer.ExportSource.RecursiveLevelInfinity);\r\n        exporter.SourceRoots.Add(sourceRoot);\r\n\r\n        //property settings\r\n        exporter.ExportPropertySettings = true;\r\n        exporter.IncludeImplicitContentDependencies = true;\r\n\r\n        if (Request.QueryString[\"debug\"] != null)\r\n        {\r\n            Response.Clear();\r\n            exporter.Stream = new MemoryStream();\r\n            exporter.Export();\r\n            if (exporter.Log.Errors.Count > 0)\r\n            {\r\n                foreach (string s in exporter.Log.Errors)\r\n                {\r\n                    Response.Write(s + \"<br>\");\r\n                }\r\n            }\r\n            else\r\n            {\r\n                Response.Write(\"OK\");\r\n            }\r\n        }\r\n        else\r\n        {\r\n            Response.Clear();\r\n            string file = Path.GetTempFileName();\r\n            exporter.Stream = new FileStream(file, FileMode.OpenOrCreate, FileAccess.Write | FileAccess.Read, FileShare.Read);\r\n            exporter.Export();\r\n            exporter.Close();\r\n            if (exporter.Log.Errors.Count > 0)\r\n            {\r\n                throw new Exception(\"errors occured,try &debug=true\");\r\n            }\r\n            Response.ContentType = \"binary/octet-stream\";\r\n            Response.AddHeader(\"Content-disposition\", \"attachment; filename=CatalogAssets.episerverdata\");\r\n            exporter.Stream.Close();\r\n            Response.WriteFile(file);\r\n        }\r\n        Response.End();\r\n    }\r\n</script>\r\n\r\n\r\n\r\nFrom: Jeroen slor [mailto:notifications@github.com]\r\nSent: den 24 maj 2015 12:35\r\nTo: episerver/Quicksilver\r\nSubject: [Quicksilver] Question: Product assets export (#1)\r\n\r\n\r\nHi,\r\n\r\nOn the following code line you are importing product assets. How did you manage to export the assets from epi?\r\n\r\nhttps://github.com/episerver/Quicksilver/blob/72edc555a09e1bfa33e014eb353fa39e3232f4f9/Sources/EPiServer.Reference.Commerce.Site/Infrastructure/ImportSiteContent.cs#L59\r\n\r\n—\r\nReply to this email directly or view it on GitHub<https://github.com/episerver/Quicksilver/issues/1>.\r\n"}}