Nick Grattan’s SharePoint Blog

About Microsoft SharePoint and some .NET

Archive for the ‘SharePoint Power User’ Category

SharePoint Versions – MOSS v. SharePoint Services

with one comment

In this post I explained how to determine if your SharePoint installation is service packed, and to what level. However, the situation is a little more complex since your MOSS 2007 farm will be running Microsoft SharePoint Services 3.0 and MOSS on top.

When using Central Administration / Operations / Servers In Farm to report the version number you’re seeing the Windows SharePoint Services 3.0 version number. This will be updated when you run the Windows SharePoint Services (WSS) service pack update.

So how do you find which service pack for MOSS you’re running with? One way is to find the version number of the Microsoft.Office.Server assembly from the Windows GAC (Global Assembly Cache). To do this:

  • Run the Windows Explorer.
  • Navigate to \Windows\Assembly.
  • Right-click the file Microsoft.Office.Server and select Properties.
  • Click the Version tab.
  • Take a note of the “File Version”:

ver1.PNG

Here are the version numbers for the main MOSS services packs using this technique:

Service Pack

WSS Version (Central Admin)

MOSS Version from Microsoft.Office.Server
Unserviced packed 12.0.0.4518 12.0.4518.1014
Service Pack 1 12.0.0.6219 12.0.6211.1000
Service Pack 2 12.0.0.6421 12.0.6420.1000

Version numbers from the Microsoft.Office.Server assembly do not follow exactly those for the WSS reported version number, but there is a close correlation.

Written by Nick Grattan

November 5, 2009 at 7:47 pm

Problem Solved: Amnesia Problem: Multiple Content Types on Libraries

with one comment

In this blog post I describe a problem whereby document libraries having multiple content types use the default content type when documents are saved regardless of the selected content type.

Well, thanks to Kevin at Dublin City Council, (that’s Dublin, Ireland) here’s a solution to this problem. It’s all to do with how you define the template for the content type using “Advanced Settings” for a content type:

ct3.PNG

First, if you “Upload a new document template” the problem described above does not occur. The correct content type will always be selected regardless of how many content types there are associated with the document library. However, your document template is not under version control and becomes more difficult to update using this option.

I normally use the “Enter the URL of an existing document template” and add the URL to a document library containing content type templates (let’s call it “Content Type Templates Library”). That way, if the content type template is updated in this document library the new version will immediately be used. This is the situation where the wrong content type will be selected.

To solve the problem (and this is where Kevin comes in), you need to associate the content types with the “Content Type Templates Library”. The documents representing the content type templates need to have the content type they are being used in. Let me give an example:

Say you’ve got two content types: “CT1″ and “CT2″ and these use document templates called “DT1.doc” and “DT2.doc” respectively. The documents “DT1.doc” and “DT2.doc” are stored in a document library called “Content Type Templates Library”. Now, you need to associate content types “CT1″ and “CT2″ with “Content Type Templates Library”. Further, “DT1.doc” must use “CT1″ and “DT2.doc” must use “CT2″.

Once this has been setup, the content types “CT1″ and “CT2″ can be associated with a document library in which users will create documents. Now, new documents created by users will have the correct content type associated with them.

Written by Nick Grattan

October 30, 2009 at 8:27 am

My SharePoint Sites and “Members” Group

without comments

The “My SharePoint Sites” links facility is designed to provide quick and easy access to all sites to which you are member:

membergroup1.PNG

This facility is very well described in the blog post Overview of My SharePoint Sites and how the data is populated by Jerry Orman.

Sites in which you are a member are included in the list. What does “member” mean? In the simple case, it means that you belong to the group
designated as the “members” group for the site.

When you create a site and choose unique permissions you can specify a new group for site members. You can also change the “Members of this site” group through “Setup Groups for this Site” or create another members group:

Now, what’s strange is that it is the group “Project N Members” that is deemed to be a “members” group when it is created as a “Members of this Site” group and regardless of how and where it is used in the future.

Therefore, if you use this dialog to select another group that was not created as a “Members of this Site” (say “Project N Visitors”), the site will not appear in the “My SharePoint Sites” list.

Conversely, if you select “Project N Members” as the “Visitors to this Site”, the site will appear in the “My SharePoints Sites” list.

Note that when editing a group you do not get an opportunity to set the “Is Member” flag. However, if you look at the “Groups” table in the content SQL Server database you’ll find a “flags” column. A value of “0″ means the group is a “Members” group, and “1″ for other groups:

Please note I’m only showing the SQL Server Database table for illustration. Please do not modify the table contents directly.

Written by Nick Grattan

October 16, 2009 at 4:25 pm

Metadata, Default Values and Required Columns

with one comment

To improve the quality of metadata associated with documents it is advisable to make columns required:

req1.PNG

When applied to “Choice” types, the first choice from the list is automatically selected. Thus the user is not forced to make a choice, and the likelyhood is that the correct value will not be selected.

To circumvent this problem you can set a calculated default value that sets an empty string as the default value. This is an equal sign followed by two double quotes:

req2.PNG

Now, when a new item using this field is presented to the user a blank item is selected. If the item is added without supplying a value an error is presented:

req3.PNG

Written by Nick Grattan

September 22, 2009 at 9:20 am

Amnesia Problem: Multiple Content Types on Libraries

with one comment

Update Oct 30 2009: Here’s a solution to this problem.

There are many cases where you may want to have multiple content types associated with libraries. For example, a document library may be created for all documents do with a project. You may have different content types for project specifications, project plans etc. This can be easily done and is well documents. This results in multiple items displaying on the “New” menu, each of which can have different document templates and different meta data columns:

ct1.PNG

Now, when the user selects New + Content Type 2 the document template for Content Type 2 will be downloaded. So far, so good. Remember, though, that the document has not yet been created in the document library.

Once the document has been authored, the user will now save the document back to the document library, say with the name “document1.docx”. This is the point at which SharePoint suffers from amnesia. It has no idea that this document was created by the user selecting New + Content Type 2, and so when the document is saved SharePoint will use the default content type, which is “Content Type 1″ in this case.

ct2.PNG

In many situations, this does not matter. However, when the content types have different meta data associated with them, or different workflows or policies, the document will have the wrong processing applied. This can have serious problems, especially when documents are passed to records management.

This problem can be mitigated to an extent by having required meta data fields – in this case the user will be prompted by the client application to provide values, and at this stage the user will have an opportunity to select the content type. Alternatively, separate document libraries will be required for each of the different content types – but this compromises your taxonomy.

 

Written by Nick Grattan

September 3, 2009 at 2:49 pm

Adding Styles to “Full HTML content with formatting and constraints for publishing” Columns

without comments

In this last post we looked at using “”Full HTML content with formatting and constraints for publishing” column types in lists and document libraries. When using this control, you can mark text and then select a style to apply:

applystyle1.JPG

You can replace this style list with your own styles. To do this, create new styles that start with “ms-rteCustom-”. These styles can be placed in the page itself (if only available for that one page) or in CSS files used by the page. For example, you might want to add a new style of the “EditForm.aspx” page for the list or library in which the Full Html Control Column is used. To do this:

  • Using SharePoint Designer, open the “EditForm.aspx” page associated with the list or library.
  • Add a style using the New Style … link in the “Apply Styles” pane, eg “.ms-rteCustom-MyStyle”.
  • Save the file.

The style will be placed within a “<asp:content>” tag in the form:

applystyle2.JPG

Now, when the HTML editor is used, this new style will be available:

applystyle3.JPG

Note: The style list will only show styles when text is selected.

Written by Nick Grattan

August 18, 2009 at 8:07 am

Using “Full HTML content with formatting and constraints for publishing” Columns in Document Libraries and Lists

with one comment

You can easily add columns with the type “Multiple lines of text” to lists and libraries to allow rich text and HTML editing. However, the column type “Full HTML content with formatting and constraints for publishing” provides much better editing capabilities, including applying styles, table formatting and reusable content.

This post shows how to use this column type in lists and document libraries. To do this, you must first add a “Site Column” to the site using the column type “Full HTML content with formatting and constraints for publishing” and then apply this site column to the list or document library.

Note: You must activate the “Office SharePoint Server Publishing” feature on the site.

Here are the instructions:

  • Select the Site Actions + Site Settings + Modify All Site Settings menu command.
  • Click the Site columns link.
  • Click the Create link.
  • Enter a column name and select the “Full HTML content with formatting and constraints for publishing” column type.

htmledit1.JPG

  • Click OK to create the column.

The site column can now be applied to a list or document library:

  • Navigate to the list or document library.
  • Select the Settings + Document Library Settings menu command.
  • Select the Add from existing site columns link.
  • Select the column from the site column gallery:

htmledit2.JPG

  • Click OK.

Now, when you edit properties in the list or document library the full HTML publishing menu will be used:

htmledit3.JPG

Written by Nick Grattan

August 17, 2009 at 9:56 am

Logging in as a different user

with one comment

When using default.master in SharePoint users have the “Sign in as Different User” menu option on the “Welcome” menu to login as a different user. This is useful when testing security etc.

This menu is often removed when customizing sites – clients we find often do not want these options displayed. So how can you add a link to allow this facility for testing?

The “Sign in as Different User” navigates to the /_layouts/AccessDenied.aspx page, which displays thus:

Accessdenied

You’ll notice the link “Sign in as a different user”. From the browser status bar you can find the target of this link:

Accessdenied2

So, it turns out to login as another user you simply need to navigate to:

/_layouts/AccessDenied.aspx?loginasanotheruser=true

The standard browser username/password dialog box will be displayed without the “Access Denied” page being displayed to the user.

 

 

 

Written by Nick Grattan

December 3, 2008 at 1:11 pm

Changing Order / Hiding Columns in New / Edit Forms

with 13 comments

The default order of columns in New/Edit forms for lists and document libraries is typically the order they are added. In many cases you may want to change this order, or to remove columns from these forms.

Changing the column order is easy but the method depends on whether you have selected “Allow management of content types” for the list. See below if you have this option selected, otherwise you can:

  1. Open the list and select Settings + List Settings
  2. Select the “Column ordering” link under “Columns”.
  3. Use the “Change Field Order” form to change the order of columns.

Colorder1

You can only hide columns if “Allow management of content types” is selected! So, to hide, for example, the “Title” column you can:

  1. Open the list and select Settings + List Settings
  2. Select Advanced settings
  3. Click Yes for “Allow management of content types” and then click OK.
  4. From the list of content types, select the content type the column appears in, e.g. “Item”.
  5. From the list of columns for the selected content type, select the column (e.g. Title).
  6. Select Hidden and click OK.

Colorder2

Even if you have a single content type, selecting the “Allow management of content types” option does no harm, so this should work in all cases.

Note that when displaying the content type there is a “Column Order” link under the list of columns which can be used to change the order of columns.

In this example, “Title” is a required field, but you can still hide it. The form will allow the item to be created or updated even though a value has not been supplied.

Written by Nick Grattan

December 2, 2008 at 3:57 pm

Stubborn Publishing Pages

with 3 comments

This knowledge article describes the limitation with folders in the “Page” publishing document library – they are ignored by the publishing features and all publishing pages are placed in the root. That’s OK, I can live with that.

In a recent project, I wanted to create a new document library (“News Articles”) that used publising to maintain a list of news stories used by the site. So, I create a new document library, enable content types and add the “Page” content type from the “Publishing Content Types” group. Standard stuff…

Next to testing; I create a new item based on the Page content type, select the page layout and create the new item. The list of documents in my news article document library is freshed … and it’s empty. I try again – and again – and the document library remains stubbornly empty. I check the current view (is there a filter?) and permissions (I’m the site collection administrator); no luck.

Sometime later, I list of the content of the standard “Pages” document library created by the publishing feature. Lo and behold – all my new document pages are there! Rather than creating the new pages in my “News Articles” document library it placed them in the “Pages” document library.

So, not only does publishing ignore folders, it also ignores the document library you try to place pages in! We live and learn.

 

Written by Nick Grattan

September 15, 2008 at 3:27 pm