1 / 18

Design patterns using XSL to generate web part user interfaces

Design patterns using XSL to generate web part user interfaces. Paul Galvin, SharePoint MVP Slalom Consulting (www.slalom.com). Thank you fo r being part of the 5 th Annual Houston Techfest. Welcome to Houston Techfest 2011. Thanks to our Diamond sponsors .

ceri
Download Presentation

Design patterns using XSL to generate web part user interfaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design patterns using XSL to generate web part user interfaces Paul Galvin, SharePoint MVP Slalom Consulting (www.slalom.com)

  2. Thank you for being part of the 5th Annual Houston Techfest Welcome to Houston Techfest 2011 Thanks to our Diamond sponsors. Please turn off or set all devices to vibrate. Houston Techfest 2011

  3. Welcome to SharePoint Saturday—The Conference Design patterns using XSL to generate web part user interfaces (DEV300) Paul Galvin BrightStarr (www.brightstarr.com)

  4. Agenda • About Paul and Slalom (brief) • What’s the End Goal? • Code Review • Setup (“Pretend Announcements”) • Announcements Collection and individual announcements • Web part structure and properties • XSL helper class • Review actual XSL • Demonstrate debug, simple and “fancy” XSL views • Demonstrate using XSL from a document library • Wrap-up

  5. Slalom Consulting is a national business and technology consulting firmwith more than 1,500 employees across 10 offices in North America.

  6. About Paul Galvin • Microsoft MVP since July 2008 • Just completed book on SharePoint Designer Workflow • “Paul Galvin Workflow” on Amazon.com • Working with SharePoint since January 2007(MOSS just came out) • Twitter: @pagalvin • Email: galvin.paul@gmail.com • Blog: www.mstechblogs.com/paul

  7. About Slalom

  8. Slalom is Hiring • Pick up some glossies

  9. Concept - XSL • XSL is “extensible style sheet” • XML goes in … • A parser consumes the XML and emits transformed XML. • Whatever you want comes out • In this case, HTML comes out • Other uses: • XSL to generate / supplement XML messages • Microsoft BizTalk

  10. Demo Setup • Visual web part • Could be old style web part • “Pretend” Announcements • Announcements collection of individual announcements • The collection and the individual announcements “know” how to generate an XML representation of themselves as strings

  11. The XML <AllPretendAnnouncements Count="3"> <AnAnnouncement> <title>SharePoint Saturday India</title> <location>Virtual Event</location> <description><![CDATA[<a target=_new href='http://www.sharepointsaturday.org/india/default.aspx‘>Click here to view the event details.>]]</description> </AnAnnouncement> <AnAnnouncement> <title>BrightStarr Cookout</title> <location>New Jersey, USA</location> <description>BrightStarr is holding its annual summer cookout.</description> </AnAnnouncement> <AnAnnouncement> <title>Test Announcement</title> <location>Test location</location> <description>This is a test announcements.</description> </AnAnnouncement> </AllPretendAnnouncements>

  12. <![CDATA[ … ]]> • What is that token for?

  13. Web Part Properties • XSL File • URL • As you’ll see, this can be in “layouts”, a document library or any URL to which the user has access at runtime • Encode results? • If true, results are html-encoded • This is useful for debugging

  14. Helper Class • Method for pulling XSL files into a string • Method to transform XML into HTML using that XSL

  15. Demo Time • Let’s do a demo • Review the code • Run the code • Try out different XSL files and links

  16. Summary • Use XSL because… • It separates the user interface from the c# logic • It makes you think about the data first, which is always helpful • You can separate roles. • Developers to do the hard C# coding • Designers and even end users to edit and manage XSL • XSL can do more… • Embed jQuery • Embed advanced CSS • Reference nodes, attributes, sort results, define variables

  17. Questions? Paul’s contact information: • galvin.paul@gmail.com • Twitter: @pagalvin • www.mstechblogs.com/paul

  18. Thanks to our sponsors

More Related