SlideShare une entreprise Scribd logo
1  sur  25
Where to save my data, for devs!

Benjamin Steinhauser
SharePoint Saturday Virginia Beach 2014
1
Welcome to
SharePoint
Saturday
Virginia Beach
Jan 11, 2014
7:30 - 8:30 –
Registration(Lobby)
Breakfast (Sponsor Hall)
8:30 - 8:45 - Welcome
9:00 - 10:15 – 1st Sessions
10:30 - 11:45 – 2nd Sessions
11:45 - 12:30 – Lunch
(Sponsor Hall)
12:30 - 1:45 - 3rd Sessions
2:00 - 3:15 – 4th Sessions
3:30 - 4:45 – 5th Sessions
5:00 - 5:30 - Closing &
Giveaways

2
About Me
• Benjamin J. Steinhauser
•
•
•
•
•
•

SharePoint Solutions Developer
B&R Business Solutions
BS/MS in CS; MCP, MCTS (SP2010 Config. & Dev.)
10+ years as ASP.NET Application Developer
5+ years as SharePoint Developer
Creator of Open Source CodePlex Projects
•
•
•
•
•

SPCAMLQueryHelper (over 25,000 downloads)
SPFileZilla (over 200 downloads)
SPMetroGrid
SPMMDNavigator
SPClippy, SPjQuerify, SPEasyBranding

• Presenter at SP User Groups and SharePoint Saturday Events

3
Intro
• Where do I put my application’s data?
• “Every custom SharePoint application is driven by data in one way
or another” –W. Wilen

• Developers face many choices when building solutions that
consume data
• “Knowing is half the battle!”
• Who: is the consumer of the data?
• What: is the type of data being saved?
• When: is the data needed, and for how
long should it persist?
• Why: is the data being stored in the first place!?
• Where: is the data being stored?

4
Cont’d
• What are the advantages/disadvantages for each option?
• What are the restrictions?
• What type of data is it?
• Settings, configuration, licensing
• Structured data (employees, favorites, HR forms, etc.)

• How long should the data persist?
• Who is the data consumer?
• End user, Power User, Administrator
• Web Part, Application Page, Timer Job, Web Service, Service
Application
5
Where is my data!?
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

MS SQL Server
SharePoint List
Property Bags
Web Part Properties
View State/Hidden Fields
Cache
Web.config
SPPersistedObject
Session State
Cookies
6
Databases
•
•
•
•
•

MS SQL Server, Oracle, MySQL
CRUD: create, read, update, delete
For structured data, relational data
Easy (if you know SQL), very fast
Ways to interact:
•
•
•
•

LINQ to SQL
LINQ to Entity
Stored Procedures
Inline-sql in .NET

• But…
•
•
•
•
•
•

Farm solutions only (not for Sandbox Solutions)
Database needs to be created (database administrator)
Permissions need to be configured (database administrator)
Contexts need to be built (when using LINQ)
Another actual “layer” to manage
Connections strings need to be saved (more data!)

• “Put it in a list, duh!”, not so fast, does it need the SP overhead?
• Better for custom business applications that store lots of data, specialized data,
data that doesn’t need to be accessible via a List, Searched.

7
SharePoint List
•
•
•
•
•
•
•

ECM: Site Columns, Content Types, Custom Lists
BCS External Lists too!
Provisioning, create on Feature Activation, WSP
Site level (root web), Web level
Accessible to Power Users and Admins
Sandbox Solutions supported
May ways to interact:
•
•
•
•
•
•

Direct access via SOM
LINQ to SharePoint
SPQuery (with CAML)
SPSiteDataQuery: cross site list queries
SP Client Object Model: from JS, Silverlight, .NET
REST

8
Cont’d
• Implementations:
• My Custom Config List
• Codeplex: http://spconfigstore.codeplex.com
• SharePoint Enterprise Patterns and Practices

• But…
• SharePoint overhead
• Permissions are very important
• RunWithElevatedPrivileges may be needed, or use current user
permission
• Across site collections gets tricky
9
DEMO: Config List Reader
• Custom List created in Feature Activation
• Filled with default data

• Custom Class: ConfigListHelper
• CreateConfigList()
• GetAllValsElev()
• GetAllVals()

• Custom application page:
• Reads all config data into Hashtable
• Displays to page

10
Aside: LINQ to SP
• Enables you to use Language Integrated Query (LINQ) queries
• Translates LINQ queries into Collaborative Application Markup Language (CAML)
queries.

• Sandbox Solutions supported
• From MSDN, steps to use LINQ2SP:
• Generate the entity classes. create or generate the strongly-typed entity classes
that represent your list data and lookup column relationships.
• Use SPMETAL.exe, batch file (.bat, .cmd)

• Develop the solution. write LINQ queries against the strongly-typed entities that
represent your data model.
• Run the solution. provider dynamically converts your LINQ expressions into CAML
queries, executes the CAML, and then maps the returned items to your stronglytyped data entities.

• Pros:
• No more CAML! Natural Language syntax or Expression syntax, FTW!

• Cons:
• Need to build context
• SPMETAL.exe by default builds entity classes for ALL lists, content types, etc.
• Can customize this with xml parameters file, see MSDN

11
DEMO: LINQ to SP
• Feature Activation, Event Receiver:
• Create List, “Best SharePoint Blog Sites”
• Fill with sample data

• SPMETAL BAT file, creates Entity context
• SPSVB2014Linq.cs

• Custom Application Page:
• Display ListItems
• Add a ListItem

12
Web.config
• Usually the first place “web developers” look to start saving settings
• We quickly find out that it’s a double edged sword
• Pros:
• Find file, open, add key/value pair, save … profit!
• 1 LOC to access data from app

• Cons:
• Farm solutions only (not for Sandbox Solutions)
• Have to update every WFE separately
• SPWebConfigModification can be used, which may “nuke” your
custom settings added manually (so I’ve heard)
• Need server access, admins only

• Either don’t use this, or use this for farm-wide settings that “need”
to be secured in web.config
• Better yet, use a nested web.config in your applications layouts
folder

13
DEMO: Web.config
• Nested Web.config file in app “_layouts/<appname>”
• Custom Class: WebConfigHelper
• Designed to use modes, makes it easy to store different
environments together (ex. dev, test, staging, prod)
• GetMode(): get the current mode
• GetKey(): get the key associated with the current mode

• Custom application page:
• Retrieves single property and displays

14
Property Bags
• Hashtable/Dictionary collections to store simple objects (string, int)
• Can use Serialization to save custom objects, Lists, collections, etc.

• PropertyBags are available here:
• Farm: Farm admins only; no Sandbox; WFE read-only(?)
• TimerJob: Each timer job has its own bag; Farm admins only; no Sandbox

• Web Application: Each web app has its own bag; Farm admins only; no Sandbox; WFE read-only(?)
• Site Collection (via root web): Web admin to edit; root web read access to read; Sandbox
supported

• Web: Web admin to edit; web read access to read; Sandbox supported
• List (via root folder): List owner to edit; list read access to read; Sandbox supported

• Pros:
• Easy to use, quick/efficient to store settings, small amounts of data
• Saved in content database

• Cons:
• Not meant for large data, approx. 4-8kb and below
• No interface to CRUD, build your own, or use a plugin (codeplex), or SPDesigner
• http://pbs2010.codeplex.com/
• http://pbs2013.codeplex.com/

15
DEMO: Property Bags
• Custom Class: PropBagHelper.SiteRootWeb
• SafePropBagSave(site, key, value)
• SafePropBagRead(site, key)
• SafePropBagRead(site)
• Custom Application Page:
• Get all root web keys
• Save a key

16
Aside: Serialization
• Serialization: converting an object into a stream of bytes, to store or
send the object
• Its main purpose is to save the state of an object in order to be able
to recreate it when needed.
• The reverse process is called Deserialization.
• We convert bytes to strings, to save in Property Bags, ViewState,
cache, etc.
• Popular Formats:
• XML Serialization
• SOAP Serialization:

Conform to the SOAP specification. SOAP is a protocol based on XML, designed specifically to
transport procedure calls using XML

• JSON Serialization

• Tools/API:
• NewtonSoft’s Json.NET
• My API

17
DEMO: Serialization
• Custom Classes:
• JsonExtensionMethod
• XmlSerialization
• Custom application page:
• Local class: Person
• On page load, Person created, Serialized to text,
displayed in textboxes
• Button to Deserialize, fill Person Objects, display IDs
18
Web Part Properties
• The Web Part base class contains a set of properties that users can use to control its appearance
and behavior (width, height)
• A custom property is a property that you create when you need additional properties to enhance
your Web Part's functionality
• The custom properties you create and specify as able to be browsed are displayed automatically
in the default property pane
• If the default property pane isn't rich enough in functionality, you can create a custom user
interface called a tool part to manipulate your custom properties
• Available in Sandbox Solutions
• Available in Standard and Visual Web Parts
• Standard Property Attributes:
• WebBrowsable = true, property visible to user in properties pane
• Category = “Licensing”, section where property added in pane
• Personalizable = PersonalizationScope.Shared, for all users
• Easy to update in custom tool pane Class, tricky to update in regular Web Part page lifecycle
events
• SetPersonalizationDirty()
• ***Checkout required, Content Approval, Publishing

19
DEMO: Web Part Properties
•
•
•
•
•

Web Part Feature
Add to page
Read web part property value
Update web part property value
Show in default properties pane

20
Temporary Data
• Per WFE all Sessions, or Per Session, or Per Web Page,
• Options:
• Session State: disabled by default in SharePoint, can be turned on
• ViewState: easy way to save data between postbacks, string data
only, but with serialization…
• Hidden Fields: with viewstate enabled (by default), can be useful
for mixing ASP.NET postbacks and JavaScript operations; only
saves strings, but with serialization…
• Cache: HTTPRuntime, Application state; server side cache, useful
for data that only needs periodic refreshing; per WFE, load
balancing may interfere; behaves like static/shared/singleton
• Cookies: ASP.NET management of client side cookies, or use
jQuery Cookie plugin (recommended)
• HTML5 web storage: not all browsers support it, but cool!

21
DEMO: Temporary Data
• Custom application page:
• Read/write ViewState
• obfuscated/encoded/encrypted in browser

• Read/write HiddenField
• accessible via JavaScript

22
SPPersistedObject
•
•
•
•
•
•
•
•

For storing settings at the Farm and Web Application level
For storing multiple settings and more complex values
Create a class that inherits SPPersistedObject
Add your settings as properties
Mark them as Pesisted (with attribute)
Then use SPFarm.GetChild or SPWebApplication.GetChild
Settings saved in SP Configuration database
Cons:
•
•
•
•

Requires Farm Admin to save settings
Farm solutions only (not for Sandbox Solutions)
There is no built in user interface to manage SPPersistedObjects
Must impersonate Farm admin to read and write, since access to
Config database required (RunWithElevatedPrivs doesn’t help)

23
24
Thanks!
• Go download my CodePlex projects!
• SPCAMLQueryHelper
• SPFileZilla

• SOURCE CODE & PRESENTATION:

http://sdrv.ms/1adh74r
• Twitter: @njitben
• Email: bsteinhauser@bandrsolutions.com
• Company: http://www.bandrsolutions.com
25

Contenu connexe

Tendances

Introduction To Microsoft SharePoint 2013
Introduction To Microsoft SharePoint 2013Introduction To Microsoft SharePoint 2013
Introduction To Microsoft SharePoint 2013Vishal Pawar
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingJohn Calvert
 
Understanding SharePoint site structure what's inside
Understanding SharePoint site structure  what's insideUnderstanding SharePoint site structure  what's inside
Understanding SharePoint site structure what's insideBenjamin Niaulin
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...J.D. Wade
 
What SQL DBAs need to know about SharePoint-Indianapolis 2013
What SQL DBAs need to know about SharePoint-Indianapolis 2013What SQL DBAs need to know about SharePoint-Indianapolis 2013
What SQL DBAs need to know about SharePoint-Indianapolis 2013J.D. Wade
 
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed CodeSEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed CodeMarc D Anderson
 
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...Softree Technology Pvt. Ltd
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConSPTechCon
 
SharePoint 2010: Business Insights
SharePoint 2010: Business InsightsSharePoint 2010: Business Insights
SharePoint 2010: Business InsightsJ.D. Wade
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonJoel Oleson
 
Clockwork 2013 - SharePoint overview
Clockwork 2013 - SharePoint overviewClockwork 2013 - SharePoint overview
Clockwork 2013 - SharePoint overviewWilco Sinnema
 
SPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content TypesSPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content TypesTheresa Lubelski
 
SharePoint 2016 Platform Adoption Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption   Lessons Learned and Advanced TroubleshootingSharePoint 2016 Platform Adoption   Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption Lessons Learned and Advanced TroubleshootingJohn Calvert
 
Getting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTCGetting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTCJohn Ross
 
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...Suhail Jamaldeen
 
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little Secrets
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little SecretsSharePoint Saturday Kansas City - SharePoint 2013's Dirty Little Secrets
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little SecretsJ.D. Wade
 
SPS Twin Cities - Congratulations You Inherited a SharePoint Site
SPS Twin Cities - Congratulations You Inherited a SharePoint SiteSPS Twin Cities - Congratulations You Inherited a SharePoint Site
SPS Twin Cities - Congratulations You Inherited a SharePoint SiteDon Donais
 
Intro to SharePoint Web Services
Intro to SharePoint Web ServicesIntro to SharePoint Web Services
Intro to SharePoint Web ServicesMark Rackley
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...European SharePoint Conference
 

Tendances (20)

Introduction To Microsoft SharePoint 2013
Introduction To Microsoft SharePoint 2013Introduction To Microsoft SharePoint 2013
Introduction To Microsoft SharePoint 2013
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
 
Understanding SharePoint site structure what's inside
Understanding SharePoint site structure  what's insideUnderstanding SharePoint site structure  what's inside
Understanding SharePoint site structure what's inside
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
 
What SQL DBAs need to know about SharePoint-Indianapolis 2013
What SQL DBAs need to know about SharePoint-Indianapolis 2013What SQL DBAs need to know about SharePoint-Indianapolis 2013
What SQL DBAs need to know about SharePoint-Indianapolis 2013
 
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed CodeSEF2013 - Create a Business Solution, Step by Step, with No Managed Code
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
 
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
 
SharePoint 2010: Business Insights
SharePoint 2010: Business InsightsSharePoint 2010: Business Insights
SharePoint 2010: Business Insights
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel Oleson
 
Clockwork 2013 - SharePoint overview
Clockwork 2013 - SharePoint overviewClockwork 2013 - SharePoint overview
Clockwork 2013 - SharePoint overview
 
Infopath controls
Infopath controlsInfopath controls
Infopath controls
 
SPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content TypesSPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content Types
 
SharePoint 2016 Platform Adoption Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption   Lessons Learned and Advanced TroubleshootingSharePoint 2016 Platform Adoption   Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption Lessons Learned and Advanced Troubleshooting
 
Getting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTCGetting The Most Out Of SP Search SPSTC
Getting The Most Out Of SP Search SPSTC
 
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...
Build SharePoint Online Workflows and Customize Forms Using Nintex for Office...
 
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little Secrets
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little SecretsSharePoint Saturday Kansas City - SharePoint 2013's Dirty Little Secrets
SharePoint Saturday Kansas City - SharePoint 2013's Dirty Little Secrets
 
SPS Twin Cities - Congratulations You Inherited a SharePoint Site
SPS Twin Cities - Congratulations You Inherited a SharePoint SiteSPS Twin Cities - Congratulations You Inherited a SharePoint Site
SPS Twin Cities - Congratulations You Inherited a SharePoint Site
 
Intro to SharePoint Web Services
Intro to SharePoint Web ServicesIntro to SharePoint Web Services
Intro to SharePoint Web Services
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
 

En vedette

Camarada
CamaradaCamarada
CamaradaLeerte
 
Doping: strategie, strumenti, reti e web 2.0
Doping: strategie, strumenti, reti e web 2.0Doping: strategie, strumenti, reti e web 2.0
Doping: strategie, strumenti, reti e web 2.0Giuseppe Fattori
 
Science WEBQUEST ACTIVITY
Science  WEBQUEST ACTIVITYScience  WEBQUEST ACTIVITY
Science WEBQUEST ACTIVITYsilviaprofe56
 
Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Giuseppe Fattori
 
The johnsonrealestateteam (1)
The johnsonrealestateteam (1)The johnsonrealestateteam (1)
The johnsonrealestateteam (1)Rich Johnson
 
國防報告25 26 35 36
國防報告25 26 35 36國防報告25 26 35 36
國防報告25 26 35 36TFGYi12
 
Newton's laws project lerna, brianna
Newton's laws project lerna, briannaNewton's laws project lerna, brianna
Newton's laws project lerna, briannagirginle
 
Wk2 using accounting information to make short term decisions
Wk2 using accounting information to make short term decisionsWk2 using accounting information to make short term decisions
Wk2 using accounting information to make short term decisionsbgrewal40
 
обучение грамоте. тест 14 буква з
обучение грамоте. тест 14 буква зобучение грамоте. тест 14 буква з
обучение грамоте. тест 14 буква зМКОУ СОШ № 1 г. Сим
 
NITIM presentation
NITIM presentationNITIM presentation
NITIM presentationTero Peltola
 
Supplier Enablement Program Services
Supplier Enablement Program ServicesSupplier Enablement Program Services
Supplier Enablement Program Servicesbillwoerner
 
Geographical isiolated people
Geographical isiolated peopleGeographical isiolated people
Geographical isiolated peopledrodarte004
 
Atlanta Public Schools Redistricting Virginia-Highland
Atlanta Public Schools Redistricting Virginia-HighlandAtlanta Public Schools Redistricting Virginia-Highland
Atlanta Public Schools Redistricting Virginia-HighlandVirginia-Highland Connect
 
2010 DFC Taiwan-Chi 046 實小校園淨化之旅
2010 DFC Taiwan-Chi 046 實小校園淨化之旅2010 DFC Taiwan-Chi 046 實小校園淨化之旅
2010 DFC Taiwan-Chi 046 實小校園淨化之旅dfctaiwan2010
 

En vedette (20)

Camarada
CamaradaCamarada
Camarada
 
Doping: strategie, strumenti, reti e web 2.0
Doping: strategie, strumenti, reti e web 2.0Doping: strategie, strumenti, reti e web 2.0
Doping: strategie, strumenti, reti e web 2.0
 
Деление суммы на число. урок 1
Деление суммы на число. урок 1Деление суммы на число. урок 1
Деление суммы на число. урок 1
 
Science WEBQUEST ACTIVITY
Science  WEBQUEST ACTIVITYScience  WEBQUEST ACTIVITY
Science WEBQUEST ACTIVITY
 
Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.Marketing sociale e comunicare salute. App & Game. Citizens included.
Marketing sociale e comunicare salute. App & Game. Citizens included.
 
The johnsonrealestateteam (1)
The johnsonrealestateteam (1)The johnsonrealestateteam (1)
The johnsonrealestateteam (1)
 
Presentation1
Presentation1Presentation1
Presentation1
 
國防報告25 26 35 36
國防報告25 26 35 36國防報告25 26 35 36
國防報告25 26 35 36
 
Soles for soles
Soles for solesSoles for soles
Soles for soles
 
Newton's laws project lerna, brianna
Newton's laws project lerna, briannaNewton's laws project lerna, brianna
Newton's laws project lerna, brianna
 
Gioi han lien tuc tb
Gioi han lien tuc   tbGioi han lien tuc   tb
Gioi han lien tuc tb
 
Wk2 using accounting information to make short term decisions
Wk2 using accounting information to make short term decisionsWk2 using accounting information to make short term decisions
Wk2 using accounting information to make short term decisions
 
обучение грамоте. тест 14 буква з
обучение грамоте. тест 14 буква зобучение грамоте. тест 14 буква з
обучение грамоте. тест 14 буква з
 
NITIM presentation
NITIM presentationNITIM presentation
NITIM presentation
 
đLcm
đLcmđLcm
đLcm
 
Supplier Enablement Program Services
Supplier Enablement Program ServicesSupplier Enablement Program Services
Supplier Enablement Program Services
 
The Five Senses
The Five SensesThe Five Senses
The Five Senses
 
Geographical isiolated people
Geographical isiolated peopleGeographical isiolated people
Geographical isiolated people
 
Atlanta Public Schools Redistricting Virginia-Highland
Atlanta Public Schools Redistricting Virginia-HighlandAtlanta Public Schools Redistricting Virginia-Highland
Atlanta Public Schools Redistricting Virginia-Highland
 
2010 DFC Taiwan-Chi 046 實小校園淨化之旅
2010 DFC Taiwan-Chi 046 實小校園淨化之旅2010 DFC Taiwan-Chi 046 實小校園淨化之旅
2010 DFC Taiwan-Chi 046 實小校園淨化之旅
 

Similaire à SharePoint 2014: Where to save my data, for devs!

Share point development 101
Share point development 101Share point development 101
Share point development 101Becky Bertram
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012Lee Klement
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
SharePoint 2013 – the upgrade story
SharePoint 2013 – the upgrade storySharePoint 2013 – the upgrade story
SharePoint 2013 – the upgrade storySPC Adriatics
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsSteve Knutson
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...Toni Frankola
 
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...Joel Oleson
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
Extjs3.4 Migration Notes
Extjs3.4 Migration NotesExtjs3.4 Migration Notes
Extjs3.4 Migration NotesSimoAmi
 
Deploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDeploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDenny Lee
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundaryJonathan Ralton
 
Grails patterns and practices
Grails patterns and practicesGrails patterns and practices
Grails patterns and practicespaulbowler
 
What's new in SharePoint 2016
What's new in SharePoint 2016What's new in SharePoint 2016
What's new in SharePoint 2016Giuseppe Marchi
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UIThomas Daly
 

Similaire à SharePoint 2014: Where to save my data, for devs! (20)

Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
Share point development 101
Share point development 101Share point development 101
Share point development 101
 
Sharepoint Deployments
Sharepoint DeploymentsSharepoint Deployments
Sharepoint Deployments
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
 
Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint Beast
 
SharePoint 2013 – the upgrade story
SharePoint 2013 – the upgrade storySharePoint 2013 – the upgrade story
SharePoint 2013 – the upgrade story
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
Prepare for SharePoint 2016 - IT Pro best practices for managing your SharePo...
 
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...
SharePoint 2010 Upgrade Strategies and Best Practices - MS Days Bulgaria - Jo...
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Extjs3.4 Migration Notes
Extjs3.4 Migration NotesExtjs3.4 Migration Notes
Extjs3.4 Migration Notes
 
Deploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePointDeploying and Managing PowerPivot for SharePoint
Deploying and Managing PowerPivot for SharePoint
 
Deep thoughts from the real world of azure
Deep thoughts from the real world of azureDeep thoughts from the real world of azure
Deep thoughts from the real world of azure
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
 
Grails patterns and practices
Grails patterns and practicesGrails patterns and practices
Grails patterns and practices
 
What's new in SharePoint 2016
What's new in SharePoint 2016What's new in SharePoint 2016
What's new in SharePoint 2016
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
 

Dernier

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Dernier (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

SharePoint 2014: Where to save my data, for devs!

  • 1. Where to save my data, for devs! Benjamin Steinhauser SharePoint Saturday Virginia Beach 2014 1
  • 2. Welcome to SharePoint Saturday Virginia Beach Jan 11, 2014 7:30 - 8:30 – Registration(Lobby) Breakfast (Sponsor Hall) 8:30 - 8:45 - Welcome 9:00 - 10:15 – 1st Sessions 10:30 - 11:45 – 2nd Sessions 11:45 - 12:30 – Lunch (Sponsor Hall) 12:30 - 1:45 - 3rd Sessions 2:00 - 3:15 – 4th Sessions 3:30 - 4:45 – 5th Sessions 5:00 - 5:30 - Closing & Giveaways 2
  • 3. About Me • Benjamin J. Steinhauser • • • • • • SharePoint Solutions Developer B&R Business Solutions BS/MS in CS; MCP, MCTS (SP2010 Config. & Dev.) 10+ years as ASP.NET Application Developer 5+ years as SharePoint Developer Creator of Open Source CodePlex Projects • • • • • SPCAMLQueryHelper (over 25,000 downloads) SPFileZilla (over 200 downloads) SPMetroGrid SPMMDNavigator SPClippy, SPjQuerify, SPEasyBranding • Presenter at SP User Groups and SharePoint Saturday Events 3
  • 4. Intro • Where do I put my application’s data? • “Every custom SharePoint application is driven by data in one way or another” –W. Wilen • Developers face many choices when building solutions that consume data • “Knowing is half the battle!” • Who: is the consumer of the data? • What: is the type of data being saved? • When: is the data needed, and for how long should it persist? • Why: is the data being stored in the first place!? • Where: is the data being stored? 4
  • 5. Cont’d • What are the advantages/disadvantages for each option? • What are the restrictions? • What type of data is it? • Settings, configuration, licensing • Structured data (employees, favorites, HR forms, etc.) • How long should the data persist? • Who is the data consumer? • End user, Power User, Administrator • Web Part, Application Page, Timer Job, Web Service, Service Application 5
  • 6. Where is my data!? 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. MS SQL Server SharePoint List Property Bags Web Part Properties View State/Hidden Fields Cache Web.config SPPersistedObject Session State Cookies 6
  • 7. Databases • • • • • MS SQL Server, Oracle, MySQL CRUD: create, read, update, delete For structured data, relational data Easy (if you know SQL), very fast Ways to interact: • • • • LINQ to SQL LINQ to Entity Stored Procedures Inline-sql in .NET • But… • • • • • • Farm solutions only (not for Sandbox Solutions) Database needs to be created (database administrator) Permissions need to be configured (database administrator) Contexts need to be built (when using LINQ) Another actual “layer” to manage Connections strings need to be saved (more data!) • “Put it in a list, duh!”, not so fast, does it need the SP overhead? • Better for custom business applications that store lots of data, specialized data, data that doesn’t need to be accessible via a List, Searched. 7
  • 8. SharePoint List • • • • • • • ECM: Site Columns, Content Types, Custom Lists BCS External Lists too! Provisioning, create on Feature Activation, WSP Site level (root web), Web level Accessible to Power Users and Admins Sandbox Solutions supported May ways to interact: • • • • • • Direct access via SOM LINQ to SharePoint SPQuery (with CAML) SPSiteDataQuery: cross site list queries SP Client Object Model: from JS, Silverlight, .NET REST 8
  • 9. Cont’d • Implementations: • My Custom Config List • Codeplex: http://spconfigstore.codeplex.com • SharePoint Enterprise Patterns and Practices • But… • SharePoint overhead • Permissions are very important • RunWithElevatedPrivileges may be needed, or use current user permission • Across site collections gets tricky 9
  • 10. DEMO: Config List Reader • Custom List created in Feature Activation • Filled with default data • Custom Class: ConfigListHelper • CreateConfigList() • GetAllValsElev() • GetAllVals() • Custom application page: • Reads all config data into Hashtable • Displays to page 10
  • 11. Aside: LINQ to SP • Enables you to use Language Integrated Query (LINQ) queries • Translates LINQ queries into Collaborative Application Markup Language (CAML) queries. • Sandbox Solutions supported • From MSDN, steps to use LINQ2SP: • Generate the entity classes. create or generate the strongly-typed entity classes that represent your list data and lookup column relationships. • Use SPMETAL.exe, batch file (.bat, .cmd) • Develop the solution. write LINQ queries against the strongly-typed entities that represent your data model. • Run the solution. provider dynamically converts your LINQ expressions into CAML queries, executes the CAML, and then maps the returned items to your stronglytyped data entities. • Pros: • No more CAML! Natural Language syntax or Expression syntax, FTW! • Cons: • Need to build context • SPMETAL.exe by default builds entity classes for ALL lists, content types, etc. • Can customize this with xml parameters file, see MSDN 11
  • 12. DEMO: LINQ to SP • Feature Activation, Event Receiver: • Create List, “Best SharePoint Blog Sites” • Fill with sample data • SPMETAL BAT file, creates Entity context • SPSVB2014Linq.cs • Custom Application Page: • Display ListItems • Add a ListItem 12
  • 13. Web.config • Usually the first place “web developers” look to start saving settings • We quickly find out that it’s a double edged sword • Pros: • Find file, open, add key/value pair, save … profit! • 1 LOC to access data from app • Cons: • Farm solutions only (not for Sandbox Solutions) • Have to update every WFE separately • SPWebConfigModification can be used, which may “nuke” your custom settings added manually (so I’ve heard) • Need server access, admins only • Either don’t use this, or use this for farm-wide settings that “need” to be secured in web.config • Better yet, use a nested web.config in your applications layouts folder 13
  • 14. DEMO: Web.config • Nested Web.config file in app “_layouts/<appname>” • Custom Class: WebConfigHelper • Designed to use modes, makes it easy to store different environments together (ex. dev, test, staging, prod) • GetMode(): get the current mode • GetKey(): get the key associated with the current mode • Custom application page: • Retrieves single property and displays 14
  • 15. Property Bags • Hashtable/Dictionary collections to store simple objects (string, int) • Can use Serialization to save custom objects, Lists, collections, etc. • PropertyBags are available here: • Farm: Farm admins only; no Sandbox; WFE read-only(?) • TimerJob: Each timer job has its own bag; Farm admins only; no Sandbox • Web Application: Each web app has its own bag; Farm admins only; no Sandbox; WFE read-only(?) • Site Collection (via root web): Web admin to edit; root web read access to read; Sandbox supported • Web: Web admin to edit; web read access to read; Sandbox supported • List (via root folder): List owner to edit; list read access to read; Sandbox supported • Pros: • Easy to use, quick/efficient to store settings, small amounts of data • Saved in content database • Cons: • Not meant for large data, approx. 4-8kb and below • No interface to CRUD, build your own, or use a plugin (codeplex), or SPDesigner • http://pbs2010.codeplex.com/ • http://pbs2013.codeplex.com/ 15
  • 16. DEMO: Property Bags • Custom Class: PropBagHelper.SiteRootWeb • SafePropBagSave(site, key, value) • SafePropBagRead(site, key) • SafePropBagRead(site) • Custom Application Page: • Get all root web keys • Save a key 16
  • 17. Aside: Serialization • Serialization: converting an object into a stream of bytes, to store or send the object • Its main purpose is to save the state of an object in order to be able to recreate it when needed. • The reverse process is called Deserialization. • We convert bytes to strings, to save in Property Bags, ViewState, cache, etc. • Popular Formats: • XML Serialization • SOAP Serialization: Conform to the SOAP specification. SOAP is a protocol based on XML, designed specifically to transport procedure calls using XML • JSON Serialization • Tools/API: • NewtonSoft’s Json.NET • My API 17
  • 18. DEMO: Serialization • Custom Classes: • JsonExtensionMethod • XmlSerialization • Custom application page: • Local class: Person • On page load, Person created, Serialized to text, displayed in textboxes • Button to Deserialize, fill Person Objects, display IDs 18
  • 19. Web Part Properties • The Web Part base class contains a set of properties that users can use to control its appearance and behavior (width, height) • A custom property is a property that you create when you need additional properties to enhance your Web Part's functionality • The custom properties you create and specify as able to be browsed are displayed automatically in the default property pane • If the default property pane isn't rich enough in functionality, you can create a custom user interface called a tool part to manipulate your custom properties • Available in Sandbox Solutions • Available in Standard and Visual Web Parts • Standard Property Attributes: • WebBrowsable = true, property visible to user in properties pane • Category = “Licensing”, section where property added in pane • Personalizable = PersonalizationScope.Shared, for all users • Easy to update in custom tool pane Class, tricky to update in regular Web Part page lifecycle events • SetPersonalizationDirty() • ***Checkout required, Content Approval, Publishing 19
  • 20. DEMO: Web Part Properties • • • • • Web Part Feature Add to page Read web part property value Update web part property value Show in default properties pane 20
  • 21. Temporary Data • Per WFE all Sessions, or Per Session, or Per Web Page, • Options: • Session State: disabled by default in SharePoint, can be turned on • ViewState: easy way to save data between postbacks, string data only, but with serialization… • Hidden Fields: with viewstate enabled (by default), can be useful for mixing ASP.NET postbacks and JavaScript operations; only saves strings, but with serialization… • Cache: HTTPRuntime, Application state; server side cache, useful for data that only needs periodic refreshing; per WFE, load balancing may interfere; behaves like static/shared/singleton • Cookies: ASP.NET management of client side cookies, or use jQuery Cookie plugin (recommended) • HTML5 web storage: not all browsers support it, but cool! 21
  • 22. DEMO: Temporary Data • Custom application page: • Read/write ViewState • obfuscated/encoded/encrypted in browser • Read/write HiddenField • accessible via JavaScript 22
  • 23. SPPersistedObject • • • • • • • • For storing settings at the Farm and Web Application level For storing multiple settings and more complex values Create a class that inherits SPPersistedObject Add your settings as properties Mark them as Pesisted (with attribute) Then use SPFarm.GetChild or SPWebApplication.GetChild Settings saved in SP Configuration database Cons: • • • • Requires Farm Admin to save settings Farm solutions only (not for Sandbox Solutions) There is no built in user interface to manage SPPersistedObjects Must impersonate Farm admin to read and write, since access to Config database required (RunWithElevatedPrivs doesn’t help) 23
  • 24. 24
  • 25. Thanks! • Go download my CodePlex projects! • SPCAMLQueryHelper • SPFileZilla • SOURCE CODE & PRESENTATION: http://sdrv.ms/1adh74r • Twitter: @njitben • Email: bsteinhauser@bandrsolutions.com • Company: http://www.bandrsolutions.com 25