-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement idea: Import custom content #7865
Comments
Hi, I have the exact same issue and haven't found any way to import custom data. I'm rebuilding a client website and I'm upgrading from an old .NET Framework CMS to a newer CMS (Orchard Core is my preferred candidate for now). I can control the data format (CSV, Excel, JSON, etc.) and I'd like to know if there was a way to import my contents in Orchard Core. There are more than 1,000+ contents in the website and entering them manually is out-of-the-question. Thanks! |
I will be working on something today for that. At least I think we should be able to import simple content items from an Excel file. Basically it would convert the Excel to JSON so that it can be imported with the Import/Export feature. But I need to try different things first. |
Just a thought: Basically what it does = loads csv file, maps fields from csv into json structured content item, calls create/update copied from that api controller. maybe this could be the way to create some general excel/csv/json importer |
I would generally tend toward using the Import feature we already have which can handle a lot. I don't know about the ApiController. We do bulk insert/updates with the import feature but not with the ApiController. So the logic and whatnot is already working with the Import feature. Anything that you could share though would be great. 😄 The code part that does "maps fields from csv into json structured content item" I'm interested in 😉 |
@Skrypt Do you have a link on the Import feature? I don't seem the find it in the documentation, nor I do see it in the CMS... (I'm using the master branch, I'll take a look at the dev branch later). |
OrchardCore.Deployment |
I have a same issue too.. |
@Skrypt so , we can follow your demo to implement a Relational Database import feature 😊 |
You guys can take a look at this project : https://github.com/dalenewman/Transformalize/blob/master/README.md |
Great proposal and great project. Thanks for sharing @Skrypt |
I'm pinging this issue back as I'm curious to know if Nmedia developped a solution for this. @fpionnmedia maybe you should ask Nicolas Hébert about this as I think he's the DB guy. As for myself, I did use the ContentManager directly to import data in Orchard Core. But, doing this again I would probably opt to generate recipe.json files to import the data. But that's not the entire answer. Of course, if you have a relational database that needs to be built in some specific way you need to build also IndexingProviders before importing the data to fill up these tables. Or you can use the tables as is too. Also, there is always the option to consume the data from the GraphQL API so that you don't need to change the database data at all. You compose SQL Queries and expose the data with a Schema and then you can consume the database custom tables. Here, the idea is that if you need relational tables you need to use IndexingProviders to map the data. Nothing prevents you in Orchard Core to use relation between tables but you need to define them through a combination of migrations, recipes and else. Also, nothing prevents you from using Dapper or EF directly in some custom modules that would be coded with a different approach. Also building an API to export the data as JSON from Altitude would not be a bad idea. 🎅🏼 ... |
Hi, I believe that I have searched every bit of documentation of OC but did not found a way to import custom data from excel or something.
Just got idea which could help devs to import their own content and it should not cost too much time to include in OC..
Idea: Use orchard import / export and just modify "ContentStep" to allow inserting, if there is no VersionId and ContentItemId provided and use some ImportContentItemId to avoid duplicates. Then users could use their own way to transform their datasource to json and import these documents.
This could be in theory doable even now, but there is no easy way to generate unique contentitemid from some custom dataset.
What do you think about that?
The text was updated successfully, but these errors were encountered: