Renaming a document – ”The Specified name is already in use”

A SharePoint document library in some ways acts similar to a folder when storing documents on your local computer. For example, you can’t have two documents with the same name within a document library (or folder, if you are using folders). If you try to rename a document and give it the same name as another document in the library, you will be given this wonderful error (in SharePoint 2007):
error
[Server Error in ‘/’ Application. The specified name is already in use. A document cannot have the same name as another document or folder in this library or folder. Click your browser’s Back button, and type a new name.]


This makes perfect sense, unless the “existing file” really isn’t there. I recently ran into an issue where a user tried multiple times to upload a document (PEBKAC) and finally, they received the error that they couldn’t add the document with the current name because it already existed. Somehow, the document they were uploading and checking-in was removed from the database, but SharePoint thought it was still there. So, they couldn’t upload a document or rename a document with that same name.
When I tried to upload a document to the library, I received the error below that says the document (which wasn’t really there) was checked-out to the user that was uploading the document from before.




[Error. The {filename} is checked out or locked for editing by {username}]
Again, since the document really wasn’t there, it was a bit frustrating, but this last error did give me insight into how to resolve the issue. The fix in this case was simple enough. After opening the document library’s settings, I opened the Manage checked out files page (selected from the Permissions and Management column).

error1

Since SharePoint did believe the document was still there, I am given the wonderful opportunity to “Take Ownership” of the checked-out document.

error2

After selecting the checkbox next to the document and clicking the Take Ownership of Selection button, the document was then checked-out to me. I then was able to upload a document with the same name (the library had versioning turned on, so I selected for it to add another version).

Custom Filter on a Data View Web Part (series part 3)

Data Views can be a very powerful tool when using SharePoint Designer 2007 in designing pages in your WSS 3.0 and MOSS 2007 environments (the same is true for SharePoint Designer 2010 and SharePoint 2010).
One of the requirements for my project is to display documents from two different SharePoint Document Libraries in one view and have the documents displayed in a specific way. The content is to be displayed in the table view as follows:

Document Icon Name Title Modified Date

To filter the list of items in the Data View, first I setup the Data View to display the content like I wanted. Then, selecting the Common Data View Tasks drop-down (as shown below), I selected the Filter: option.

tasks

The expression is pretty involved, but I cheated a little by using the Filter Criteria option. The expression I started off with was Modified Is Greater or Equal To [Current Date], as shown below.

basicexpress

I then selected the Advanced button (shown on the picture above) and I was presented with the advanced expression being used by the builder. I added “- 30” without the quotes to the expression.

expressionbuilder2

The whole expression ended up being the one shown below:
[number(translate(substring-before(@Modified,’T’),’-‘,”)) >= number(translate(substring-before($Today,’T’),’-‘,”)) -30]

Custom Column Data Display Names Using a Data View Web Part (series part 2)

Data Views can be a very powerful tool when using SharePoint Designer 2007 in designing pages in your WSS 3.0 and MOSS 2007 environments (the same is true for SharePoint Designer 2010 and SharePoint 2010).
One of the requirements for my project is to display documents from two different SharePoint Document Libraries in one view and have the documents displayed in a specific way. The content is to be displayed in the table view as follows:

Document Icon Name Title Modified Date

To show the name without the file extension, I added the Name field to the table, then converted the value to a Hyperlink. I then made the hyperlink value point to the file using @FileRef.

To remove the extension from the display, I built the display value using two different expressions, as shown below:
substring-before(string(@FileLeafRef), ‘.’)

full

Working from the inside out, ‘string’ converts the filename variable into a string so the next expression can work with the value. ‘Substring-before’ accepts two variables: the data value and what character to look at for stopping (which is the period ‘.’).

So, the full URL looks like: <a href=”{@FileRef}”><xsl:value-of select=”substring-before(string(@FileLeafRef), ‘.’)” /></a>

Custom Document Icon Using a Data View Web Part (series part 1)

Data Views can be a very powerful tool when using SharePoint Designer 2007 in designing pages in your WSS 3.0 and MOSS 2007 environments (the same is true for SharePoint Designer 2010 and SharePoint 2010).
One of the requirements for my project is to display documents from two different SharePoint Document Libraries in one view and have the documents displayed in a specific way. The content is to be displayed in the table view as follows:

Document Icon Name Title Modified Date

To show the Document Icon, I added the DocIcon field to the table, then converted the value to a Hyperlink. I then made the hyperlink value point to the file using @FileRef.
To point the DocIcon (which has a value of ‘PDF’, since all my documents were PDFs) link to the correct picture, I pointed to a pdf picture (pdf.gif) on my site. You could do this several ways, but I just put a PDF icon in a ‘system’ document library on my site. I also wanted to make my solution work if it was later decided to add documents to the displayed libraries that were a different type other than PDF.

So, in the hyperlink, I used the @DocIcon field in the src value:
src=”/site/system/{@DocIcon}.gif width =”17” height=”17”

A couple things to note about the link above: 1) it assumes all the images will be gifs and will reside in the same document library and 2) the images are all shown with 17 pixel width and height.

So, the full URL looks like: <a href=”{@FileRef}”><img border=”0” src=”/site/system/{@DocIcon}.gif width =”17” height=”17” /></a>

SharePoint Datasheet View and Office 2010 64-bit

If you have installed the 64-bit new version of Microsoft Office, Office 2010, then you will most likely see the following message when trying to edit a SharePoint list using the Edit in datasheet function:

The list cannot be displayed in Datasheet view for one or more of the following reasons:

– A datasheet component compatible with Windows SharePoint Services is not installed.

– Your Web browser does not support ActiveX controls

– Support for AxtiveX controls is disabled

 

The issue revolves around the fact that 64-bit versions of Office 2010 do not ship with the 32-bit Activex control that would make the datasheet option work with Internet Explorer.
There are ways to make this work, and the usual suggestion is to find a copy of an Office 2007 product and either install it (such as SharePoint Designer 2007) or just choose to install the Windows SharePoint Services components of the product. This works, but I don’t really want to go to that much trouble.
Another solution, and the one that I employed, is to install the 2007 Office System Driver: Data Connectivity Components. After installing the Components, go back to the menu and the datasheet option will work great.

Intermittent forbidden errors (403)

After applying a new master page and related theme components, we have been receiving reports that users were being presented with 403 ‘forbidden’ errors when trying to load our intranet site. After refreshing the screen four (4) times, the page would finally load.

I checked the web server’s Application log and found that every time a user received a 403 error, there was an “Information” Web Event message logged with a source of ASP.NET and an ID of ID 1314. The body of the event included, among other information:

Event code: 4011
Event message: An unhandled access exception has occurred.


After doing research and knowing this was most likely a security issue, I came around to fixing permissions on the Bin and _app_bin folders for the IIS virtual server that was hosting my SharePoint Web Application. I added the server’s local group “users” (which includes the domain group users) to both folders with READ permissions.

After an application pool restart, there have been no more reports of 403 errors and not a single 1314 report has been shown in the Application log.

Access Denied Message When Trying to Edit Properties of a List or Library Item

I created a new Office SharePoint Server 2007 Web Application a few months back and moved our existing sites around to create a new structure in the new Web Application. I did this to move all the project sites under one ‘roof’ and get things more organized. At the time, we were a little behind the curve on patching SharePoint. We were on version 12.0.0.6327, which is SP1 plus the August 2008 Cumulative update.

When new sites were created though, users were unable to edit the properties of anything they added to the site, whether a document or list item. As the SharePoint farm administrator, I received the Access Denied message as well when trying to edit the properties. The Access Denied message was also received when attempts were made to edit the properties of items within newly created Lists or Libraries on existing sites. Items could be added and deleted, but not edited.

While doing some research (see Technet Forums and Odole blog), I ran across several sites saying this was a known issue that is fixed in the February 2009 Cumulative update (for MOSS and WSS 3.0). I was told by Microsoft support after contacting them (see below) that the root cause is ACL corruption when the sites are moved.

After installing Service Pack 2 (for MOSS and WSS 3.0), and the latest Cumulative update (February 2010), the issue was not resolved for existing sites; but I expected this behavior. I contacted Microsoft support to obtain an executable (not publically available) that would fix the existing sites. After running the executable, the existing sites were all fixed and when I created a new site, it did not have the issue.

A screenshot of the fix program in action:

ListFixer

SharePoint 2007 and Office OneNote 2007

When looking to allow indexing of OneNote 2007 content (to allow for searching) within SharePoint Server 2007, I was directed toward this Microsoft KB: How to configure SharePoint to let you search OneNote 2007 content on SharePoint sites (KB925765). KB925765 describes the way to enable the indexing of OneNote content on MOSS 2007 using 5 steps:

  1. Install OneNote 2007 on the server
  2. Add…….

It really doesn’t matter what steps 2-5 are…step 1 really threw me for a loop. Install a Microsoft Office suite product on the server?!?!?! You have to be kidding me!

No Microsoft Office suite product (i.e. Word, Excel, PowerPoint, Publisher, OneNote, etc.) should ever be installed on a production server, IMHO! In fact, I would go as far to say it shouldn’t be installed on a development server either, especially if you don’t have a clean QA server because how do you know what you have configured on your DEV server will work on production when you have a client OS product (Office suite) installed on your DEV server?!

Seeing KB925765 got me worried, because people around my office hate it when a server admin says ‘no’ to a developer.

So, I kept looking and finally stumbled upon this KB: How to register Microsoft Filter Pack with SharePoint Server 2007 and with Search Server 2008 (KB946336). Ah, the wonderful Microsoft Filter Pack! The Filter Pack “includes IFilters for the following formats: .docx, .docm, .pptx, .pptm, .xlsx, .xlsm, .xlsb, .zip, .one, .vdx, .vsd, .vss, .vst, .vdx, .vsx, and .vtx.”

Following the instructions listed in KB946336 gave me exactly what I needed. There are also instructions on how to use the Filter Pack with WSS 3.0 and SharePoint Portal Server 2003.

Thank goodness I didn’t take the word of my fellow associate and go with KB925765!

Nashville SharePoint Users Group

If you are in the Nashville, TN, USA area and would like to hear wonderful SharePoint presentations, FREE! food, and great discussions with like-minded people, then come join us! The meetings are always free and open to the public.

Information concerning the Nashville SharePoint Users Group can be found here:

The Nashville SUG website also has copies of the . Some of the topics include:
-> Upgrading SPS 2003 Areas and Portals to MOSS 2007
-> Certification Options for SharePoint Professionals
-> Using K2 and MOSS for MOF
-> Free Tools for SharePoint 2007 and WSS 3.0
-> SharePoint Backup and Recovery along with Best practices for My Sites
-> A Practical Approach to SharePoint Content Management
-> …plus lots more!

Using STSADM to Add Permissions to SharePoint Sites

Recently I came across multiple WSS sites (v3) that someone else created. These sites are used by everyone in the company and were not provisioned correctly; the permissions were incorrectly setup.

So, instead of visiting every site and adding the appropriate permissions, I created a batch file that went through the sites and added several SharePoint groups and individual users to the sites in different roles.

The stsadm operation I used was ‘userrole’. The syntax of the userrole operation is as follows:
stsadm –o userrole –url <full url> –userlogin <domain\user or SharePoint group> –role <role, such as Contribute or “Full Control”>

I created the script in Excel so I could put it together rather quickly. I created three (3) columns in a new Worksheet.
-> The first column [A] was for the full URL of the sites
-> Second column [B] was for the following function: =”stsadm –o userrole –url “&A2&” –userlogin “&C2&”<SharePoint group name or domain\user>”&C2&” –role “&C2&”<intended role>”&C2
-> The third column [C] holds a double quote mark – “ (this is done so I can enter the “ symbol in the outputted text, but not within the function. The quote is needed in the output text because your SharePoint group or role may have spaces in the names)

For example, one of my cells in the [B] column looked like this:
=”stsadm –o userrole –url “&A2&” –userlogin “&C2&”SharePoint Members”&C2&” –role “&C2&”Contribute”&C2

The output text looked like this: stsadm –o userrole –url http://sharepoint/site1 –userlogin “SharePoint Members” –role “Contribute”

I then logged into the Windows 2008 SharePoint front-end server as a SharePoint Farm Administrator and copied all the text in the [B] column to a text file and named it permissions.cmd. I ran the file as an administrator (making sure the current directory was the ‘12 hive’ where the stsadm.exe resided) and after a few moments, all was well with the permissions.

You can also use the userrole operation to remove permissions by adding the –delete switch. For more information on the userrole option, type stsadm –help userrole