Thursday 30 July 2009

Sharepoint Site Columns Missing in Gallery

Here is a handy snippet of information.... if you are creating Site Columns via CAML and deploying them as a feature you may find that you have deployed the feature ok but they are not showing up in the Site Columns gallery.

The answer is that you probably declared the Guid for the Id in the CAML without the {} around them. This is one of the only places in Sharepoint where this is crucial...


Lets Share the Point !!!!!!

Tuesday 7 July 2009

Invalid FormatETC error and Sharepoint controls

There are some projects and tutorials out there that take you through creating Application pages. They take you through adding a an empty project and then referencing the Sharepoint control and then setting up the toolbos to show the Sharepoint controls... All well and good but when you go and drag a control of the toolbox and onto the page you get an error of InvalidFormatETC.

SOLUTION: Add a web.config file........... I hate all these tutorials that fail to accommodate the main reason for their existence of teaching newcomers to the technology by failing to think how somebody new to a technology would think.

Monday 29 June 2009

Content Types and WSS API

The WSS api is a powerful beast but as the old saying goes with great power comes great responsibility.

When you are adding content types note that they are just groupings of either existing or created fields. Now in a development lifecycle I am sure you will create a content type deploy and then find that you want to redeploy it with some additional features.

If the above scenario is the case then a word of warning.... if you don't delete the constituent fields before adding the augmented content type then you are going to be adding loads of fields again to the site and when it comes to using the content type it may look as if Sharepoint has not picked up your changes. However if Sharepoint has fifty fax number fields then how does it now which one to use?

Although this sounds obvious and as a new comer to Sharepoint this blog represents a newbie coding journey with the product you must always remember check for the existence of an object and delete it before redeploying it.


Saturday 27 June 2009

Sharepoint Web Services Errors

If you are trying to connect an application to the Sharepoint web services for example the list service then you might be experiencing some degree of pain. Specifically if you try to enter a web reference via the wizard you may get the following error

The document at the url http://localhost/_vti_bin/Lists.asmx was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Root element is missing.'.
- Report from 'http://localhost/_vti_bin/Lists.asmx'

Some sites have stated that you can remedy this by pressing service definition however I still got the error. Follow this method and it will work.

1) Apply latest WSS service pack and if necessary MOSS.
2) Paste the exact location of the web site whose list you want to access e.g.
http://mark-0f396c89fa/sites/MyTopSiteCollectionName/AgentB/_vti_bin/Lists.asmx?WSDL

Remember each site that includes subsites has its own web service.

To make doubly sure paste the url you created in stage 2 within the browser and the wsdl should be displayed if it is correct.

Friday 26 June 2009

Visual studio extensions and renaming sharepoint modules


If you get the problem in ESP view of many versions of the same feature normally shown as featurename_3
the cleanest fix is to go onto the filesystem where your visual studio project lives and delete the obp and pkg folders and then rebuild

-- Post From My iPhone

Wednesday 24 June 2009

Sharepoint Visual Studio Extensions Gotchas Day 1

Before I start I am going to caveat everything in this blog by saying I am only just starting out with Sharepoint and so am open to being challenged on anything within these articles.

I am developing Sharepoint and am using the Visual Studio Extensions and when I start a new Technology I like to get the structure of the project working within Visual Studio. I see this as a foundation for future development of the project. Now even with my lack of knowledge of all things Sharepoint the first thing that struck me was that it was a temperamental beast.

Firstly I am trying to implement Content types via the WSS API and specifically the SPFeatureReceiver class. Now the first thing that struck me was that due to development being iterative and requirements constantly shifting I would need to be able to deploy my content types on an individual basis what is the point of re-deploying all your content types just to implement a small change in one of them.

With this in mind I though I know within my solution I will have each individual content type in its own project that way I can deploy on a project by project basis. I will also have common code in its own project as a standard helper class. Good Idea but totally wrong.
I found out that even in helper projects you must specify the deployment site in the projects debug property url. Even when I put this in which seemed overkill and right clicked the project I wanted to deploy even though the context menu inferred I was only deploying the project I had right clicked on I was in fact deploying the whole solution and not just the project that I wanted..... (Again this may be newbie ignorance here so feel free to show me the errors of my ways). So I am now back at square one looking at the best ways to provision a site via the API and Visual Studio Extensions.

Oh also here is a tip for newbies always put code in the uninstall method to remove the feature item you have installed and better still put some guard code in the activating method to check for the existence of that item and remove it before re-installing it. Many hours of debugging and head scratching wasted over that one.

I fear this is going to be a journey.... sometimes not pleasant but always an interesting one..... I struggle on !!!!!!

Monday 22 June 2009

Features in sharepoint

Features are great but when starting out make sure that you uninstall them on a regular basis using the stsadm tool otherwise when you provision new sites or want to release the features again but with update functionality things get a bit messy.