Everyone that has inspected SharePoint's content database will notice that all lists and documents are stored in two tables only, AllUserData and AllDocs.
As only a few properties are contained in indexes searches will most likely lead to table-scans. Having a few 1.000 documents in SharePoint might not lead to slow performance but if you're looking at 100.000+ documents the situation is obviously different as outlined in this excellent article.
Sunday, November 18, 2007
Thursday, November 08, 2007
Potentially excessive number of SPRequest objects currently unreleased on thread
Hopefully you'll never come across the error "Potentially excessive number of SPRequest objects (35) currently unreleased on thread 5". It seems it can occur in several situations due to issues in your code as well as due to issues within Microsoft Office SharePoint Server 2007.
In order to avoid the problem in your code ensure to properly dispose the SPWeb object as outlined in this Microsoft article as well as in this blog. One important thing missing is the SPWeb.Webs() object - if using this object you also need to dispose all webs within the collection.
Potential reasons include:
In order to avoid the problem in your code ensure to properly dispose the SPWeb object as outlined in this Microsoft article as well as in this blog. One important thing missing is the SPWeb.Webs() object - if using this object you also need to dispose all webs within the collection.
Potential reasons include:
- Invalid XSL stylesheet
- Drop down lists - simple C# example
- Orphans
Friday, November 02, 2007
SharePoint Content Database
In case you wish to modify the SharePoint Content Database through SQL rather than using Microsoft SharePoint API you might wish to start reading this blog.
Where is my content type used
If you have worked extensively with MOSS content types you have been in situations where you couldn't locate where the content type was used. Thanks for this blog you can now use the SQL below to retrieve that information.
DECLARE @ContentTypeName nvarchar(128)
SET @ContentTypeName='Document'
SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title], ct2.* FROM ContentTypes ct1 JOIN ContentTypes ct2 ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId LEFT OUTER JOIN dbo.ContentTypeUsage ctu ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId LEFT OUTER JOIN dbo.AllLists al ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId LEFT OUTER JOIN dbo.Webs w ON al.tp_WebId = w.Id WHERE ct1.ResourceDir=@ContentTypeName
DECLARE @ContentTypeName nvarchar(128)
SET @ContentTypeName='Document'
SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title], ct2.* FROM ContentTypes ct1 JOIN ContentTypes ct2 ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId LEFT OUTER JOIN dbo.ContentTypeUsage ctu ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId LEFT OUTER JOIN dbo.AllLists al ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId LEFT OUTER JOIN dbo.Webs w ON al.tp_WebId = w.Id WHERE ct1.ResourceDir=@ContentTypeName
Monday, October 22, 2007
SharePoint AJAX Toolkit
If you haven't yet noticed it you need to check out SharePoint AJAX Toolkit. Or even better - start looking for jQuery support for SharePoint. I wonder if Microsoft will support jQuery in a future version of SharePoint. Woud be great.
Sunday, October 21, 2007
AJAX on SharePoint - how to get started
This blog described how to get started with AJAX on SharePoint
Friday, September 28, 2007
Web Content Management Content Type IDs
Check out this blog for a great overview of SharePoint content types.
Saturday, September 08, 2007
ASP.NET or SharePoint --> and SharePoint
Check out this article describing the relationship between ASP.net and SharePoint.
Tuesday, August 21, 2007
SPFileCollection.Add ignores title property on upload
Using SPFileCollection.Add (String, Byte[], Hashtable) as described on MSDN I found that it's simply isn't working properly :-(
Adding system properties doesn't work:
dim oHash as new hashtable
oHash.add("DocumentType","Contract")
oHash.add("Title","Leasing agreement with Smart Leasing Inc.")
oFile = oFolder.Files.Add(,,oHash)
oFile.Item("Title") is not equal to "Leasing agreement...".
The only way is to modify it manually after having added the file, e.g.
dim li as SPListItem
li = oFile.Item
li("Title")="Leasing agreement..."
li.UpdateOverwriteVersion(); ' In order to avoid creating a new version
Any explanations why "Title" property cannot be set in oHash would be appreciated.
Other problems with Add has been reported various places. This blog is worth reading.
Adding system properties doesn't work:
dim oHash as new hashtable
oHash.add("DocumentType","Contract")
oHash.add("Title","Leasing agreement with Smart Leasing Inc.")
oFile = oFolder.Files.Add(
oFile.Item("Title") is not equal to "Leasing agreement...".
The only way is to modify it manually after having added the file, e.g.
dim li as SPListItem
li = oFile.Item
li("Title")="Leasing agreement..."
li.UpdateOverwriteVersion(); ' In order to avoid creating a new version
Any explanations why "Title" property cannot be set in oHash would be appreciated.
Other problems with Add has been reported various places. This blog is worth reading.
Wednesday, August 08, 2007
SharePoint explorer view - cut-paste issues
Using SharePoint "explorer view" provides end-users with the old Windows Explorer view to files which is great.
However, in a few situations the "explorer view" behaves quite strange.
If you try using Cut-Paste the file is moved from one place to another - including all the history, old versions etc. This is great. However - the Cut-Paste does not respect event handlers that are operational.
I have an ItemDeleting events that blocks deleting documents from certain document libraries. It works fine from all interfaces (Word, SharePoint, Web Dav) - except from cut-paste. Obviously Microsoft had to implement custom code to handle the clipboard in this situation - and it seems that they forgot to respect the event handlers. Just too bad.
Any experience with similar issues much appreciated - as well as workarounds.
However, in a few situations the "explorer view" behaves quite strange.
If you try using Cut-Paste the file is moved from one place to another - including all the history, old versions etc. This is great. However - the Cut-Paste does not respect event handlers that are operational.
I have an ItemDeleting events that blocks deleting documents from certain document libraries. It works fine from all interfaces (Word, SharePoint, Web Dav) - except from cut-paste. Obviously Microsoft had to implement custom code to handle the clipboard in this situation - and it seems that they forgot to respect the event handlers. Just too bad.
Any experience with similar issues much appreciated - as well as workarounds.
Saturday, July 28, 2007
Wednesday, July 25, 2007
Great workflow tutorial - expense reporting
Creating a custom SharePoint workflow isn't as easy as you might expect. However, a great tutorial can be found here.
Wednesday, July 18, 2007
Friday, July 13, 2007
Monday, July 09, 2007
Managing Active Directory - SharePoint
Managing Active Directory is a challenge especially as only a few applications can act as a true LDAP client.
Extending Active Directory with custom schemas is an excellent model for applications that can act as an LDAP client (e.q. Exformatics ESDH). This allows custom application attributes to be stored in Active Directory, thus maintaining one single point of administration for Users and Computers in organisations.
One of the challenges is that the standard Windows Users, Groups and Computers view doesn't allow for management of custom attributes. ADSI Edit is the answer. Read more here.
Extending Active Directory with custom schemas is an excellent model for applications that can act as an LDAP client (e.q. Exformatics ESDH). This allows custom application attributes to be stored in Active Directory, thus maintaining one single point of administration for Users and Computers in organisations.
One of the challenges is that the standard Windows Users, Groups and Computers view doesn't allow for management of custom attributes. ADSI Edit is the answer. Read more here.
Friday, June 29, 2007
Exception (0x81071003): Unable to update the information in the Microsoft Office document
When adding a document (Excel) to SharePoint I get the exception: "(0x81071003): Unable to update the information in the Microsoft Office document".
The exception occur in a ItemAdded event handler where I add a global unique human-readable document id to the document.
This most likely due to an error in the property promotion/demotion part of SharePoint.
If I try to open up the Excel sheet myself I get an error as inline VBA code cannot be executed. So if SharePoint tries the same no wonder it doesn't work. But how can you block promotion/demotion in such situations.
Ideas very much appreciated.
The exception occur in a ItemAdded event handler where I add a global unique human-readable document id to the document.
This most likely due to an error in the property promotion/demotion part of SharePoint.
If I try to open up the Excel sheet myself I get an error as inline VBA code cannot be executed. So if SharePoint tries the same no wonder it doesn't work. But how can you block promotion/demotion in such situations.
Ideas very much appreciated.
Monday, June 11, 2007
Search Query Web Service Test Tool for Microsoft Office SharePoint Server (MOSS) 2007
If you need to work with MOSS search engine this is a must have tool.
Tuesday, June 05, 2007
Office property promotion/demotion in SharePoint
I came across this posting today about Office property promotion/demotion. Figuring out why and when properties are synchronized from SharePoint into Office and vice versa is quite a challenge. I'm still figuring out the details. Documentation and details needed.
Wednesday, May 09, 2007
SharePoint fine grained permission control
Just located this blog - an excellent description of how to extend SharePoint permissions to avoid approvers having delete rights.
Wednesday, May 02, 2007
Approve a SPFolder programmatically
If you are creating folders programmatically in SharePoint you'll notice that they turn of with "Approval Status" Pending.
Conclusion: And it's just sooo simple --> check out this.
Luckily it seems that you can programmatically change the _ModerationStatus of a folder item using the ProcessBatchData operation of the SPWeb object as outlined in this blog.
Unfortunately for me I can't get it working - yet. My code for ProcessBatchData looks like this:
<?xml version="1.0" encoding="UTF-8"?><ows:Batch OnError="Continue" >
<SetList Scope="Request">{5234ebfe-58c5-4af3-8879-cde8ade42315}</SetList>
<SetVar Name="DatesInGregorian">TRUE</SetVar>
<Method ID="1,Update">
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">14</SetVar>
<SetVar Name="owshiddenversion">1</SetVar>
<SetVar Name="owsfileref">http://intranet/Projects/Labbooks/ABC</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationStatus">0</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationComments">Exformatics Approved Folder</SetVar>
</Method>
</ows:Batch>
I get a proper reply back - but the folder is not yet approved. Maybe it only works in SharePoint 2003 and not in MOSS 2007. However, according to Joris Poelmans ProcessBatchData also works for MOSS 2007 - at least for creating new pages.
A good description with similar syntax can be found here - but not working either :-(
Conclusion: And it's just sooo simple --> check out this.
Luckily it seems that you can programmatically change the _ModerationStatus of a folder item using the ProcessBatchData operation of the SPWeb object as outlined in this blog.
Unfortunately for me I can't get it working - yet. My code for ProcessBatchData looks like this:
<?xml version="1.0" encoding="UTF-8"?><ows:Batch OnError="Continue" >
<SetList Scope="Request">{5234ebfe-58c5-4af3-8879-cde8ade42315}</SetList>
<SetVar Name="DatesInGregorian">TRUE</SetVar>
<Method ID="1,Update">
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">14</SetVar>
<SetVar Name="owshiddenversion">1</SetVar>
<SetVar Name="owsfileref">http://intranet/Projects/Labbooks/ABC</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationStatus">0</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationComments">Exformatics Approved Folder</SetVar>
</Method>
</ows:Batch>
I get a proper reply back - but the folder is not yet approved. Maybe it only works in SharePoint 2003 and not in MOSS 2007. However, according to Joris Poelmans ProcessBatchData also works for MOSS 2007 - at least for creating new pages.
A good description with similar syntax can be found here - but not working either :-(
Subscribe to:
Posts (Atom)