Developing a BDC Model on Visual Studio 2010 for SharePoint Foundation 2010 – Create, Update and Delete Methods and Solution Deployment

In my final post in this article on the new Business Data Connectivity Model in Visual Studio 2010 for SharePoint 2010, I am going to finish up by completing my BDC model to include Create, Update and Delete methods before packing the solution and deploying it to a production server. I’ll upload the final solution as well.
First of all, if I am going to add manipulation capability to the data, I need some persistency. For the sake of “quick and easy”, I have amended the Customer and Address classes to be Xml serialisable so I can persist to an xml file. Not a best practise approach I admit but this is not the focus of the blog.
Having added the necessary logic for creating, updating and deleting a customer record in my LOB project, I now need to set about mapping this with the necessary BDC model changes.

First up: Create.

In the BDC Method Details Window, drop down the Add a Method list and select “Create Creator Method”:

BDC Add Creator Method
This will automatically generate the expected parameters and the code behind method. Go to the BDC Model explorer and expand the Create method tree to expose the properties of the entity (NewCustomerEntity in my case). Select the Identifier property (CustomerId), and then in the Property Window, set the Creator Field property to TRUE:

Creator Field - True
Now, hook up the code behind method to the LOB method call. You will also need to ensure your entity class (CustomerEntity) as a parameterless constructor else this will cause a runtime error – I missed out his step initially and hit the error,

“Constructor on type ‘CrmBdcModel.CRMCustomerModel.CustomerEntity’ not found.”

Hit F5 to deploy. Before you jump into your new functionality, I found I had to remove the list and create a new external list in order to successfully use the new functionality. Once I had done this, I could click on the Create button and fill in the automatically generated form to create a new customer:

New Customer
It is worth noting that the method generated for Create returns the new instance. In the more likely situation where you would not provide the Id, this would be create by your back-end system and returned to you as the return parameter. You can modify the field settings so that this filed does not appear in the Create dialog. In my example, I simply adding in the Id manually, and clicked Save.
The setup for Update and Delete is very similar. Just be aware that you will need to set the Pre Updater and Updater fields to CustomerId when setting up the Update Method as below:

Pre Updater Field Update Method
The Delete method simply takes a CustomerId (string) and the In parameter. These two methods will then enable your Edit and Delete buttons when viewing a single item as well as adding them as options in the item the dropdown menu.

Deployment

Now we have finished the BDC Model methods and verified that it all works when debugging, we can move on to packaging the entire solution for deployment on a production server. You can test this out on your development machine too as you will perform the same steps.
When you debug your solution, it automatically creates a wsp file in the bin directory. This is the file that needs to be deployed. If it is not present, then right click on your BDC project and select “Package”. I found there were a couple of stumbling blocks to deployment that you may or may not experience yourself.
Firstly, on both my SharePoint 2010 Foundation systems, the SharePoint Administration Service was not set to start automatically. Without this service, your deployment of the solution will fail. So it is worth checking your services and starting this service if necessary:

SharePoint Administration Service Not Started
Second quirk was that the deployment of the solution in Powershell would added as a scheduled job but this would never seem to run so I had to cancel the job and perform the deployment inside the Central Administration Console. Before you get to this stage though, you need to add the solution using the SharePoint PowerShell. You will find this in Start -> Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell (you will need to run it with Admin privileges). In the console, navigate to where you have copied your wsp file, and add the solution into your SharePoint Farm with the following command:

STSADM –o addsolution –filename CrmBdcModelPackage.wsp

You can then try to deploy the solution with the following command, however this did not work for me:

STSADM.EXE -o deploysolution -name CrmBdcModelPackage.wsp -immediate –allowgacdeployment


What I had to was log into the Central Administration console and take the following steps:
1.    Go to System Settings -> Manage Farm Solutions

SharePoint 2010 Foundation - Central Administration - Manage Farm Solutions

You should then see your added solution (but not yet deployed):

SharePoint 2010 Foundation - Farm Solution - Not deployed
2.    Click on your solution, then click “Deploy Solution” in the next window

SharePoint 2010 Foundation - Farm Solution - Options
3.    You will then be presented with options for deployment, but if you leave everything as it is, this should deploy the solution immediately:

SharePoint 2010 Foundation - Farm Solution - Deployment Confirmation

4.    Once you have completed these steps your solution should be successfully deployed and ready to use to create an external list:

SharePoint 2010 Foundation - Farm Solution - Solution Deployed

That’s about it. I’d love to hear from anyone else who has gone through the same experience and get any thoughts or suggestions on where this process and be improved. If you do download the solution, remember to set the SharePoint project to point at your local install of SharePoint and to change the path to the temporary xml customer data file as necessary.

The solution can be downloaded here

, , , ,

No Comments

Developing a BDC Model on Visual Studio 2010 for SharePoint Foundation 2010 – The BDC Model and external references

In my previous post, I quickly walked through setting up, creating and deploying a BDC Model Project on to a local SharePoint Foundation 2010 system from within Visual Studio. Whilst it covered areas that others already have, I hoped to bring it all together in a step by step guide so that others in the same position I was may be able to avoid some of the nasty pitfalls in getting past that first hurdle. Now that we’ve got to this stage, I want to dive a little deeper into understanding how the various components fit together before I extend the project by referencing an external project. After all, the whole concept of BDC is to allow external LOB systems to be brought into your SharePoint arena so this should be a common scenario.

First of all, let’s take a look at what the BDC Model in our project is made up. When you create a BDC model project, a new explorer window becomes available to us – the BDC Explorer. This allows us to navigate through the various components of our model and make the necessary changes to build it into what we need. You’ll notice within your solution explorer as well that your BDC Model is a special folder that incorporates the following components:

BDCModel1

   > BDCModel1.bdcm

      > BDCModel1.bdcm.diagram

   > Entity1.cs

   > Entity1Service.cs

The BDCModel.bdcm.diagram is simple an xml definition of the design layout of the Model diagram. To see how these solution items fit with the BDC components viewed in the BDC explorer, it is best we view the BDCModel1.bdcm file as Xml:

SharePoint 2010 Foundation and Visual Studio 2010 - BDC Model Xml with mapping to BDC Model and Solution Items

Excuse all the arrows but I’ve attempted to show how the elements within the actual Model relate to their components within both the BDC and Solution explorers. You can see from the xml that the parent object is the Model itself, naturally. This relates to the BDC Model view within your Business Data Connectivity Models page within the Application Services section of your SharePoint Central Administration.

A model comprises of a number LOB systems (in our case, just the one). These systems can either be a DotNet Assembly (connector), WCF or SQL. In our instance we are creating a DotNet connector. It is this system that appears under the “External Systems” section in your SharePoint Admin Application Services Page.

An External System can contain one or more Entities, referred to as External Content Types in the SharePoint Admin Application Services Page. In our case, this is Entity1. Note that this is not a direct mapping to our class, Entity1, but simply a description of the external content type. It is this component that defines the LOB system service class that defines the CRUD methods for interacting with our 3rd party system. Within each Method declaration, you can see the mapping to the method name (e.g. ReadList), and the mapping to the return parameter (IEnumerable<Entity1>). The BDC Model definition has to then dive even deeper though and describe the mapping to the type returned in the list (Entity1) and further more into the properties to be returned within that type. This is obviously quite a bit of manual work but I don’t expect the entities would change much, and if they did, only to include extra properties.

Now we can see how everything relates to solution items, BDC Model components and how they are reflected in your SharePoint Central Admin Service Application pages, we can start to create a BDC Project that reflects something close to a real-life scenario. Let’s take a common ERP scenario such as CRM. Most enterprises use some sort of CRM system to manage contacts and leads and yes, most of these systems offer some sort of connectivity to SharePoint but let’s assume we want to create our own connectivity through the BDC Model to surface Customer information. It is irrelevant how we retrieve this data – it could be directly from a SQL DB, via a WCF service, through an API, it doesn’t matter. All I am trying to demonstrate is that this happens in an external project that knows nothing of SharePoint at all.

CRM System

For ease of reference, I’ll create my CRM Connector Library project in the same solution as my BDC Model but note this is not necessary. Obviously I am not going to replicate an entire CRM connector library so I’ll stick to a subset containing the following:

CRM Customer Class Diagram

I have faked some data to provide a list of 4 customers. Before I reference this project in my BDC Model project, it makes sense if rename my necessary components so they are more relevant. Just be aware that the renaming of classes, namespaces and files needs to be done with caution as you must ensure you marry up any changes in all places. You may find it easier to begin a new BDC Model project from scratch. Either way, my new CRM BDC Model project is reflected in the screen shot of the solution explorer below:

CRM BDC Solution Explorer

To map the external entities (Customer, Address) across to my BDC Model, I have only been successful thus far in flattening the entire composite structure (i.e. Customer & Address) into the CustomerEntity class. When adding a Type descriptor into your BDC Model Return Parameters, whilst you can set the type to be one within your project, unless that type has an override ToString method, the property will not appear. If you have a encapsulated composite type, such as Address, the only way to surface this information is to flatten the Customer class properties, along with its Address, into the CustomerEntity class. I did try to add a second entity class, AddressEntity and then reference an instance of this type within CustomerEntity but my attempts to extract the data via the LOB Name property in the BDC Model resulted in an error. I would be interested to hear from anyone else who has looked into this and to learn if there is a best practice approach to this scenario.

For now though, my CustomerEntity class has all properties relating to both Customer and Address, and my new BDC Model is as below.

BDC Model Customer Entity

The three attributes worth noting when it comes to naming are as follows:

1. Type Descriptor: property name as appears in the list. This is the minimum and will be used for referencing the LOB property name and providing the default column name if none other is set.

2. LOB Name: property name as appears in the entity class you are referencing (i.e. Customer Entity). Must match exactly class name but need not match Type Descriptor.

3. Default Instance Name: name as should appear for column in SharePoint need not match LOB Name or Type Descriptor.

Because of changes to the Model name, feature name etc. you should not expect your previous external list to work. Because debugging ensures the retraction and deleting of previous models, if you did try to access the original external list you created, you will see the following error:

External List Error - missing BDC Model

What I have also discovered is that, whilst the Visual Studio debugger will clean up your deployed BDC Model and External Content Type, it will not touch the LOB system within the Service Application Section. When I deploy my new CrmBdcModel, the previous BDCModel1 LOB system was still present.

We are almost finished but we have missed one last step. If you have deployed your project, with its new external reference, you will probably find that when you come to create your list, it errors when trying to view with an error alongs the lines of,

̋MethodInstance with Name ‘ReadList’ on Entity (External Content Type) with Name ‘CustomerEntity’ in Namespace ‘CrmBdcModel.CRMCustomerModel’ failed unexpectedly. The failure occurred in method ‘ReadList’ defined in class ‘CrmBdcModel.CRMCustomerModel.CustomerEntityService’ with the message ‘Could not load file or assembly ‘MyCRMConnector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ee909816b5cd7af9′ or one of its dependencies. The system cannot find the file specified.’

This is because we need to tell the package to include the external project reference. To do this, double click on the Package.package component

Package

then click the “Advanced” tab at the bottom of the Package screen

Package Advanced Tab

Click Add and choose “Add Assembly from Project Output”

Add Assembly from Project Output

Select your external project and leave all other settings

Add Assembly from Project Output Dialog

You should now see your assembly added as part of your package

Project Output Assembly added

You can now hit F5 and the necessary project reference will be included in your solution and you can create your external list of customers successfully

External Customer List

In my next post on BDC Models in SharePoint Foundation 2010, I’ll walk through taking this project from the development environment and deploying on to a production SharePoint Foundation 2010 Server.

, ,

2 Comments

Developing a BDC Model on Visual Studio 2010 for SharePoint Foundation 2010 – Install, create and deploy

The following articles will cover the creation and deployment of a BDC Model on Visual Studio 2010 (i.e. a .Net Connector Assembly) on to a SharePoint Foundation 2010 installation. I intend to cover the entire walkthrough as I experienced it, as I found the whole experience to be a little disjointed. Hopefully this blog, along with others that I’ll reference will help others get through the whole experience a little quicker than I did! I am relatively new to the SharePoint Development arena so I’d love to get some tips back from any of the pros out there.

I intend to split this blog into multiple posts for ease of reference. Eventually, I hope to cover the following:

  1. Installing SharePoint 2010 Foundation on Windows 7
  2. Setting up your first BDC Model project for SharePoint Foundation 2010
  3. Deployment of your BDC Model to SharePoint Foundation 2010 via Visual Studio
  4. Adding, and successfully deployment external project references to your BDC Model project (later post)
  5. Packaging your BDC project for deployment on a remote SharePoint Foundation 2010 system (later post)

Requirements/ Setup

For the above to work, I had/ needed the following setup

  1. Windows 7 Enterprise Development machine (x64 – is a *must*)
  2. SharePoint Foundation 2010 (http://www.microsoft.com/downloads/details.aspx?FamilyID=49c79a8a-4612-4e7d-a0b4-3bb429b46595&displaylang=en)
  3. SharePoint 2010 SDK (beta only available at this time but do check for updates – http://www.microsoft.com/downloads/details.aspx?FamilyID=f0c9daf3-4c54-45ed-9bde-7b4d83a8f26f&displaylang=en)
  4. SharePoint Designer 2010 (http://www.microsoft.com/downloads/details.aspx?familyid=D88A1505-849B-4587-B854-A7054EE28D66&displaylang=en – Office 2010 32 bit is recommended even if you do have an x64 machine unless you deal with significantly large (> 2GB) excel data)

Step 1 – Installing SharePoint Foundation 2010 on your Windows 7 machine.

Follow the Microsoft help page here (http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx) and ensure you pay particular attention to the IIS setup and do not forget the Windows Identity Foundation. Missed steps may allow you to still install Foundation but will cause you untold grief when it comes to getting your project to work successfully.

If you have any beta version of Foundation already installed, I strongly recommend you perform a clean uninstall (removes the data) and delete any WSS Virtual Directories in IIS.

Also, don’t forget to install the SP 2010 SDK else you will not be able to access the VS templates to create your BDC Model project

Step 2 – Create a BDC Model Project

Select Create a New Project from the VS 2010 Welcome Screen:

Expand SharePoint under your preferred language tab, select 2010 and then choose “Business Data Connectivity Model” as your template. Click ‘OK’ and then you’ll be asked to verify the name of your local SharePoint server. BDC Model .Net Connector assembly projects can only be deployed as Farm Solutions so you will not be given the option to deploy as a sandboxed solution.

Once this has been done, you should be facing your new BDC Model project with the Model view as the opening page as below.

I strongly recommend you do not make any changes yet. In order for you to successfully deploy your BDC Model project to SharePoint *Foundation* 2010, you’ll need to follow the steps outlined in this post http://blogs.msdn.com/vssharepointtoolsblog/archive/2010/04/02/deploy-a-bdc-model-project-to-sharepoint-foundation-2010-using-visual-studio-2010.aspx)

Again, I strongly recommend you do not make any other changes that those stipulated in the post and aim to achieve a successful deployment first. By doing this, it is far easier to identifier and rectify any issues you hit should things not work as expected.

I did make a small change from the post above, but a logical one. I changed the namespace for the Feature1.EventReceiver class to match that of my project’s namespace (BdcModelProject1.Features.Feature1) and I left the created Guid for the same class in place. If you also change your namespace, make sure you amend the Feature Receiver Class properties for both the BDC SPI property and the feature property (i.e. mine now read BdcModelProject1.Features.Feature1.ImportModelReceiver)

Once you have made the changes, build your project and then F5 it. You should then be presented with the home page of local SharePoint site. I would recommend debugging rather than deploying at this stage as this action performs the necessary admin steps for retracting and deleting your project once you stop debugging.

Before you dive in to play around with the BDC connector, it is worth opening up the SharePoint Central Administration site from the Start Menu to see what has changed behind the scenes, and to verify it has indeed been successfully deployed. In Central Administration, click on “Manage service applications” under Application Management. You should see on the loaded page that the Business Data Connectivity Service is hyperlinked.

Click on either link. I am assuming both links are active because I am running a single machine instance of Foundation and therefore the service is running on this machine. On farmed instances, I suspect only the Proxy service would be active. In any case, you should see in the next loaded page your BDC Model project showing up as Entity1. Note that this page is referred to as External Content Types, but you can view the BDC Models and the External System by selecting them from the highlighted dropdown box. By debugging your project, Visual Studio should have deployed the package which would have created your External Content Type (Entity1), your BDC Model (BdcModel1) and the External System (also referred to as BdcModel1).

The External Content Type is representation of the object through its properties, identifiers and methods. The External system is the Line Of Business (LOB) system that incorporates one or more External Content Types. The BDC Model describes the LOB systems and their entities.

By debugging, Visual Studio should have also have given you the necessary permissions to execute the methods on your External Content Type. This can be checked by hovering over Entity1 to bring up the dropdown arrow and expanding the dropdown menu, then selecting “Set Permissions”. I find on my home machine, which is not on a domain, this step of adding the permission fails as shown below:

If this happens to you, simply type in your username, click the finder, then Add, before setting yourself the necessary permissions as below

Now go back to your SharePoint home page which should still be under a debug session. Click on Site Actions and select “More Options”, select “External List” and click “Create”

You should now be presented with screen prompting you to enter the details. The last section asks you for the data source configuration, click on the “Select External Content Type”.

If you were in successful in deploying your BDC Model, and ensuring you have the necessary permissions you should see your Model available to you. Select it and click ‘OK’, then Create back on the main screen.

If all of this succeeded, the External List will be created and you will be re-directed to its page as below.

The identifier also provides the link to the individual item. Click on this and you should see an Ajx dialog with the individual item details.

In the next post, I intend to dive deeper into the BDC model to pick out the driving components for manipulating the entity properties, its methods and how to add an external reference into the mix.

, , ,

No Comments

Blog sabbatical

It’s been a very long time since I last posted. The past 12 months have been a roller coaster of a ride with house purchases falling through, missing hamsters, expectant partner (of child, not of me, that is). More recently though, things have settled and I have begun to take a deeper dive into technologies new and old. Before I welcome my daughter into the world in August, I thought it best to get back into my blog to record what few moments of serenity (or should that be sanity?!) I can still enjoy. Hopefully I’ll gain some momentum, particularly in the SharePoint 2010 arena which is currently peaking my interest somewhat. If I have failed to respond to any comments, please accept my apologies. I have now update my WordPress engine and the comment notification appears to be now working.

No Comments

Inbox, Outbox, shake it all about box.

I spent yesterday at the INBOX/OUTBOX conference in London trying to gauge the industry’s opinion on Email. It’s a well know fact that whilst designed as a communication tool, most corporate employees will recognise a plethora of other uses ranging from collaboration to document management. Our reliance on email has now peaked to the extent that most of use could no longer work without it, yet most of us blame it for stopping us from getting our work done! Behavioural habits aside, there is a more serious side to this waste dump approach to email. Legal compliance, data protection, business process efficiency are all at risk by our nature to run it all from our inbox. I can scan my inbox now and out of 100 emails, less than 15% are communications for me to act on. The rest are company announcements (plus the inevitable reply-to-all fallouts), confirmations, status updates and the dreaded attached documents. I’m not saying that email is not the easiest way to distribute such knowledge and information, but the whole structure of an email system does not lend itself towards a conducive business practise. In essence it’s a list. A list ordered by date usually with a header of sender and subject. OK, perhaps you are of one those organised people I hear about and you’ve created a beautiful, hierarchical folder structure in your inbox but a) my emails come in faster than I can file them and b) before I can search for an email, I have to remember in which folder it resides (admittedly I can get around this if I click on the advanced find button).

So I was intrigued as to how various industry experts envisaged the future of email and what systems were being plied as the super saviours to this potential timebomb. A number of terms/ buzz words came out of the sessions which are worth noting/ dropping into dinner table conversations.

1. Litigation Readiness, i.e. are you ready to be sued? The idea that it’s not the legal action you should be concerned about but simply the legal cost it will incur whilst your lawyers dig around your exchange server searching for those emails that will prove (or disprove) your legality.
2. Email Archiving & Findability (or eDiscovery) - how many of us archive our company emails to the local hard drive then find out they can no longer find them when their hard drive fails (“What? It’s not on the exchange server?!”)
3. Enterprise 2.0 – not suitably happy with Web 2.0, Enterprise 2.0 is the merging of Web 2.0 technologies, such as Twitter and Facebook, with existing business tools such as exchange server to provide a more user-friendly interface but maintaing a corporate focus

I also picked up a few interesting facts on the day as well:

  • The biggest growth on Facebook over the past year has been in the 35 – 49yr old age group
  • The number of 55yr+ joining Facebook in the past year is double that of under 18s.
  • 38% of people spend more than 2 hours in their email per day
  • Only 28% of companies insist on using paper or fax for recording committments, obligations or contracts. The rest use email.

What has become apparent is that more and more professionals are becoming accustomed to using smarter tools to collaborate. What they lack is an integrated, inter-connected approach to doing this at work. And so they use email. Google’s Wave is one upcoming candidate that attempts to tackle this issue but there is no doubt a host of other solutions are arriving at the market as we speak. I, for one, think this is the start of a revolution. Many have suggetsed the death of email is nye but I cannot see the unstoppable beast becoming usurped in the near future. What I believe will happen, though, is a make over for Outlook. A shift from email focus to communication focus. An interface whereby you receive a communication, not an email. This may be an message, but it could be a voicemail, a voice call, a video call, a document, a calendar invite etc. The criteria by which such communication gets stored can be determined by its content. So if you need to send somebody a document, you send a document, not an email with a document attached. This should not preclude the ability to attach a message to the communication but herein lies the crux of the issue. Is it a comment, or is it an instruction or a request? If it is one of the latter, then perhaps you should not be sending a document but creating a task or submitting a request and the document is a corresponding part of that communication. Imagine if the whole process began with the who and not the what. Rather than having to decide whether you are creating a message or a request, you find the person you want to communicate with and the options are presented to you.

If all corporate communication could be centralised this way, then it would ensure the viability and security of its content, but would not guarantee it accessibility. In order for such an approach to work, the search facility would need to be both intelligent and efficient. This will obviously depend on the quality of data but in a domain-centric environment where all communication should have an identity attached, it should be a natural assumption to make that any communication would hold vital metadata to aid both deep and sematic search capability.

A semantic search engine layered on top of a centralised communication hub with an interface to match? That has to be a winner for any corporation above a certain size. Add in voice-to-text capability, a workflow engine and some decent VOIP and video hardware and you’ve got yourself a tasty solution.

So, if you are at work and you’ve just received another email, check to see if it’s simply just a message or one a call to collaborate on much more. Then check the size of your inbox, and then see where your archived emails get sent. It’s only the tip of the iceberg but it could the start of something beautiful!

,

No Comments

VS2010 Beta 1 Ships

Visual Studio 2010 Beta 1 has finally shipped and can be downloaded here.

Jason Zander has been discussing the new features in his blog which you can catch up on in full details here.

The main highlights that excite me the most are as follows:

  • Tools Extension Manager – provides a built-in one-stop-shop for downloading and installing new templates and other goodies directly from within VS
  • Office Programmability – simplifies MS Office programming allowing simpler and therfore more readable code to be created for Office applications
  • Sequence Diagrams – generates a sequence diagram of your code so you can understand the code flow better
  • Layer Diagrams – view your entire system at the block level so you can check layering and ensure correct architecture from a high level
  • Test and Lab Manager – a new test centre that does not require the full VS install
  • TFS Reporting improvements – TFS web interface, MOSS integration, hiearchichal work tasks and more to better aid project monitoring

I’m looking forward to playing with some of the new features immediately, but, overall, what excites me the most is the project and architectural orientated improvements.
The success of a software project nowadays is no longer down to just the quality of the code but the planning of both the project and architecture and VS2010 is looking towards bringing all these necessary requirements together. Happy Days!

No Comments

WSS, SharePoint and a good ol’ game of licensing

Historically, as a developer, you’ve always known about SharePoint, but it was always the giant at the other end of the playground that you never felt would come close enough for you to feel to threatened. As long as you stayed away from high-end bespoke enterprise development, you could leave the embattled IT managers of this world to try and restrain the beast.

But, just as you felt comfortable enough to take your eye off it, MOSS’s little brother, WSS, joined your school and, whilst smaller than big bro, he’s got that same swagger, that confidence and, what’s more, here’s in your year and organising all the games you liked to play.

He’s also giving sweets away for free.

So now you’re worried if you don’t join in, you may alienate yourself. The problem is twofold: firstly you need to find out how he plays these games so that you get along with him and, secondly, whilst it seems free to join, you’re not sure if that’s an open invitation for you to bring your mates with you. Maybe you can bring your mates, but what about your extranet partners and customers who want to join in on the internet?

The first issue I describe in my abhorrently obscure analogical way is one of a technical nature and I will elaborate further as I delve deeper, but, here I want to discuss that other issue – licensing. Yes I said it. I apologise to those sensitive souls I have just offended with such colourful language. Unfortunately, there is no escaping the beast, El Licenso. Even if you are a developer, there can be nothing more dejecting than spending time on a great solution if you are not aware of the entire deployment costs for that solution. Ultimately, it may well be down to the end user to ensure they meet the licensing requirements, but if you have not informed them, you could well be in for an uncomfortable conversation.

The most talked about issue concerning the licensing of Microsoft Products though, is not so much the cost, but the clarity. And therein lies the crux of the problem. People are not just unsure about what licensing they may require for a proposed solution, but what licensing they should currently have. It’s like opening the Pandora’s box of IT infrastructure. Once you’ve decided to take stock on what started as a simple audit, the fear is that you may end up with no new hardware but a hefty bill running into the many thousands.

So let me cut to the chase. I want to dispel a few myths and state a few facts. When it comes to WSS, the first fact is simple. It is free. The first myth is that you cannot use it externally. That is untrue. WSS *itself* incurs *zero* licensing costs in any setup you imagine. The costs you may incur are simply related to the server on which is it hosted and any SQL server instance that it uses. However, you may already have covered the license costs for these items and do not need to pay extra simply to use WSS. Rather than explain my findings in conversation that can suffer from ambiguity, let me list the various licensing costs of Windows Server 2008 and SQL Server 2008 regardless of whether WSS is used or not. First a couple of definitions:

User CAL – a license used *in addition to the server license* that covers 1 additional user to be authenticated against that machine. A user that is not authenticated by the machine does not require a CAL to use that particular machine.

Processor license- a license that covers an unlimited number of authenticated (or unauthenticated) users to access that particular machine. This license is used against a physically complete processor, not processor cores, so a Dual Quad Core Xeon machine requires 2 processor licenses, *NOT* 8.

Microsoft External Connector License (ECL)- a license that covers providing external access to your server from outside your internal network (i.e. a company website hosted on a DMZ for instance). This is required whether or not the external access is authenticated.

Now on to the flavours of Windows Server 2008 and their *approximate* UK licensing cost:

  • Microsoft Windows Server 2008 Standard (includes 10 CALS) = £1000
  • Microsoft Windows Server 2008 Enterprise (includes 25 CALS) = £2500
  • Microsoft Windows Server 2008 CALs (20) = £500
  • Microsoft Windows Server 2008 Web Edition Single Processor License (Internet, No CALs req.) = £500 *N.B* Cannot be used on an internal network, but does not require ECL.
  • Microsoft Windows Server 2008 DataCenter – 2 processors = £3000

N.B. Authentication is *NOT* limited to AD, but any form of authentication. The simple rule is that if any feature on the machine (IIS, Share Network Folder etc.) is setup to recognise individuals, then those individuals require a user CAL each. The exceptions to this rule are the processor license based DataCenter Server and Web Edition.

So far, so good. Now on to data storage. First of all, WSS does not use SQl Express. It uses SqlServer Embedded Engine. This is important as SSEE has *NO* data limit, whereas SQL Express has a maximum of 4GB.

Whilst this is great for data size, it may not be ideal for critical business practise that requires backup, reliability, fail-over, performance etc.

So, what are the costs of beefing up your data storage?

  • SQL Server 2008 Enterprise (Single Processor License) = £20000
  • SQL Server 2008 Standard (Single Processor License) = £5000
  • SQL Server 2008 Enterprise 25 CALS = £12000
  • SQL Server 2008 Standard 10 CALS = £2000
  • SQL Server Web Edition (Single Processor, Internet Only, no Cals req.) = £3000
  • SQL Server 2008 Standard User Cal = £150
  • SQL Server 2008 Enterprise User Cal = £80 (requires a 1 standard CAL per enterprise CAL)

So, using the above information as a guide, the following examples demonstrate the sort of costs you may face for various WSS installations. Please note you should be aware of other mitigating factors such as network bandwidth, hosting costs, back up requirements etc. all of which will impact the overall cost of any solution you may decide to implement. All costs are approximate.

WSS Install Examples

Example A: Internal server. No authentication. No external access.

1 @ 2008 Standard Server (10 CAL included)         £1000

Total:

£1000

Example B: Internal server. 50 *internal* Users authenticated. No external access.

1 @ 2008 Standard Server (10 CAL included)         £1000
2 @ 20 x 2008 User CAls                            £1000

Total:

£2000

Example C: Internal server. 50 *internal* Users authenticated. No external access. SQL Data Backup required.

1 @ 2008 Standard Server (10 CAL included)         £1000
2 @ 20 x 2008 User CAls                            £1000
1 @ 1 x Processor SQL 2008 Standard License        £5000

Total

£7000

N.B. must be hosted on a single processor machine

Example D: Internal server. 50 *internal* Users authenticated. External access for *unauthenticated* users.

1 @ 2008 Standard Server (10 CAL included)         £1000
2 @ 20 x 2008 User CALs                            £1000
1 @ Microsoft External Connector License        £2000

Total

£4000

Example E: Internal server. 200 authenticated external users (plus any number of authenticated internal users).

1 @ 2008 Server DataCenter                         £3000
1 @ Microsoft External Connector License        £2000

Total

£5000

Example F: Internal server. 50 internal and 500 + external users, all authenticated. SQL Data Backup required

1 @ 2008 Server DataCenter                         £3000
1 @ SQL Server 2008 Standard 1 Processor        £5000
1 @ Microsoft External Connector License        £2000

Total

£10,000

N.B. Single Process machine only

Example G: External server. No internal Users (AD). All users authenticated.

1 @ Server 2008 Web Edition                        £500
1 @ SQL 2008 Server Web Edition                    £3500

Total

£4000

, ,

No Comments

Replace Search Home page with default WSS Team Site on Search Server Express

I’ve been getting involved in WSS for the past few months now and recently, wanted to add the Search Server Express functionality into a test WSS site. Seemed like an obvious thing to do. Surely, it should work without a glitch, right? I’m sure there are step-by-step instructions out there for such a scenario but, being a bloke, I left them in the box and dove straight to my flat pack search express assembling. Of course, it didn’t go to plan, but that’s another long story so I’ve covered the pains and tribulations in an article here. What I want to discuss now is that, following a simple installation of Search Server Express, how you can go about retaining the original WSS Team Site as the home page:

  1. DO NOT install WSS 3.0 (uninstall if present and delete all DBs)
  2. Install SSE
  3. Go to WSS Central Admin -> Application Management
  4. Click “Delete Web Application”
  5. Only one should be present (default web app)
  6. Check “Delete Web site from IIS”
  7. LEAVE “Delete Database Content” as UNCHECKED
  8. Back in App Management click “Create or Extend a Web Application”
  9. Click “Create a new Web Application”
  10. “Use an existing IIS Web site” should be checked and showing as Default website (unless you have set up another website on your system)
  11. In the Application Pool section, set the Security Account option as Predefined, Network Service
  12. Click OK
  13. If this worked successfully, you should get a page refresh telling you the application was successfully created.
  14. Click on “Create Site Collection”
  15. Give it a title
  16. Leave Website address drop down as “/”
  17. Leave the template as Team Site
  18. Provide Site administrator
  19. Click OK

I hope that helps.

, , ,

4 Comments

WSS 3.0 and Search Server Express

If you are thinking of playing around with Search Server Express with an existing install of WSS 3.0, here a couple of pointers I came across whilst stumbling my way through it last week.

First off, SSE *is* WSS, simply another flavour. Install it after WSS and chances are, things will not work out the way you expect or want. You are presented with three options when you install SSE:

  1. Overwrite the existing WSS website
  2. Create a new website
  3. Don’t install a website

If you went for number 1, you won the holiday, but you lost the car. Your WSS default website has been replaced with a the SSE search page, your content is missing and you won’t find it in the SSE database. The reason for this is that SSE uses SQL Express 2005 or full SQL Server 2005. WSS uses the Sql Server Embedded Engine (SSEE). Finding either the WSS embedded engine or the SSE Express is not obvious either. If you are using SQL Express for SSE, it will create a new SQL instance called OFFICEEXPRESS. The WSS database connection is even more obscure as you need to connect to it using the named pipe protocol with the following string:

np:\\.\pipe\MSSQL$Microsoft##SSEE\sql\query

You will find your original WSS databases here. Good luck if you need to resurrect any of that data though. I’m certainly not covering it here!

If you chose option 2, you will now have a brand new SSE website and your original WSS website. Unfortunately, neither will play with each other as they are driven by separate databases and engines. You can set up the SSE content crawler to trawl through the WSS content but the UXP will remain distinctly separate. Not ideal for what I wanted.

So on to the third option. I felt good about this for two reasons. Firstly, if I did not install the SSE website, I would not lose the original WSS site and secondly, if I could then get a SSE site created within my WSS site, surely this would allow me to use the embedded SQL engine WSS uses to store the SSE crawled content. The benefit here is that SSEE has *no limit* whereas SQL Express used by SSE has a 4GB limit. Very nice. So off I went and, sure enough, SSE provided an Enterprise tab when creating a new website so I added a new SSE website to my WSS collection. Job done. Or was it? In short, no. When trying to set up SSE, I found that the whole permission structure had been thrown off by the inclusion within WSS. I has to change a number of account settings within the SSE admin section, service account settings and this took some time to rectify. I won’t go into specifics concerning services and settings I change as, even though I managed to get SSE up and running within WSS, once I rebooted, I hit a brick wall with the following error whenever I tried to search:

“Your Search Server Express License has Expired”

It seems apparent that, SSE is simply not permitted to work within WSS, most likely due to the aforementioned lack of SSEE limits. Microsoft are very good at ensuring that their licensing system cannot be circumnavigated. In short, for a stable, production environment you have two options:

  1. SSE with SQL Express and take the 4GB limit
  2. SSE with full SQL Server (standard or enterprise)

If you are wondering how much 4GB will get you, it’s about 400,000 standard docs, but if you are adding WSS content to that, it’ll obviously be less. If you want the WSS look, check out my other post to replace the SSE search page with the WSS Team Site.

, , ,

No Comments

Managed Extensibility Framework (MEF) in a nutshell

Next week, I’m off to listen to a talk on Microsoft’s Managed Extensibility Framework. This is another example of how to work smarter using frameworks, patterns and practices and I’m very much looking forward to it. I’m intending to dig a little deeper over the coming weeks but thought I’d give it a plug and describe how I understand it from a high level first look.

How it works

  1. Host app exposes itself and consumes extensions
  2. Framework provides infrastructure to discover and load extensions
  3. Extensions can be tagged with additional meta data for querying and filtering

What’s it made up of?

At a high level:

  1. Composable Parts – extensions
  2. Catalogs – responsible for discovering the extensions
  3. Composition Container – coordinates creation of composable parts and satisfies their dependencies.

Take it down a level:

  1. ComposablePart: offers Exports (services that other composable parts need) and consumes Imports (services from other composable parts that it needs)
  2. Export/Imports: each has a contract that is the bridge between an Export from one composable part to the Import on another composable part.
  3. Catalogs:  these provide access to the composable parts.
  4. Container: uses the catalogs to gain access to the composable parts and resolve the dependencies of each part.
  5. Export Providers: factories for exposing composable parts to be consumed by the container.

We’ll see if that it still the way I see it following a deeper dig and next week’s talk.

,

No Comments