Thursday, July 18, 2013

Sharepoint or ASP.Net?

SharePoint or ASP.Net?



                                                                         

 

As architects we have often come across this scenario in Software development life cycle.
The grilling project requirement phase ends, it’s time to start getting design savvy and the tech architecture team will brainstorm amongst eachother to come up with a recommended architecture.

 SharePoint and Asp.net are widely used technologies and finalizing one vs the other is a challenging task in itself.

Based on my experience and what I have learned from my community, for the applications that can utilize the below features of SharePoint - this platform should be the preferred choice...
  • Collaboration
  • Internet facing website
  • Social networking such as Blogs, Wikis, Communities, etc
  • Applications requiring browser enables forms
  • Enterprise Search
  • Information portals
  • Business Intelligence and Dashboards
  • Workflows
  • Content Management
  • Ms Office Integration
  • External Data systems integration via BCS
  • Document Management

If the dilemna still remains, we need to look at different aspects before deciding whether to go for SharePoint or Asp.Net.

Below I have collated a couple of my considerations:

Licensing : To get the Basic OOB Out-of-the-box features from the Free version of Sharepoint
SharePoint Foundation is aptly named because it provides the base for SharePoint 2010 Standard and SharePoint 2010 Enterprise. SharePoint Foundation is free and is supported on Windows Server 2008 R2 and Windows Server 2008 SP2. Here’s a list of what you get in SharePoint Foundation (see Editions Comparison at Microsoft's site to learn more about each feature):

SharePoint Foundation
AccessibilityBlogsBrowser-based Customizations
Business Connectivity ServicesBusiness Data Connectivity ServiceClaims-Based Authentication
Client Object Model (OM)Configuration WizardsConnections to Microsoft Office Clients
Connections to Office Communication Server and ExchangeCross-Browser SupportDeveloper Dashboard
DiscussionsEvent ReceiversExternal Data Column
External ListsHigh-Availability ArchitectureImproved Backup and Restore
Improved Setup and ConfigurationLanguage Integrated Query (LINQ) for SharePointLarge List Scalability and Management
Managed AccountsMobile ConnectivityMultilingual User Interface
Multi-TenancyOut-of-the-Box Web PartsPatch Management
Permissions ManagementPhotos and PresenceQuota Templates
Read-Only Database SupportRemote Blob Storage (SQL Feature)REST and ATOM Data Feeds
Ribbon and Dialog FrameworkSandboxed SolutionsSharePoint Designer
SharePoint Health AnalyzerSharePoint ListsSharePoint Ribbon
SharePoint Service ArchitectureSharePoint Timer JobsSharePoint Workspace
Silverlight Web PartSite SearchSolution Packages
Streamlined Central AdministrationSupport for Office Web AppsUnattached Content Database Recovery
Usage Reporting and LoggingVisual Studio 2010 SharePoint Developer ToolsVisual Upgrade
Web PartsWikisWindows 7 Support
Windows PowerShell SupportWorkflowWorkflow Models

SharePoint 2010 Standard includes SharePoint Foundation features and adds these features:
Ask Me AboutAudience TargetingBasic Sorting
Best BetsBusiness Connectivity Services Profile PageClick Through Relevancy
Colleague SuggestionsColleagues NetworkCompliance Everywhere
Content OrganizerDocument SetsDuplicate Detection
Enterprise Scale SearchEnterprise WikisFederated Search
Improved GovernanceKeyword SuggestionsManaged Metadata Service
MembershipsMetadata-driven NavigationMetadata-driven Refinement
Mobile Search ExperienceMultistage DispositionMy Content
My NewsfeedMy ProfileNote Board
Organization BrowserPeople and Expertise SearchPhonetic and Nickname Search
Query Suggestions, "Did You Mean?", and Related QueriesRatingsRecent Activities
Recently Authored ContentRelevancy TuningRich Media Management
Search ScopesSecure Store ServiceShared Content Types
SharePoint 2010 Search Connector FrameworkStatus UpdatesTag Clouds
Tag ProfilesTagsTags and Notes Tool
Unique Document IDsWeb AnalyticsWindows 7 Search
Word Automation ServicesWorkflow Templates

SharePoint 2010 Enterprise includes the features in SharePoint Foundation and SharePoint 2010 Standard and adds these features to the mix:

Access ServicesAdvanced Content ProcessingAdvanced Sorting
Business Data Integration with the Office ClientBusiness Data Web PartsBusiness Intelligence Center
Business Intelligence Indexing ConnectorCalculated KPIsChart Web Parts
Contextual SearchDashboardsData Connection Library
Decomposition TreeDeep RefinementExcel Services
Excel Services and PowerPivot for SharePointExtensible Search PlatformExtreme Scale Search
InfoPath Forms ServicesPerformancePoint ServicesRich Web Indexing
Similar ResultsThumbnails and PreviewsTunable Relevance with Multiple Rank Profiles
Visio ServicesVisual Best Bets


Again, to learn more about each feature, see this side-by-side comparison chart at Microsoft’s SharePoint 2010 website. Hovering over each item displays a description that explains what the feature does.

You can use SharePoint 2010 to set up intranet, extranet, and Internet sites. SharePoint 2010 Standard and SharePoint 2010 Enterprise are licensed depending on how you will use SharePoint. There are two ways to use it, and thus two licensing models:
  • Intranet sites: Server/Client Access License model
  • Extranet/Internet sites: Server-only model
Intranet sites. Intranet sites are licensed using a Server/CAL model. SharePoint Server 2010 is required for each running instance of the software, and CALs are required for each person or device accessing a SharePoint Server. There are two licensing models for intranet sites:


  • Check if the requirement maps to Out-of-the-box (OOB) SharePoint features :
Is the requirement to utilze some of the basic features i.e. site provisioning, search, version control, roles/groups, easy forms/Lists (new, edit, view pages), collaboration, workflows, content deployment, alerts, social collaboration on documents etc...?                       

If we are not using any of these features, then it’s probably not worth using SharePoint.. The effort involved in building Custom features will be pretty considerable.

  • Check what kind of System/Application is being built
 Is it one application or similar replicated Applications across many teams\sites?                        

SharePoint is an excellent platform to replicate one type of site to many teams. Site templates are excellent feature of the replication.

  • Check the Scale and Performance objectives of the application                      

SharePoint may not be able to match the performance of a plain ASP.net application as it does a lot more work (security trimming, getting files from database etc.)
Getting back to real life scenarios, we should not forget some project specific considerations:
  •  Cost of project -  Is the licensing cost ( free, standard, Enterprise) goof enough to demonstrate to the client that there will be savings? 
  • Skillset of the team - A very important aspect is to also assess the team's skillset. Have we considered the budget to to ramp up and provide trainings to the team?  Though SharePoint is based on ASP.net, but there is need to have additional knowledge to develop SharePoint applications. Custom development in SharePoint is complex and requires extertise.
DECIDE.............WISELY!!!!
                                                                                                                                                                                                                                                                                    
    --------------------------------------------------------------------------------------------------------

    Refrences: MSDN

Thursday, May 9, 2013

Chicago SharePoint Migration Breakfast Seminar!



Chicago SharePoint Migration Breakfast Seminar officially kicked off today morning at the downtown Microsoft Technology Center. ( Aon Center )

Beautiful building and my very first time to this place, lovely tulips by the side walk and a beautiful day indeed! What more could you have asked for..

 The first session was insightful of the SharePoint 2013 collaboration world  by Alisa Swann, Collaboration Solutions Sales Manager at Microsoft.


Neudesic presented some great thought leadership in the SharePoint Migration world.

Migration has always been one of the challenges for any organizations and to help our community through this migration process there a couple of tools available today one of which is Metalogix.

More details on how Neudesic can help you with their experience and walk you through the process is detailed in the slide deck that was presented.


                
 
 
The key topics that were presented and demoed by me are listed below :
  • Migration Toolkit
  • Responsive UI framework
  •  
     
    Wrapped up the series with a demo of Metalogix migration capabilities by Matthew Calcagno.
     
    If you need more info on any of the items above please leave a note here and i will get back to you at the earliest.
     


                            The tulips in front of the Aon center... beautiful colors of nature....

 

 
Thanks,
Pallavi!

Thursday, March 7, 2013

InfoPath - People Picker Control

Recently I have had the opportunity to deep dive into K2 project where the InfoPath form needed some validation for a valid user and display the current user email.

Well, after scratching my head for a long time I found that this was not something very complex.
All you need to do is the below


  1. Validate User Control :
     InfoPath 2010 comes with Out of box. To add this control in InfoPath 2003 please click here : Contact Selector - Infopath 2003





  

 

Specifying a valid SharePoint site to fetch the existing users and Sharepoint Groups

This Picker controls connects to the SharePoint site the infopath form has been published to.
If the form has not been published to a SharePoint site the settings of the the SharePoint site need to be specified as below
  1. Right-click the control in the view and select Person/Group Picker Properties from the context menu
  2. In the Person/Group Picker Properties dialog, select the SharePoint Server tab
  3. Type the URL of the SharePoint site you want to query




Mandatory field property can be set as below:






A perfect validation is all we need!

You can check for free text validations


 You can search for the user



It validates if a wrong entry is encountered similar to the SharePoint People Picker control.

Tuesday, February 26, 2013

Export to excel Link ...


Today I ran into a scenario where requirement was to NOT use the ribbon to export the list to excel but access it via the left navigation.

After some research I could find a way to do this:

http://[Server]/[Site]/([Subsite]/)_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[ListGUID]&View=[ViewGUID]&CacheControl=1

Replace the [Placeholders] with your specific values.

One way to get the list and view GUIDs is to go into "List settings" then scroll down to the views section and click on the view that you want to use.

Here is an example:
http://development004:100/_layouts/ViewEdit.aspx?List=%7B9B8241B3%2D7F09%2D4F45%2DBEE3%2D755E3F7C3FE4%7D&View=%7B70A055C3%2DAEAD%2D4006%2DAB79%2D93D3E700EEC4%7D

Breaking the above :

List=%7B9B8241B3%2D7F09%2D4F45%2DBEE3%2D755E3F7C3FE4%7D

View=%7B70A055C3%2DAEAD%2D4006%2DAB79%2D93D3E700EEC4%7D


Another Tip :
If you are getting the error displaying the list in Data sheet view download and install
http://www.microsoft.com/en-us/download/details.aspx?id=23734

Monday, February 25, 2013

Custom Site Provisioning - SP2013 way....

Before I move on to the  content for my blog today .. here's some importnant information..SP2013 preview is ending soon to give way to the live version of SP2013 on the cloud ( o365)
 
O365 launch event info below. Please Sign up to see the new stuff.

Virtual Launch Event on February 27th 2013 as Microsoft celebrates the availability of a major new release coming to Office 365 for businesses.  Demo of new features in enterprise social and show how this has transformed the full Office experience you know into an always up-to-date service. Some real-world stories from customers about their move to the cloud. 
 
Now coming back to code....
 
Recently I had a requirement to do some feasibility study for SP2013 for sandboxed solutions. Well as we all know Microsoft has deprecated sandboxed solutions in o365 2013
This means that the functionality will still be available for use in SharePoint 2013, but primarily for backwards compatibility with existing solutions built using the sandbox solution approach.
 
Microsoft's guidance is that if you are building new applications that in the past you would have deployed as sandbox solutions, you should use the new App model for those solutions instead of using sandbox solutions.
 
More info on an article here...
 
Some SharePoint components are used in end-user scenarios but do not have any equivalents in the SharePoint app model. For these you must use farm solutions.

Well the requirement in this case is to "Create a custom user interface to provision a sub site based off a custom template, add some details to the site and add users"

Well - I plan to try this as an app too.. but from the looks of it if I want to create a custom web Template this is not supported. Hence, my first reaction is to create a Sandbox solution.

Upload a custom SP 2013 Site template in the solutions gallery!

 
 
 
 
 


CODE :
 using System;  
 using System.ComponentModel;  
 using System.Web.UI;  
 using System.Web.UI.WebControls;  
 using System.Web.UI.WebControls.WebParts;  
 using Microsoft.SharePoint;  
 using Microsoft.SharePoint.WebControls;  
 using Microsoft.SharePoint.Client;  
 using System.Collections.Generic;  
 using Microsoft.SharePoint.Navigation;  
 namespace SharePointProject1.CreateSubSite  
 {  
   [ToolboxItem(false)]  
   public partial class CreateSubSite : System.Web.UI.WebControls.WebParts.WebPart  
   {  
     string AccountGroup = "";  
     protected override void OnInit(EventArgs e)  
     {  
       base.OnInit(e);  
       InitializeControl();  
     }  
     protected void Page_Load(object sender, EventArgs e)  
     {  
       AccountGroup = txturl.Text + " Account Group - Contributor";  
       // Create more gropups based on requirements  
     }  
     protected string GetCustomTemplate(SPWeb web)  
     {  
       SPWebTemplate SiteTemplate = null;  
       // Find correct template  
       foreach (SPWebTemplate wt in web.GetAvailableWebTemplates((uint)1033)) // for EN-US use LCID 1033, http://msdn.microsoft.com/en-us/goglobal/bb964664  
       {  
         if (wt.Title == "AccountSiteTemplate")  
         {  
           SiteTemplate = wt;  
           break;  
         }  
       }  
       return SiteTemplate.Title;  
     }  
     protected SPWebTemplate GetCustomSiteTemplate(SPWeb web)  
     {  
       SPWebTemplate SiteTemplate = null;  
       // Find correct template  
       foreach (SPWebTemplate wt in web.GetAvailableWebTemplates((uint)1033))  
       {  
         if (wt.Title == "AccountSiteTemplate")  
         {  
           SiteTemplate = wt;  
           break;  
         }  
       }  
       return SiteTemplate;  
     }  
     private void CreateSPGroup(SPWeb newWeb)  
     {  
      //  AccountGroup = txturl.Text + " Account Group - Contributor";  
       SPGroup groupContributor = newWeb.SiteGroups[AccountGroup];  
       SPRoleDefinition roleDefinitionContributor = newWeb.RoleDefinitions.GetByType(SPRoleType.Contributor);  
       SPRoleAssignment roleAssigmentContributor = new SPRoleAssignment(groupContributor);  
       roleAssigmentContributor.RoleDefinitionBindings.Add(roleDefinitionContributor);  
       newWeb.RoleAssignments.Add(roleAssigmentContributor);  
       lblStatus.Text += "</br>Subsite Groups successfully created!!</br> ";  
     }  
     private void AddUsersToGroups(SPWeb newWeb)  
     {  
      //  AccountGroup = txturl.Text + " Account Group - Contributor";  
       SPUser spUser = newWeb.EnsureUser(txtContributor.Text);  
       if (spUser != null)  
       {  
         SPGroup spGroup = newWeb.Groups[AccountGroup];  
         if (spGroup != null)  
           spGroup.AddUser(spUser);  
       }  
       txtSiteDesc.Text = "";  
       txtSiteName.Text = "";  
       txturl.Text = "";  
       lblStatus.Text += "</br>User Successfully added to the group! ";  
       lblStatus.ForeColor = System.Drawing.Color.Green;  
     }  
     protected void Button1_Click(object sender, EventArgs e)  
     {  
       using (SPSite site = new SPSite(SPContext.Current.Web.Url))  
       {  
         using (SPWeb web = site.OpenWeb())  
         {  
           if (string.IsNullOrEmpty(txturl.Text))  
             txturl.Text = "Demo";  
            if (string.IsNullOrEmpty(txtSiteName.Text))  
             txtSiteName.Text = "Demo";  
            try  
            {  
              web.AllowUnsafeUpdates = true;  
              web.SiteGroups.Add(AccountGroup, web.CurrentUser, web.CurrentUser, string.Empty);  
              SPWeb newWeb = site.AllWebs.Add(txturl.Text, txtSiteName.Text, txtSiteDesc.Text, 1033, GetCustomSiteTemplate(web), true, false);  
              newWeb.Description = " New Account site created!!";  
              lblStatus.Text = "Subsite successfully created!! " + "<a href ='" + newWeb.Url.ToString() + "'> New Subsite Link </a> ";  
              CreateSPGroup(newWeb);  
              AddUsersToGroups(newWeb);  
              newWeb.Dispose();  
              web.Dispose();  
            }  
            catch (Exception ex)  
            {  
              lblStatus.Text = "Exception Occured! Error message : " + ex.Message.ToString();  
              lblStatus.ForeColor = System.Drawing.Color.Red;  
            }  
           finally  
           {  
             web.AllowUnsafeUpdates = false;  
           }  
         }  
       }  
     }  
     protected void txtTemplate_Click(object sender, EventArgs e)  
     {  
       using (SPSite site = new SPSite(SPContext.Current.Web.Url))  
       {  
         using (SPWeb web = site.OpenWeb())  
         {  
           txtSubsiteTemplate.Text = GetCustomTemplate(web);  
         }  
       }  
     }  
   }  
 }  


Upload the sandbox soultion to the solutions gallery

 
 


 



Add the web part top a page and start provisioning sites your way in SP2013...!!

Note:
In case you are thinking about the cool User Interface... This is because I have chosen a Theme - Orbit.. This is super simple and easy...
Please go through my blog to see how this can be done!



 
 

Thursday, February 7, 2013

My First NAPA App - o365 SP2013 Preview

What is NAPA ???

 
NAPA is the easiest way to start building apps for the new Cloud App Model introduced in SP2013. You can think of it as a super simple development environment with no installations on the local machines & an online companion to Visual Studio. This is a free app for SharePoint to facilitate rapid application development.

App Model - what is it?

Within the last decade the Internet has evolved tremendously from simple pages to robust social sites that support loosely coupled yet highly integrated third party apps. From the beginning of SharePoint to today, SharePoint has also made significant changes from being a portal site to our newest release. SharePoint 2013.
 
For the developer and ultimately benefiting the user, SharePoint 2013 has made a significant investments to provide a new way to bring custom solutions to users with the new web standards based cloud app model that are easily discoverable and yet will give IT and developers peace of mind knowing that they can scale, are safely isolated from SharePoint yet can leverage the full capabilities of SharePoint.
 
 
One of the new features of SharePoint 2013 development model is the App model. Using this new App model, developers can easily extend SharePoint 2013 and build great apps that integrate with the numerous services. Today web is filled with many services i.e.
Financial data, WikiPedia, Bing Search and Maps etc.  Even SharePoint, Dynamics CRM can provide data for us. This model make it easy for developers to integrate these services into SharePoint for consumption and build solutions that solves specific user needs.

Apps enable SharePoint 2013 users to extend the capabilities of SharePoint 2013 to address specific business needs by allowing users to connect to data and services both from within an organization as well as in the public cloud.

How is it different that what was offered before in SP2010?

The new cloud app model gives the developer the freedom of choice in how they implement apps for SharePoint. No longer are you tied to writing on top of the SharePoint platform, now you can write along-side it with the tools and web hosting platforms of your choice… Whether it is on premise or in the cloud… Whether the platform is IIS/ASP.NET, a part of the Windows Azure family of hosting options or a non-Microsoft web hosting platform.  The final choice is up to you.
 
 
Now we have had WebParts and the like for SharePoint for some time and we can provide similar experiences creating full-trust and sandbox solutions.  The issue is that these apps are tightly integrated with the platform and require some amount of touch to insure as technology advances that our customizations can advance with it.  This is were apps differ, apps are loosely coupled and not dependent on the SharePoint as a platform, but dependent on SharePoint as a service. Apps execute “off-server”, hence they don’t actually run on the SharePoint box but instead are hosted in their own hosting environment which could be the browser, a Window Azure service, ASP.NET or even a non-Microsoft web hosting platform such as Linux or Amazon Web Services.

 
 Life cycle for app for SharePoint development :

 

Developement - Let's build our very first Napa App on the cloud:

Create a new SP2013 preview account by following the instructions here
 
The Team site that is provisioned by default, Let's try to add NAPA app.
 
 
 
 
 
 
 
 
 
You will see that it does not get added. Don't panic yet,  Go to see the details of the error.
 
So we need a site with a developer template / developer features turned on. Hence I go ahead and create a new developer Site. 
 
 
 
 
 
And YAY it gets added !!
 
 
 
 
 
Now, Let's create a new Project:
 
 
 
 
 
 
 
 
 
 
Some changes that we need to do in the Default.aspx
 

 


And Now changes to App.js file

To Change the look and feel of the site changes can be done to our App.css

The O/P looks as below:



I added the code for an embedded Bing map


 <p>A simple embedded map.</p>  
    <iframe width="400" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"  
      src="http://dev.virtualearth.net/embeddedMap/v1/silverlight/aerial?zoomLevel=10&center=47.5_-122.5&pushpins=47.5_-122.5"/>  

 
The app is ready for testing and starts appearing in your gallery

 
 

A couple of items that I tried to add to my NAPA app are below for reference using JavaScript Client Object Model

1. Add a People picker to your page:

 Changes to the App.js file

 
Changes to the default.aspx file  

2. Add a Embedded Bing Search to your page:

Add the below to Deafult.aspx


Important links for reference

MSDN  

Monday, February 4, 2013

o365 - SP2013 Preview Branding....

Recently I tried my hands on branding SP2013 preview site and wanted to share this with the community. SP2013 has vastly reduced the overhead that we had in SP2010 for branding by giving us the flexibility of using the HTML editor of your own choice rather than SP designer. Today we will focus on some of the different ways you can achieve branding in SP2013.

To start with I had to go ahead and create a SP2013 preview account, this is easy to get started with for a free trial. I have blogged about how a  trial preview account can be set up earlier. click here to learn more..

Create a site based off publishing site template and here's how the provisioned site looks..

 
Design Manager :

SP2013 has a new feature called as the Design Manager : In SharePoint 2013, Design Manager can help web developers and designers build and export the visual design of a SharePoint site collection as a package. This package can easily be distributed to customers, or other designated groups, for installation on their site collections. This new feature reduces the complexity of transporting designs, and makes it easier for customers to outsource the visual design of their sites. To access the design manager go to site settings ..

 
 
This will give you a list of links on left navigation and in this blog we will go though a simple process of changing the master page using some of the left navigation links of the Design Manager.
 
A quick and easy way to change the look of your site if you like what you see in the preview.
 


 
 
 
 
Custom Master (HTML) :
 
If you have not happy with what you get in the out of the box options of changing the look and feel there are options to also modify that or create your own custom master page.
 
Create a new minimal Master to start with an empty canvas and start adding your functional branding components via the HTML snippet tool.
 
Very important note : As long as the master page and the HTML file are associated you will only be allowed to change the HTML and not the master.
 
 

Insert Snippet:

Click on the Snippet link. This will redirect you to a snippet tool editor which is customized based on whether you are creating snippets for a master page or a page layout.

Click the Top Navigation button in the ribbon.This will create the HTML snippet you need.You can customize the properties of the top navigation control and click on “Update” to generate the new snippet. Now  copy the HTML snippet to the clipboard and paste it in the right location in the HTML file. Save and Publish the HTML file.
 
 
 
 
 
Explore your Branding elements files via the Explorer :
 
You can also map your local drive to the online account and use any HTML editor of you choice to edit your branding assets. This gives great flexibility to the end user for designing.
 
 
 
 
 
 
 
 
 
 

SharePoint Designer 2013 Preview :
 
Download SPdesigner 2013 from here if you are still hooked to the Designer as I am. Old habits die hard.......








Publish the master files

 
 
Specify Css and Script files if any in the master page

 <link href="_catalogs/masterpage/Custom/Custom.css" rel="stylesheet" type="text/css" />  



Site settings : Master Page -

Set the new master page as your custom master page.



 
 

 

New look and feel...........


The html file and the master page are associated with each other and SharePoint does not allow you to delete the master page or even publish it as long the association is still there.If you wish to remove the association, go to the master page gallery.

   1.Select the Html file
   2.Edit Properties
   3.Uncheck the “Associated File” check box.
   4.Save


You could also build the master page per the specifications and then, disassociate the html file, package the master page in a wsp and then deploy it to your various environments.
      Or
Use the design manager to create a design Package which can be imported across
environments. This is what I will be exploring more in my next blog.