Tuesday, June 29, 2010

Built-In Search Experience Features

Without any administrator intervention, the Google Search Appliance provides a rich search experience by using its built-in search features. The following table lists these built-in search features.

Feature

Description

Automatic spell check

The search appliance automatically suggests spelling corrections accurately, even on company-specific words and phrases. The spell checker can suggest corrections in multiple languages, including U.S. English, French, Italian, German, Spanish, Portuguese, and Dutch.

Sorting search results based on relevance

The search appliance finds the highest quality and most relevant documents for a search query; Google factors in more than 100 variables for each query.

Automatic filtering of duplicate snippets

If multiple documents contain identical titles, as well as the same information in their snippets, only the most relevant document of that set is displayed in the results.

Automatic filtering of duplicate directories

If there are many results in a single web directory, then only the two most relevant results for the directory are displayed. An output flag indicates that more results are available from that directory.

Automatic filtering of languages

Limits search to a specified language, as determined by the majority language used in the web document body.

Dynamic page summaries

Users can judge relevance of results more easily with dynamically generated snippets showing a query in the context of the page.

Results grouping-

Users can navigate search results easily and clearly using intelligent grouping of documents residing in the same narrow subdirectories.

Cached pages

Users can view search results even when the sites are down by using cached copies of pages included in the search results.

Highlighted query terms

User can quickly find the most relevant section of a document by using the highlighted query terms displayed on cached documents.

View as HTML

Users can display documents without needing the original client application of the file format because the search appliance automatically converts over 220 file formats into HTML.

Sort by date

User can access time-sensitive information first by using date sorting.

Advanced Search page

Users can perform complex and sophisticated queries with over 10 special query terms, including Boolean AND, OR, and NOT searches.

Create Production Site Collection

When setting up a content deployment path, the site collections must be in separate content databases so that the unique identifiers (GUIDs) do not conflict. The easiest way to ensure that the production site collection is in a different content database is to create it in a new web application.
Open Central Administration:
Under Application Management:
Select Create or extend Web application:
Select Create a new Web Application:
Choose an easy to remember port number, such as 12345:
Type in a user name and credentials to create a new app pool:
Type in a descriptive database name such as MOSS_PRODUCTION:
Leave all other settings at the default and click OK, then wait for the Web application to be created:
Click Create Site Collection:
Ensure that your new Web Application is selected:
Type in any name for the Title (it will be overwritten later):
Select "Blank Site" as the template. This step is IMPORTANT, because Blank Site is the only template that you can import any other template into:
Type in the names for the site collection owners:

Allow Incoming Content Deployment Jobs on the Production Site

Create Content Deployment Path from Staging to Production

Select Content deployment paths and jobs:
Click New Path:
Type a descriptive name for the path. Select the web application and site collection for the staging site. Then type in the URL of the Central Administration web site of the production site. Since we are putting both of our sites on the same server farm, the URL is the farm that we are on now.
Click Connect:
Once you see "Connection succeeded", select the web application and site collection that you created for production. You can also choose to deploy user names and security if you want the new site to have the same users and permissions.
Click OK.

Create Content Deployment Job

Click New Job:
Type a name, and then select the path you created:
Keep all other default values, and click OK.

Run Content Deployment Job

Refresh the page, and then click on the text Running:
Watch the status of the job:
When the status changes to Succeeded, you can click on the URL to the production site to verify that the content was deployed.

Run Quick Deploy Job

Select Quick Deploy Settings from the Quick Deploy context menu:
Select Allow Quick Deploy jobs along this path, and set the schedule to check every 10 minutes, then click OK:
Visit the staging site and edit a page:
Make some changes:
Publish the page:
Show the page editing toolbar:
From the Tools menu, select Quick Deploy:
The changes will be picked up and deployed to production within 10 minute:

Monday, June 28, 2010

If you’ve tried to insert a form into a sharepoint’s page you mus have been disappointed. The form just didn’t work. You can’t make the form to post or get to some url, because the whole SharePoint’s page is one big <form> element.

So I went a bit deeper on how Microsoft guys are doing it on their spaces site (blog this functionality makes a post to a certain url) and based on this, I’ve made this simple script to make “forms” to post and to submit.

Update (5.11.): Unfortunately this method works straight only in IE, because it’s the only one that coppies the innerHTML with the changes (input data). So to get this method to work in FF, Chrome, Safari, Opera,.. you have to copy the field values. Here’s how

After the line

var formToSubmit = document.body.appendChild(theForm);

add code similar to the one below for copying the values for each of the input fields

Scinaptic OnePlaceMail provides integration between Microsoft Outlook and SharePoint to facilitate the transfer of business knowledge from personal mail boxes to a shared centrally managed, secure repository.

With Visual Studio 2010 SharePoint Developer Tools, the concept of the Mapped Folder was introduced. A mapped folder is a convenient way for developers to specify a location for any files that need to be deployed on to the SharePoint file system, all from within in a Visual Studio solution. Mapped folders can be included as part of a deployment package (.WSP) and the files will get copied to the correct location when the WSP is installed on to the server.

Let’s take a quick look at how a developer might use a mapped folder. Say a developer wants to develop a custom application page for their SharePoint site that will consume a custom image. The SharePoint server has a designated location for both application pages and images. With mapped folders, the developer can ensure that their files will be deployed to the correct location. Here’s an example:

First we need to create a project. In this example, we will start by creating an Empty SharePoint project (Installed Templates->Visual Basic/C#->SharePoint->2010).

Next, we’ll create our custom image that we want to display. First, let’s setup a mapped folder to the Images directory on the SharePoint farm. To do this, we simply right-click on the project node and select “Add->SharePoint “Images” Mapped Folder”:

This will create a mapped folder named “Images” in our project. (You can also create it via the “Project->Add SharePoint “Images” Mapped Folder on the main menu bar”)

In the Solution Explorer, mapped folders look very similar to normal folders but have a small green globe in the bottom right corner of the icon. You’ll notice that underneath the mapped folder there is a sub folder with the same name as the project. This is to help organize images specific to your project and keep developers from inadvertently overwriting another item with the same name.

Also, if you select the mapped folder and open the property window (F4), you’ll see two entries: Folder Name and Deployment Location. The Deployment Location indicates the location relative to the SharePoint root directory ({SharePointRoot}) on the SharePoint farm.

Now that we have our mapped folder, we can right-click on the project directory underneath it and add our image file (“Add->New Item’). In this example, I’ve added a bitmap image named ”Bob.bmp”.

The next step is to create the application page and modify it to show our image. To start, right-click on the project node in the Solution Explorer and select “Add->New Item”. When the Add New Item dialog appears, the “2010” node under SharePoint will be selected. From the list of templates, select the “Application Page” item, give it the name you want, and click “Add”. You’ll notice that when the application page is added to the project, it automatically gets created under the “Layouts” mapped folder, which is the default location on the SharePoint file system for application pages:

Following its creation, the .aspx file we just added should be opened in the designer. Locate the <asp:Content> element with the ID equal to “Main”. Within that element add an image element and set the ImageUrl attribute to point to the image in your product. It should look like this:

<asp:ContentID="Main"ContentPlaceHolderID="PlaceHolderMain"runat="server"><asp:LabelID="Label1"runat="server"Text="Label"Font-Size="Medium">This is Bob.......</asp:Label><asp:ImageID="Image1"runat="server"ImageUrl="~/_layouts/Images/SharePointProject1/Bob.bmp"/></asp:Content>

The last thing we’ll want to do to make testing our project easier is to set the application page to be our startup item when we F5. To do this, select the project node in the Solution Explorer and open the property window (F4). In the property window, select the “Startup Item” property and choose our application page from the drop down list. Now when we F5, it will take us right to our application page:

A couple of things to know about mapped folders. First, since mapped folders effectively deploy files onto the SharePoint file system, they are only allowed in farm level solutions. Sandboxed solutions are restricted to only deploying content to the content database on the server. In VS, when you try add a mapped folder to a sandboxed solution, the package validation will generate an error regarding this.

Second, as you saw when we added the application page, some items go into certain mapped folders by default when they are added to the project. Another example is User Control items (.ascx) which are automatically placed into the User Control mapped folder. While these are the SharePoint “default” locations, there may be times you need to place one of these files in a different location, and this can be done by mapping the folder to a different location.

Finally, you can create a mapped folder to any folder under the SharePoint root on the farm by opening the Add SharePoint Mapped Folder dialog (Project->Add SharePoint Mapped Folder… from main menu, Add->SharePoint Mapped Folder… from project context menu:

For instance, if you had a custom web service you wanted to deploy to the SharePoint server, you could simply add a mapped folder that points to the ISAPI directory on the SharePoint file system and dropped the web service in there. Then, when the package gets deployed to the server, the web service will automatically be placed in the ISAPI directory and available for consumption.

So you add a Visual Web Part to your SharePoint solution and you want the Web Part to show some data. No problem. I’ll show you three ways to do it. This post shows you how to surface data in your Visual Web Part by performing the following tasks:

Binding data to a GridView at design time.

Binding data to a GridView by using LINQ to SQL code.

Binding data to a GridView by querying the Business Data Catalog.

I have also published a sample that shows these tasks here. For now, let’s make some data appear!

3. Attempt to configure a data source for the GridView. Wait! Where can I select Database? I only see XML File. Could this be a bug?

Nope. This is not a bug. The ability to configure other data sources by using the Data Source Configuration Wizard is a feature that has not been implemented in the Visual Web Designer for SharePoint projects in Visual Studio. You have two options.

· Write XML that defines the data source in the Source view of the designer (Not fun).

· Configure your data source in an ASP.NET project and then copy over the data source object (fun).

For this post, I’ll configure a SQLDataSource object in an ASP.NET project. Then, just copy control over to my Visual Web Part project. Then, I will bind the GridView to that control.

1. In Visual Studio, create a new ASP.NET Web Application project.

2. From the Toolbox, drag a SQLDataSource control to the designer of any page.

3. Configure the control by using the Data Source Configuration Wizard (Shown earlier). Use the wizard to generate create, update, delete, and select commands.

4. In the designer of the ASP.NET project, copy the SQLDataSource control.

5. In the designer of the Visual Web Part project, paste the SQLDataSource control.

6. Bind the GridView to that data source.

7. In the GridView Tasks dialog box, select Enable Editing, and Enable Deleting. Selecting these options will add Edit and Delete links to the GridView.

8. Finally, add the name of the primary key column of your database table to the DataKeyNames property of the GridView.

9. Design the rest of the GridView (look and feel etc.).

If you open the designer in Source view, your GridView should look something like this:

This line grabs the connection string from the web.config file of the root site. This is one way to persist a connection string. There are other ways to do this as well. You can read about them in the MSDN topic Managing Application Configuration.

The sample contains code that adds the connection string to web.config by using code in the feature receiver of the Visual Web Part project.

Bind Data to a GridView by using LINQ to SQL Code

There are probably a dozen ways to structure this. Here is one way to do it.

· Create a class library.

· Generate objects to access the data.

· Add methods that retrieve, edit, and delete the data.

· Bind the GridView to those methods.

Create a Class Library

1. Add a Class Library project to your solution.

2. Compile the project.

3. Strong name sign the assembly of the project. You can read more about how to do that here.

4. Add the assembly to the package manifest. You can read more about how to do that here.

Generate objects to access the data

1. Add a new data source to the Class Library project. You can read more about how to do that here.

2. Add a LINQ to SQL Classes item to the Class Library project.

3. In Server Explorer, drag a table onto the O/R Designer.

This creates an Entity that represents the table. Your code will read, edit, and delete data by using the entity not the actual table.

Add methods that retrieve, edit, and delete the data

1. In the class file of the Class Library project, add code to retrieve, update and delete data.

Binding Data to a GridView by Querying the Business Data Connectivity Service

Perhaps your organization has a bunch of data in the Business Data Connectivity Service in SharePoint. No problem. You can bind your GridView to that too.

<Quick Shameless Plug>

If you are not familiar with the Business Data Connectivity Services in SharePoint, it is the coolest thing since ice cubes. You can read more about it here. Visual Studio has a project template to help deploy data models to the service. You can read more about that here.

</Quick Shameless Plug>

1. Add a class to your Class Library project.

2. Add a reference to the Microsoft.BusinessData assembly. Unfortunately, you won’t find that assembly in the .NET tab of the Add Reference dialog box. I found it by browsing to this location - C:\program files\common files\microsoft shared\web server extensions\14\ISAPI\Microsoft.BusinessData.dll.

3. In your class, add the following using (or for VB Imports) statements:

5. Now, just call these methods from the event handlers of your GridView.

Surfacing data in a Visual Web Part, application page, or a user control, is not a whole lot different than the way that you do this in a plain vanilla ASP.NET Web application. Here a few take-away points:

· You can configure data sources visually by using an ASP.NET project and port over your data source object. – or – you can just write XML that describes the data source yourself.

· If you use a separate assembly for your data access code, make sure to sign the assembly and add that assembly to the package manager.

You can get to data described in the Business Data Connectivity service by using the Business Data Connectivity services object model.

If you compare these two diagrams, what you see is that it becomes less about the technology capabilities (i.e. content management, collaboration, search, business intelligence) and more about how these technologies support the user or the business: communities, content, insights.

Does this mean there's a big difference between SharePoint 2010 and SharePoint 2007? Time will tell. But if you watched the overview video, you'd see things have certainly improved in many instances. Here's what we took away from the overview of SharePoint 2010.

UI Improvements

SharePoint 2010

Multi-Browser Support

Microsoft says they recognize the need to support multiple browsers such as Safari and FireFox. The video even demos SharePoint in FireFox, so you know it's not all talk.

Ribbon

You first saw the introduction of the ribbon UI in Office 2007 and although it took a little getting use to, it grew on you. That ribbon UI is part of SharePoint 2010. It's contextual, so it changes as required and it grays out the options in the ribbon that you may not have access to.

SharePoint 2010 Ribbon UI

Of course, if you don't like it, you can choose to use the old UI from SharePoint 2007.

Dialogs

Now SharePoint will have real dialog boxes, instead of redirects to another web page with your dialog box options. The background is grayed out when a dialog box pops up. Much more in tune with the way web applications work today.

Live Preview & Themes

The ability to set a theme for your look and feel within SharePoint is improved. Included is the ability to take your PowerPoint theme and upload and apply it to your SharePoint site.

If you are modifying a web page, you now have Live Preview capability, so you can see how the change will look before you actually accept it.

Silverlight

SharePoint 2010 comes with out of the box Silverlight web parts, making the inclusion of Silverlight apps much easier. Note the change to the how you can select new web parts for your pages, much improved.

SharePoint 2010 - Silverlight Web Parts

Empowering the Business

There are a couple of different ways to look at SharePoint 2010. Although the developer perspective is important, maybe the most critical is how it makes the lives of business users easier and lets them do more without the need for IT assistance.

Visio Integration

Use Visio 2010 for documenting and describing business processes? Now you can publish those diagrams directly to SharePoint with the back end connection remaining intact. So the view of the diagram is real time. What's nice about this capability is that not everyone needs to have a license for Visio to see the diagram.

SharePoint 2010 Visio Integration

SharePoint Designer

It's still free, but looks very much improved with new modeling capabilities and enhanced workflow.

SharePoint Designer 2010

Now if you are one of those who worry about the power SharePoint Designer provides the power user, this may worry you more. We need to get a closer look at this tool to see if any of these concerns have been eased. This overview doesn't provide that warm and fuzzy feeling.

Business Connectivity Services

The evolution of the BDC, the BCS is very much improved enabling you to connect Line of Business applications, web services and databases to SharePoint easily using the new SharePoint Designer, as well as Visual Studio 2010.

SharePoint 2010 - Business Connectivity Services

You can even take this a step further and connect your Office 2010 applications to the BCS providing a tightly integrated connection with business data.

SharePoint Workspace

Take your SharePoint content offline with the SharePoint Workspace (formerly Groove), a rich client to work with while you aren't connected.

SharePoint 2010 - Workspaces

Search

The addition of FAST to SharePoint gives a much improved search experience. Microsoft says their goal is to help you get the "right results on the first page". Those results include not only SharePoint content, but possibly business data and people — the Rich People Search Function from SharePoint 2007 will comes with SharePoint 2010.

Community Feedback

Despite this look into the SharePoint 2010, it seems to be very quiet so far in the greater SharePoint community. Sure, lots of people are pointing to the videos, some even saying things are looking pretty good, but we've haven't been able to dig up any real reviews or thoughts.

Perhaps many are waiting until the CTP arrives sometime this fall before they dig and really say what they think. Or maybe they are waiting for even more details to come from the SharePoint Conference in October. Truth is, although this is nice look into SharePoint 2010, much of what they talk about we already knew was coming in the first place.

There are three video to look at. This is just a snapshot of things in the overview video. Discussing Developer and IT improvements deserves its own article. Stay tuned.

Thursday, June 24, 2010

Rounded corners have become a staple in website design. But they come with a price. Don't get me wrong I really like the look of them and they really help soften the look of the site.

In most cases you can create this look by using the method below. Later on in this post I will highlight some of the things you can do and some of the things not technically possible without major custom development.

Design 1: Rounded corners to frame a site:

Open up your master page and add 1 <div> tag right before the ms-main table to represent the site container (This is used to position the site and give it its width)

Example: Please note that the shadow effect is a bit more complex and requires two more <div> tags to represent the right side repeat and the bottom repeat.

Design 2: Rounded corners to frame content

This approach can achieved the same way as per above with 4 <div> tags but just needs to included around the <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server"> control within the master page.

Example:

Design 3: Rounded corners around individual web parts

Now this one has some tricky elements that I am still trying to work out.

My Original thought was to use the approach above and simply add the 4 <div> tags around each individual webpart zone in a page layout. But there is a catch…

Normally webpart zones are wrapped in a <td> that has an id of "_invisibleIfEmpty" There is some java script that basically hides that zone from rendering on the page if there is no content in it.

However if you place those 4 div tags within that <td> you would assume that it would still hide that zone. But no basically its like a buffer and that JavaScript no longer thinks that zone is empty and it shows it on the page even if there is no webpart in that zone. So you end up with something like below: Notice that below the two web parts on the right there are two empty white containers with nothing in them.

Example:

So all in all its fairly easy to add in rounded corners to different areas within your design by using the approach above but there is still a need to have individual web parts with a container all for themselves.

If anyone out there has any ideas on either modifying the JavaScript to ignore the div tags and hide the empty zones or have any other approaches that have worked for them please don't hesitate to comment.

I hope this post will help many of you feel comfortable with using the Content Query Web Part.

In this post I will walk you through the process of creating a content query web part and configuring it to show custom field types. I will also give details on how to use XSLT to stylize and format the data being pulled.

I will be using the following scenario as an example. Say that you had a site collection with a top level publishing site. This publishing site would display a the most recent blog posts from all blog sites within its own site collection.

To solve this problem we will use a Content Query Web Part and a customized ItemStyle.xsl using XSLT.

Please note that the “SharePoint Server Publishing Infrastructure” needs to be enabled at the site collection to display the content query web part.

Step 1: Add a Content Query Web Part to Page

Navigate to the site that you want the blog posts to show up and click on edit page.

Under Editing Tools in the Ribbon, Click on insert > Web Part

Under the Content Rollup Category Click on Content Query

Then Click on the Add Button

Now that you have a CQWP on the page edit the web part

Expand open the “Query” properties

Since we will be just showing blog post in this query choose the following

List Type: Posts

Content Type Group: List Content Types

Content Type: Post

You should get a result like the following.

Next we will configure the web part to pull in additional values from the blog posts.

Title – linked to post

Date – with standard formatting

Body – Rich text

Author

Number of Comments

Categories

Step 2: Configure Web Part

Click on web part arrow and choose “Export”

Save the .webpart file to your desktop

Edit the “Content_Query.webpart” file in Notepad

Search for "CommonViewFields”

Replace the default “<property name="CommonViewFields" type="string" />” with the following:

About Me

A SharePoint Developer,I have worked for several consulting companies, and developed several SharePoint solutions. I have been awarded Application Development MCTS in MOSS from Microsoft on the May 2009.
And also I am a MS CRM Developer.
Please visit my MS CRM Blog
http://srikanthcrm.wordpress.com