SharePoint Dragons

Nikander & Margriet on SharePoint

SharePoint 2013 Best Practices: Using Folders

This discussion is updated again at: http://social.technet.microsoft.com/wiki/contents/articles/16166.sharepoint-2013-best-practices-using-folders.aspx

The current place where we stand is this:

Should you use folders or not?

Advantages

  • Scale by partitioning a document library
  • To apply permissions more effectively
  • To use location based default metadata properties. You can set default metadata values for every folder. In ‘Library settings’, ‘Column Default Value settings’, you can set defaults on all of you subfolder starting from the root(inherits by default). Also check out the Location-Based Metadata defaults feature: http://msdn.microsoft.com/en-us/library/ee557925.aspx  .
  • Folders are great for finding info when you know your way around the folder structure.
  • Folders improve the efficiency of data access because the creation of a folder leads to the creation of an internal index.
  • Folders work great in scenarios where file shares are used. In a file share, the only way of classifying files is through filename and folder structure. In SharePoint we have a choice, and you could consider using both folders and metadata together.
  • Folders work a lot better with Windows explorer views. In a flat structure you see everything and nothing in one view….
  • Document sets inherit from the folder content type. So, even if you resent the idea of using folders, you’re probably still a fan of using them without recognizing it (that is, unless you deny the usefulness of Document Sets).
  • You can use folders while still removing them from view. If you don’t want to use the folders all the time, create a view that does not display the folders. In ‘Library settings’ – ‘Create View’ – ‘standard view’ – under ‘Folders’ – you have a choice of ‘show all items without folders’. This will turn your folder based structure into a flat library.
  • Folders is a great way to introduce metadata to old school change-reluctant users, using default folder values will allow you to add metadata without the user noticing.
  • Folders save you time in migrations if you can copy an existing fileshare folder structure.

Disadvantages

  • If you don’t know the folder structure, finding info is easier using metadata based navigation.
  • Folders increase URL length, which breaks when it pops above around 260 characters. See: http://www.loisandclark.eu/Pages/limitsurl.aspx
  • Folders don’t look great when you put a Library web part on a page (there’s no navigation back up to the parent folder).
  • Folders without metadata, can cause you to ‘lose’ documents.
  • It’s harder to change folder structures, while changing metadata is easy.Additional comments about Security…
    You can have several document libraries in one site, that is also a way to separate security/permissions. There is a commercial third party tool available for SharePoint that allows you to set permissions by the use of metadata. So, if you’re interested in that, you can investigate further.

    Folder vs Metadata

    • SPS 2013 search makes it easy to find worthwhile files and list items with or without any added metadata.
    • If you don’t use metadata, Sharepoint automatically adds metadata anyway to your documents. The document name, document type, folder name, created by, modified by etc. Sharepoint adds about 20 metadata to your documents automatically without you having to do a thing. So in fact you are always using metadata.
    • You can lose documents when placed in the wrong folder, but the same is true when you add the wrong metadata to a document. A good search engine alleviates those problems.
    • Besides the time needed to add constantly new metadata to individual documents, there is no decent way to add or change metadata in bulk when its Term Store metadata. The Datasheet view options are greyed out when using the term store. Are you really going to ask you end-users to add metadata to individual documents when they want to move 50 documents from file share to SharePoint on any given day? Do you really want to use third party migration software for every instance that this occurs?
    • Of course it is best practice not to create too many folder levels, but metadata grouping can only give you 2 levels of “folder like” structure. Sometimes you just need 3 levels to make the document structure logic for everyone.
    • When you add a library web part view on a page, there is no way to tell in which folder you are at any given time, there is also no way to navigate to the parent folder. However, it’s possible to invest in custom work to give library web part views that do show a breadcrumb and that has taken away the biggest disadvantage of using folders for my end-users.

    Conclusion

    Try and keep the folder hierarchy as flat and minimal as you can, but don’t limit yourself to metadata views exclusively. Mix the opportunities for the best results!  If you choose to depend on metadata only, you should separate sets of documents by putting them in its own websites and set the permissions on this level. If you need a more granular rights management, folders/libraries are the easier way to do it.

    See Also

Beware of content db creation via SCA UI

If you create a content database via the SCA UI (Application Management > Manage content databases> Add a content database), not only are the Autogrowth settings of your Model DB ignored, SharePoint also ignores the Initial Size of the Model Log files, and instead takes divides the size of your Data file by 4. So, if your data file is 100 GB, the Initial Size of your Log files becomes 25 GB.

Optimizing SQL Server 2012 for SharePoint 2013

Brian Alderman and Bill Baer did a great job on covering how to optimize SQL Server 2012 for SharePoint 2013 at

https://www.microsoftvirtualacademy.com/training-courses/tuning-sql-server-2012-for-sharepoint-2013-jump-start If you want to hear Brian pronounce our Dutch names, skip to the end of the last section :-)!

Third-Party JavaScript

As technical reviewers, we see a lot of books. We feel that Third-party JavaScript is a great book with a horrible title. During review, we’ve commented on the title several times, and suggested to replace it with something like “Enterprise JavaScript”, but the title lasted. This is a sad thing, but don’t judge the book by its title. This is truly a great book that takes writing JavaScript to the next level. We mean, JavaScript is a fun language, and after jQuery we were quite impressed with where you can take this language, but this book has brought our understanding of the language to a whole new level – that is saying something, as we have worked with JavaScript since it’s v1.0 version was released way back when. We’ve even worked with Netscape’s LiveWire (server-side JavaScript aeons before Node.js, btw, why do people love server-side JavaScript, we lived in that world and were quite happy to leave!).

To us, this book is about writing enterprise-level JavaScript code, a topic important in a time where SharePoint devs have to depend upon CSOM so much. It covers:

  • Distributing and loading JS applications
  • Rendering HTML and CSS
  • Communicating with the server
  • Cross-domain IFrame messaging
  • Authentication and sessions
  • Security
  • Developing a 3rd party JS SDK
  • Performance
  • Debugging and Testing

Tool Tip: CloudXPlorer

We have to say, this is a great tool that makes working with Azure easier: http://clumsyleaf.com/products/cloudxplorer

Quick Tip for Testing Load Balancing in SharePoint 2013

Adjust the SharePoint Master page on each WFE and add an HTML comment to it such as: <!—WFE 1 –>, and <!—WFE 2 –>. Yes, we know that’s not supported in production, but if you don’t dare to try minor stuff like that when the situation calls for it, you’re just lacking courage ;-)! We’ve added this tip and more to the Troubleshooting section of the SharePoint 2013 Best Practices page at http://social.technet.microsoft.com/wiki/contents/articles/12438.sharepoint-2013-best-practices.aspx#Troubleshooting

SharePoint 2013 Upgrade and Migration Best Practices

Where are the SharePoint 2013 Search Suggestions?

What to do when search suggestions don’t show up? Run the “prepare query suggestions” timer job!

If you set up search suggestions (as described in http://technet.microsoft.com/en-us/library/jj721441.aspx ) you may notice that no suggestions drop down from the search bar. That makes sense, because they only appear after the “prepare query suggestion” timer job has run. You can force this via PowerShell like this:

Start-SPTimerJob -Identity “prepare query suggestions”

We’ve added the following TechNet Wiki page that describes how to do that: http://social.technet.microsoft.com/wiki/contents/articles/16640.sharepoint-2013-tips-for-troubleshooting-search-suggestions.aspx It will contain any updates to this tip.

Credits

Based on the content of: http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/33265dfd-1316-4c57-92b9-31f0d8f0078c

Add a multivalued taxonomy field to the default view in a custom list thru PowerShell

The title says it all, really. There was one particularly tricky part, where the view needed to be stored in a separate variable, like so:

$view = $myCustomList.DefaultView

Because $myCustomList.DefaultView resulted in the creation of a new View object every time, causing any changes you made to a previous object instance to be lost. The code is here, and it requires you to set up a managed metadata service instance (ours is called Managed Metadata Service), the following blog post can help you with that: http://chakkaradeep.com/index.php/sharepoint-2010-content-type-hubs-publish-and-subscribe-to-content-types/

$TestSiteUrl = “http://demosrv/sites/Wilmie”
$Web = Get-SPWeb -identity $TestSiteUrl

#Dev: remove list and create it every time anew
$List = $Web.Lists[“CustList”]
$List.Delete()

$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::GenericList
$lstId = $Web.Lists.Add(“CustList”,”Cust Descr”,$listTemplate)
write-host “list ” $ListName ” created successfully” $ListName -ForegroundColor Green  

$myCustomList = $Web.Lists[“CustList”]

#Example simple text field (without taxonomy field, this makes testing easier)
#$firstNameColXml = “<Field Type=’Text’ DisplayName=’FirstName’ Required=’TRUE’ MaxLength=’255′ StaticName=’FirstName’ Name=’FirstName’ />”
#$myCustomList.Fields.AddFieldAsXml($firstNameColXml,$true, [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)  
#$myCustomList.Update()

$taxonomySite = Get-SPSite “http://demosrv:1971″
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$termStore = $taxonomySession.TermStores[“Managed Metadata Service”]
write-host “Connection made with term store -“$termStore.Name
$termStoreGroup = $termStore.Groups[“MyTermStoreGroup”];
$termSet = $termStoreGroup.TermSets[“MyTermSet”];

Add-Type -Path ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Taxonomy.dll’
$taxonomyField = [Microsoft.SharePoint.Taxonomy.TaxonomyField] $myCustomList.Fields.CreateNewField(“TaxonomyFieldTypeMulti”, “Location”)
$taxonomyField.Required = $false
$taxonomyField.StaticName = “my_static_name”
$taxonomyField.SspId = $termStore.Id
$taxonomyField.TermSetId = $termSet.Id
$myCustomList.Fields.Add($taxonomyField)
$myCustomList.Update()
Write-Host “Added field ” $taxonomyField.Title ” to list ” $myCustomList.Title -ForegroundColor Green

$field = $myCustomList.Fields[“Location”];
# PLEASE NOTE: It’s important to store the view in a variable, because calling list.DefaultView results in the creation of a NEW view object every time,
# if you do that, new columns will NEVER be added succesfully to the view.
$view = $myCustomList.DefaultView
$view.ViewFields.Add($field)
$view.Update()
$myCustomList.Update()

Write-Host “Added field ” $field.Title ” to default view” -ForegroundColor Green

Write-Host “Finished set metadata”

SharePoint 2010 Best Practices

It’s all about 2013 these days, nevertheless, whenever we see a reason, we’re updating the SharePoint 2010 Best Practices page as well. The Upgrade and Migration section has been updated at http://social.technet.microsoft.com/wiki/contents/articles/8666.sharepoint-2010-best-practices.aspx