Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Obilogic - Accessing BCS Data: Query vs Search (sugukea)

1,439 views

Published on

SharePoint User Group East Anglia – 12 June 2012

http://sugukea010.eventbrite.com/

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Obilogic - Accessing BCS Data: Query vs Search (sugukea)

  1. 1. Accessing BCS Data: Query vs. SearchAnthony ObiSUGUK:EA 12th June 2012
  2. 2. About Me Independent SharePoint Consultant - Obilogic Ltd (a SharePoint ‘All Hat’) Working with SharePoint since Portal Server 2001 (10 years+) MCITP / MCTS SharePoint 2010 Blog: http://community.obilogic.co.uk Twitter: @obilogic Email: aobi@obilogic.co.uk
  3. 3. AgendaQuerying BCS Data via SharePoint : Fundamentals ApproachesSearching BCS Data via SharePoint: Fundamentals ApproachesTitle Fight: Query vs. SearchQuestions (and hopefully Answers)
  4. 4. The ChallengeIdentify the best approach for retrieving anddisplaying external data in SharePoint 2010Based on: Practicality Flexibility Scalability General Awesomeness!!! (Title Fight!)
  5. 5. EnvironmentTWO-TIER FARM • SharePoint 2010 (sp1 + Feb2012 cu) • BCS Service Application • Secure Store Service Application • SharePoint Designer 2010 • SQL 2008 R2 (x2 instances) • All SharePoint Databases • Adventure Works 2008 R2 Sample DBs http://social.technet.microsoft.com/wiki/contents/ articles/3735.sql-server-samples-readme-en- us.aspx#Readme_TOC_worknow
  6. 6. SQL Server DBsSQL Instance 001 SQL Instance 002 SharePoint DBs Sample Databases Database: AdventureWorks2008R2 Table Name: Person.Person
  7. 7. SharePoint 2010 SharePoint 2010 PresentationExternal Lists SP Search Business Connectivity ServicesAdvWorks ECT AdvWorks-Search ECT Sample Databases Database: AdventureWorks2008R2 Table Name: Person.Person
  8. 8. So…Query vs. Search What’s the difference?In a nutshell: SPQuery (Microsoft.SharePoint.SPQuery) VS. KeywordQuery (Microsoft.office.Server.Search.Query.KeywordQuery)
  9. 9. Demo 01Simple ‘Query vs. Search’ PowerShell Examples
  10. 10. #SPQuery (Microsoft.SharePoint.SPQuery)# get the splist (external list)$spList = $web.Lists["AdvWorks-Person"]# set the spquery (+ some properties)$spQuery = new-object Microsoft.SharePoint.SPQuery$camlQuery ="<Where><Eq><FieldRef Name=LastName /><Value Type=Text>Troyer</Value></Eq></Where>"$spQuery.Query = $camlQuery$spQuery.RowLimit = 10# issue the query$spListItemCollection = $spList.GetItems($spQuery)
  11. 11. #SP Search (Search.Query.KeywordQuery)# setup a keyword query object$site = New-Object Microsoft.SharePoint.SPSite https://sp2010test;$kq = New-Object Microsoft.office.Server.Search.Query.KeywordQuery $site;# set the keyword query (+ some properties)$kq.QueryText = "Troyer";$kq.ResultTypes =[Microsoft.Office.Server.Search.Query.ResultType]::RelevantResults;$kq.RowLimit = 5;$kq.ResultsProvider =[Microsoft.Office.Server.Search.Query.SearchProvider]::SharepointSearch;#alternatives ::FASTSearch or ::Default# issue the search$resultTableCollection = $kq.Execute();
  12. 12. SPQuery: Dataflow SharePoint BCS API External List •Secure Store (PowerShell) Database: AdventureWorks2008R2 Table Name: Person.PersonUser SharePoint BCS API External List •Secure Store (PowerShell)
  13. 13. SP Search: Dataflow SharePoint API SP Search Mapped ‘Crawl’ and (PowerShell) ‘Managed’ Properties SP Search Databases: BCS CrawlDB •Secure Store PropertyDB SearchServAppDBUser Full / Incremental SharePoint Crawls (Scheduled) API SP Search (PowerShell) Database: AdventureWorks2008R2 Table Name: Person.Person
  14. 14. SPQuery
  15. 15. Demo 02Displaying SPQuery Data with the XsltListViewWebPart
  16. 16. Demo 03Filter SPQuery Data with the XsltListViewWebPart & FilterWebParts
  17. 17. SPQuery: Filters Aren’t As Good As They Seem How u might think they work: SharePoint Filter BCS External List •Secure Store Presentation WebParts Database: AdventureWorks2008R2 Table Name:User Person.Person SharePoint BCS External List •Secure Store Presentation
  18. 18. SPQuery: Filters Aren’t As Good As They Seem How they ACTUALLY work: SharePoint BCS External List Presentation •Secure Store Database: AdventureWorks2008R2 Table Name:User Person.Person SharePoint Filter BCS External List •Secure Store Presentation WebParts
  19. 19. Demo 04Filter SPQuery Data with the Business Data Web Parts
  20. 20. Demo 05Displaying ‘True’ SPQuery Datawith the XsltListViewWebPart
  21. 21. SP Query: True Query Re-cap Passing SPQuery Parameters: Form / Filter XSLT View BCS ECT WebParts WebPart ReadList Database: AdventureWorks2008R2 •Form •List Param •ReadList Param •Finder Filter Filter Param Table Name:User Person.Person
  22. 22. SharePoint Versions: What’s Included
  23. 23. SP Search
  24. 24. SP Search: Dataflow (Recap) SharePoint Full / Incremental SP Search Presentation Crawls (Scheduled) SP Search Databases: BCS CrawlDB •Secure Store PropertyDB SearchServAppDBUser SharePoint SP Search Presentation Database: AdventureWorks2008R2 Table Name: Person.Person
  25. 25. SPQuery: Dataflow (Search Comparison) SharePoint BCS External List Presentation •Secure Store Database: Ext. Lists AdventureWorks2008R2 Missing! (Not Required) Table Name: Person.PersonUser SharePoint BCS External List Presentation •Secure Store SP Search
  26. 26. Demo 06Creating Enterprise Content Type For SP Search
  27. 27. Demo 07Creating ECT Content Source For SP Search
  28. 28. Demo 08Mapping ECT Properties For SP Search
  29. 29. Demo 09Creating Search & Results Pages For SP Search
  30. 30. Demo 10Creating Custom Results Pages For SP Search
  31. 31. SPQuery: Weigh In Pros ConsPracticality Flexibility Scalability Practicality Flexibility ScalabilityCrawls + Searches any Easily Create Available in Missing SPList XSLTViewWPsupported external Multiple Views SP Foundation Features (no RSS, restricted to currentcontent source (SPLIst / SPDesigner) (NO Enterprise Excel, Add column, SPWeb License Req’d) data sheet views, (guid restriction) item permissionsMultiple (Ext)SPLists Multiple Custom x2 Levels Requires an SPList May need to grantFrom single / multiple SPViews available to unnecessaryECT(s) – across multiple across single / Add /Restrict permissions on ECTsites / site collections multiple (Ext) SPLists Permissions (if x2 SPLists share x1 (SPList / ECT) ECT)Real Time Queries to Perform ‘True” SPQuery Deploying Custom Performance???External Datasource (using parameters) XSLTViewWP arts Lots of real-time(Knock Out Punch!) through dev lifecycle queries of ‘large data (dev, test, prod) sources’
  32. 32. SP Search: Weigh In Pros ConsPracticality Flexibility Scalability Practicality Flexibility ScalabilityCrawls + Searches any All Search Features Very Scalable ! Default results Difficult customising NOT Available insupported external available (RSS, (Search Service display NOT very (XSLT only – NO SP Foundationcontent source alerts etc) App Architecture) user friendly SPList Config UI) (Enterprise License IS Required)Does NOT need SPList Only need to grant Can give users Content Sources Advance planning(Only ECT) ECT permissions to search access determined by ECT required DefaultCrawlAcc without granting “data source name” (if want to separate access to (NOT ECT name) multiple tables from underlying ECT same datasource)Schedule when data is Perform ‘Custom” Can get around Queries to“Crawled” Data Queries BCS Throttle limit External Datasource using “LastIdSeen”(Extracted) (using custom ECT and IDEnumerator NOT REAL TIME - eg. Overnight parameters) methods(Knock Out Punch!) (Knock Out Punch!)
  33. 33. Title Fight !!!Lets Get Ready To Ruuuummmble! x2 Volunteers Please! 

×