| Yesterday I saw and replied to @nickhadlee’s twitter Poll: Poll: Is #XSL code? In the context of a 'codeless' solution :) [Feel free to RT] My twitter response was: @iwkid RT @nickhadlee: Poll: Is #XSL code? In the context of a 'codeless' solution <-- I consider it "no-code" in that it is not managed/deployed What I did not do was further qualify my response. Jim called me on it: http://ednortonengineeringsociety.blogspot.com/2010/06/code-blue.html He’s absolutely right – but there’s some history here. Let’s go WAY back in time to SharePoint 2007... Building Solutions on SharePoint 2007 There were two kinds of solutions you could build in SharePoint 2007 – Managed and “No Code” solutions. Managed solutions: - Involve custom managed code that is generally built by a developer and deployed by an administrator
- Treated as a true development project stored in source control, deployed as a perfectly wrapped SharePoint Solution
- Ideally it would go through a code promotion process (dev –> test –> prod) and thorough testing
“No Code” solutions: - Involve customizations generally made with the browser or SharePoint Designer
- Can consist of a variety of code:
- DHTML, JavaScript, XSLT, XPath, CSS
- Generally are not stored in source control, packaged, or deployed by an administrator
- Generally are built in production
So if those are the attributes of the two solution types, what really is a “No Code” solution: - A solution that is not deployed by an administrator?
- A solution that does not contain any managed code (.dll)?
- A solution that wasn’t built in Visual Studio?
- A solution that really doesn’t contain any code (JavaScript/XPath)?
In 2007, I think the generally accepted answer was a solution that is not deployed by an administrator, which really has nothing to do with code at all :-) Now let’s fast-forward to SharePoint 2010... Building Solutions on SharePoint 2010 In SharePoint 2010 the “No Code” designation has been further complicated. Two new technologies have been added to the “No Code” side of the world: - Sandbox Solutions – SharePoint Solution files, built with managed code but deployed by site (not server) administrators.
- Client Object Model – Enables even more sophisticated solutions to be built via JavaScript/Silverlight/etc
I don’t think we can call solutions built with either of these new technologies “No Code” so I would argue that the idea of what is a “No Code” solution is changing. In fact, I’m not sure the designation really means anything and I think we should consider the term “No Code” to be dead. So..... A few points to sum up: - I DO consider .XSL to be code
- I think there is a great deal of value in what we traditionally called “No Code” solutions
- I think there are some huge issues with what we traditionally called “No Code” solutions
- I’m very curious to see how how we will classify solutions built in SharePoint 2010
- This would have taken a LOT of tweets :-)
|
| While I was in Las Vegas for the SharePointPro Summit & Expo I met up with the folks from fpweb.net. They were nice enough to hook me up with a hosted 2010 enviroment! Thanks to my new friends (thanks again @FPWEB) today I’m re-launching my blog hosted on SharePoint 2010! There may be a few bumps in the road as I play with the layout / look & feel but I am super excited to get my hands on a hosted 2010 environment. |
| In my last post I showed how to output only XML using the Data Form Web Part (aka: Data View). One reason you may want to do that is to output your own customized RSS Feed for a list (or other data source!). Here is sample output from an OOTB SharePoint 2007 Blog RSS Feed (modified for simplicity): In most cases this works just fine, but what if you wanted to make changes to how this is displayed? There are not a ton of changes you can make via configuration. Enter the DFWP: Start with a DFWP that’s ready to output XML I went through the steps to do this in my previous post. Your starting point should be a DFWP that is linked to your Posts list that is configured to display XML: Modify the XSL to output custom RSS Here is where we can configure the output to render what we’d like to show. Let’s jump to the <xsl:template name="dvt_1.body"> template and add the core structure for our feed:  Now that we’ve got that structure in place, we’ll make a few changes: - First of all, we’ve got some ugliness that came over from our default XSL Templates. Let’s take out the two xsl:variable declarations and the xsl:if statements that are inside our for-each:
- Next let’s update the Title, link, description, generator, and image tags:

- Now we need to make the lastBuildDate dynamic. For that I’m going to assume that we want the most recent post update date (since we’re sorting by date, I’ll just grab the first item’s PublishedDate:
 Next let’s update the <xsl:template name="dvt_1.rowview"> template: - Again we’ll start with the core structure that we copy in:
 - Next we’ll make the values dynamic. Most of this is pretty simple but I’ll highlight the <description> node in the next bullet:
 - We have to get a little tricky in the <description> tag because we’re outputting HTML within XML. To do that, we need to wrap the values in a <![CDATA[...]]> tag. The problem with that is, if we have an <xsl:value-of tag inside our CDATA, it won’t evaluate! :) To get around it, I used the <xsl:text tag and specify that we should disable output escaping. Problem solved!
- One last thing we have to do is update our dates. RSS expects an “RFC 822” spec date (according to http://cyber.law.harvard.edu/rss/rss.html) so we need to change our DateTimeFormat string to: 'ddd, dd MMM yyyy HH:mm:ss'. Remember to do this for all dates we are outputting!
And that should be it! View the custom feed When you preview the XML feed (sample available here: http://www.iwkid.com/blog/pages/rss.aspx) in IE you should get a display similar to this: That’s it! Now you have custom RSS feed you can use for your blog!
A few points about this approach - I don’t know much about RSS. I used some sample feeds out on the Internets to come up with my XSLT. Someone that knew more about the RSS standard could do more, I have no doubt :)
- Unfortunately your site doesn’t magically know how to link to your custom RSS. We’ll save that for another day (assuming I can figure out a no-code solution) :) For now, you can add a link to your custom RSS page and drive users to that.
- There are lots of “improvements” I could see making in the RSS output that SharePoint natively gives you. We hit a few:
- Custom title (as opposed to “Blog: Posts”)
- Removing the silly “Body:" text that shows up before the body of each post
- Some other improvement opportunities:
- Change the categories to output separately. By default (and in our custom feed) we are outputting multiple categories as:
<category>category 1;category2</category> Ideally it would be: <category>category1</category> <category>category2</category>
- If you were really ambitious you could probably update the body output so images are specified as fully qualified paths instead of as relative links. I know that is a problem with some RSS readers
- Obviously RSS isn’t the only type of feed you could create. Want an Atom feed? How about a Podcast feed? Lots of interesting options come to mind…
|
| Many of you know the power of the Data Form Web Part (aka: Data View) when it comes to outputting dynamic HTML. Did you know you can also use the DFWP to output XML? Let’s take a look at how to do this: Create an .aspx page to host your DFWP First, we’ll create a blank .aspx page to host our Data Form Web Part: - Open your site in SharePoint Designer 2007
- Choose a location for your .aspx page (I’m using a document library called “Pages”)
- From the File menu, choose File –> New –> ASPX:
- Name your new aspx (I called mine xml.aspx) and open the file
You’ll see that you now have a completely blank canvas to work with! Add the DFWP and choose what XML output should display Next we’ll add a Data Form Web Part to display entries from our Posts list: - From the Data View menu, choose Insert Data View. This will open the Data Source Library.
- Select the Posts list and from the contextual dropdown, select Show Data:
- Now select which fields you want to display in your XML. You can use Ctrl+click to select multiple fields
- Once you have selected a few fields, click the Insert Selected Fields as... dropdown and select Insert Multiple Item View:
- Now that we have a DFWP on the page, you can take a look at the filtering and sorting to get it to display only the data you’re interested in. I won’t walk through all of this but if you are new to Data Form Web Parts you should be able to find your way through the sorting and filtering by selecting the chevron to open the Common Data View Tasks menu:
- One thing you will want to do to simply things later is change the Paging options. Since our goal is to display XML, we really don’t need paging enabled. Disable it by choosing to limit the number of displayed items:
Now we have a Data Form Web Part linked to our Posts list! If you preview the page and view the source you should see something similar to this:
Modify the DFWP to remove wrapping HTML Now that we have a DFWP displaying data, it is time to take a look at the XSLT that defines how the Web Part should be formatted. We’ll modify that XSLT and cleanup that output so it doesn’t have all those tables and divs. - By default, SharePoint Designer uses a basic table layout to display data. We can change that by selecting Change Layout from the Common Data View Tasks menu:
- Scrolling down to the bottom of the layout options you will see a nearly blank layout called Layout table form (note: layout names appear as tooltips when you mouse over the layout visualization). Select the Layout table form and press OK.
- You will be prompted to continue because changing layouts can remove any visual customizations you have made to the Web Part (not things like filtering/sorting). Select Yes.
- You should now see a pretty boring Web Part! :-) Next, select one of the displayed Title fields and switch to Code View:
- Once in code view you will enter the world of XSLT. There are some great resources out there if you are new to XSLT (see Marc Anderson’s series over at End User SharePoint.com)
- The main thing we want to do is strip away the HTML formatting that is part of our Data View. You will find the HTML elements inside of <template> tags and there should only be 3 we are concerned about:
- <xsl:template name="dvt_1">
- This is where most of the offending HTML will be found. It creates the table structure for your DFWP:
- Remove the HTML and you’ll simplify your output
- <xsl:template name="dvt_1.body">
- This template shouldn’t contain any/much HTML so it can be left alone:
- <xsl:template name="dvt_1.rowview">
- This template will usually contain a wrapping div which can be removed:
- Once you have removed that HTML, when you view source you should see something closer to this:
- Ok – progress right? We still have a lot of HTML happening on our page though so let’s take this opportunity to do a little cleanup. In your Page, find the opening <WebPartPages:DataFormWebPart> tag and go ahead and remove the HTML above it. Take out the HTML, Head, Body, Form tags – whatever is up there EXCEPT the <%@ Page and <%@ Register tags:
- Make sure you cleanup the closing Form, Body, and HTML tags as well. Now when you view source you should ONLY get the output of your DFWP:
- You may have noticed that although we stripped out the Table, TR, and TD tags from our XSL, some remains... don’t worry, we’ll get to that in a minute. For now let’s focus on turning our output into XML.
Modify the DFWP to output XML Let’s revisit those templates we cleaned up earlier. We’ll add some new tags with the goal of having output like this: <items><item>content here…</item></items> - Let’s start with the wrapping <items> tag.
- In code view, find the <xsl:template name="dvt_1"> tag again
- Before the <xsl:call-template name="dvt_1.body"> tag, add your <items> open tag
- After the matching </xsl:call-template>, add your </items> close tag
- You should end up with something like this:
- Now let’s add our <item> tag
- Find the <xsl:template name="dvt_1.rowview"> tag
- The only content in there should be a xsl:value-of tag that displays the Title field. Wrap that in a new <item> tag and maybe a <title> tag:
- Now, to make it more interesting, let’s add a few more fields. You can drag and drop if you’d like but I usually copy and paste the xsl:value-of and then use the intellisense to select what field I want to display:
- HINT: you can get the intellisense to display by pressing Ctrl+Spacebar when your cursor is inside the quotes
- Add a few more fields if you’d like but your XSL should look something like this:
- [UPDATE: I have since learned that outputting multiple <body> tags makes SharePoint Designer unhappy. You may want to come up with a different tagname or once you exit your page you won’t be able to re-open it!]
- Now view your XML output. It may be a little busy but you’ll notice that we’ve got some XML in there:
Modify the DFWP to output only XML So we have some XML being output but it is still wrapped in HTML elements! NO GOOD! Not to worry - there are two quick steps to fix that: - Return to your Data Form Web Part and find the xsl:output tag:
- Change the method from “html” to “xml”. This will tell the Web Part to output XML instead of HTML. That isn’t enough though, the web part itself still wants to display formatting HTML for the Web Part title, header, etc
- You can also change the indent property to “yes” if you’d like indented output
- The last piece is the real magic. You’ll want to add a special attribute to your DFWP:
- By adding SuppressWebPartChrome = “True”, you are telling the Web Part not to display the wrapping table and div
Now when you view the source of our output you should see nothing but beautiful xml:  View my sample page here: http://www.iwkid.com/blog/Pages/xml.aspx (remember – not pretty in the browser, but view source to see the goodness) This XML (while it may not display nicely in the browser) can be used by external systems or consumed via JavaScript/jQuery to help build Composite Applications. In my next posts we’ll explore other ways you might use this technique. |
| Silverlight Applications with BCS and Client Object Model - Todd Baginski
- http://www.toddbaginski.com/blog/
- Walkthrough of the components in a BCS/SP/Silverlight application
- ECT from multiple data sources
- External Content Type
- .NET Assembly Connector talks to the different LOB systems
- BCS Model defined – gives you strongly typed data
- Demo:
- Client Object Model
- Microsoft.SharePoint.Client
- Microsoft.SharePoint.Client.Runtime
- .NET Apps, Silverlight Apps, JavaScript
- Why Client Object Model + Silverlight?
- Designed for Silverlight
- Works on client machines
- Async
- Demo:
- Use Silverlight to talk to BCS Entities
- Need a clientaccesspolicy.xml to support talking to SharePoint services from other domains
- Silverlight app talks to SharePoint external lists like they are normal lists
Protecting your SharePoint Environment from Evil Developers - Rob Bogue
- Bad code examples
- Sandbox
- “User code host”
- 2007 didn’t have boundaries
- 2010 runs code in a separate process
- Solution Gallery can accept uploaded sandbox solution .wsp files
- Very limited subset of SharePoint object model
- User Code Host
- Can run locally
- Can run remotely
- Performance impacts for sandboxing
- Probably not great on high volume and/or public facing sites
- Solution Validator
- Inspect and reject solution/assembly
- Monitoring
- Page load time limits
- Resource Tracking by points
- CPU Execution time, Memory consumption, SQL Query time, exceptions
- Sandbox Proxy
- Allows access beyond sandbox limits
- Requires full trust install
- Proxy Operation, Proxy Arguments
- Just as dangerous as 2007, but no more
- Runs wherever the sandbox solution runs – which means they can run remotely
- Quotas
- Set at the site collection level
- When resource quotas get exceeded, all sandbox solutions in the Site Collection are disabled
- SharePoint Query Limits
- Non admins have 5000 limit
- Admins have more
- Overrides and exceptions
- Can increase quota limits at the site collection level
- Changes are immediate
Create SharePoint YouTube-like application without managed code - Todd Baginski
- Digital Assets Library
- Doc lib on steroids
- Comes with Foundation
- Video/audio/pictures
- RSS/Podcasting
- Tagging/rating
- Video editing via Office (PowerPoint)
- Videos don’t have previews by default
- Can write code to do it (Todd will blog)
- Capture .jpg, update properties
- Client Object Model
- JavaScript
- ExecuteOrDelayUntilScriptLoaded
- NotifiyEventAndExecuteWaitingJobs
- SP.UI.ModalDialog.showModalDialog
- Out of the box controls
- Media Web Part
- Specify what content to display (from computer, SharePoint, URL)
- Change preview image
- Content by Query Web Part
- Rollups, specify fields, specify display (XSLT)
- Rich Media Field Control
- New Page Layout with media control
- inherit from video content type
- Ratings
- go into social database
- 2 timer jobs run to transfer ratings to content DB
- Ratings cannot be set by anonymous anonymous users (but will display)
|
| I managed to overwrite this post… trying to find it cached somewhere :-) |
| Building Composite Applications using SharePoint Designer 2010 and the BCS I presented a pre-conference workshop covering TONS of stuff related to Composites. Here are some topics we covered: - Building ASPX / Web Part Pages
- Using OOTB Web Parts, Lists, and Web Part Connections
- Data Views! Data Views! Data Views!
- XSLT and the Data Form Web Part
- XLV (XSLT List View Web Part)
- Quick Workflow overview in 2010
- Creating custom Actions in SPD
- JavaScript UX extensions in 2010 (Notifications Bar, Status Bar, Dialog Framework)
- BCS! BCS! BCS!
- Create External Content Type, External Data Column
- Use BCS Web Parts
- BCS Actions, Profile Pages
- Word/Outlook integration with BCS
- BCS + PowerShell/Custom solutions
- Custom Development discussion
Resources |
| I ran into an interesting issue this morning that had me scratching my head. Users were reporting that they could not publish multiple files using Manage Content and Structure on a MOSS publishing site. I KNEW I had seen the publish option in the actions menu so I wasn’t sure what was going on. Here’s what I found out: Option 1 – NO PUBLISHING OPTION From Site Actions, choose “View Reports,” then select “All Draft Documents.” This takes you in to the Manage Content and Structure tool but as you can see, you do NOT get the option to publish pages from here:  Option 2 – Publishing Option From Site Actions, choose “Manage Content and Structure:” Click on the library you want to manage (Pages in this case): From the Actions dropdown, notice that you have the publishing option (it is disabled in the screenshot because I have not selected any files yet): What is interesting is that from this view you still have the option to pull up the “All Draft Documents" view – but this time you have access to the Publish action: So – in summary, even though both commands use the Manage Content and Structure screen, you will get slightly different functionality based on how you got there. |
| We tried something a little different at this month’s #MNSPUG meeting. Normally we meet on the 2nd Wednesday of the month from 9am until 11ish. With all of the excitement around SharePoint 2010, we decided to (as my buddy Becky used to say) go big or go home :) So today we have been presenting sessions ALL DAY on SharePoint 2010. This morning, Wes and I presented a 3 hour tour of the new SharePoint 2010 wheel: We were able to get a handful of demos going and got lots of GREAT questions. People are definitely excited about SharePoint 2010! After that, Wes and Brian gave a quick overview of how to prep for 2010. Then we split the room and we have Phil and Veasnar presenting a development overview while Nick Stillings presented on Office 2010 Client integration with SharePoint 2010. Next we have a session scheduled for Access Services and another scheduled for a SharePoint 2010 Administration overview. Once we’re done with that we’ll be heading over to Majors in Bloomington for a SharePint! Thanks to all that joined us in person today and online! Wait – you didn’t know you could attend remotely? Today’s Event Announcement: http://www.sharepointmn.com/Lists/Announcements/DispForm.aspx?ID=93 Main page for the MNSPUG: http://www.sharepointmn.com Resources from ALL of our previous 59 monthly user group sessions available here: http://www.sharepointmn.com/Pages/Presentations.aspx Recorded sessions should appear a few days after each session! See something you like? Something you don’t? Let us know! info at sharepointmn.com Hope to see you next month! |
|
|
|
|
Composite Applications, Events, MOSS 2007, WSS V3, PowerShell, SharePoint Designer 2007, Workflow, General, Stuff, Check This Out!, Dear Product Team..., Fun and Games, TweakSP, Silverlight, Me, Mobile, InfoPath 2007, Site Definitions, Windows 7, SharePoint 2010, Extended Tweets |
|
|
|
|