In the settings, select the languages that you would like to add (I only installed the Dutch Language Pack)
Leave the Overwrite Translations as it is for now, I’ll get back to that in a sec. Now go back to your original site. On the top right, select your Username. There you should now be able to select in which language you would like to see the site:
Leave it at English for now. Open the document library Shared Documents and add a column named MySpecialColumn, type text.
There we go, now change the site to Dutch (or whatever language pack you have installed). You should now see that the column names are being translated, but your new column’s name is not being translated.
Go back to the Document Library settings and change the name of the column to the translated name.
If you now switch to English you will see that the column is called MySpecialColumn, while in the Dutch site it will be called MijnSpecialeKolom. This enables the users to do the translations themselves. It would have been nice if in the interface, when we added a column that we could enter all the translations at creation, but it’s another step in the good direction 🙂 More on the multilingual aspect soon!
Exception: System.SystemException: The trust relationship between this workstation and the primary domain failed.
As I installed the language packs for SharePoint 2010 I ran into the Exception: Exception: System.SystemException: The trust relationship between this workstation and the primary domain failed.
The cause of this error, in my case, was that the SharePoint 2010 server was unable to contact the Domain Controller. Once that was sorted, I could run the configuration wizard just fine.
In the following HOWTO I will explain how you can create a list declaratively on a SharePoint site by making use of the Visual Studio 2010 Tools. In that list we will give automatically add the hotel conten type to the list so that the user can only add “hotels” to that list. If you do not know how to create a content type to achieve this, read the following blog post: https://koenvosters.wordpress.com/2010/04/27/howto-build-a-deployable-content-type-for-sharepoint-2010/
We will start from an Empty SharePoint Project. Rightclick the project, select add new item, List Instance.
Add the display name and description and change the list to instantiate to Custom List. If you want a specific url, make sure you specify this in the wizard.
This should result in the follwing xml being generated for you:
This List Instance will create a list based on the content type item. Once we deploy the solution we will see that a new list has been created called “List of Hotels”. Now we move to the steps to add this content type to a list. First thing to know is that we need to be sure that the list and the content type have already been installed on the server. How do we do that? We will create a new feature in our project and that Feature will have an activation dependency on the feature with the list instance and the content type xaml definition. At that moment the future binding the two together can only be executed when both content types have been created.
Add the feature, rename it to something meaningfull like ConnectingListCtypes and double click it. In that screen, give it as title Travel Agency. At the bottom of the screen you will see an area called Feature Activation Dependencies. Click on Add on the right side and select the feature with the list instance and the content type in it. Then click Add.
As we have two features it would mean the user would have to click twice to enable our Travel Agency list with content types. To avoid this behavior we will make the feature containing the list instance and the content type hidden. You can do this by going to the properties of the Feature and setting the property Is Hidden to false. That means that whenever I activate my TravelAgent feature it will automatically activate my depencies, invisible to the user.
Ok, so now all is linked together, all we need to do is write the actual code that will link the two together. First, we will add a Feature Receiver to the TravelAgent Feature. You can do this by rightclicking the feature and selecting “Add Event Receiver”. Uncomment the code of the FeatureActivated function.
In the code we will create an object for the list called “list” and an object for the contenttype called mytype. We will add this contenttype to the list and remove the existing content type called “Item” which the list was based on. Do not forget to call the update method on the list or the changes will not be submitted.
As the other feature is hidden you should only see 1 feature to activate in the site settings. Once you activate it, you should have a content type called Hotel in your site collection and a list called “List of Hotels” in your site. Adding an item in your list will present you the new content type. In one of my next posts we will be creating a custom field type so that we can assign “stars” to hotels in an easier way.
Comments are always welcome 🙂
On May 8th the first SharePoint Saturday is taking place. Organized by the BIWUG team this event will cover the following topics:
9:30-9:45 Welcome and Introduction
9:45 – 10:30 Visual Studio 2010 Tools for SharePoint (Karine Bosch)
10:40 – 11:30 LINQ to SharePoint (Serge Luca)
11:40 – 12:30 Client Object Model (TBD)
12:30 – 13:40 Lunch break with sandwiches and drinks
13:40 – 14:30 Sandboxed solutions (Steven Van De Craen)
14:40 – 15:30 MetaData in SharePoint 2010 (Joris Poelmans)
15:40 – 16:30 SharePoint, WCF Services en REST (Stéphane Eyskens)
16:30 – Closing drink
Don’t miss it, you can subscribe right here.
Open Visual Studio 2010, select SharePoint.
Select Empty SharePoint Project.
Select Item as Base Content Type
This will result in the following xml:
Note that I already changed the name, group and description to something more meaningful.
A content type is nice, but the real use comes from assigning some fields to it and making it available in a list. (our content type is based on item). The minimal xml for a field in a content type is the following:
You need to give a field an ID (Guid), a name and a type. For a list of the available types you can check out my blog post on available field types. As we are basing our content type on the item content type, we will already have a title field (which we will be using for the name of the hotel. Let’s add the following properties to our hotel
- Number of rooms – Number
- Pool – Yes/No
- Bar – Yes/No
- Stars – Number
Once we added all the fields, we will be adding a reference to these fields (who will result in site columns) in our content type with following syntax:
If you did all that correctly you should have the following xml.
Let’s deploy that to our SharePoint Server.
In the site settings of the site collection that we are deploying to, you should see the site columns under Travel Agency and you should see the Content Type under Travel Agency as well. You now succesfully deployed your content type. Once you link it to a list you end up with a hotel content type in your list.
In my next blog post I’ll handle linking this content type to a list in your project instead of doing it in the UI.
This post is a compilation of the fldtypes.xml and the fldtypes_*.xml files in SP2010 that gives a clear overview of the field types we can use. I haven’t added the use of each field yet as I need to test each field to get a good feeling of what it does.
Out of the box Field Types
GROUPBOARD Field Types
GROUPBOARD Upgrade Field Types (do not use)
Hold Field Types
Publishing Field Types
SPRating Field Types
TargetTo Field Types
Taxonomy Field Types
Error occurred in deployment step ‘Recycle IIS Application Pool’: The local SharePoint server is not available.
I installed the RTM bits of SharePoint 2010 during the weekend. When I was good to go! I started building my first SharePoint Project. Once I tried to deploy, all I got was “Error occurred in deployment step ‘Recycle IIS Application Pool’: The local SharePoint server is not available.”. It took quite a while to figure out what went wrong, and mainly thanks to this blog post I managed to get my stuff working. I personally don’t like to have to change the rights for every content database I create. Therefor, if you do not wish to dive into your SQL every time you want to deploy your solution on a different content database, give your user in SQL Server sysadmin rights. That way it will work for every content database.
NOTE: I got this behavior from installing SharePoint the way you should install it under a different domain account(DOMAINNAME\InstallAccount) and then using “my own account” (DOMAINNAME\Koen) to develop.