• Engage in SharePoint 2010 Development

    SharePoint 2010 provides a broad a unique set of integrated capabilities, within a unified infrastructure to allow organizations share data and information on different types of sites including intranets, extranets and internet facing sites scaling up to millions of users .  Because of the dynamic nature those solutions, SharePoint 2010 provides a platform that allows developers to customize, extend and build rich solutions on top its capabilities to address the different needs.

     

     How do I start SharePoint development?  How is it different from other development platforms? ASP.Net, Client applications and Database applications?

     

    Eric White discusses these points his blog post, SharePoint Developer Building Blocks: Technologies for Creating SharePoint Applications. He also addresses other important points such as the different types of SharePoint applications, building blocks, resources, development tools and SharePoint application lifecycle management.

     

     Now, as a developer I know what I can do with SharePoint, my sleeves are up and I want to get my warm up my hands.  You can download the 2010 Information Worker Demonstration and Evaluation Virtual Machine or Download SharePoint Easy Setup for Developers Kit.  This is a new set of pre-packaged tools that help developers easily get started with SharePoint 2010 development by automating the provisioning of a developer workstation using Windows 7, SharePoint & associated tools.

     

    Once you got your hands on the environment, check out these videos, Get Started Developing on SharePoint 2010, and get your hands on the SDK, and dive into the SharePoint Developer Center

     

    Happy SharePointing…

     

    Mohamed Yehia

    Find me on twitter : @mohdyehia

  • Recursive and Folder-Scoped LINQ Queries in SharePoint 2010

    As you might experienced in SharePoint 2007, a CAML query is by default non recursive. In other words, if you execute a CAML query, you will end up with items from the list root folder. This is still the same in SharePoint 2010. You have to define extra query options as shown below in case you want to query all folders and sub folders within a list (Recursive Query) :

    qry.ViewAttributes = "Scope='Recursive'";

    And if you want to scope your query to a certain folder :

    qry.Folder = list.ParentWeb.GetFolder("Folders DocLib/2008");

    What about LINQ to SharePoint ?

    The default behavior is the same, however if recursive querying is the desired behavior, you can use the ScopeToFolder method from your EntityList<T> object.

    Note the following queries:

    var q = dc.Projects.Where(p => p.DueDate < DateTime.Now.AddMonths(1));
    var q = dc.Projects.ScopeToFolder("", true).Where(p => p.DueDate < DateTime.Now.AddMonths(1));

    The first one executes against the list root folder while the second one is recursive. You might be wondering about the empty string that I’m passing to ScopeToFolder method. Well, let’s see what MSDN says about the parameters that the method expects.

    public IQueryable<TEntity> ScopeToFolder( string folderUrl, bool recursive )

    folderUrl –> The URL of the folder.
    recursive –> true to include items in subfolders; false to exclude them.

    That’s it, if you want to scope your LINQ query to a specific folder, pass the folder URL as the first parameter to the method & “true” if you want the recursive behavior of the query. In the second query, I just wanted the recursive behavior and I didn’t want to scope my query to any folders so I passed an empty string, this does the trick.

    Hope this helps!

  • Invitation: Enterprise Developers Academy–Microsoft Egypt

    Develop your expertise

    Get up to speed on all the latest tools available to enhance
    your skills and create new, innovative solutions.

    Develop your network

    Meet and interact with industry leaders and professionals. Share
    and exchange tips on development, generate ideas and establish relationships.

    Develop new solutions

    Discover how you can get more value out of your existing tools and
    deliver superior solutions through in-depth discussions and demos.

    Don't miss this exclusive event.

    Introduction to SharePoint Development

    Date: Wednesday October 27, 2010

    Time: 10:00 am – 3:00 pm

    Presenter: Ashraf Mansour

    Place: Microsoft Egypt Building in Smart Village

    Description:

    Learn to develop for SharePoint Server 2010 using Visual Studio 2010, with demos on developing a sample custom workflow and a sample web part.

    Seats are limited, to confirm your attendance, please reply back to mohamedw@microsoft.com

  • Creating a host-named site collection programmatically

    A host header is a third piece of information that you can use in addition to the IP address and port number to uniquely identify a Web domain or, as Microsoft calls it, an application server.

    In SharePoint 2010, You can apply host headers at two different levels :

    • The Web application (IIS Web site) level
    • The site collection level

    The following code snippet programmatically creates the host-named site collection with the URL http://training.sharepoint.com in the SharePoint Server 2010 Web application with the URL http://sharepoint

    SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://sharepoint"));
    SPSiteCollection sites = webApp.Sites;
    SPSite Site = sites.Add(“http://training.sharepoint.com”, "Training","Training Site", 1025, "STS#0", "domain\ayman",
    "Ayman El-Hattab", “ayman@aymanelhattab.com”, "domain\marwan”,"Marwan Tarek", "marwan@marwantarek.net", true);

    You can also use PowerShell to achieve the same results, for more info refer to : http://technet.microsoft.com/en-us/library/cc424952.aspx

  • WIF's Claims to Windows Token Service

    Windows authentication have been always fortified, which was for a good reason. Yet this fortification made some use cases impossible to happen here is one that sum it all:

    You have a service bus (or just service interface) that abstracts all your backend systems to user. All message float in using certificate based authentication or just non A/D username & password. A couple of your backend systems work using windows authentication and all audit work against this authenticated identity.

     

    You are left with one of two choices:

    •  Use trusted sub system model (all calls is using one user identity). And disregard the audit, or extended to have another field for the original caller.
    • (foolish choice) Use intermediate store, save all usernames & passwords. Use these credentials in each call.

     

    This has been the only choices for us before. Until Enter WIF (Windows Identity Foundation), which provides Claims to Windows Token conversion, allowing you to convert claims to windows principals while employing proper security validations.

     

    Here is how it works: http://msdn.microsoft.com/en-us/library/ee517278.aspx

     

     

    Here is how you can proxy Exchange’s OWA authentication to ADFS using C2WT (Claims 2 Windows Token) http://www.theidentityguy.com/articles/2010/10/15/access-owa-with-adfs.html

     

    Weather your federated identity is across web applications or services applications the problems you previously worked around can now be eliminated entirely.

    Find me on Twitter: http://www.twitter.com/khnidk