Skip to main content

Sharepoint

Go Search
Home
  
Sharepoint > Wiki Pages > Home  

Home

Welcome to the New WSS3 / MOSS2007 Site - This replaces the old WSS2 site, You can still find it here
 
In September 2007, my Site was upgrated from WSS2 (DK + UK Language) to WSS3 (DK + UK Language), a process that ran similar (or as a test) for my firms upgrades, as the 2 systems was very alike.
 
How did I do it? Well, as You may know, upgrading MOSS and WSS are no walk in the park, but read on: My WSS2 To WSS3 Upgrade
 
 
Adding design to generic default.aspx
 
 
 
Blog entries:
 
 
15-02-2010: Website speed: After my move to New Laptop, Home based and SP2 on: http://www.webpagetest.org/result/100215_55Y5/
 
10-02-2010: Website speed (or lack of same):
Removal of Weather (flash) webpart: http://www.webpagetest.org/result/100209_50E0/
 
 
30-10-2009: Sharepoint combined with iPhone!! Exformatics has created a iPhone app for accessing their ESDH solution; very exting: http://www.exformatics.com/Solutions/esdh.html
 
27-09-2009: God Damn Genious, someone has made upload of pictures seemless for endusers (and all others) finally!!! Read http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/1ede54df-c941-42c1-9d5a-2af558a4e0b7 Download file and install instructions here
 
26-09-2009: YES - New theme stuff for MOSS/WSS: http://geekswithblogs.net/kit/archive/2009/03/27/130468.aspx
 
As default it only applies to LCID 1033 (fuck)- both with a few steps this can be solved:
 
Apply the changes from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\XXXX\SPTHEMES.XML (for some reason the CONTOSO entry does not work for me, and I had to leave it out)
 
Warning - this is [business as usual?] a hack into the files of WSS/MOSS, and is not supported in any way, retracting the Theme features will not clean up You manually copied files!
 
 
08-09-2009: I am playing around with a complete SharePoint document export, both for a purpose on Work and possibly yo migrate to Drupal. To make it pretty simple, a VBS script is used. The task is pretty simple, main issue is to filter out Sharepoint Stuff like ghosted pages and filenaming versions of documents; - I am not sure all exections are handled yet:
 
 
Function RunSQL(sql)
 Const adOpenStatic = 3   
 Const adUseClient = 3
 Const adLockBatchOptimistic = 4
 On Error Resume Next
 Dim RS
 Set RS = CreateObject("ADODB.Recordset")
 RS.CursorLocation = adUseClient
 RS.Open sql, ConnectString, adOpenStatic, adLockBatchOptimistic
 
 Set RS.ActiveConnection = Nothing
 Set RunSQL = RS
 
 On Error Goto 0
 
End Function
Function CreatePath(CurStartPath,thePath)
 Dim NextLevel
 
 If InStr(thePath,"\")>0 Then
   
  PathArray=Split(thePath,"\")
  NextPath=PathArray(0)
  NextLevel=True
  
 Else
 
  NextPath=thePath  
  NextLevel=False
 
 End If  
 
 If Not FSO.FolderExists(CurStartPath+NextPath) Then FSO.CreateFolder(CurStartPath+NextPath)   
 
 If NextLevel Then
  
  RemainingPath=Right(thePath,Len(thePath)-Len(NextPath+"\"))     
  CreatePath CurStartPath+NextPath+"\",RemainingPath
  
 End If 
 
End Function
Dim RS,sql,ConnectString,RelPath,StartPath
ConnectString="Provider=SQLOLEDB; Data Source=AALIITNT08; Initial Catalog=Sharepoint_Content; User Id=sa; Password=PasswordHere;Network Library=DBMSSOCN"
StartPath="P:\SharepointExport\"
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
FileCount=0
Set FSO=CreateObject("Scripting.FileSystemObject")
Set LogFile = FSO.OpenTextFile(StartPath+"ExportLog.txt",2,true)
' Export All Documents from AllDocs
sql="SELECT Id,DirName,Leafname FROM AllDocs WHERE dirname NOT LIKE '' AND Leafname NOT LIKE '' ORDER BY DirName,Leafname"
Set RS=RunSQL(sql)
While Not RS.EOF
 RelPath=Replace(RS("DirName"),"/","\")
 If Not Left(RelPath,1)="_" And InStr(RelPath,"_catalogs")=0 And InStr(RelPath,"_layouts")=0 Then
  DocId="'"+RS("Id")+"'"
  DocFileName=RS("LeafName")
  DocDirName=RS("DirName") 
 
  DotPos=InStrRev(DocFilename,".") 
  If DotPos=0 Then
 
   DocExtension=""
   DocShortFilename=DocFilename
 
  Else
 
   DocExtension=Right(DocFilename,Len(DocFilename)-DotPos)
   DocShortFilename=Left(DocFilename,Len(DocFilename)-(Len(DocExtension)+1))
  
  End If
 
  sql="SELECT COUNT(*) FROM AllDocVersions WHERE Id="+DocId+" AND Content IS NOT NULL"
  Set RS2=RunSQL(sql)
 
  On Error Resume Next
  DocVersions=CInt(RS2(0))
  If Err Then LogFile.WriteLine("Error: "+Replace(DocSaveFilename,"/","\")+","+DocId) 
  If DocVersions>0 Then
 
   sql="SELECT * FROM AllDocVersions WHERE Id="+DocId+" AND Content IS NOT NULL"
   Set RS2=RunSQL(sql)
   
   s=0
  
   While Not RS2.EOF
 
    CreatePath StartPath,RelPath
  
    DocVersion=CStr(RS2("Version")/512)
    DocTimeCreated=RS2("TimeCreated")
   
    'Create Stream object
    Dim BinaryStream
    Set BinaryStream = CreateObject("ADODB.Stream")
 
    'Specify stream type - we want To save binary data.
    BinaryStream.Type = adTypeBinary
 
    'Open the stream And write binary data To the object
    BinaryStream.Open
  
    'On Error Resume Next
    BinaryStream.Write RS2("Content")
  
    'If Err Then msgbox DocDirName+DocFileName+CStr(DocVersions)
 
    'Save binary data To disk
    
    If s=0 Then
    
     DocSaveFilename=StartPath+RelPath+"\"+DocShortFilename+"."+DocExtension  
     s=1
     
    Else
    
     DocSaveFilename=StartPath+RelPath+"\"+DocShortFilename+" (version "+DocVersion+")."+DocExtension  
     
    End If
    BinaryStream.SaveToFile DocSaveFilename,adSaveCreateOverWrite
    LogFile.WriteLine(Replace(DocSaveFilename,"/","\")+","+CStr(DocTimeCreated))
    
    RS2.MoveNext
    FileCount=FileCount+1
    
   Wend  
  
  End If 
 
 End If
 
 RS.MoveNext 
 
Wend
LogFile.Close
Msgbox "Finish. Files saved: "+CStr(FileCount)
 
 
 
18-09-2009: Back on track, for the last long time, my frontpage has moved to a right-alignment, and I could not find out why. After 10 hours of investigation, FireFox'ing with Web Developer etc etc I found the [stupid] error, a missing quote in the default.aspx - SUCKS!!! But no-one to blame but meself...
 
23-06-2009: Back again with a small tip on filling field with Javascript: http://webborg.blogspot.com/2007/07/refferencing-sharepoint-form-fields.html
 
25-03-2009: Ran into a "tough" situation, a XLS document named MACH IP VLAN.xls was corrupted and the user has tried to save it and in the process he has deleted the document from the Document Library (hence including all versions) and uploaded a new that also was corrupted...
 
So - No document, no versions and nothing(!) in the recycle bin (have to figure out why not)...so....what to do?
 
Well, a database restore and pointing web frontend to the restored database was out of the question, the database restore in another location (another MS SQL server) was no real problem, but I still had to figure out to get the binary data out...
 
After a bit of "Woosaaaa" - I started to examine was was in the current database first:
 
SELECT * FROM AllDocs WHERE LeafName = 'MACH IP VLAN.xls'
 
This gave 2 rows (versions) with 2 id's: 786e66d9-7b31-4e77-91ce-4abe3915864b and 87b10e0e-989b-4aff-97f3-7b0f57c276e1
 
So the next query was:
 
SELECT * FROM AllDocVersions WHERE (Id = '87b10e0e-989b-4aff-97f3-7b0f57c276e1')
ORDER BY TimeCreated DESC
 
This gave a lot of versions of the document:
 
ec66704f-0276-4d6e-87eb-02fa57fb5625 87b10e0e-989b-4aff-97f3-7b0f57c276e1 205824 24-03-2009 06:31:46
ec66704f-0276-4d6e-87eb-02fa57fb5625 87b10e0e-989b-4aff-97f3-7b0f57c276e1 205312 23-03-2009 22:09:19
ec66704f-0276-4d6e-87eb-02fa57fb5625 87b10e0e-989b-4aff-97f3-7b0f57c276e1 204800 23-03-2009 14:35:05
ec66704f-0276-4d6e-87eb-02fa57fb5625 87b10e0e-989b-4aff-97f3-7b0f57c276e1 204288 12-03-2009 10:47:41
 
So I created a small ASP site ( this is the simplest version possible, could need some shining..) using stuff from my Modus-Operandi product to retrive and save the Content column using this url:
 
/Default.asp?id=87b10e0e-989b-4aff-97f3-7b0f57c276e1&version=25824&extension=xls
 
The files for the ASP Site:
 
Global.asa
 
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows Library" -->
<script language="VBScript" runat="Server">
Sub Application_OnStart
 Application.Lock
 Application("ActiveUsers") = 0
 Application("ConnectString")="Provider=SQLOLEDB; Data Source=AALIITNT08; Initial Catalog=Sharepoint_Content; User Id=sa; Password=PasswordHerei;Network Library=DBMSSOCN"
 Application.UnLock 
End Sub
</script>
 
 
DBConnect.asp:
 
<%
' *********************************************************
' Created and with copyright 2002-2004 by notezone
'
' For professional use, visit
www.modus-operandi.dk
' http://support.microsoft.com/default.aspx?scid=kb;EN-US;176056
'
' *********************************************************
Function RunSQL(sql)
 Const adOpenStatic = 3   
 Const adUseClient = 3
 Const adLockBatchOptimistic = 4
 On Error Resume Next
 Dim RS
 Set RS = Server.CreateObject("ADODB.Recordset")
 RS.CursorLocation = adUseClient
 RS.Open sql, Application("ConnectString"), adOpenStatic, adLockBatchOptimistic
 
 If Err.Number <>0 Then
 
'  If Err.Number=-2147217900 AND InStr(LCase(sql),"ipageid='")>0 Then Response.Redirect("/Common/Error/iis/404b.asp")
     Response.write "<b>SQL Error: <font color=red>" & Err.Number & " - " & Err.Description & "</b><br><br><font color=blue>" & sql
   Response.write "<br><br>"
   Response.write "<center><input type=button class=Button value=""Close"" onclick=""self.close();""> <input type=button class=Button value=""Go Back"" onclick=""history.go(-1);""></center>"
   Set RS.ActiveConnection = Nothing
   Response.End
    
 End If
 Set RS.ActiveConnection = Nothing
 Set RunSQL = RS
 
 On Error Goto 0
End Function
%>
 
Default.asp:
 
<!--#include file="dbconnect.asp"-->
<%
Dim RS,sql,bRead,bWrite,bChange,bChangeRights
iFileId=Request.QueryString("id")
iVersion=Request.QueryString("version")
vcExtension=Request.QueryString("extension")
If iFileId="" Or iVersion="" Or vcExtension="" Then
 Response.write "Missing Parameter - I need id=xxxxx&version=xxxxx&extension=xxxx"
 Response.end
 
Else
 Response.write "Download the file <a href=""ServeFile.asp?id=" & iFileId & "&version=" & iVersion & "&extension=" & vcExtension & """>Here</a>"
End If
 
%>
 
 
ServeFile.asp:
 
<!--#include file="dbconnect.asp"-->
<%
Dim RS,sql,bRead,bWrite,bChange,bChangeRights
iFileId=Request.QueryString("id")
iVersion=Request.QueryString("version")
vcExtension=Request.QueryString("extension")
If iFileId="" Or iVersion="" Or vcExtension="" Then
 Response.write "Missing Parameter"
 Response.end
End If
sql="SELECT Content,Size FROM AllDocVersions WHERE id ='" & iFileId & "' AND Version=" & iVersion
Set RS=RunSQL(sql)
If Not RS.EOF Then 
 Select Case LCase(vcExtension)
 Case "asf"
 
  ContentType = "video/x-ms-asf"
  
 Case "avi"
 
  ContentType = "video/avi"
  
 Case "doc"
 
  ContentType = "application/msword"
 Case "zip"
 
  ContentType = "application/zip"
   
 Case "xls"
 
  ContentType = "application/vnd.ms-excel"
   
 Case "gif"
 
  ContentType = "image/gif"
   
 Case "jpg", "jpeg"
 
  ContentType = "image/jpeg"
 Case "wav"
 
  ContentType = "audio/wav"
       
 Case "mp3"
 
  ContentType = "audio/mpeg3"
       
 Case "mpg", "mpeg"
 
  ContentType = "video/mpeg"
 Case "rtf"
 
  ContentType = "application/rtf"
 
 Case "htm", "html"
 
  ContentType = "text/html"
 Case "asp"
 
  ContentType = "text/asp"
 Case "zip"
  ContentType = "application/zip"
   
    Case Else
  
  ContentType = "application/octet-stream"
 End Select
 
 Response.Clear
 Response.Buffer=False
 Response.AddHeader "content-disposition","attachment; filename=""thefile." & vcExtension & """"
 Response.AddHeader "Content-Length", RS("Size")
 ' In a Perfect World, Your Client would also have UTF-8 as the default
 ' In Their Browser
 Response.Charset = "UTF-8"
 Response.ContentType = ContentType
 
 Response.BinaryWrite RS("Content")
 Response.Flush
 
End if
%>
 
--------------------------------------------------------
18-03-2009: Spooky, ran into serious problems of SP hanging at work and some DCOM error in the log:
 
 
--------------------------------------------------------
12-03-2008: I am doing some tricks to (hopefully) enhance performance:
 
 
--------------------------------------------------------
04-03.-2009: A user wants to view all checked out files on the sharepoint: http://ryansteeno.spaces.live.com/blog/cns!5BD49B6555761E83!244.entry
--------------------------------------------------------
03-03-2009: Another thing to test, Silverlight Webpart: http://msdn.microsoft.com/en-us/magazine/dd148643.aspx
--------------------------------------------------------
 
And truly a great day@work, I have finished the first "real" sharepoint Webparts, these will replace some JavaScript with ActiveX that I have used, mening that it was slow and only IE supported.
 
Now both a Customer Menu, a Menu based on a List and a IFrame'ish Webpart are .NEt programmed in C#. Some finetuning and errorhandling will be added, but they do work now:
 
--------------------------------------------------------
--------------------------------------------------------
16-01-2009 : An "old School" tip, to set all pages ( Also _layouts) in Edit mode:
 
Make a Link on the IE toolbar to the code: javascript:MSOLayout_ChangeLayoutMode(false);
 
16-01-2009 : Went to a course "Web Part Development" at Pilentum in Nørresundby, Denmark - the course was "homemade" and really, really good, nop M$ crap in it. And the teacher, Jakob Lund Krarup, was really dedicated. I will strongly recommend this to all upcomming/starting Web part developers.
--------------------------------------------------------
07-01-2009 : A TagCloud that seems to work(!) http://www.codeplex.com/CKS/Release/ProjectReleases.aspx?ReleaseId=4820
 
Installation:
 
stsadm -o addsolution -filename c:\temp\CKS.TagCloud.Solution.wsp
 
stsadm -o deploysolution -name CKS.TagCloud.Solution.wsp -url http://www.mos-eisley.dk -immediate -allowgacdeployment
 
Danm, installed the old version of the Cloud Tag by mistake, so I had to figure old how to remove again:
 
Removal:
 
stsadm -o retractsolution -immidiate -url http://www.mos-eisley.dk -name CKS.TagCloud.Solution.wsp
 
stsadm -o deletesolution -name CKS.TagCloud.Solution.wsp
 
And the install again....
--------------------------------------------------------
--------------------------------------------------------
--------------------------------------------------------
11-12-2008 : Found some gold here: http://community.bamboosolutions.com/media/g/jeffwebbmedia/default.aspx - Seems to be high quality products :-)
--------------------------------------------------------
Something to exiting to explore : http://darrenjohnstone.net/2008/07/22/a-cross-browser-javascript-api-for-the-sharepoint-and-office-live-web-services/ - Javascript Libs for lists - until now I have used ActiveX ( = IE only)!
--------------------------------------------------------
--------------------------------------------------------
 
Important
Tools for my daily
challenges and struggles
of Sharepoint Development:
 
 
 
 
Debug Viewer [File]
 
 
 
 
 
 
 

 Links

  An Advanced Search for WSS 2/3
  Login trouble in an AD with Vista/IE7
  Great Article om Master Pages
  Interesting Sharepoint Blog
  SUSHI - For Sharepoint
  Slow WSS - Warm it up..
  Modifying System Pages in Sharepoint Safely
  From the field (Microsoft Blog)
  WSS Wiki
  How to customise the SharePoint application.master file
  Sharepoint Branding Tool
  Batchprocessing List Items from C#
  Taming the Elusive “Calculated Column” - Customizing a Contacts List (Part II-III)
Last modified at 3/1/2010 15:23  by Normann P. Nielsen