locked
How to set the users default Blog in MySite. RRS feed

  • Question

  • I had a MySite Blog, that worked ok with the webparts "Recent Blog Posts" and showed recent posts on the collegue tracker. I created a 2nd blog, and deleted the first one.

    Both web parts stopped showing the updates. Is there a way to set the new blog as the default?

    Thanks!

    Thursday, June 2, 2011 5:45 PM

Answers

  • Hi diegochb,

    >Can anyone tell me if MySite have a unique main Blog or not?

    The Colleague Tracker web part only monitors the Blog with value Blog ID=1, which is created by clicking the button “Create Blog”.

    1. When you create the first blog with the button, it will set the properties “urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId” value as Blog ID=1, and then the button is disappeared.
    2. Then the ID of blog sites created later through “Sites and Workspaces” doesn’t equal 1, even if you have deleted the first Blog created with button.
    3. That button “Create Blog” is used to create the Blog which ID=1.

    There is a workaround for solving this issue.
    You can construct the URL of the button “Create Blog” in your browser as follow, and create the Blog (Id=1) which can be monitored by Colleague Tracker web part:
    http://<servername>/personal/<mysiteUserName>/_layouts/MySite.aspx?Blog=1


    Thanks & Regards,
    Daniel



    • Marked as answer by Porter Wang Monday, June 27, 2011 1:38 AM
    Wednesday, June 8, 2011 12:19 PM
    Moderator
  • Hi diegochb,

    You can update the webid via SPWeb.Properties["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"]=webid.
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb_members(v=office.12).aspx


    Thanks & Regards,
    Danie

    • Marked as answer by Porter Wang Monday, June 27, 2011 1:38 AM
    Monday, June 13, 2011 7:13 AM
    Moderator

All replies

  • Can anyone tell me if MySite have a unique main Blog or not?

    thanks!

    Tuesday, June 7, 2011 5:32 PM
  • Hi diegochb,

    >Can anyone tell me if MySite have a unique main Blog or not?

    The Colleague Tracker web part only monitors the Blog with value Blog ID=1, which is created by clicking the button “Create Blog”.

    1. When you create the first blog with the button, it will set the properties “urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId” value as Blog ID=1, and then the button is disappeared.
    2. Then the ID of blog sites created later through “Sites and Workspaces” doesn’t equal 1, even if you have deleted the first Blog created with button.
    3. That button “Create Blog” is used to create the Blog which ID=1.

    There is a workaround for solving this issue.
    You can construct the URL of the button “Create Blog” in your browser as follow, and create the Blog (Id=1) which can be monitored by Colleague Tracker web part:
    http://<servername>/personal/<mysiteUserName>/_layouts/MySite.aspx?Blog=1


    Thanks & Regards,
    Daniel



    • Marked as answer by Porter Wang Monday, June 27, 2011 1:38 AM
    Wednesday, June 8, 2011 12:19 PM
    Moderator
  • The Colleague Tracker web part only monitors the Blog with value Blog ID=1, which is created by clicking the button “Create Blog”.


    Thanks! I will try that. I assume the "Latest Posts" have a similar logic (looking at Blog with ID = 1). I try that and see if it's possible to change the ID to one from console (stsadm or powershell) to the newly created blog.
    • Edited by Mike Walsh FIN Thursday, June 9, 2011 7:08 PM Full quote serves no useful purpose and just wastes screen space
    Wednesday, June 8, 2011 3:08 PM
  • No, there is no id 1 saved anywhere... I event searched a little in the SQL tables but did not find where it references to the "main blog"... Also didn't find the code where it looks for it. All sites have a unique GUID, including the blog.

    thanks


    • Edited by diegochb Thursday, June 9, 2011 12:28 PM spelling error
    Thursday, June 9, 2011 12:27 PM
  • I got a little closer.... I created the main blog and a second blog and found that they are registered differently on the table EventReceivers

    The main blog has these rows (first colimn here is the Type, not sure of what)

    2 10000 Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.Office.Server.UserProfiles.BlogListEventReceiver
    3 10000 Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.Office.Server.UserProfiles.BlogListEventReceiver
    10001 10000 Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c Microsoft.Office.Server.UserProfiles.BlogListEventReceiver
    10001 10000 Xom.SharePoint.EventReceivers,Version=1.0.0.0,Culture=neutral,PublicKeyToken=8de4aba51823bf5a Xom.SharePoint.EventReceivers.CheckControls
    10002 10000 Xom.SharePoint.EventReceivers,Version=1.0.0.0,Culture=neutral,PublicKeyToken=8de4aba51823bf5a Xom.SharePoint.EventReceivers.CheckControls

    While the second blog to

    10001 10000 Xom.SharePoint.EventReceivers,Version=1.0.0.0,Culture=neutral,PublicKeyToken=8de4aba51823bf5a Xom.SharePoint.EventReceivers.CheckControls
    10002 10000 Xom.SharePoint.EventReceivers,Version=1.0.0.0,Culture=neutral,PublicKeyToken=8de4aba51823bf5a Xom.SharePoint.EventReceivers.CheckControls
    201 10000 Xom.SharePoint.EventReceivers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8de4aba51823bf5a Xom.SharePoint.EventReceivers.SiteEvents

     

    Mainly, it's not registered to the event Microsoft.Office.Server.UserProfiles.BlogListEventReceiver

    Is there a way to change that from a stsadm/powershell/or central admin way?

    Thursday, June 9, 2011 6:57 PM
  • Hi diegochb,

     

    The button “Create Blog” with the link http://<servername>/personal/<mysiteUserName>/layouts/MySite.aspx?Blog=1

    Is used to create the MySiteBlogs feature.

     

    1.       The SharePoint checked the MySite properties ["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"], if it’s value is null or empty.

    2.       The SharePoint would generate the button “Create Blog” which is used to create the main blog with that link http://....?Blog=1

    3.       After click the button “Create Blog” and the feature is active, the feature should done the things as follows:

    a.       Create the web using parent.RootWeb.Webs.Add( parameters about main blog).

    b.       Get the ID(GUID) of that main blog. And update the property ["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"] value as the main blog GUID.

    c.       Add the Navigation node, Create lists, assign permissions and lots of other things….

    d.       Add the 3 EventReceivers to process blog post add, delete, update…

    e.       …..

    4.       When Blog add, update and delete, it will update the UserProfile database, then the Colleague Tracker should display the Blog posts.

    The general things done by the button “Create Blog” is above. The blog (Created via “Sites and Workspaces”) has no that 3 EventReceivers and other things.

     

     

    NOTE: It is NOT recommend to modify the code to implement the custom blog as main blog.

    If you want to set the blogs create via “Sites and Workspaces” for TEST purpose (not production), you can try as follow thought direction, but it is very difficult and with lots of unknown risks.

    1.       Create a blog site.

    2.       Get the web ID.

    3.       Update this ID to the property parent.RootWeb.Properties["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"]

    4.       Add the 3 Event Handles (add/update/delete) to the “Post” list.

     

     

    Thanks & Regards,

    Daniel

    Friday, June 10, 2011 11:07 AM
    Moderator
  • Hi diegochb,

     

    The button “Create Blog” with the link http://<servername>/personal/<mysiteUserName>/layouts/MySite.aspx?Blog=1

    Is used to create the MySiteBlogs feature.

     

    1.       The SharePoint checked the MySite properties ["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"], if it’s value is null or empty.

    2.       The SharePoint would generate the button “Create Blog” which is used to create the main blog with that link http://....?Blog=1

    3.       After click the button “Create Blog” and the feature is active, the feature should done the things as follows:

    a.       Create the web using parent.RootWeb.Webs.Add( parameters about main blog).

    b.       Get the ID(GUID) of that main blog. And update the property ["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"] value as the main blog GUID.

    c.       Add the Navigation node, Create lists, assign permissions and lots of other things….

    d.       Add the 3 EventReceivers to process blog post add, delete, update…

    e.       …..

    4.       When Blog add, update and delete, it will update the UserProfile database, then the Colleague Tracker should display the Blog posts.

    The general things done by the button “Create Blog” is above. The blog (Created via “Sites and Workspaces”) has no that 3 EventReceivers and other things.

     

     

    NOTE: It is NOT recommend to modify the code to implement the custom blog as main blog.

    If you want to set the blogs create via “Sites and Workspaces” for TEST purpose (not production), you can try as follow thought direction, but it is very difficult and with lots of unknown risks.

    1.       Create a blog site.

    2.       Get the web ID.

    3.       Update this ID to the property parent.RootWeb.Properties["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"]

    4.       Add the 3 Event Handles (add/update/delete) to the “Post” list.

     

     

    Thanks & Regards,

    Daniel


    Thank you!!

    I had done steps 1, 2 and something similar to step 4. And yes, Im doing everything on a lab test machine, to understand the problem and see what is the best way to solve a production problem.

    Up to now, I think the only solution is to restore the entire MySite.

    Where can I access the property mentioned in

    3.       Update this ID to the property parent.RootWeb.Properties["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"]

    Thanks again!


    Friday, June 10, 2011 11:28 AM
  • Hi diegochb,

    You can update the webid via SPWeb.Properties["urn:schemas-microsoft-com:sharepoint:portal:profile:BlogWebId"]=webid.
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb_members(v=office.12).aspx


    Thanks & Regards,
    Danie

    • Marked as answer by Porter Wang Monday, June 27, 2011 1:38 AM
    Monday, June 13, 2011 7:13 AM
    Moderator
  • Daniel,

    Didn't you just state that it isn't recommended to change that property via code?  If so, what are the consequences doing so?

    Ali

    Monday, March 12, 2012 7:41 PM