|
An ordinary VB developer shares his own successes and failures |
|
| Home News Articles Resources Tips Downloads About me | ||
I hate SharePointHow a tiny project turned into a big headache because of poor platform choice!?The other day, my company has got a request from the CIO of one of our long-term, loyal customer. The CIO apparently fell in love with SharePoint Portal Server and he wanted to migrate one of his old ASP applications to SPPS. The ASP application was a simple presentation solution for a set of documents representing the company's bylaws. Not a rocket science here:
The publishing funcionality was not automated at all! When a new bylaw was issued, a dedicated employee had to copy the document onto the appropriate place in the file system and add a new record describing the document to the MDB database. So I took over the task of converting the data and building the presentation as well as publishing feature working with the SPPS storage system.I defined a simple interface representing the required document management functionality: ' This is our document server API. Public Interface IDocumentServer ' Returns a DataTable with a list of folderUrl subfolders. folderUrl can be Nothing or an empty ' string. In this case the method should return a list of toplevel folders for given storage system. ' The DataTable should have the following schema (at least); ' Url (String) - URL of the subfolder ' Name (String) - name of the subfolder ' ParentUrl (String) - URL of the folder's parent Function GetFolders(ByVal folderUrl As String) As DataTable ' Returns a list of documents in the given folder. folderUrl must not be Nothing. ' The resultset should have the following schema: ' Url (String) - URL of the doc ' FolderUrl (String) - URL of the folder containing the doc ' Author (String) - document author ' Description (String) - document description ' MimeType (String) - MIME type of the document content (i.e. application/msword) ' IssueDate (DateTime) - document issue date ' MasterNumber (Integer) - unique document number ' SupplementNumber (Integer) - unique supplement number (if the doc is a supplement) ' ' The fields MasterNumber and SupplementNumber help to implement the concept of ' a supplement; master document and its supplements have the same MasterNumber. Master ' document has SupplementNumber = 0, the supplement documents have their SupplementNumber ' always > 0. Function GetDocuments(ByVal folderUrl As String) As DataTable ' Creates a subfolder with the give name. If parentUrl is Nothing or String.Empty, the ' method should create a toplevel (root) folder in the given storage. ' The method should return the URL of the newly created folder. Function CreateFolder(ByVal parentUrl As String, ByVal name As String) As String ' Removes the given folder. Sub DeleteFolder(ByVal url As String) ' Creates a document with the given attributes and returns its URL. ' If the masterNumber argument is <> 0, the document should be treated as an existing ' master document supplement and the server should assign the document a ' unique SupplementNumber. ' The pointer in the content stream must be set to the beginning of the document data. Function CreateDocument( _ ByVal folderUrl As String, _ ByVal author As String, _ ByVal description As String, _ ByVal issueDate As DateTime, _ ByVal masterNumber As Integer, _ ByVal supplementNumber As Integer, _ ByVal mimeType As String, _ ByVal fileTitle As String, _ ByVal content As System.IO.Stream) As String ' Returns a stream with the content of the given document. Function GetDocumentContent(ByVal documentUrl As String, ByRef mimeType As String) As System.IO.Stream End InterfaceTwo classes implemented the interface:
IDocumentServer
implementation was chosen at runtime based on
settings in the application's web.config
file.
I've also implemented a
After a couple of days of development and
testing I took the piece to deploy and test
it at the customer's site. The customer has
one dedicated intranet server INTRANET
(that's exactly the server's name
On the INTRANET machine, I created an IIS
vroot for the application and entered the
appropriate
To make a long story short, the reason for
this was in the
OK, I hear you. This was entirely my fault,
because I didn't study the False
to the KnowledgeFolder.PromptToAuthenticate
property and by using explicit credentials
(with sufficient permissions to open and
manipulate the SPPS store) in a call to the
KnowledgeFolder.DataSource.Open method.
I've tested the browsing and publishing feature and it worked great. At this point it is important to note that I was running the browser under an account that was member of the Domain Admins global group. When I logged onto my client machine as a "normal" domain user (i.e. Domain User member only), the browsing functionality worked well, but when I've tried to publish a document, I've got a confusing "The directory name is invalid" error: System.Runtime.InteropServices.COMException (0x8007010B): The directory name is invalid. at PKMCDO.IDataSource.SaveTo(String SourceURL, Object ActiveConnection, ConnectModeEnum Mode, RecordCreateOptionsEnum CreateOptions, RecordOpenOptionsEnum Options, String UserName, String Password)I've tried almost everything imaginable to make the publishing work for domain users, but it was of no avail. No combination of the IIS / COM+ application identity, web.config
authorization / impersonation settings or
SPPS workspace settings worked for domain
users. It seems that even if SPPS allows you
to pass explicit user credentials to manipulate its
storage, the browser's user access token is
still used for some internal processing,
which results in the "directory name is
invalid" error. (Auditing didn't help,
because the SPPS web storage system
apparently doesn't generate security events).
So the end result is: When the browser user is member of the Domain Admins group, publishing works. Otherwise it doesn't. Period. For the customer, it wasn't acceptable for the bylaw documents publisher to be member of the Domain Admins global group, so I've had to implement a workaround:
SppsDocumentServer.
Finally, everything worked well for both
domain administrators as well as "normal"
users, including publishing!
I was exhausted! The worst thing is that I still don't know why SPPS was returning the "directory name is invalid" error. Well, they probably know why they abandoned the infamous web storage system and why the new SPPS version 2 is based on SQL Server and .NET framework. What do you think? © Palo Mraz, Monday, July 28, 2003 Linkshttp://www.microsoft.com/sharepoint/server/ - The official SPPS site.
http://msdn.microsoft.com/library/en-us/spssdk/html/_adodb_connection_object.asp - I
should have read this article on PKMCDO's
PromptToAuthenticate handling.
http://msdn.microsoft.com/library/en-us/dnbda/html/DBGch03.asp - Great article on debugging ASP.NET applications, including description of the 1003 "deadlock" event ID. http://www.sharepointserver.com/forum/topic.asp?TOPIC_ID=377 - Another "nice" SPPS endeavor. http://msdn.microsoft.com/msdnmag/issues/01/08/Interop/ - Nice article about .NET - COM interoperability (a bit outdated, but still valid). |
||
|
|
||
| ©2003-2008 Palo Mraz. All Rights Reserved. See my 'new browser window' policy | ||