Thursday, December 31, 2009

Introduction to Service Application - Part 2

In my previous post on "Introduction to Service Application" I have explained the concept of why did we come up with Service Application model,what are the different types of service application available as of now (till Beta 2) and also explained terms such as proxy,proxy group. At the end I also listed down the service application (SA) that can be shared across farms.

This blog is a continuation of my previous post and this post I will be discussing the concept of cross farms v/s child farm (just a short topic but an important one!!) and also some more topics....

CHILD FARM : In MOSS 2007 we used to create SSP and share the services of that SSP with other farms.So the farm thar is providing the services would be the parent farm and the farm that is consuming the services is the child farm.Most of the services were consumed by the child except excel services as this service was not able to share with other farms.One major problem in this scenario was that the child farm should have access to the parent farm database which led to lot of confusion and misconfiguration.
CROSS FARM : In SharePoint Server 2010, as you may already know that we dont have the concept of SSP and so we had the parent-child relationship at all. What we do have is the concept of cross farm where any farm can consume services from any other farm
For instance Say we have FARM A and it has managed metadata service application running the we have another remote farm called FARM B. Now we decide that FARM B would like to consume the metadata service from FARM A. So we just need to publish the metadata service in FARM A and when from FARM B we try to connect to FARM A (for the metadata service) a proxy will be created in FARM B and it will take care of the communication.

(I will be writing a seperate blogpost on how to publish and consume the services.)

The main advantage of the cross farm is that the FARM B doesnot need any permission on the databases present in FARM A.

Also any web application consume services from any farm in any combination. For example:

FARM A: Managed Metadata Service, BDC,Secure Store Service.
FARM B: Search and web analytics.
A Web application (WA1) is created in FARM A. So WA1 can consume BDC,Search,Metadata service or any combination of the service that are published and available.That is we can consume both local and remote service applications.

We can also have an entire farm build that can just host all the services.This is help in scaling the services to a very large extent.

Lastly all the Service application communication happens over HTTP and the service application are built on WCF.

What is new in Excel Service in SharePoint 2010??

Excel Services was one of the features that was widely used by large organisations with MOSS 2007. It was used to render the content of Excel worksheet in Internet Explorer so that you can only one true copy of the worksheet rather than everyone carrying there own copy and modifying it.
Also at the same time we also had Excel Web Access Web Part which could be used to publish the excel sheet anywhere in the site.

With SharePoint Server 2010 the Excel Services Team went one step ahead. They introduced a new API called REST API (REpresentational STate).

REST API is a easy programming feature for "non-developers" to easily access and display the information present in the excel worksheet. You may be confused with the above sentence as it contains the words programming and non developers. What I mean by the sentence is REST API feature can be achieved by just going manipulation to the URL which can be done by a non-developer (like me).At the same time it gives developers a platform on which they can do very complex operations as well.

Now lets talk where and how can we use the Excel Services with REST API:

For Example : Say you create a worksheet and that worksheet has the number of hours that you have worked for the entire week. Something similar to the below image




Now lets say you and your team have a requirement from your manager to show a graph of the work done in the entire week.
So you create an interal site and you would like to embed the above "chart/graph" in that site. You have to first publish the particular excelsheet to the a document library (lets consider we have a document library
called Worksheet library and the excel sheet is publish to this using excel services.The procedure to publish the excel sheet using excel services remains the same as in MOSS 2007).

Once the above is done, using the REST API by writing the following URL in the address of the  image web part in SharePoint Server 2010 you will get the chart/graph. (for time being ignore what exactly does the URL mean and do).

http://teamsite/sites/manager/_vti_bin/ExcelRest.aspx/worksheetlibrary/Book1.xlsx/Model/Charts('WorkChart')

Hurry!!!!..... Thats the end result of REST API. You have the chart in the site.!!!.....

The data shown the graph is NOT static, its dynamic. That means when whenever the value chages the graph gets automatically updated in the site.With the REST API, any changes in the workbook are reflected in the data that is returned. This includes the latest edits made to the workbook, functions that have recalculated (including User Defined Functions), and external data that is refreshed.

The REST API can also push values into the workbook, recalculate based on those changes, and return the range or chart you requested after the effects of the change have been calculated. For example, in the sample spreadsheet above, the chart is displaying the effects of a Actual Work done = 80% .With REST, you can request a chart displaying the effects of a Actual work done = 70% by adding a parameter to the URI that changes the value of cell B4 to 70%.
Now we know what the end result is and how to achieve using. Next lets have a discussion on how we came to that particular URI.

Firstly I have a site collection built and named as "teamsite". In that team site I have created another site and named it as "manager" and in the manager site I also have a document library called "worksheetlibrary" to which I have published my excel sheet.
So to access the excel sheet i would type the URI as http://teamsite/sites/manager/worksheetlibrary/Book1.xlsx (assumption that the excel sheet is saved as Book1.xlsx)

Now in order to use the REST API in the URI we insert _vti_bin/ExcelRest.aspx just before the document library in the above URI.Hence the URI would look like

http://teamsite/sites/manager/_vit_bin/ExcelRest.aspx/worksheetlibrary/Book1.xlsx

Now we need to get to the items in thee excel sheet like the chart or the table. For that we add /Model at the end of the URI. So now the URI is

http://teamsite/sites/manager/_vti_bin/ExcelRest.aspx/worksheetlibrary/Book1.xlsx/Model

Once you add "/Model" to the URI and hit enter you will find 4 terms listed in the Internet Explorer page. They are:

1.Ranges.
2.Charts.
3.Tables.
4.PivotTables

Important
-----------
Before proceeding further you need to make sure that the chart and/or the table in the excel are named ranges. Basically you need to select the chart and give it a name and if you also interested in publishing the table with the Hours Worked and Billed Time data then select the entire table and give it a name.(Giving the name is simple,just select the table and left top corner above the cell 'A' type the name that you would like to give.) THIS HAS TO BE DONE BEFORE PUBLISHING THE EXCEL TO THE DOCUMENT LIBRARY.

Next at the end of the URI type /Ranges and you will be given the list of named ranges that you have defined in the excel sheet.

Lastly you need to choose which range you would like to publish. In out case since its a chart the URI will become

http://teamsite/sites/manager/_vti_bin/ExcelRest.aspx/worksheetlibrary/Book1.xlsx/Model/Charts('ChartofHours')?$format=html

(ChartofHours is the name for the chart that I defined)

or you just also just type

http://teamsite/sites/manager/_vti_bin/ExcelRest.aspx/worksheetlibrary/Book1.xlsx/Model/Charts('ChartofHours')

Once the chart is displayed in the IE page copy the URI, go the SharePoint site,edit the page,click on image in the ribbon menu, you will be given two options,choose "from address", put-in the URI and its done.

Now whenever you can values in the excel sheet that chart also gets updated in the site.

For more information on Excel Services refer the following links:
1.Excel Services - Rest API Part 1
2.Excel Services - Rest API Part 2

Tuesday, December 29, 2009

Introduction to Service Application Part 1

One of the major investment in SharePoint Server 2010 is moving away from Shared Services Provider and get into the new concept of Service Application.

Before going into details of Service Application lets first talk why did we move away Shared Services Provider (SSP)??..One of the main reason for moving away from SSP was that we could not choose/select specific services that we wanted to use in that particular web application. For Example: Say I create a SSP and I have search, user profile,excel and BDC services enabled in this SSP then any web application that gets associated with that SSP will get all these services even if that Web application doesnot need/makes use of it.
Also another major problem was under the hosting environment.If a partner hosts MOSS 2007 and say he has 2 clients where one of the client has a requirement telling that it needs BDC and Excel , and the another client has a requirement telling that it needs Search, BDC and User Profile then we had to create 2 SSP and also we had to provide an entire web application for the 2 clients. So in total in SQL Server we would have 8 SSP databases and 2 web application databases. This was not a feasible solution and hence hosting on MOSS 2007 was not recommended.

So SharePoint Server 2010 we came up with the concept of Service Application where each service application is independent (without any relation to SSP)and we do not have a SSP site as these Service application are configured/controlled from Central Administration (CA) site. Below are the list of Service Application that are available (till Beta 2):
  1. Access Services 
  2. Business Data Connectivity service.
  3. Excel Services
  4. Managed Metadata Service 
  5. People (User profile) 
  6. Search Service Application  
  7. Secure Store service (formely known as Single Sign On) 
  8. State Service  
  9. Usage and Health Data Collection
  10. Visio Graphics Service 
  11. Web Analytics Service
  12. Word conversion service
As said above that these service application are independent,so any web application can consume and combination of service application(SA). For Example : Say a web application needs only BDC, secure store service and web analytics ,it can be achieved.

If you have installed SharePoint Server 2010 successfully then, you would get a wizard to install the service application as well.For the first time when the service application have been installed they would a part of the default proxy group. (I will talk about proxy and proxy group later in this blog). We can create different proxy groups and each group can have any combination of service application.While creating a web application we do get the option to choose the proxy group. By default, the default proxy group would be selected (the one that we created when we installed SharePoint and ran the wizard in SharePoint).

Now lets talk about the two important terms : Proxy and Proxy Group
Proxy : As soon as we create a SA a proxy would be created to it. Proxy is nothing but a virtual link using which the web application(WA) will talk with the SA.Proxies are basically WCF service.
Proxy Group :  proxy group is a group of SA's that can be associated with a web application. for example: default proxy group.A proxy group can have any combination of SA.

Important
----------
If we create a custom proxy group and associate that custom proxy group with a WA, then we CANNOT re-use the same custom proxy group with another WA.


Now going back to service application(SA), we can provide process isolation to the SA. We can choose if we want to use a new application pool or use an existing one.by default all the service application virtual directories would be under SharePoint Web Services in IIS. You would find a list of GUID's and if ou want to know which GUID is associated with which SA, the easiest way is to switch the view to content view in IIS and once you click on the GUID the name of the service application would be displayed in the right hand window.There is also another way of knowing which GUID to SA association, that is by using the powershell but I guess the content view is the simple and easiest way to find it out.

We can also create multiple instance of Service application. Each instance will have its own proxy. We CANNOT create multiple instance of proxies.

I would llike to give you some details of the databases for the Service Application.Some of the service application have there own databases and the list is as below:

Business Data Connectivity service.
Managed Metadata Service
People
Search Service Application
Secure Store service (formely known as Single Sign On)
State Service
Usage and Health Data Collection
Web Analytics Service
Word conversion service
Perfomancepoint.

Lastly I would like to throw some light on the sharing of the service application. I will be writing a seperate blog on the steps to follow to share/publish the service application. But for now I would like to note down the service application that can be shared across farms.Yes...you are right not all service application can be shared across farms. The ones that can be shared are as follows:

People
Managed Metadata Service.
BDC
Search Service.
Secure Store
Web Analytics.

As of now thats all on service application.....................

Monday, December 28, 2009

Document Management in SharePoint Server 2010

From past couple of days I have been investigating the New Document Management Capabilities in SharePoint Server 2010 and here are some of the terms that I came across.

*Document ID
*Document Sets

Let me define the above in a simple and understandable way:

Document ID
--------------
When do we need an ID?..In MOSS 2007 we did have a column type called "ID" which would assign unique numbers to the document or list items in the document or list library. As we saw that this ID was restricted to the library level only. What if we need to have unique string ID's to all the document across the site collection. The answer was given in SharePoint Server 2010 with Document ID feature.

This is a feature that you need to enable in the Site Collection Features. Once done, all the document will get a unique ID and this unique ID will STICK to that document forever. That means when a document is assigned an ID it also provides a URL using which you can track down the document regardless of the location of the document.Even if the document has been moved to different site collection the Document ID that was associated with it remains with it.

The ID's prefix can bedefined as well. For Example : If you have a site collection made for the HR team, you can have the ID prefix as "HRDoc" and the actual ID would be something like HRDoc 1-1, HRDoc 1-20 etc.Basically the format Document ID can be customizable.

Document Set
---------------
Document Set as the name tells is a set of documents that are treated as a single unit of work.In MOSS 2007 the closet that can be related to the document set was a folder. Document Set can be called as a improved and much sofisticated version of folder.

It is again a feature and so it has to be enabled in the site collection feature.Once the feature is enabled it can be used in a document library to create document set. Wait a minute!!!!!................. Document set is a special content type in SharePoint Server 2010. Which means that if you want to use the document set content type in the document library if you to make sure that the document library is ready allow multiple content types.This can be achieved by following steps:

1. Go to the document library settings.
2.Click on Advance Settings.
3.Choose YES in the section which tells "Allow management of content types".
4.Once this is done now you need to add the document set content type to this document library.
5. Go back to the Library settings page.
6. You would see a section for content types and also a click that tells" add from existing content types".Click on that.
7. Choose the Document Set content type from the list and now the document library is ready to produce the document set types.

Once you have followed the above steps, click on the new document and you will find a new content type listed there known as the "Document Set".

Multiple content types can be associated with the Document Set.  For Example: A single document set can have one word document,one excel document and a presentation document.

The welcome page of the Document Set can be totally cutomized according to our requirements.

Also when you choose to download the Document Set, all the documents associated with the document set will be put into a zip file and then downloaded.

Since the document set acts as a single unit,a document ID will be associated with it. Even a workflow can
be assigned to the document set. All features like versioning, security permission can be given to the document set directly.

Last point about the document set is the concept of  "Shared columns". We can add columns to the document set and they get inherited to the documents that are present in the document set. For example: Say I create a document set called "Sales Proposal" and this document set has 3 content types (word,excel and ppt). Also I add a column to the document set called "Date".So what happens is that all the 3 content types will gert this column called "date" into them.

More on Document Management in some time........ :)

Sunday, December 27, 2009

Content Type Publishing in SharePoint Server 2010

Another improvement in SharePoint Server 2010 is the ability to publish the content type across site collection. Content types were restricted to a site collection in MOSS 2007. Now its possible that several site collection can use the same content type and also the changes, if any, made to the content type will also be propogated to the sites where the content type is being used.

Below are the steps to publish the content type:

1. Create a New Site collection.(for ex: http://sharepoint2010/sites/hr)

2.Go to the Site settings of the Newly created Site collection.

3. click on the Site collection features.There you need to activate the content type publishing hub.

4. Now since content types are a part of metadata service you need to go back to the central administration site.

5.Once back to the CA site (central Administration Site) click on manage service application and then click on the managed metadata service.(do not click on the managed metadata service connection)

6. Go to the properties of the service application.

7.At the very end of the Properties popup dialog box, you will find the section for Content Type Hub. Enter the URL to your content type hub site collection.

IMPORTANT
----------------
Once the association is made it cannot be changed back, which means if you want to use another content type hub, you need to create a new managed metadata service application.

8.Once this is done you have successfully configured your Content Type Publishing. Now any web application associated with that particular service application cam make use of the published content type.

Happy Publishing :)

Saturday, December 26, 2009

Chart web part

In SharePoint Server 2010 we have a interesting web part know as Chart Web part

Chart Web Part
----------------

Right now in Beta Bits you can find this web part under "Miscellaneous" section. This web part can be used to build chart from the data that is present in Sharepoint List, Excel Sheet (that is published using Excel Services), data from SQL Server and also from another web part that provides data. Its very easy to configure. For a chart using Sharepoint List follow the link Chart using Sharepoint List . Also the same can be achieved using data present in Excel. Steps to achive it.

1.Publish Excel using Excel Services to a document library (Excel Services remains same with regards to MOSS expect REST API).

2.Add the Chart Web Part.

3.Click on Data Appearance.

4.Put the Excel Workbook Path.

5.Range Name (very important)

6.Once you click next the data present in the excel sheet will be displayed. You can do the formatting as you need.

7.Bind data with the chart and you are done.


SilverLight Web Part on Sharepoint Server 2010

Today I was working with Sharepoint Server 2010 specially with the web parts and found one interesting web part known as "Silverlight web part" which is under Media and Content. When i try to add this web part it asked for a .xap file. Since I was not a developer I had very less idea about xap files.


Finally I got a got a xap file (basically a silverlight file) and when added it worked perfectly fine. It definatley made the life of non-developers (like me :) ) very easy.

Wednesday, December 23, 2009

communication b/w wfe and query during search

Very recently i was asked a question on a particular scenerio.
Scenerio : consider you have 1 wfe ,2 query servers, 1 index server and a clustered database server. The 2 query servers are NOT load balanced. So how will the wfe server communicate with the query server and an end user hits a search query.

After a long research the answer was when the end user puts some keywords for search the search.asmx is invoked. This search.asmx will send a request to both the query servers and which ever query server responds for the request the search.asmx( which is on the wfe) sends the keyword search request to that query server and the search result is got back.The query will look into the local index that it has and give back the result.

Monday, December 21, 2009

SharePoint Server 2010

This Blog is dedicated for SharePoint Server 2010.