Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Relation between blog & blog Post document View modes: 
User avatar
Member
Member
mukesh.laxkar-octalsoftware - 2/14/2012 7:42:34 AM
   
Relation between blog & blog Post document
Hi,

I want to know how are blogs & blog post maintain relation because there is no foreign key in Content_BlogPost table.

thanks.

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/15/2012 7:00:34 AM
   
RE:Relation between blog & blog Post document
Hello,

That is because blog posts and blogs are documents like any others, so the dependency logic is implemented in the hierarchy structure of documents. Please look at the CMS.Blogs.BlogHelper class in our API documentation to find appropriate methods, which can return ID of a blog from a blog post.

Best regards,
Jan Hermann

User avatar
Member
Member
kris-o3world - 2/17/2012 10:08:35 AM
   
RE:Relation between blog & blog Post document
i would like to know the same thing...
i'm migrating a wordpress blog to kentico,
and it requires quite a bit of 'heavy lifting' w/ respect to the database

at the moment i need to re-associate the imported blog posts to the categories to which they used to belong... i re-created the categories in kentico that existed in wordpress, but now i can't figure out for the life of me how kentico 'knows' which row in CONTENT_BlogPost corresponds to the same in CMS_Document, so that i can create the appropriate rows in CMS_DocumentCategory.

User avatar
Member
Member
kris-o3world - 2/17/2012 10:10:56 AM
   
RE:Relation between blog & blog Post document
kris-o3world wrote: i can't figure out for the life of me how kentico 'knows' which row in CONTENT_BlogPost corresponds to the same in CMS_Document, so that i can create the appropriate rows in CMS_DocumentCategory.


i mean, it's easy enough to figure out the primary/foreign key relationships in the other tables... NodeID in CMS_Tree is DocumentNodeID in CMS_Document, etc.

but CONTENT_BlogPost doesn't seem to have any foreign keys at all!

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 2/17/2012 10:22:35 AM
   
RE:Relation between blog & blog Post document
Hello,

There is a DocumentForeignKeyValue column, which is associated with the BlogPostId:

SELECT * FROM [CONTENT_BlogPost] where BlogPostId in (SELECT DocumentForeignKeyValue FROM [CMS_Document] where DocumentName like '%Expanding to Europe%')

Please checkout also this on the market, maybe it will help.

Best regards,
Boris Pocatko

User avatar
Member
Member
kris-o3world - 2/17/2012 12:37:27 PM
   
RE:Relation between blog & blog Post document
this is what i ended up doing, since DocumentForeignKey had matches for both MenuItemID in CONTENT_MenuItem in addition to BlogPostID in CONTENT_BlogPost...

why isn't there a column to identify the 'content type' associated with DocumentForeignKey?

SELECT
t.NodeID, t.NodeAliasPath,
d.DocumentID, d.DocumentName,
bp.BlogPostID, bp.BlogPostTitle
FROM
CMS_Tree t, CMS_Document d, CONTENT_BlogPost bp
WHERE
t.NodeID = d.DocumentNodeID
AND d.DocumentForeignKeyValue = bp.BlogPostID
AND t.NodeAliasPath LIKE '/blog%'
ORDER BY bp.BlogPostID

User avatar
Member
Member
kris-o3world - 2/17/2012 12:39:37 PM
   
RE:Relation between blog & blog Post document
as for that marketplace posting...

1. the last reply to it was from 2009.
2. 'works with' is 4.x
3. price is 'contact for pricing'

for the above reasons we simply couldn't trust it.
(in addition, even if it was a 'canned' solution,
it wouldn't take into account our customizations.)

User avatar
Member
Member
egarrison-wte - 5/30/2012 8:15:48 PM
   
RE:Relation between blog & blog Post document
Plus the person who created that will not reply to my request for pricing.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/31/2012 5:57:18 AM
   
RE:Relation between blog & blog Post document
Hello,


you can select the data from 'View_CONTENT_BlogPost_Joined' which join all needful tables for documents of this document type.

By the way, the CMS_Tree table contains NodeClassId which stores the document type. The other data for document type (e.g. code name or display name) are in the CMS_Class table. See the Database reference for more details: Database reference for 6.0.

If you use API, you don't need to know the exact tables which are necessary. You simply selects the documents of a document type according to some conditions: API - managing documents.

Regarding the market place item: We noticed last contact with that developer here: http://devnet.kentico.com/Forums.aspx?forumid=29&threadid=21805. He also posts his e-mail address there. You can try to use this address to contact him.


Best regards,
Helena Grulichova