Windows SharePoint Services 3.0 Notes

  • Microsoft has posted videos of several Office Developers Conference 2006 sessions which cover SharePoint development.
  • To put a SharePoint site into debug mode, set the following values in its web.config file:
    1. configuration.SharePoint.SafeMode.CallStack = "true"
    2. configuration.system.web.customErrors.mode="Off"
    3. configuration.system.web.compilation.debug="true"
  • To get data from an InfoPath form:
    1. Save the form as an .xsn file.
    2. Use "Extract from files..." to get the .xsd file for the form.
    3. Run the following at command line to generate a C# class from the .xsd file: xsd.exe FILENAME.xsd /c
    4. Use the following code to get an object representing the form:
      XmlSerializer serializer = new XmlSerializer(typeof(FormClassName));
      XmlTextReader xtr = new XmlTextReader(new StreamReader(workflowProperties.InitiationData));
      FormClassName frm = (FormClassName)serializer.Deserialize(xtr);
    This comes from the Microsoft's Office Developer Conference 2006 WS311 video, which has a complete overview of how to do this. Note that this only works in MOSS 2007, not WSS 3.0. (I don't remember this ever being said explicitly in the video, and it caused me some headaches before I finally figured out what was going on.)
  • Theme assets go in:
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES
    You also need to add the theme to
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML
    And theme thumbnails go in
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES

    When creating a new theme, you need to do an iisreset on the SharePoint server.

    When updating a theme, you need to go to each site using the theme, apply a different theme, and then apply the theme you changed to get changes to stick. (If anyone knows a better way of doing this, I'd like to know--I have about 12 sites/subsites all using the same theme and have had to change the theme CSS on occasion.)

  • Here's how I was able to move a SharePoint database from one server to another:
    1. Back up the database (either in SQL Server Management Studio or SharePoint Central Admin).
    2. Restore the database from backup through SQL Server Management Studio.
    3. Make sure that the account you're using to run SharePoint Central Admin has db_owner permission for the database.
    4. Create a new web application in SharePoint Central Admin.
    5. Remove the empty content database from the new web application.
    6. Add the database you just restored to the new web application.
    7. Run iisreset.
    8. As long as the same versions of the Web Parts you are using are deployed to the new site, you shouldn't require any further configuration in this area.
  • If you're going to use Forms Authentication with the ActiveDirectoryMembershipProvider, make sure that the user account SharePoint is using to do AD queries has the following permissions set in AD itself. (Otherwise, SharePoint won't be able to check the names you enter, and so you won't be able to enter any new users.)

    • Users container: Read all properties
    • Users container: User objects: Read all properties
    • Users container: InetOrgPerson objects: Read whenCreated

    You may be able to get by with fewer permissions, but this is what I ended up with through trial and error (and log file checking). Here's how to set these:

    1. Click on the object you want to set permissions for and go to Properties.
    2. Click on the Security tab.
    3. Click the "Advanced..." button.
    4. On the Permissions tab, click "Add..."
    5. Select the user account SharePoint is using to connect to AD.
    6. Click the Properties tab.
    7. Select which object this permission should apply to, and select which permissions should be granted.
  • So my previously posted list of steps to change the service account SharePoint runs under was pretty incomplete... and far more manual than it needed to be. Turns out Microsoft actually has a support article on how to do this.
  • Some Content Types (like the Calendar's Event) can't be used as the basis for other types directly because they're in a hidden Content Type Group. There is a way to change this, however:
    1. Create a calendar
    2. Under "Advanced Settings," allow management of content types for the calendar.
    3. On the calendar settings page, click on the "Event" content type.
    4. On the next page, click on the parent "Event" content type.
    5. Under Settings, click "Name, description, and group."
    6. Change the group from "_Hidden" to something else.

Post a Comment

To post a comment to this page, login below:

Email:
Password:

If you don't have an account, register here.