Thursday, December 29, 2011

Why the change in architecture?

With SSPs everything was lumped together, even though some services offered very different capabilities. This made SSPs difficult to deploy and manage over the lifetime of your SharePoint deployment. Plus, because SSPs were effectively grouped together into a single database, scalability became difficult. In addition, allowing administration of a single service in the SSP, so that every administrator could administer any service, was next to impossible. Finally, you couldn’t really share services across farms. There were many restrictions and the administrative and management overhead made administration difficult.
As a developer, you can write your own Service Application that provides services to your features that run on the SharePoint WFEs. There are certain scenarios in which this makes sense. For example, if you need specialized computing and analytics, if you want to share data across sites, site collections, and farms, if you need to execute long running operations or if you want to scale out your application by taking advantage of the services infrastructure. You should not use Service Applications if your data or features are specific to a site, a site collection or a site template. Instead, you should write code that runs within the boundaries of your site or site collection, such as event receiver or web part.
Anyways I may not tell you writing a complete Service Application because even I too don’t know. But I can provide some steps to be aware of and also the APIs associated with Service Applications. To write a good Service Application, you should have a working knowledge of Windows communication Foundation (WCF), because Service Applications use WCF extensively to communicate between the Service Application Proxy and the consumer.
The steps to write a Service Application at the high level are:
1. Create Service Application
2. Create Service Application endpoint using WCF
3. Create Service Application Installers
4. Install and provision Service Application
5. Create Service Application Proxy
6. Create Service Application Proxy Installers
7. Install and provision the Service Application Proxy
8. Create Service Application consumers
9. Install, deploy and test consumers

Friday, December 23, 2011

How Does Claim Based Authentication Works?

This is the simplified version of how claims work. The easiest way to think about how claims work is to take a real world example. Let’s imagine that you need to board an aero plane. First you need to check in. That could be at the ticket counter or that could be online. Both require you to authenticate yourself in different ways. The ticket counter requires you to show some form of ID and that ID comes from a trusted source. Online you are forced to login and that login must be trusted in order for you to print your boarding pass
Your Boarding pass contains a lot of extra information rather than just your name. It contains your destination, the gate you are leaving from, your flight number, and also your seat information. When you reach the gate, the gate agent checks your boarding pass. This agent doesn’t really care whether your claim came from the ticketing agent or from your printer at home. The boarding pass is trusted claim and you are allowed to get on your flight. If we translate this to software, that boarding pass is a signed security token from a trusted issuer. Your application would validate it and allow the user or application presenting that token to have access to the resource that was requested.

Wednesday, November 9, 2011

Differences among Chart Viewer, Chart web part and Excel Services























Chart ViewerChart web partExcel Services
1)Simple web part that allows you to chart data from a SharePoint list1)The chart web part is more general purpose web part that provides wizard based interface 1)Excel Services is the ultimate tool, because it is Excel rendered through SharePoint
2)This doesn’t allow for complex scenarios, formulas2)Can connect to more data sources, such as the business connectivity services, lists, web part connections or even Excel Services2)It has the most functionality, including spread sheets, formulas, charts and data connectivity
3)The only downside of Excel Services is that it can’t connect to SharePoint data, so for charting data in SharePoint, you must use one of the other web parts

Thursday, October 27, 2011

The source files for this operation cannot be found in this solution

By using VS 2010 webpart i was planning to deploy one custom webpart into the sharepoint 2010 site.In that process i was planning to copy one png image of solution1 to solution2 of VS 2010.But i was facing the below road block to move ahead,finally with my colleagu's idea i was able to move further



Resolution:

Right click on the folder of solution1 and click on 'Open with Windows Explorer' as below



Copy the needed items as below



Finally go to the folder where you are willing to paste and right click on that folder of solution2.Click on 'Paste' as below

Wednesday, August 10, 2011

Session Time Out in SharePoint 2010

Hi,

We got session time out problem for our sharepoint 2010 application,after googling i was able to increase session time by following the below navigation path

Central Administration -> Application Management -> Manage Web Applications -> Select your Web Application->Click on General Settings Now in Web Page Security Validation category you can set the time as in the below screen shot.



Thursday, July 28, 2011

ECMA script in SharePoint 2010

Hi,

ECMA Script is new in sharepoint 2010.First time when i got the task which should be done with ECMA script.But as i got 2 days,i couldn't do the task perfectly,my TL got bad impression.After some time there was requirement for my teammate in ECMA script,finally after googling i was able to do some POC's as below


Before writing the below code i have created a custom list with name 'Testlist',i have added another column with name 'Department' with type of single line of text

Below is the code to fetch the items from the list using ECMA script.For this added one CEWP on the page and through Edit HTML source of CEWP i have pasted below code




To debug this script actually i followed the below link,but as per opinion this method is not much affective as C# debugging,in some cases we couldn't get the value of the variable where we insert breakpoint
http://digsharepoint.blogspot.com/2011/04/how-to-know-all-methods-in-sharepoint.html

Below is the code to update List item using ECMA script

Monday, July 25, 2011

Error occurred in deployment step 'Retract Solution': Only a site collection administrator can activate or upgrade solutions that contain code.

Hi,

I got the above error when i was trying to deploy my sandbox solution.Finally with my teammates suggestion i deployed this sandbox solution into the site.Actually i created sandbox solution with my individual id,and it was throwing this error,to resolve i logged into the site with system account and added my id,finally it worked out.Below is the navigation path that i followed to add my id

Site Actions->Site Permissions->Click on 'Site Collection Administrators' under 'Edit' tab

Add the id through which you have created sandbox solution.Now deploy your sandbox solution right clicking on solution again.Finally sandbox solution gets deployed into the site

Thursday, July 21, 2011

Create,Add,Update and Delete List Items using PowerShell Script

Hi,

We had a requirement as follows with powershell

-For creating List,adding field in that list,
-Adding,Updating and Deleting all the list items

Finally after googling i found and implemented the task.Code is as below

//Creating and adding field to the list using powershell
$MyAssignment = Start-SPAssignment
$MyWeb = Get-SPWeb http://aaaa -AssignmentColl
ection $MyAssignment
$MyWeb.Lists.Add("My List","This list created with powershe
ll",$MyWeb.ListTemplates["Custom List"])

//Adding Field into the list
$MyList = $MyWeb.Lists["My List"]
$MyList.Fields.Add("TextField","Text",$MyWeb.FieldTypeDefin
itionCollection["Text"])
TextField
$MyWeb.Dispose()
Stop-SPAssignment $MyAssignment

//Adding ListItem
$spAssignment = Start-SPAssignment
$mylist = (Get-SPWeb -identity http://aaa -As
signmentCollection $spAssignment).Lists["My List"]
$newItem = $mylist.Items.Add()
$newItem["Title"] = "Added by Powershell"
$newItem["TextField"] = "My PowerShell Magic"
$newItem.Update()

//Deleting all ListItems
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, V
ersion=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Po
rtal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Pu
blishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

[System.Reflection.Assembly]::Load("System.Web, Version=2.0
.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

$SITEURL = "http://aa"
$site = new-object Microsoft.SharePoint.SPSite ( $SITEURL )

$web = $site.OpenWeb()
"Web is : " + $web.Title

# Enter name of the List below
$oList = $web.Lists["My List"];

"List is :" + $oList.Title + " with item count " + $oList.I
temCount

$collListItems = $oList.Items;
$count = $collListItems.Count - 1

for($intIndex = $count; $intIndex -gt -1; $intIndex--)
{
"Deleting : " + $intIndex
$collListItems.Delete($intIndex);
}

Friday, July 8, 2011

Useful Posts of SharePoint 2010

Hi,

Below are some posts of sharepoint 2010 that i found very useful and learnt/learning a lot.Hope this may be useful too as well to googlers who have eager to learn more in sharepoint 2010

//Hide I Like It and Notes and Tags
http://www.sharepointkings.com/2011/07/hide-i-like-it-and-notes-and-tags.html

//Silver light client object model
http://www.sharepointkings.com/2011/07/client-object-model-part-2.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+SharepointKings+%28Sharepoint+Kings%29

//SharePoint 2010 Cookbook: Create a Slide Image Web Part Using jQuery
http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2011/07/08/sharepoint-2010-cookbook-create-a-slide-image-webpart-using-jquery-in-sharepoint.aspx

//Using jQuery with SharePoint 2010
http://blogs.msdn.com/b/yojoshi/archive/2010/06/17/using-jquery-with-sharepoint-2010.aspx

//Programmatically add Javascript or CSS to pages in SandBox web part
http://stsadm2010.blogspot.in/2011/12/programmatically-add-javascript-or-css.html

//What is Sandbox Solutions in SharePoint 2010?
http://geekswithblogs.net/venkatx5/archive/2010/11/23/what-is-sandbox-solutions-in-sharepoint-2010.aspx
http://www.chakkaradeep.com/post/SharePoint-2010-Sandboxed-Solutions.aspx

//How to Create Multilingual Webpart in SharePoint 2010?
http://geekswithblogs.net/venkatx5/Default.aspx

//Site Workflow in SharePoint 2010
http://www.sharepointkings.com/2012/05/site-workflow-in-sharepoint-2010.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+SharepointKings+%28Sharepoint+Kings%29

//Integrating Facebook comments into SharePoint
http://www.sharepointkings.com/2012/02/integrating-facebook-comments-into.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+SharepointKings+%28Sharepoint+Kings%29

//Connectable web parts in MOSS / SharePoint 2010
http://www.sharepointkings.com/2012/05/connectable-web-parts-in-moss.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+SharepointKings+%28Sharepoint+Kings%29

Data Sheet View of SharePoint 2010 lists

Hi,

Normally Data Sheet View comes up after installing Office 2010 for sharepoint site.There will be a situation where you need datasheet view for bulk copy/paste of list items,at that moment if we don't have Office 2010 then we can install Access2007Runtime.exe.After installing this we can get DataSheetView of list only through IE browser

Friday, May 20, 2011

Power Shell Script to add and Install wsp

Hi,

Below is the power shell script to Add and Install wsp.Just you need to update the correct path,name of solution package correctly(which is in bold),copy and paste the below script entirely after updating accordingly.After pressing enter just it will add and install the wsp solution

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
{
Write-Host "Loading SharePoint Powershell Snap-in"
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
$SolutionName = "xxxx.wsp"
$SolutionPath = "path" + $SolutionName
write-host "Adding Solution: " $SolutionName
Add-SPSolution -LiteralPath $SolutionPath
$SolutionTocheck = Get-SPSolution -identity $SolutionName
write-host "Deploying Solution: " $SolutionName
if ($SolutionToCheck)
{
if ($SolutionToCheck.ContainsWebapplicationResource)
{
if ($SolutionToCheck.ContainsGlobalAssembly)
{
Install-SPSolution -identity $SolutionToCheck -allwebapplications -GacDeployment
}
else
{
Install-SPSolution -identity $SolutionToCheck -allwebapplications
}
}
else
{
if ($SolutionToCheck.ContainsGlobalAssembly)
{
Install-SPSolution -identity $SolutionToCheck -GacDeployment
}
else
{
Install-SPSolution -identity $SolutionToCheck
}
}
}

Monday, March 14, 2011

The Site URL property of the project does not contain a valid URL.To ensure that designers work as expected,set the Site URL property of the project t

Some times after opening the solution file,if you search any text you will get an error as below





To fix this error see the file which has cylinder symbol as below.



Just click on that file and press F4 key,you will get a window as below on right side



Enter any site URL.Now search any text now it won't throw any error.Good Luck

Wednesday, March 9, 2011

Copying Data from One site to Another Site

Hi,

Some times we may need to copy the pages from one site to another under the site collection.In SP 2010 its pretty simple,let me explain with clearly.For example there is site 'Latest News',you want to copy the pages from this site to other site called 'Latest News1'.For this navigation is as below

Click on 'Manage Content and structure' which is under 'Site Actions' as below



Through tree view on left side go to the site pages from where you want to copy.Select the pages,under Actions click 'Copy' as below



You will get the dialog box to select the destination as below



After copying it shows the copied page in the destination page as below




Select the destination and click OK.You will get the message as below

Monday, February 21, 2011

Popup not working properly with jquery

We had a problem with popup.Problem was as soon as page loads if we click 'Edit' hyperlink popup was coming,but after clicking check box/button in any other custom webpart that are available on the page,after that if we click on 'Edit' link popup was not coming up.From my TL i came to know the problem as popup is getting called in document.ready function.After any post back this function doesn't get called,popup should not be called in the document.ready function.For fixing this issue i got some Knowledge by go throughing the below link
http://geekswithblogs.net/venkatx5/archive/2010/11/17/how-to-open-a-page-in-sharepoint-2010-dialog-framework.aspx
After go throughing the above link
I have added the below function in the popup.js(path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\xx\xx-js)

//User Defined Function to Open Dialog Framework
function OpenDialog(strPageURL)
{
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = strPageURL;// URL of the Page
dialogOptions.width = 750; // Width of the Dialog
dialogOptions.height = 500; // Height of the Dialog
dialogOptions.dialogReturnValueCallback = Function.createDelegate( null, CloseCallback); // Function to capture dialog closed event
SP.UI.ModalDialog.showModalDialog(dialogOptions); // Open the Dialog
return false;
}

// Dialog close event capture function
function CloseCallback(strReturnValue, target)
{
if (strReturnValue === SP.UI.DialogResult.OK) // Perform action on Ok.
{
alert("User clicked Ok!");
}
if (strReturnValue === SP.UI.DialogResult.cancel) // Perform action on Cancel.
{
alert( "User clicked Cancel!");
}
}
After this please change the code as below in the xxItemStyle.xsl in the template My Selection



Javascript:OpenDialog('');void('');

Recommendation to test the issue

1)Comment the code as below in the popup.js file(path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\xx\xx-js)

//$(document).ready(function () {


// $('a.poplight').each(function () {
// var href = $(this).attr('href')
// href = '#' + href.substr(href.indexOf('?'), href.length).replace(/#/, '')

// $(this).attr('href', href)


// });

//});

2)After doing above code changes please do iisreset,delete the cookies,history from Internet Options and close that browser
3)Open another browser and test the issue

Thursday, February 17, 2011

This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

Hi,

Below you can see the error some times when you try to install the wsp



Then you can run the following command to install the wsp

The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started.

I got the below error when i was trying to create Managed Metadata Service
"The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator."
Finally it got resolved after making changes as mentioned in the below blog
http://sensoft2000-sharepoint.blogspot.com/2010/10/error-security-token-service-is-not.html

Wednesday, February 16, 2011

The document could not opened for editing.A Microsoft SharePoint Foundation compatible application could not found to edit the document

Hi,

I was getting error as below When I was trying to edit the master page



I have used the below option from Site Actions of the Site to edit the master page and then click 'All files' folder on left side and then select your master page. Then I am able to edit the master page of the site in designer

Saturday, January 8, 2011

Difference between SharePoint 2010 and MOSS 2007

SP 2010
MOSS 2007
Look and feel
In SP 2010 look and feel perspective there will be a ribbon where we can have a look and feel like Office 2010
In MOSS 2007 there is no ribbon
Deployment of Web parts
In SharePoint 2010 deploying custom web part is pretty simple i.e. just right click on the solution and click Deploy
In MOSS 2007 you need to drag the dll either to bin or GAC
Silverlight Application
In SP 2010 we can create a Silverlight application directly from Visual Studio 2010
In MOSS 2007 we have to create a web part to host Silverlight application
Shared Database & Service Application
In SP 2010 there is no SSP but there is a concept of Service Application like BCS as one service application, Excel Services as another service application, User Profile as separate service application
General idea is that you have an application for each service, rather than one application with lots of service crammed into it
Own database rather than shared database in SP 2010
In MOSS 2007 we have SSP where we can work around with BI,Search Settings, User Profile Import, Excel Services, Info path
In Database also we use to have separate area for SSP stuff
Easy exports/imports between the forms
In SP 2010 we can update existing information
In MOSS 2007 through we can just read the information and we can't update the existing services
Improvement in Deployment
In SP 2010 we can Deploy through Farm based and solution based solution in SP 2010
In MOSS 2007 there is no such option
Alerts
In SP 2010 it has been improved in validation and unique values. While creating column itself we have an option "Allow Duplicate values" to Yes or No
In MOSS 2007 alerts were sent only through emails but in SP 2010 users can also send alerts to mobile device as SMS message. A New property delivery channel is introduced to indicate, whether the alerts is delivered as Email or an SMS message
Improvements of events
New events for list creation and web creation
No List and web events in MOSS 207
Getting Items from the list
In SP 2010 through object model we can fetch multiple list data by LINQ query and object model
In MOSS 2007 we can fetch only through object model
Rating
In SP 2010 we can have rating column by default
In MOSS 2007 we should install the feature that is available in codeplex to have rating
Key Word Suggestions
In SP 2010 we can have keyword suggestions
In MOSS 2007 we don’t have any keyword suggestions
Taxonomy
In SP 2010 we can create Taxonomy by using Managed Metadata service
In MOSS 2007 we don’t have taxonomy
Other Features
In SP 2010 we have Power Shell Scripting, JavaScript object model, Chart Web Parts
In MOSS 2007 we don’t have Power Shell Scripting, JavaScript object model, Chart Web Parts
Running stsadm command
In SP 2010 we have to go 14 hive path to run stsadm command
In MOSS 2007 we have to go 12 hive path to run stsadm command
Content Type Publisher
 In SharePoint 2010 we can create one specific web application which serves as a content type publisher and other web applications consumes those content types as a consumer from the main web application which is considered as a content type hub.
Here you do not have any options other than recreating the same content type in another web application .