Thursday, November 21, 2013

Tips and Tricks - SP2013


Here are some of my commonly used SP2013 Tips and Tricks :


SP2013 Office 365 site - Napa App can be added only to a Site collection of the template : Developer



 
 




 
 

To get a list to display the add new item and edit list menu on a page - add the list to the page and set the view and tool type as Summary Toolbar

 








 
SP2013's Design Manager has an option to Upload Design Files or Design packages by mapping the Master Page gallery as a network drive. I have tried that several times and have had success and failure intermittently.

More details here :

                            
 
 Links in the suite bar ‘NewsFeed, SkyDrive and Sites’ are displayed using “SuiteLinksDelegate” Delegate Control. Adding, Removing and Customizing these Links however is not easy. You can add and remove these links only by Overriding “SuiteLinksDelegate” Delegate Control.



 
 


In SharePoint 2013 Managed Metadata type Site columns from with the site Collection. ‘Metadata type’ Field type & all Site Columns that contain values will automatically become managed properties when they are crawled.

Using Drag and Drop you can only drop 100 documents at a time but the size limit does not really matter. So multiple documents of upto 1gigs can be uploaded at one time but only 100.


 Image Retention in SharePoint 2013 - need to enable the BlobCache of the web application
In the Web.config file for the web application search for "BlobCache" and set enabled=”true”

There is an easier way to email, the link to new Document Library that you created. simply Click the Library tab, and then in the Share & Track group, click Email a link. Your default email program opens a new email message that has the link in the message area.



 
Development environment for Visual studio 2012 - SP2013 development :
 
when I set up my VS2012 environment, the first VS project that I created gave me an error
 
Cannot connect to the targeted site. This error can occur if the specified site is not hosted on the local system. SharePoint solutions work only with locally-installed versions of SharePoint Foundation or SharePoint Server. Remote development is supported only for apps for SharePoint 2013.
 
Usually this error goes away by doing the below:
               
.e.g.
123.45.67.89  myurl.com
 

Monday, November 4, 2013

o365 Sharepoint Online Branding

For the Sharepoint Saturday Chicago on Nov 2nd 2013 @the Hard Rock Hotel, downtown Chicago, I spoke on one of my favorite topics : o365 SP2013 Online Branding - How to make your SP online site not look like Sharepoint.

I had worked on gathering some good demos and the audience found it valuable. The public site that I showcased in my presentation is https://sponlinedemo-public.sharepoint.com/ , it is a carousel based site with static images as of now but can be easily changed to getting the images from the library. Well this site does not look like this was built on Sharepoint.. and guess what.. IT IS!









Here is the session details and deck from my presenation.






 
                         


 

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