Posts

Showing posts from April, 2008

Adding a custom content type to a site definition

Today we'll be a adding a custom content type to our site definition we created in this post . The project that we're working with is an STSDEV project, so my project file structure reflects that. If you aren't using STSDEV you may need to make a few modifications. If you don't know what custom content types are, here's a good overview . The content type we develop here will extend the Document content type. We'll call it a Project Proposal. Now let's get to work. Step 1: Project Set up Aside from basing this project on the site definiton I created earlier, we'll need to add the Feature folders that reflect the structure on the server. Right click on the TEMPLATE folder in your project and choose 'Add New Folder', name this folder 'FEATURES'. Then add a folder under 'FEATURES' called 'ProjectProposalContentTypes'. Step 2: The feature definition file Since we want to deploy this as a feature we'll need to create the fe

Creating and Deploying a Custom Master Page with STSDev

This is my second post on creating SharePoint solutions the easy way, with STSDEV. This time around I'll be enhancing my last post's project by adding a custom master page. This master page will start by using a base master page from Heather Solomon's site . If you don't already have it, download it. The base master page simply gives you a stripped down master page that you can enhance. We'll actually do some enhancements to give a taste of the power that you have over the UI when you choose to customize a master page. Step 1: Add the base master page to the project If you haven't already done so, download and unzip the base master page from Heather Solomon's site. Right click on your 'RootFiles\TEMPLATE\SiteTemplates\YourSiteTemplateName' directory and choose 'Add Existing Item' Select the base master page from your file system and click 'Add' Rename the file 'SharePointersDemoCustom.master'. Step 2: Editing the Defa

Deleting sites that were created with errors

This post will have something to do with my next post... When you are creating site definitions and deploying them via a solution, you may successfully deploy them and then find out there is a problem with them upon creation, i.e. you get an error message when creating a site using the definition through the UI. After the error occurs, the site may actually have been created, but does not show up in your navigation bar and the root of the site will be inaccessible. Interestingly enough, you can still get to the site's settings page by going to: http://serverName/siteName/_layouts/settings.aspx You can then delete the broken site from there.

Using STSDEV to create a solution with a Site Definition

In this post I'll give a basic overview of how to create a simple site definition using STSDEV. The purpose of using STSDEV is to give the project a standardized structure and to make use of the solution autogeneration. Here are the steps (Make sure you've downloaded STSDEV and run through the tutorials , or understanding this might be tough) Part 1: Generate the STSDEV solution Open Visual Studio and run STSDEV (should be an option on your tools menu if you ran through the tutorials, see above link) Choose to create an empty solution with C# assembly Click 'Create the Solution' After you create the solution, you'll need to open it from the file system. STSDEV does not automatically open it for you in Visual Studio. Part 2: Set up the project structure Even the most basic site definition needs at least 3 files: a webtemp.xml file, an onet.xml file, and a default.aspx file. So let's create these files in the appropriate places. right click on the 'Root

Security issue when calling a WCF service from SharePoint

I've recently been charged with integrating several WCF services into SharePoint and it's been relatively smooth sailing up until I began to receive the following exception: "The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate......." My endpoint configuration originally looked like so: <endpoint address="http://myserver/Services/BackOfficeService/basic" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBackOfficeService" contract="BackOfficeService.IBackOfficeService" name="BasicHttpBinding_IBackOfficeService" /> Looks ok, right? Wrong! We are missing the 'identity' child of the endpoint element. So, to correct this issue, the final product should look like this: <endpoint address="http://myserver/Services/BackOfficeService/basic"

STSDEV is pretty awesome, but...

I've begun using STSDEV as the start for my projects instead of VSeWSS. I like the simplicity of it, especially as Ted Pattison says in his first of three screencasts that you can load it into any installation of Visual Studio (that corresponds to the project type you created) because you don't rely on Add-ins/Extensions. After running through the screencasts, I decided it was time to do the solution release build and I ran into immediate trouble with a "ERROR: Could not find file DeploymentFiles\SoulutionPackage.ddf ..." error message in the Output Window. The solution, found on the STSDEV discussion board , is as follows: Modify the "ReleaseBuild" target in the DeploymentFiles\Microsoft.SharePoint.targets file as below (fix highlighted in bold red ): <target name="ReleaseBuild"> <message text="Deleting Pacakge File..." importance="high"> <delete files="$(ProjectDeploymentFilesFolder)\$(PackageFile)&

ASP.Net AJAX and SharePoint

There's a project on CodePlex that integrates ASP.Net AJAX with SharePoint: I've only read the overview, but I've had lots of projects that I've wanted to use AJAX with SharePoint. So I can see how this will be a tremendous help. http://www.codeplex.com/sharepointajax