Saturday, February 27, 2010

SharePoint 2010 HTML Markup changes in rendering

Wow. SharePoint 2010 has lot of new features. Everyone knows that. But, among all of them, the main thing I have really loved is the HTML markup generated for the SharePoint 2010. You know what? They have replaced the tables with Div and ul, li etc. So, this is a very good thinking and change from SharePoint team which likes by all and browsers. Everyone knows what are the problems with TABLES and in SharePoint 2007 you find many many tables. But not any more in SharePoint 2010.
Below is the simple snapshot which is taken from the view source of SharePoint 2010 Publishing site template.

Friday, February 26, 2010

SharePoint 2010 ECMAScript - How to know logged in user information

This is post which is simple and not really needed. But when I started writing the code in ECMAScript I have faced problems in getting the logged in user information. So, my readers may feel good after see this post and really most the users are looking for this too.
By this time, we have really understood all about ECMAScript Client Object Model and debugging. So, it's easy for us to know it well.
Please find the code below to get the current user information.
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js");
var context = null;
var web = null;
var currentUser = null;
    function getWebUserData() {
        context = new SP.ClientContext.get_current();
        web = context.get_web();
        currentUser = web.get_currentUser();
 currentUser.retrieve();
        context.load(web);
        context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    }
    function onSuccessMethod(sender, args) {
        var userObject = web.get_currentUser();
        alert('User name:' + userObject.get_title() + '\n Login Name:' + userObject.get_loginName());
    }
    function onFailureMethod(sender, args) {
        alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
    }
</script>
So, the above code returns you the user object and displays user name and user login name. You can customize it as you want and please let me know the feedback or questions you have.

SharePoint 2010 ECMAScript - how to know all methods in SP object and debug

After spent good time to write nice posts on Client Object Model and ECMAScript how to use, I want to present you another nice tip on how we know all the methods and properties available for the SP object in the ECMA javascript . MSDN documentation is not finalized or completed yet to know what properties and methods  for SP objects have. And when you want to query something [like list or web] and you are not aware of what it has inside methods and properties, then the best way as far as I know is, using the Javascript debugging using Internet Explorer.

SharePoint 2010 - Client Object Model - ECMAScript - Introduction on how to use

In SharePoint 2010, the great feature is introducing the client object model [Read this article before proceed]. The great advantage with this is, we can do plenty of things without server side coding using the ECMAScript. There are plenty of default supported files to use and do whatever you want with the SP Package files. All javascript files will be found in the layouts folder. All of them starts with "SP" name.

ECMAScript works only for the current context. It means from outside of the site, you can't access the SharePoint data. This won't support the cross-site scripting.

How to add the reference to SP.js and access the data?

Thursday, February 25, 2010

SharePoint 2010 - Complete details about Client Object Model

This is the introduction to the Client Object model introduced in the SharePoint 2010. This is going to be a huge help and useful part in SharePoint 2010 for developers and makes lot of customization to the existing SharePoint system.

In eariler versions, I mean till SharePoint 2007 the code runs using the SharePoint object model to run against the server which is running SharePoint. Other than the SharePoint server object model, other way is, simply reference the web service and use that to get and manipulate data. Then what is the need of SharePoint 2010 Client object model[Cleint OM] concept?

Wednesday, February 24, 2010

Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa

This is a SharePoint 2010 BETA edition exception. Most of the people who are working with SP2010 should get this exception. Below are the exception details:

Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.

Workaround:
  1. Doing an IISRESET solving the problem but it is solving temporarily.
  2. Open IIS and go to your SharePoint site. And find the application pool.
  3. Go to application pool, click Advanced settings, change the value for "Load User Profile" to "true".
That's it!!! You are done.
Special thanks to Bassem Georgi for the nice tip.

Tuesday, February 23, 2010

JQuery 1.4.2 released

These guys are very quick and fast updates in releases. Jquery 1.4.2 is released and they came up with strong version. This version again improved plenty of things in terms of performance and some events. Fixed lot of issues and bugs. So, get it and use it. Read the complete list of features on their site.

http://blog.jquery.com/2010/02/19/jquery-142-released/

Tuesday, February 16, 2010

SharePoint 2010 site templates not showing in create site page, How to get them?

This is a bit surprising to the people who are playing with SharePoint 2010 very first time. When we try to create subsites in the main site collection we need to pick the right site template and go. But, what if you are not able to see the list of site templates in the list?
  1. I have created a simple publishing site in SharePoint 2010 server and below is the screen which looks like by default.
     

User profile import problems in SharePoint 2010

I know, most of the SharePoint administrators and development team facing problems with importing or syncing up the active directory with user profile store or SSP in SharePoint 2010. There are many reasons and you need to read the complete documentation before do anything.

I have initiated the thread in MSDN forums here and still that is growing. User profile import

But, there are some configurations we need to check before do the user profile import. One of the important notes is "The farm is running either the Standard or Enterprise version of SharePoint Server 2010 and you have run the farm configuration wizard. Profile Synchronization does not work on a stand-alone installation for SharePoint Server 2010 Beta."