Showing posts with label U2U. Show all posts
Showing posts with label U2U. Show all posts

Wednesday 11 June 2014

CAML Designer for SharePoint 2013 is Brilliant

I always used U2U for checking my CAML queries in SharePoint.  I have just used CAML Designer for SharePoint 2013 and it is brilliant.

Link to the CAML Designer tool
http://karinebosch.wordpress.com/2012/12/13/caml-designer-for-sharepoint-2013-released/

Simple Example of using CAML to query a list:
string riskListCAMLQry  = "<Query><Where><Eq><FieldRef Name='Status' /><Value Type='Text'>Scheduled</Value></Eq></Where><View><RowLimit>1000</RowLimit></View></Query>"

Call using C# CSOM
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = riskListCAMLQry;  
// Add a where clause on the status on the list to restrict the result set, only return the first 1000 rows

Friday 2 July 2010

Dynamic LINQ to SharePoint 2010

Problem: I have 2 connected Web Parts, the provider provide multiple values for lookup columns. I started with LINQ to SharePoint (SPMetal) but could not build up the query dynamically.
Hypothesis: My initial reaction was to use a dynamic CAML query as done in MOSS using U2U to work out my query. The issue is that the CAML is not safe (as we don't get validation until run-time) but at least I can dynamically build up my query.

Using Dynamic link with LINQ to SharePoint to can achieve the required result. The code is safe as least for run-time (my logic is still dodgy). Only issue is with the performance and the results if the list if large. Using a very broad LINQ-to-Sharepoint query that is converted into a CAML query anyway I get a large result set. I then filter using dynamic LINQ. Pretty heavy filtering and inefficient querying. Throttling concern: If I returned more than 5,000 items (default list throttling limit for SP2010 lists) I now loose results that should be queried (SharePoint would trim my SPMetal query and then Dynamic LINQ would work on the max of 5,000 items). Sure you can turn throttling off as a farm admin but not a great idea. You could programatically override the throttling (SPQueryThrottleOption.Override) using the server OM but this doesn't help for your SPMetal query.
In this case, my best option is to use a dynamic CAML query and get the exact set of data I am looking for.

Tip: Only get the fields you are using in CAML queries.
More Info:
Building CAML queries
Dynamic LINQ - Scott Guthrie

LINQ to SharePoint Posts

Tuesday 8 June 2010

Developer SharePoint Machine Prep

BgInfo - Automatically display local computer information on the desktop's background, such as the computer name, IP address, ect
Disable ShutDown Event Tracker - Stop the comment box on Shut down of your developer machine.
CKS - Community Kit for SharePoint: Development Tools Edition by Matt Smith and others. Invaluable if not just for deployment of code.
.NET reflector - Explore compiled .NET assemblies
SharePoint Dispose Checker Tool
SharePoint Manger
U2U - CAML builder tool - Still a great tool and works with SP2010
WireShark
SharePoint Designer (SPD) 2010
Visual Studio 2010 (Professional version is the lowest edition but any version will work)
FireFox with Firebug (like the IE developer toolbar, good developer tools e.g. css), collazilla (colour picker for firefox), Firequery (jQuery addin), FiddlerHook (integrate Fiddler) & YSlow (Page performance and optimisation)
Fiddler
IE Developer Toolbar part of IE 8
Update 29/08/2010 - Visual Studio 2010 SharePoint Power Tools - Useful if you are using Sandboxes, adds 2 functions: Sandbox visual web parts & Sandboxed compilation.  Also note CKS has remove there sandboxed template in version CKSDev 1.1 release 1 August 2010.  Update 23/06/2012 - CKSDev is at version 2.4
Accessibility: http://www.cynthiasays.com/ &
Update 20/09/2010 - Also add Visual Studio 2010 Sharepoint Power Tools, it has sandboxed solutions and sandboxed visual web parts has been removed from the CKSDev project, so also get the latest CKSdev code.
Update 20/09/2010 - SPTraceView on codeplex is worth installing.
Update 26/11/2010 - Enable wifi on Windows 2008 R2
Update 24/06/2011 - Smtp4Dev is a useful codeplex project for collecting email sent from the dev machine.
Update 24/06/2011 - Office 2010 Plus has all the office applications and includes InfoPath.
Update 24/06/2011 - Visual Studio 2010 SP1 was realease in May 2011 and should be installed.
Update 24/06/2011 - Unit Testing nUnit, TestDrive.NET & TypeMoch or Rhino Mochs.
Add VS cmd prompt to VS using External Tools:  %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
Update 08/01/2013 - Create Shortcuts on the desktop using Powershell (14 hive folder and  hosts.exe) download
Update 09/01/2013 - Ps to add hosts entries.
Update 13/02/2014 - Process Explorer (Usefule if a machine has high memory, CPU or IO issues)
SoapUI if you are working with web Services.