Zieglers

Just little about C#, .NET, SQL Server, SharePoint and SAP

Archive for August, 2010

Move SharePoint Documents/Folders using FrontPage RPC

Posted by zieglers on August 18, 2010

Recently i was trying to move sharepoint files / folders (along with contents) programmatically. Finally i ended up using the method below. It is a neat helper method that you can use easily.

Note: Cross-web folder move is not supported!

Zieglers

Advertisements

Posted in IT Stuff, SharePoint | Tagged: , , , , , , | 2 Comments »

Move Documents in SharePoint with Versions

Posted by zieglers on August 13, 2010

In this post, i’ll mention an enhancement I recently implemented for ‘Move Documents‘ bulk action in SharePoint.
 
Content explained in this post is additions and enhancements made to the topic explained in Bulk Move Documents post. If you are not familiar with bulk move action, you can refer to that post before reading this one.
 
MOTIVATION:
After developing bulk actions, i received some feedbacks on how to improve its functionality and make it more useful in SharePoint.
 
Enhancements:
 
1. Move Documents within subsites (site-collection level)
 
Original functionality only supported moving documents from one library to another in the same web(subsite). It was suggested that being able to move documents from one subsite to another would be a good improvement to extend its scope of use.
So, i implemented that functionality. Now users can move documents from one library to another in a site-collection. Simply on move page, you first select destination web and then destination library as shown below.
 
 
2. Move documents with versions
 
Also another feedback was about to keep versions of documents during move operation. Although that was trickier, finally i managed to implement it. As an addition i included an extra comment in version history showing from which location documents were moved.
 
DEMO:
 
To begin with, I have two test docs in Shared Documents library.  Those documents were editted 3 times after being uploaded so there are 4 versions in total as shown. As for this demonstration, i renamed titles as v0 (uploaded), v1, v2, v3 respectively.
 
 
Then, I move these 2 test docs using ‘Bulk Move’ action.
 
 
I select destination web and library.
 
 
After clicking OK, documents are moved to ‘Move Here‘ library in subsite-1.
 
 
Let’s check Version History of recently moved documents.
 
 
As you can see document was moved along with its versions. Also there is an extra comment showing where doc was moved from.
 
 
Feel free to download bulk move from codeplex in case you are interested. Also you are more than welcome to provide your feedback, comments and enhancement ideas.
 
Zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , , , | Leave a Comment »

Creating shared custom search scopes in SharePoint

Posted by zieglers on August 3, 2010

Business Requirement:

Let’s say there is a request where users want to be able to search a set of site collections.  For example, HR has 3 site collections. HR would like their users to be able to search all 3 site collections at once, but only those three. 

This can be done with painful criteria manually entered into your search, but it seems like a custom search scope is the cleanest solution. 

By only creating the search scope, that scope won’t be available in the search dropdown on all pages on that site.  It won’t show up anywhere. To use custom search scopes requires the user to create a search center for their collection. 

Question: How would you have an end user SCA create a custom search scope for their site to search against 3 site collections?

Facts: 

Custom search scopes require a dedicated search center be created. Otherwise, custom scopes won’t be visible in search dropdown.

SCAs can create custom scopes and make those available to end users by doing proper configuration in site collection search settings and search scopes.

Solution:

Custom search scopes can be created by SCAs in order to search a set of site collections. Before doing so a dedicated content source to serve those scopes must be created in Central Admin by farm administrator.
 

Create a new Content Source. (performed by Farm Admin)

Create a shared scope using content source created above. (performed by Farm Admin)

Update scopes. (performed by Farm Admin)

Go to your site collection settings.  Search Scopes. (performed by SCA)

Make a shared copy of search scope. (performed by SCA)(Repeat these steps for search center as well.)

 Note: Create your shared scope both for your site collection and for search center. Don’t forget to use same scope names. In case you don’t create one for search center, you’ll receive an error saying “Scope in your query does not exist”.

Edit copied scope.

Provide Search Center Url for Custom Scopes. (performed by SCA)

Now go to your site collection and search something using the scope you just created.

 

You’ll see that results are displayed only for site collections you provided in your content source.

In this case, results are displayed for HR sites 1-2-3.

Zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , , , , , | 2 Comments »