Has anyone successfully import Blog4Umbraco posts/comments using this?
Hi folks. Before I implement my own solution I wanted to know if anyone has successfully imported Blog4Umbraco entries using this tool. I tried from XML, but instead of being placed in the correct date folder tree, the entries all ended up in a folder for the current date. I know this may have to do with the way the Blog4Umbraco handles the date folder creation, but I wanted to see if I'm missing anything obvious.
So has anyone tried this successfully?
Also for comments, since they have to map to the appropriate BlogPost node, I'll probably have to do those manually, but I'm open to hearing if anyone has done that.
It's indeed the datafolder of blog4Umbraco that is causing this issue. It adds the datafolders based on the create data of the node instead of the create date of the document which you can map.
I will install an Umbraco V4 with blog4Umbraco package later on today to test if Chris his approuch is working, would be cool. Did you find my rss data adapter demo on my blog also? It's easier to import rss feeds.
@Chris: Thanks, but I actually want the folders, I just want them to be based on the original blog date instead of the node creation date as Richard indicated.
@Richard: That is what I suspected. I downloaded the code for the Blog and I can probably create a modified version temporarily for import, but as I may have to do something similar for other customers, I'm considering spending the time to get this working properly. I think it would be a good how-to or package for the community. As for the RSS I did see your blog entry, however the RSS I have truncates the description data so the only source I have is an XML export of the DB data. I may have to create an import process manually anyway as I need to match the comments with the Blog data and it doesn't appear the import as is can handle hierarchal data.
Indeed the current version doesn't support hierarchal data. I have ideas how to solve that issue, but that would be included in the Pro version and not Pro 1.0. But what you could do is take the article I wrote as a base for your solution. I wanted to write a part II for a long time but didn't find the time due client projects. So just a few Hints here. When you create a custom DataAdapter you can use the RecordImported event. It comes with two parameters:
1. The imported Document 2. The dataKey in the datasource. You can define this on your custom DataAdapter DataSourceKeyField property and return the column name of the datakeyu in your datasource.
In this event you can import the comments but that is all hard coded, or you can store the datakey and the document id in a database table and add an option to import comments (so the user had to choose between posts and comments) and import the comments and on the same RecordImported event add the comment to the related post.
It's a little difficult without a concrete example so I'll hope to find some time in the near future to write Part II of the series that cover this topic.
To add the blogpost in the correct folder I think it's best to modify the source for Blog4Umbraco for this. Maybe I will do that MySelf and add a patch when writing part II of the series
I was able to solve the Blog import issue by creating a custom Action handler for the publishing Action and moving the blog to the correct location. The reason they all go to a folder for the current day is that the location of the blog entry is set upon initial creation, which has the current date in the creation date field. So even though the Creation Date is modified in the import process, it happens after the location of the Blog Post is set. By setting the UMBImport to autopublish and creating the appropriate folder location upon publish in the Action Handler, I was successful. Not elegant, but effective.
Unfortunately the umbImport is throwing an error while trying to add comments. I've add a note to the error log
I've asked you allreadey in the other thread for some info. I think you are usin duplicate column names in either the Datasource or the document type that is currently a bug.
Yes, sorry for the delay in responding to your other request. I was pulled into some other work and so I haven't gotten back to this until today. I just posted the information about the bug request in this topic so that folks who might later come across this topic could follow the chain of events. I'll update the bug topic with the information you requested.
Can you please let me know in detail how you handled the blog entries import issue.
I could see that you handled it using the custom action handler upon publish of the blogpost, can you please guide me about the process how you did it.
I don't have time to post the code for doing this right now, but here are the basics. If necessary, you can look at the Source code for the Blog4Umbraco here to discover how it is placing the files. You can do something similar, but in an action handler for the publish event. If you aren't sure how to create and use an action handler this document can help.
So in essence, when the file is published I move up the tree to the top of the blog (traverse the parents until you find a document with a content type of "Blog") and then check for/create the appropriate children folders for the date. When you arrive at the correct folder, check to see if the blog entry is already there (does the document's parent id equal the id of the folder it should be in) and if not, move the file.
To facilitate comment import, I added a field to the BlogPost datatype to store the old ID of the blog post from my source so I could associate the Comments with it when I imported those (as my data was originally from a relational DB and not merged into one hierarchal tree).
As I stated earlier, this isn't optimal, as this code is run each time so the import takes a while, but it is working for me.
Don't forget that Richard had some thoughts above, some of which may be relevant to your situation and which may, when complete, be a more robust solution. Also, the Comment upload created an error which had to be worked around as well. The thread for this is in the Bug Section here.
When I'm sure I have a fully viable solution, I'll post the code for all to see.
Has anyone successfully import Blog4Umbraco posts/comments using this?
Hi folks. Before I implement my own solution I wanted to know if anyone has successfully imported Blog4Umbraco entries using this tool. I tried from XML, but instead of being placed in the correct date folder tree, the entries all ended up in a folder for the current date. I know this may have to do with the way the Blog4Umbraco handles the date folder creation, but I wanted to see if I'm missing anything obvious.
So has anyone tried this successfully?
Also for comments, since they have to map to the appropriate BlogPost node, I'll probably have to do those manually, but I'm open to hearing if anyone has done that.
Thanks in advance.
Try your import again... but remove the Blog4Umbraco dll beforehand. This will disable the auto folder creation.
Hi,
It's indeed the datafolder of blog4Umbraco that is causing this issue. It adds the datafolders based on the create data of the node instead of the create date of the document which you can map.
I will install an Umbraco V4 with blog4Umbraco package later on today to test if Chris his approuch is working, would be cool. Did you find my rss data adapter demo on my blog also? It's easier to import rss feeds.
Cheers,
Richard
@Chris: Thanks, but I actually want the folders, I just want them to be based on the original blog date instead of the node creation date as Richard indicated.
@Richard: That is what I suspected. I downloaded the code for the Blog and I can probably create a modified version temporarily for import, but as I may have to do something similar for other customers, I'm considering spending the time to get this working properly. I think it would be a good how-to or package for the community. As for the RSS I did see your blog entry, however the RSS I have truncates the description data so the only source I have is an XML export of the DB data. I may have to create an import process manually anyway as I need to match the comments with the Blog data and it doesn't appear the import as is can handle hierarchal data.
Hi,
Indeed the current version doesn't support hierarchal data. I have ideas how to solve that issue, but that would be included in the Pro version and not Pro 1.0. But what you could do is take the article I wrote as a base for your solution. I wanted to write a part II for a long time but didn't find the time due client projects. So just a few Hints here. When you create a custom DataAdapter you can use the RecordImported event. It comes with two parameters:
1. The imported Document
2. The dataKey in the datasource. You can define this on your custom DataAdapter DataSourceKeyField property and return the column name of the datakeyu in your datasource.
In this event you can import the comments but that is all hard coded, or you can store the datakey and the document id in a database table and add an option to import comments (so the user had to choose between posts and comments) and import the comments and on the same RecordImported event add the comment to the related post.
It's a little difficult without a concrete example so I'll hope to find some time in the near future to write Part II of the series that cover this topic.
To add the blogpost in the correct folder I think it's best to modify the source for Blog4Umbraco for this. Maybe I will do that MySelf and add a patch when writing part II of the series
Cheers,
Richard
I was able to solve the Blog import issue by creating a custom Action handler for the publishing Action and moving the blog to the correct location. The reason they all go to a folder for the current day is that the location of the blog entry is set upon initial creation, which has the current date in the creation date field. So even though the Creation Date is modified in the import process, it happens after the location of the Blog Post is set. By setting the UMBImport to autopublish and creating the appropriate folder location upon publish in the Action Handler, I was successful. Not elegant, but effective.
Unfortunately the umbImport is throwing an error while trying to add comments. I've add a note to the error log
Hi,
I've asked you allreadey in the other thread for some info. I think you are usin duplicate column names in either the Datasource or the document type that is currently a bug.
Cheers,
Richard
Yes, sorry for the delay in responding to your other request. I was pulled into some other work and so I haven't gotten back to this until today. I just posted the information about the bug request in this topic so that folks who might later come across this topic could follow the chain of events. I'll update the bug topic with the information you requested.
Thanks for your help so far.
Hello WebAngelo,
Can you please let me know in detail how you handled the blog entries import issue.
I could see that you handled it using the custom action handler upon publish of the blogpost, can you please guide me about the process how you did it.
Thank you
Hey npanguuluri,
I don't have time to post the code for doing this right now, but here are the basics. If necessary, you can look at the Source code for the Blog4Umbraco here to discover how it is placing the files. You can do something similar, but in an action handler for the publish event. If you aren't sure how to create and use an action handler this document can help.
So in essence, when the file is published I move up the tree to the top of the blog (traverse the parents until you find a document with a content type of "Blog") and then check for/create the appropriate children folders for the date. When you arrive at the correct folder, check to see if the blog entry is already there (does the document's parent id equal the id of the folder it should be in) and if not, move the file.
To facilitate comment import, I added a field to the BlogPost datatype to store the old ID of the blog post from my source so I could associate the Comments with it when I imported those (as my data was originally from a relational DB and not merged into one hierarchal tree).
As I stated earlier, this isn't optimal, as this code is run each time so the import takes a while, but it is working for me.
Don't forget that Richard had some thoughts above, some of which may be relevant to your situation and which may, when complete, be a more robust solution. Also, the Comment upload created an error which had to be worked around as well. The thread for this is in the Bug Section here.
When I'm sure I have a fully viable solution, I'll post the code for all to see.
is working on a reply...