Skip to main content

Mark Stokes

Go Search
Home
People & Blogs
Twitter
Wiki
Events
Forums
Resources
Jobs
Support
Account
SP2010
  

Sharepoint Studio > People & Blogs > Mark Stokes > Categories
Adding Automatic SharePoint XML Intellisense to Visual Studio
Adding intellisense to Visual Studio for SharePoint based XML files (such as Feature.Xml files) is pretty easy. 
 
Open up the following directory (this is assuming Visual Studio 2008)
C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas\
 
Add a new file called SharePointCatalog.xml
 
Add the following XML to that file:

<SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog">

<Schema href="file://c:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/XML/wss.xsd" targetNamespace="http://schemas.microsoft.com/sharepoint/"/>

<Schema href="file://c:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/XML/CamlQuery.xsd" targetNamespace="http://schemas.microsoft.com/sharepoint/"/>

<Schema href="file://c:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/XML/CamlView.xsd" targetNamespace="http://schemas.microsoft.com/sharepoint/"/>

<Schema href="file://c:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/XML/CoreDefinitions.xsd" targetNamespace="http://schemas.microsoft.com/sharepoint/"/>

</SchemaCatalog>

 
Save the file and restart Visual Studio.  Now you should automatically get SharePoint XML Intellisense.
Determining Your Version of SharePoint
 
This content is in the Wiki and will be updated there as more updates are released for WSS3.0 / MOSS 2007
 
If you need to determine which version of SharePoint you are running, you can do the following:
  • Central Administration -> Operations -> Servers In Farm -> Farm Information: Version
  • Site Settings -> Modify All Site Settings -> Site Information -> Database Schema Version
These two options give you the Database Schema Version which you can reference against the list below:
 
SP2
12.0.0.6421
Cumulative Update KB956056 & KB956057
12.0.0.6327
Infrastructure Update KB951695 & KB951297
12.0.0.6318
SP1 + KB948945
12.0.0.6303
SP1 + KB941274
12.0.0.6301
SP1 + KB941422
12.0.0.6300
SP1
12.0.0.6219
October 2007 public update
12.0.0.6039
August 24, 2007 hotfix
12.0.0.6036
RTM
12.0.0.4518
Beta 2
12.0.0.4017
Beta 2 TR
12.0.0.4407
Office 12 PDC Pre-beta
12.0.0.311
 
 
References
A question about Workflow in SharePoint

I recently received this query from a colleague and thought the answer would be usefull for others:

Hi Mark,

Could you share with me a print-screen of how a work-flow is configured in SP-2007?

I am wondering to know the level of detail we can set in the system to program a work-flow such as sequential authorizations, parallel authorizations, etc.

Thank you in advance,

A. Colleague

That is a really difficult request to answer. Workflow is so big in SharePoint that there isn’t really a screen shot that can be taken of all the options.

Workflows can be created in SharePoint Designer and there are a initial number of Conditions and Actions that are available, however it is possible to write new Conditions and Actions for use in our workflow, which means what we can do in workflow is limited only to the code that we can write.

When looking at the live Global Collaboration Portal we are not going to be using SharePoint Designer for our workflows (not initially at least) for a number of reasons, but mainly because Workflows created using SharePoint Designer can only be used against the one single list that it is assigned to when created. This makes creating and testing workflows in a development environment very tricky as once the workflow has been tested it needs to be recreated by hand, from scratch in the new next environment along (Local, Dev, UAT, Production, etc) which gives us the risk of human error in recreating them, and no clear path to re-install in a DR environment, let alone reuse in another area of the site.

Later in the life of the Global Collaboration Portal we may allow Power Users to create workflows in this way for small workflows that are only appropriate in that area, with larger workflows being created in Visual Studio.

This brings us nicely onto the preferred approach, which is to create our workflows in Visual Studio. This alleviates many of the issues outlined above, but does carry a higher development cost. Our workflows created in Visual Studio are contained in a Source Control application, can be compiled and deployed to many different environments, and many different lists and document libraries in those environments.

When creating these types of workflow, we start with a blank canvas allowing us to model any process we can imagine (in bother sequential and state-machine workflows) and have the same (including a few other) Conditions and Actions available to us that we had with out SharePoint Designer workflows, and again we can write new Conditions and Actions to cover situations not covered by out-of-the box modules.

Regards,
Mark Stokes
Good Coding Practices: try / finally using() SharePoint Dispose()
This is a very good article outling common coding standards for SharePoint.
 
After experiencing bad code in a project a couple of years ago when SPWeb objects were not properly disposed, we had all manner of memory leaks and server issues.  A big code re-write was required which proved expensive and laborious.
 
Roger Lamb outlines good coding practices that EVERY SharePoint developer should adhere to.
 
Profile Property Questions

I wonder if anyone has any experience configuring profile properties in MOSS?

I am trying to customise users profiles so that the profile database can be nursed into becoming the corporate directory. Once I have setup the profile properties I can configure some custom search pages to give a pretty good corporate directory. However I have come across some pretty major limitations that I can't seem to get around.

1. Profile Syncing is one way, from AD to MOSS. If I let a user update their own information (all users should be able to update all their own details) then this will not be sync'd back to AD and the next import could overwrite the user entered data. Because of this, we probably won't store this user data in AD, but just pull in basic uneditable information (such as account and email details) and use MOSS at the authoritative source for everything else (not my personal preference, but not many choices without AD write back). This will require me to go through all profile properties and remove their bindings to AD fields, a long laborious job!

2. Reordering the Profile Properties is a right royal pain in the backside. Moving items up and down one by one with a refresh in between clicks takes foooooooorrrrevvvveeeeerrr.... I have written a small Windows App to make this a bit quicker that I will make available on CodePlex when I tidy a couple of bits up and add in support for editing sections and not just properties.

3. Changing the default properties. A lot of the default properties are locked so I cannot edit them. A Key example is Office. I have a choice list that I want users to select from, but since this was implemented at set to inherit from AD I cannot modify this Property to allow a choice list. I also am unable to delete it so I can create my own Office Property. My only option left is to disable the default property and create a new one with a different name, since Office will be used. Rubbish, what a waste of space and storage. Does anyone know how I can unlock these properties to make use of them?

4. Deploying Profile Settings between environments. There is no way that I know at the moment of deploying profile property settings between environments, which opens the door to days of manual editing to synchronize the settings between multiple environments. I will also guarantee that some errors or mis-configurations WILL get incorporated into this process. We are humans after all. Chris O'Brien has made a start on some code to move properties between environments, but this needs a bit more work, such as exporting sections and maintaining these section / relationship properties. I will endeavor to extend this and include it in the Profile Manager windows app I mentioned above.

5. User Profile Editing Page. Since I will have a lot of Profile Properties, and they are grouped into Sections, the Mange profile page for users ignores these sections completely. So they just have one long page of options. I will need to create a custom manage profile page to implement a reasonable user experience.

I would very much welcome comments on peoples views of these issues and would love to hear how other people have managed customizations of the Profile Database.

Thanks

Mark Stokes
SharePoint Studio
http://sharepointstudio.com

SharePoint ServerTemplate values
Thanks to Evan Grimmett for this list:
 
100  Generic list
101  Document library
102  Survey
103  Links list
104  Announcements list
105  Contacts list
106  Events list
107  Tasks list
108  Discussion board
109  Picture library
110  Data sources
111  Site template gallery
112  User Information list
113  Web Part gallery
114  List template gallery
115  XML Form library
116  Master pages gallery
117  No-Code Workflows
118  Custom Workflow Process
119  Wiki Page library
120  Custom grid for a list
130  Data Connection library
140  Workflow History
150  Gantt Tasks list
200  Meeting Series list
201  Meeting Agenda list
202  Meeting Attendees list
204  Meeting Decisions list
207  Meeting Objectives list
210  Meeting text box
211  Meeting Things To Bring list
212  Meeting Workspace Pages list
300  Portal Sites list
301  Blog Posts list
302  Blog Comments list
303  Blog Categories list
850  Page Library
1100  Issue tracking
1200  Administrator tasks list
2002  Personal document library
2003  Private document library
 
 
Changing Regional Settings for all sites in a Site Collection

Step 1 – Default Time Zone settings
Note: This step will not effect any sites currently created, but will be used in the creation of new sites.

  • Central administration
  • Application management
  • Web application general settings
  • Default Time Zone
    • Select time zone
      • GMT

Step 2 – Resent current Sites.

  • Navigate to any site in your Site Collection
  • Site Actions -> Site Settings
  • Site Collection Administration
    • Go to top level site settings
  • Site Administration
    • Regional Settings
      • Locale
        • Choose your required locale
    • Subsite Settings
      • All sub-sites inherit these Regional Settings
    • Click Ok

All sites in your Site Collection will now be updated with the required Regional Settings, and any new sites will also be updated.

How to: Customize XSL for the Content Query Web Part

A very useful article on customising the Content Query Web Part look and feel:

http://msdn.microsoft.com/en-us/library/bb447557.aspx
Can I view Document Library Columns with Content Types?
Question
If I have a Document Library that is set up to store Content Types, can I also make use of additional Columns set on the Document Library? Such as a Status choice column?
 
Answer
After adding the content type to a list, you can click to manage the content type and you can choose to add new columns from the list.
 
These changes to the content type are localised to the specific list.
Storing your development projects on a network share

For my development environment I use a Apple MacBook Pro and run my development environments in Virtual Machines under Parallels.

Since I am trying to centralise all my information and projects (I have a LOT of VMs for different projects) I try to store all my data in my Mac Home folders and then just share those user folders with each Virtual Machine This also protects me against a VM going belly up and loosing my code.

When you share your Home folders through parallels, they are mounted as mapped Network Folders, such as \\.psf\.home\.

If you try to open a Visual Studio Project from a network location, you get a very nice error box telling you that the project is not in a trusted location and you have a LOT of problems compiling and debugging.

I found this post that contains a very useful guide on how to enable Full Trust on your network location through the .Net Configuration tools.

I am using Visual Studio .Net 2008 and didn't need to perform step 2, in fact, I don't even see the Security Page, but have left it in, in case other people need to run through it.

STEP #1

Mscorcfg.msc
One simple way to modify the policy affecting a file share is to give a specific file share FullTrust permission using Mscorcfg.msc. You must be an administrator on the computer to make this change.

To give a file share FullTrust permission

  1. Start Mscorcfg.msc. or from the Start Menu, Admin Tools, Microsoft .NET Framework 2.0 Configuration
  2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, and the All_Code node.
  3. In the right pane, click Add a Child Code Group.
  4. Choose Create a new code group, enter a name (VS Developmenmt)for the code group, and then click Next.
  5. Choose a condition type of URL, and enter the UNC path to the share location of your project, using the format \\servername\sharename\* where \\servername\sharename (\\N5200\*) is the name of the share. Click Next.
  6. Choose Use existing permission set and select FullTrust, and then click Next.
  7. Click Finish.
  8. Select your new code group, right click, and select Properties
  9. Under the General tab, check the two boxes under the "If the membership condition is met" statement, then click Apply
  10. Close Mscorcfg, Reboot Machine
  11. Restart Visual Studio - You will now be able to create a new project without The Project Location is not Trusted Dialog Box. However, you will not be able to Debug until you choose a zone for your partial-trust application

STEP #2

Choose a zone for your partial-trust application

  1. From the Project menu, choose Projectname Properties.
  2. In the Projectname property pages, click the Security page.
  3. Select Enable ClickOnce Security Settings.
  4. Under Zone your application will be installed from, click the drop-down listbox and choose the zone you want to simulate the application being installed from.
    1. The Permissions required by the application grid shows all available permissions. The check mark indicates permissions granted to your application
  5. If the zone you choose was (Custom), select the correct custom settings in the Setting column of the Permissions grid.
  6. Click OK to close the property pages.

That should be it.  Happy coding!

1 - 10 Next