Saturday, September 29, 2012

My First Look at SharePoint 2013 Site

[The content is specific to SharePoint 2013 Preview. The RTM may come up with some changes.]

SharePoint 2013 - I was waiting for you. Yes, today I started working on SharePoint 2013 (Preview) site.

I put the URL in browser and this is what I see on home page.

I have highlighted few parts in the picture. These are new in the UI and are not self-explanatory.

Let us have a look at each one.

Edit Links

What links are they talking about? Do they mean page links? Can we re-organize or update page links? Why duplicates are placed at top and below left navigation? Too many questions... came to my mind. Let's give it a try.

Click "Edit Links" in the top. The UI changes in-place as below.

I clicked the "+" sign and it presented me with screen below. It asks for the "Text to be displayed as link" and the target URL.

Can't I specify the target to open the link in new window? There is no way. This a Global navigation, use it only for links scoped to the content in the site collection.

Click "OK". It added a link in Global navigation. But the link is not saved... we have to click on "Save".

Here is how it looks after saving.

Can I edit the link? Yes, I can. Click on "Edit Links" and then click on the link itself. It presents the below screen changes. Click on "Link" icon which is similar to infinity symbol.

It allows to update the link. (Note: This applies to only saved links. If you have added a link but not saved and before saving you want to edit. It does not allow to do it.)

So the duplicate below left updates the links in left navigation and it should contain links scoped to the site level content.

Focus On Content

There is an icon on right side at the top icons collection. On hovering the icon, it displays a tooltip saying "Focus on content".

I clicked it...the left navigation bar disappeared. I again clicked it, the left navigation re-appeared. This is really good. Rather than the navigation items occupying the real-esate of screen, it will become available for content. User will have a better experience while working with the content. When required, user can invoke the navigation on demand. Really, cool...!

Stay tuned...!more stuff coming up about SP 2013.

(The screen-shots are from Office 365 Preview site. There is not much difference in the UI of actual SharePoint 2013 site. So the notes apply to SharePoint 2013 Preview site.)

Sunday, September 23, 2012

List the "vti_" properties using PowerShell

Every file/document in SharePoint possess some meta-info. It is stored in hashtable presented by SPFile.Properties property. Most of the properties start with "vti_". We cannot write the "vti_" properties as they are read-only.

But we can use this property-bag store custom meta-property for the file. We can manage the custom properties using below method:
  • SPFile.AddProperty
  • SPFile.SetProperty
  • SPFile.GetProperty

SPFile.CustomizedPageStatus property determines the customization status of wiki page or page layout using below properties.
  • vti_setuppath
  • vti_hasdefaultcontent
Different SharePoint objects has the hashtable based property to store these kind of properties. e.g SPWeb.AllProperties. SPWeb.AllProperties["__PagesListId"] stores the GUID value of "Pages" library created on activating publishing feature.

Changing the UIVersion of migrated sites automatically updates the master page to appropriate UIVersion. This is possible because of the SPWeb.AllProperties. It stores the master page details related to each UIVersion.

PowerShell script to list the "vti_" properties of a file.

$web=Get-SPWeb <webSite URL >
$list=$web.Lists["Site Pages"]
foreach($item in $list.Items)
    Write-Host "**********"
    foreach($key in $item.File.Properties.Keys)
        Write-Host $key "=" $item.File.Properties[$key]
    Write-Host "------------------*****---------------------------"

PowerShell script to list "vti_" properties of web site.

$web=Get-SPWeb <webSite URL >
foreach($key in $web.AllProperties.Keys)
     Write-Host $key "=" $web.AllProperties[$key]

Have a look!