Thursday, December 31, 2009

Currently Logged-In username

Its easy to get currently loggedin user name in clientObject Model. below is the code used in silverlight application.

private string GetLoggedUserName()
{
string name = string.Empty;
try
{
ClientContext cnt = new ClientContext("serverUrl");
if (cnt != null)
{
user = cnt.Site.RootWeb.CurrentUser;
cnt.Load(user);
cnt.ExecuteQueryAsync(loginNameSuccess, loginNameFailure);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + " Inner Exception:" + ex.InnerException.Message);
}
return name;
}

private void loginNameSuccess(object sender, ClientRequestSucceededEventArgs e)
{

this.Dispatcher.BeginInvoke(delegate()
{
MessageBox.Show(user.LoginName);

});

}

Monday, December 21, 2009

Add Excel Web Renderer Webpart From SilverLight ObjectModel

Hi,
First in How To's :)
To add a Excel Webpart from Silverlight oject Model -





ClientContext cnt = new Microsoft.SharePoint.Client.ClientContext("http://hydhtc130180d:3333/");
if (cnt == null)
{
throw new Exception("connection failed");
}
else
{
string ewaWebpart = "<?xml version='1.0' encoding='utf-8'?><webParts><webPart xmlns='http://schemas.microsoft.com/WebPart/v3'><metaData>";
ewaWebpart +="<type name='Microsoft.Office.Excel.WebUI.ExcelWebRenderer, Microsoft.Office.Excel.WebUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' />";
ewaWebpart +="<importErrorMessage>Cannot import this Web Part.</importErrorMessage>";
ewaWebpart +="</metaData>";
ewaWebpart +="<data>";
ewaWebpart += "<properties>";
ewaWebpart += "<property name='Title' type='string'>ExcelWebRenderer</property>";
ewaWebpart += "</properties>";
ewaWebpart +="</data></webPart></webParts>";
LimitedWebPartManager limitedWebPart = cnt.Web.GetFileByServerRelativeUrl("/SitePages/mypage.aspx").GetLimitedWebPartManager(PersonalizationScope.Shared);

WebPartDefinition ewaWebPartDef = limitedWebPart.ImportWebPart(ewaWebpart);
limitedWebPart.AddWebPart(ewaWebPartDef.WebPart,"Left",1);


cnt.ExecuteQueryAsync(s1, f1);

Friday, December 18, 2009

Developer's Attraction for Sharepoint 2010

In previous post I tried to expalain some of the new terms with respect to SharePoint 2010, which business is asking since last version. This post is devoted to developers with same vision in mind.

  • Windows PowerShell Administration : This is really powerfull tool which is there to replace stsadm. stsadm is there to maintain backward compatibiltiy but goign forward cmdlet will rule the sharepoint world. These are command line option which can take result of previous command and can produce objects. This eventually helps is getting small items in working just in few line without wirtting console application for the same, like getting webID. they even can be used in back up restore with vast improvements in performance.
  •  Visual Studo2010 : Lets user to do F5 for sharepoint project, allows user to create visual webpart,  deploy the solution over sandbox, lets developer to create BCS project, content Type and list schema etc.
  • LINQ to SharePoint - This is news to developers...let's learn LINQ, this is new coding style.
  • ClientObject Model - Marvoul point, the team introduced Object Model for javascript,Silverlight and managed code. dev can use the dlls like Microsoft.Sharepoint.Client.Silverlight to work at client side. [will post some how'to very soon]
  • SharePoint Designer2010: allows developer to create new list, new Fom, new content Type and many activties from Designer interface.
 Keep watching for some how to's

Business Attraction for sps2010 / SharePoint 2010

Hi,
Sorry for not being able to post for a long time. In this Post I will try to describe some of new functionalities  which can be described as selling point for the business.

  • Claim Based Authentication -  Authentication can be done against - Active Directory, LDAP,application specefic database,user centric model like LiveID.It is based on 'GENEVA' technology, which it self is comibination of Geneva Server, geneva CardSpace and Geneva FrameWork. In one line - Identity is kept in token, token cotains one or more information about user.
  • BCS - Business Connectivity Services- New generation BDC, open scope for external list though which data can be inserted into LOB system.
  • High Availability-
  • FAST Search [Need extra licensing]-As of now fast search has been integrated as it is in the product.
  • Remote Blob Storage- It is possible to have BLOB  and customised pages in the database stored in out side database such as file system.
  • Performance Control [thorttling]- Two options avaiable
        a. Performance throtlling - Provides a way to administrator where he can define the threshhold values for the server.
        b. list control - provides a way to limit the number of rows returned by a list. Alhtough the maximum number of items has increased upto 50 million items.
  • Backup and Restore- list level backup is possible though UI.
  • SharePoint Online and Multi tanancy- Service architecture gives support for better design in case of SharePoint online. the tenants are managed by subscriotion ID, and each tenatnt can subscribe to its needed service.
  • WorkOffline - workspace2010- Gives support for to bussiness user to work offline to sharepoint Libraries, where he becomes online, the library gets synchronised.
We will talk about more from dev's perspective in next post :)

Tuesday, November 10, 2009

The Diagram

Hi,

Let's Discuss the SharePoint 2010 as per the new diagram -








Sites : Work across firewall, to engage people in effective manner .

Communities : To find people across the network easily.

Content : Manage complete life cycle of content. which means , creation, review , publishing and disposal of the content.

Search : wow, new Fast search is waiting for you :) ..but separate licensee is needed to get FAST search..

Insights : Using Information in more effective manner as per business Need, next generation of Dashboard.

Composites : Creating business solution using OOB features of SharePoint





By the way..I came across most awaited feature in SharePoint -

When you change the site title , the new version even give you option to change the URL as per new title ..cool right !!

keep watching more stories are coming out .............

Tuesday, October 27, 2009

Ban is over to talk about sps2010 !!

VERY good morning with great news :)
Now it is legal to talk about sharepoint 2010 ..
I am trying to list very basic changes / enhancements..in very brief

(It works only on 64bit OS)
  1. The New logo..
  2. The New diagram .. of course..new represenation with new diagram..a pie chart with dark blue back ground . 




Some addition on Licensing Model


The New features..we will talk about in coming weeks are -

Business Connectivity Services (BDC)


Enterprise Content Management (ECM)


Enterprise Search


Performance Point Services


Excel Services


User Profile and Social Data

I will talk about these in coming post..till then..bye


Tuesday, September 22, 2009

External List

Good Morning--
The Normal sharepoint but it gets data from Line of Business Object..confusing right?
This is new feature of Sps2010 where the sharepoint list can import all data from any external system using 'Business Connectivity System' [BDC in MOSS]
The cool feature is after getting all data from external system, the developer can play with it like normal sharepoint list, can add column, data into column etc.

Wednesday, September 16, 2009

Excel Services and soap

Excel Services and Soap call.

javascript enabled web services can be used to get client side activites in Excel services.
Below is the code snippet for getRangeA1 -

request = new ActiveXObject("Microsoft.XMLHTTP");
var url = "http://localhost/_vti_bin/excelservice.asmx";
var envelope = "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<soap:Body>"+
"<getcella1 "+
"xmlns=\'http://schemas.microsoft.com/office/excel/server/webservices\'>"+
"<sessionid>"+ EwaGetSessionId('WebPartWPQ3') +"</sessionId>"+
"<sheetname>"+"Sheet1" +"</sheetName>"+
"<rangename>"+"B3"+"</rangeName>"+
"</GetCellA1></soap:Body></soap:Envelope>";

alert(envelope);
request.open("Post",url,false);
request.setRequestHeader("Content-Type","text/xml");
request.send(envelope);
alert(request.statusText);