SharePoint 2010 Client Object Model, 

synchroneous and asynchroneous behaviors


( Brief Note :
Asynchronous Call  - code continues to execute and does not wait for the server response 
Synchronous   Call  - code  always waits for the server response )

Example :
We have a lot of questions regarding the client object model and its two execution methods which are:
- ExecuteQuery() => synchroneous
- ExecuteQueryAsync(callback success,callback failure) => asynchroneous
As a quick reminder, if you execute the following code:
The code waits until SharePoint sends a response back. This can be useful if you want to make your code conditional upon SharePoint's answer.
While, here:
The code keeps going and does not wait for SharePoint's response. So far, so good, probably everybody is well aware of the difference between a synchroneous and an asynchroneous operation.
Where this can become confusing is that the client OM for Silverlight exposes both methods, so we might think that we can use ExecuteQuery() from within a Silverlight application and actually, you can but the result will be the same than using ExecuteQueryAsync().
The reason for that is that Silverlight does not allow you to block the main UI thread, so if you run this piece of code:
from Main.Xaml.Cs, you'll get the following exception:
and if you follow the instructions of the error message stating that you should use a seperate thread, it will indeed work but you'll get again an asynchroenous behavior. So, the conclusion is for those who are still confused:
Silverlight prevents synchroneous methods to avoid blocking the UI process, meaning that by design, it is not possible. So, the ExecuteQuery() method is just there to allow you to implement your own asynchroneous framework if needed.

Content type in SharePoint 2010 :

CONTENT TYPE IN SHAREPOINT 2010 : 

  •  Content types are reusable component, they are not specific to any list or library or page layout.
  • A Content type is a group of site columns (or metadata), workflows and other settings for the item in the list or document in document library or for SharePoint page.
  • Content Type represents group of information with common properties. For example, you are maintaining group of Resume type documents and other normal documents.So you can have a separate Content Type for that Resume type documents.And separate content type for other documents. 
In simple words : 
                   To know  extra information of  Type of the content which we upload. it is not same as file type.Its a kind of meta data. Like attaching labels to the files.
    ex-1 one file type diff content type
    a word file can have
    1.resume 2.business data 3.Menus 4.Rules
    ex-2 same content types can have diff file types 
    business data-word file,excel file, ppt, pdf

    Let we see how to create and use content type.

    Create new content type : 

    • site actions->site settings->Galleries->site content types (there you can see multiple content types available in site)

    At the top there is one option for create (click that)-> Give content type name(I gave as Resume Document)-> Select Parent content type, there it shows already available types(i select document content type and document)  ->click OK
    • After that content type page you can add more columns for this content type, you can also add workflows and other things also.I have created 3 columns for this  1.Candidate Name (as single line of text)2.Domain (as single line of text)3.Experience (as number)


    • Now go to site settings->Galleries->site content types there you can see your content type name

    Using your content type :           

    • To use this content type, create one document library in your site or you can use existing library 
      Go to library settings->General setting->Advance settings->click yes on Allow management of content types->click ok

    • Now you can see Content Types in settings page, thereclick Add from existing site content types, select your content type and click add and OK





    • Now go to library and add new document, you will see two options, one is default and another one is  your custom content type see the below image



    • if you want to disable the default content type of the library then
      go to library settings->Change new button order and default content type->
      select your content type click ok. see blow image




    • Now go to your library now and you can see only your content type


    • now add or upload some documents it will ask the other columns names of content type.give that details and click OK. See the image


    now the file will be uploaded but you cant see the default columns

    • If you want to see select the file and
      click properties. Now you can see the default columns available


    Like this we can create our own content type.

    What is Content type in SharePoint 2010?

    CONTENT TYPE IN SHAREPOINT 2010 : 

    •  Content types are reusable component, they are not specific to any list or library or page layout.
    • A Content type is a group of site columns (or metadata), workflows and other settings for the item in the list or document in document library or for SharePoint page.
    • Content Type represents group of information with common properties. For example, you are maintaining group of Resume type documents and other normal documents.So you can have a separate Content Type for that Resume type documents.And separate content type for other documents. 

    In simple words : 
    •                    To know  extra information of  Type of the content which we upload. it is not same as file type.Its a kind of meta data. Like attaching labels to the files.
    • ex-1 one file type diff content type
    • a word file can have
    • 1.resume 2.business data 3.Menus 4.Rules
    • ex-2 same content types can have diff file types 
    • business data-word file,excel file, ppt, pdf

      Want know more see Click here for Link1 , Link2,Link3

      BCS vs BDC in SharePoint :

      BCS VS BDC IN SHAREPOINT :

      Business Connectivity Services (BCS) :

      • BCS is used to connect with external content like sql data.
      • Using Business Connectivity Services, you can create, read, update, delete, and query (CRUDQ) to the external system from a Microsoft Office application or SharePoint site


      Business Data Catalog

      • It is the old version of the  BCS, it is also widely used to fetch external data.
      • It differ from BCS by it can only read from external data,editing is not available here.


      What is List? and What is Library in SharePoint?

      SharePoint List :

      • Lists are a key, underlying feature of your SharePoint site. 
      • A list is a collection of data that you can share with team members
      • Lists have columns, which define the attributes that you want to record about each item in the list.
        SharePoint Column Data Types
        Column Data Type*What It’s Used ForDisplay on Form
        Single Line of TextDisplay text and numbers (such as phone or course numbers, or zip code) up to 255 characters.Single line text box (The text box may not show all 255 characters.)
        Multiple Lines of TextDisplay multiple lines of text.Select from Plain Text, Rich Text, or Enhanced Rich Text. Depending on the number of lines you select, this option shows as a text area of that size with additional toolbars to format text.**
        Choice***A defined list of choices; for example, categories or departments.Drop-down list is the default and most common.
        NumberNumerical values that can be used for calculations.You can identify a min/max value number with a choice of decimal options.
        CurrencyNumerical values that represent money.You can identify a min/max value currency. Includes options for decimal places and currency format.
        Date and TimeDates and times.Date and/or Time-Calendar Picker.
        LookupValues from another list — for example, categories could be stored in a lookup list for document metadata.Drop-down list populated based on values from other list.
        Yes/NoBoolean value of Yes or No.Check box.
        Person or GroupDirectory listing information from SharePoint.The person or group is shown as a hyperlink and can include presence information.
        Hyperlink or PictureHyperlink (internal or external) or an image.Hyperlink or picture.
        CalculatedData that can be calculated by formula.Result of calculation; can be text or numerical.
        External DataData stored in a data source; for example, a table or view in an enterprise database.Text.
        Managed MetadataProvides a common set of keywords and terms that can be used across the organization.Text.

      SharePoint Library :

      • A SharePoint library is a place on a site where you can create, collect, and update files with others
      • Library is on a Web site, other people can easily access the files using a Web browser, provided they have the permissions to do so.
        Type of LibraryDescription
        Asset LibraryAsset Library allows you to create a rich media library and lets you create, browse, share, organize and mange images, audio and video files.
        Data Connection LibraryHere you can create, browse, share, organize and manage files that contain information about connecting to external data connections.
        Document LibraryHere you can create, browse, share, organize and manage documents or other files. It also allows creating folders, versioning of documents and check-in/check-out of files.
        Form LibraryHere you store and manage Microsoft Office InfoPath forms (or XML files for use with Microsoft Office InfoPath) for instance business forms like a status report, purchase orders, etc...
        Picture LibraryHere you can upload and share pictures with others and it includes a built-in image viewer.
        Report LibraryHere you can create web pages and reports to track business metrics, goals, KPIs (Key Performance Indicators) and business intelligence information.
        Slide LibraryIt allows you to create a library for storing and sharing Microsoft PowerPoint slides.
        Wiki Page LibraryIt allows you to create and store customizable pages of content that are linked together and can be edited by several people.

      What is SharePoint Workflows?

      WHAT IS SHAREPOINT WORKFLOWS?

      • Workflows are a real poweful tool built-in in SharePoint, a series of actions that correspond to a work process to  improve business processes without any custom coding. 
      Workflows have set of




      • Events -(* An item is created.* An item is changed)
      • Actions -(* Create, copy, change, or delete list items (including documents),* Check items in or out. * Send an e-mail message)
      • Conditions -(* If item is created)
      • steps - defined by user,for better understanding.

        Types:

         List Workflows-created for on the particular list
         Reusable List Workflows - created in top level site in site collection
         Site workflows - associated with sites.


        Windows Workflow Foundation supports two fundamental workflow styles:


        sequential workflow-a workflow as a procession of steps that execute in order until the last activity completes.The state machine can have a final state that determines the end of the workflow.
        state machine workflow-represents a set of states, transitions, and actions.The state machine can have a final state that determines the end of the workflow.

        see this link for an example  http://blogs.msdn.com/b/workflows_for_product_catalogs/archive/2012/11/02/create-a-simple-workflow-that-reads-from-and-writes-to-a-product-catalog.aspx

        What is web Part

        WHAT IS WEB PART ?

        Web Parts are user interface elements that are used in pages on SharePoint sites to present information that is pulled from multiple data sources.

        Examples : 


        1. Content Editor Webpart: This webpart will be used for authoring rich content.This will be available in Media and Content section.
        2. Media Webpart : This webpart is a best pick to host media elemnts like video or Images 
        3. Page Viewer Webpart: If you have a webpage wither internal/external as a part of the web part page, Page Viewer webpart is a best pick for it.
        4.Silverlight Webpart: Its a custom web part developed using silverlight. 

        SharePoint Client Object Model VS Server Object Model

        SHAREPOINT CLIENT OBJECT MODEL VS SERVER OBJECT MODEL

        SharePoint Client Object Model :


        • Client Object Model Provides very rich user interface.
        • It will not affect the whole form while build and run.
        • No SharePoint installation required in the development machine.we can build and run on any machine.
        • No IISREST is required while deploying a Silverlight.
        • We cannot use the RunWithElevatedPrivilege kind of a delegate.
        • Classes available to access SharePoint data is very limited in COM. For example, COM do not have Classes for accessing User Profiles. We need SharePoint web services to access.



        SharePoint Server Object Model :

        • Server Object Model  user interface not so good as COM.
        • It will affect the whole form while build and run.
        • SharePoint installation required in the development machine.we can build and run only in the installed machine.
        • IISREST is required while deploying a Server object model
        • RunWithElevatedPrivilege kind of a delegate are available here.
        • Many Classes available to access SharePoint data is available which is not available in client object model 

        Classic Mode vs Claims Based Authentication in SharePoint 2010


        CLASSIC MODE VS CLAIMS BASED AUTHENTICATION IN SHAREPOINT 2010

        Classic Mode:
        •  This is nothing but Windows Authentication. 
        • If any web application is created with Classic Mode Authentication then it cannot applicable to configure forms based authentication.
        • We can convert from classic mode to Claims based using PowerShell
        Claims Based
        • In SharePoint 2010 for a web application we can enable both windows AND forms authentication.
        • If you want to convert from Claims based to Classic Mode then it is not possible
        • Normally We use Claims based authentication basically its more secure than classic mode 
        see the below table to know difference between windows vs form based authentication
        Windows Authentication refers to authenticating against Windows user accounts on the box that the application is running on. The credentials are matched with the Windows domain through IIS.
        Forms authentication is a stand alone method of authenticating in .NET forms that you can hook up to some other system, such as a database.

        Method categoryAuthentication methods
        Windows authenticationNTLM
        Kerberos
        Anonymous
        Basic
        Digest
        Forms-based authenticationLightweight Directory Access Protocol (LDAP)
        Microsoft SQL Server database or other database
        Custom or third-party membership and role providers
        SAML token-based authenticationActive Directory Federation Services (AD FS) 2.0
        Third-party identity provider
        Lightweight Directory Access Protocol (LDAP)

        Site Definition VS Site Template


        SITE DEFINITION VS SITE TEMPLATE

        Site definition

        • site definition is the basic blueprint for a site, including how it looks, what lists it contains, default navigational structures, and so on. 
        • A site definition consists of .aspx pages and .xml files with Collaborative Application Mark-up Language (CAML).
        • A site definition is installed on file system of web front ends, located at ..\12\Template\SiteTemplates. This directory is language-neutral.

        Site template : 


        • site template can be created from within the Sharepoint application, A site template (*.stp file) is created through the user interface or through implementation of the object mode (example-taking backup of a site)
        • The site template package is a package containing a set of differences and changes from a base site definition
        • A site template is based on the underlying site definition, which means that if you create a new site from a template, and later change the underlying site definition, you run the very real risk of irreversibly screwing up your site.

        Difference : 

        Site Definitions
        Site Templates
        Files are on disk, better performance.Files are in database, less efficient.
        Highly customizable and extensible (XML  and .NET code is much more flexible than UI)Not easily extensible  (You are limited by what UI offers)
        Can provision multiple webs *Can only provision one web
        Complex to createEasier to create
        Requires admin access to server for deploying.Installable from a Web UI by site owners.
        Modifying the site definition after provisioning at least one site from it is not supported and might break existing sites.Custom templates can be modified without affecting existing sites that have been created from the templates(**).

        SharePoint architecture & (WebApplication vs SiteCollection vs Sites)

        SHAREPOINT ARCHITECTURE : 

                                        Before to see architecture you should know difference between  the following things

        WebApplication vs SiteCollection vs Sites

        WebApplication :
        Is a collection of SiteCollections. In technical terms, this is a web site in IIS 
        SiteCollection :
        The name itself indicates, a collection of sites.
        The Site Collection is the root site/Top level site of the web site. Below the Site Collection, there can be one or more Sites.
        Site :
        Is a collection of pages. Site stores list of documents, discussion, events, task and many other types of information.each site can have multiple sub sites also. 

        Where we use this :
        In central admin while we are creating new application a web application created.And next step there we are creating a site collection/Top level site(you can create more site collection in this web application by clicking mange web application).
        Inside the web application we can create sub sites lists library etc.

        SharePoint server architecture :


        SHAREPOINT SITE ARCHITECTURE :