|
|
|
|
|
|
|
About Bloggings from PlanetParker
What’s my blog about? Great
question! To be honest, it hasn’t
hit me just yet, so in the meantime I’m just going to blog whatever comes to
mind that I think might be either useful or humorous to you.
What you won’t find is rants—the internet is full of blogs where people rant
about politics, business, media, etc.
Blah…I don’t want to get sucked into that negative hole, so stick with me and
you’re safe ;-)
Let me know what you think about the blog so far by posting a comment, and don’t
forget to take
the surveys. |
|
|
1/13/2010
The Problem
So if you’ve ever tried to walk someone through the process of creating a custom web part page filled with nicely styled text and pictures, you know what a poor experience SharePoint WSS 3.0 provides. It involves navigating all of SharePoint land, hunting for URL’s, and battling with a lame Rich Text Editor with the formatting of your content.
It goes something like this:
Step 1: Open any custom web part page for editing, and drop a Content Editor Web Part (CEWP) onto the page.
Step 2: Put the CEWP web part into edit mode, and click on the Rich Text Editor button
Step 3: You now get a rich text box to start typing away. But the box is really small, so you widen it. You start typing text and realize you want a cool picture or two to spice up the content. So you click on the little picture button and expect to be able to browse and insert a picture. Wrong. You get a tiny dialog box asking for the URL to the picture.
Ah huh…so then you realize that you have to actually upload the picture to your picture library ahead of time (which you didn’t because you weren’t even sure what you were going to put in your article or content until you started writing it out).
Step 4: So you save your current work (which looks terribly incomplete), and navigate over to your picture library so you can upload a picture or two. You don’t know which picture is going to look just right yet, so you upload 4 or 5 just in case because you don’t want to have to do this all over again and interrupt your creative thought.
Step 5: So after uploading the pics to a library (which takes entirely too long) you then need to go grab the URL for the picture you want to use, so you view the properties of the picture and copy the URL to the clipboard.
Step 6: Then you wander back to your custom web part page, click edit a few times, and jump back into the rich text editor. You then find a good spot within your text to drop a picture, and click on the picture button again. This time, you’re armed with that pesky little URL, and wah-la! You’ve got a picture displayed inside your CEWP. Hooray!…except…you decide it’s not really aligned well within the flow of the content. So you play around with cutting and re-pasting the picture into the rich text editor, but can’t quite figure out how to get it exactly where you want it. You then decide that the picture needs to be a little smaller, or larger. You select it and drag the corners to resize it of course, only to find out that it doesn’t retain the proportional width to height. How nifty! After fussing with it, you decide to leave it alone and move onto the rest of the content.
Step 7: You type happily along again until you decide you need another picture. Oh yes, you need to go grab that new URL now… So you go back to the picture library again to grab another picture URL. Then a return trip to your page, edit, rich text box…okay, ready to go. You insert the new picture, and briefly entertain the thought of moving it around, but dismiss the idea realizing how much of a PITA it was and you didn’t even get the results you like, so you forget it. But, then you think….hmmmm…is that really the right picture…
Step 8: Ugh, back to the picture library to grab a different picture URL, copy it, then back to web part page, edit, rinse, spin, and repeat, and paste.
Done! So, now you have an article with a couple of pics which are not exactly placed where you’d like them or proportionately sized, and you ended up with a few pictures uploaded into your picture library that you didn’t even end up using after all. But oh well, it only took 20 MINUTES!!!
Now, try training an end-user to do this on their new, spiffy SharePoint website that you created for their Glee club. Then watch their expression as they realize they will need to go through this hoop-jumping, uploading, URL hunting, content formatting HELL, over and over and over again… every time they want to create content with pictures (which is most of time). I can tell you, the Glee club won’t be singing your praises.
The Solution
Okay, so how do we solve this problem? Better rich text editor web parts you say? Maybe, but if you’re like me and in a shared hosting environment—no luck. But there is a way you can make this whole process a TON better, faster, and easier.
The secret is two key ingredients: A SharePoint Blog template, and Windows Live Writer
…and 3 simple steps: Create, Publish, and Copy
Step 1 – Create: Windows Live Writer (WLW) now integrates seamlessly with SharePoint sites based on the Blog template style. This means you can use WLW to create “posts” (aka content) which you can then publish to your SP blog. The beauty here is that WLW is a far better rich text editor, which allows you to easily draft content, import pictures (or even screen captures), links, etc., with perfect alignment, boxing, columns, or whatever you want.
Step 2 – Publish: Once you’ve put the finishing touches on the content and pictures within WLW, you simply press the publish button, and WLW takes care of not only posting the content, but also upload all of the pictures to your SP site, correctly linked and all ready to go. How cool is that!?!

Step 3 - Copy: So, once you’ve published the post to your SP blog, the only thing you need to do is visit the blog post, edit it, and steal the source code that SP embedded for you as part of the posting.Once you’ve got it, then simply edit a CEWP in source code mode (no stinky rich text editor!), and paste the code.

Click save and WAH-LA!!! NOW you’re cookin’ with gas! :-)
The Result
Tip: If you already have an existing SP site which was not based on the blog template, just create a sub-site using the blog template. You can then choose to hide it or use it as a great blogging feature for your existing site, complete with RSS feeds. 9/16/2009
UPDATED: I have updated this post with a little more information on how to achieve this, since on my original post I was being a bit...well, lazy :-)
Okay, so @jpowell490 was asking on the VisiFire forums about how to create a stacked column/bar chart with VisiFire, but pulling the data from a SharePoint list instead of hard-coded XML. So I quickly threw together a demo which illustrated his exact needs, and provided source code, but I failed to show how to implement the code. It's funny how I can remember reading posts where someone had dumped a bit of code on there, and feeling very frustrated because they didn't specifically tell me where in the heck to put the code. How easy we forget :-)
So anyway, let me try to step through this for folks who are interested.
Step 1: I'm assuming you already know how to create a SharePoint list with the necessary fields highlighted in this demo, so I won't cover that.
Step 2: Open SharePoint designer and create a new web part page (or do it through SharePoint and then open designer to edit it).
Step 3: Add a data view to any web part zone, and base it off the custom list you created. Add at least one field to the data view.
Step 4: Look at the code view through SPD of your page, and find the code related to the data view web part you just created. In that section of code you need to find and highlight the following code…and DELETE IT!
<xsl:template match="/"> <xsl:call-template name="dvt_1"/> </xsl:template> <xsl:template name="dvt_1"> <xsl:variable name="dvt_StyleName">Table</xsl:variable> <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/> <table border="0" width="100%" cellpadding="2" cellspacing="0"> <tr valign="top"> <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1"> <th class="ms-vh" width="1%" nowrap="nowrap"></th> </xsl:if> <th class="ms-vh" nowrap="nowrap">Month</th> <th class="ms-vh" nowrap="nowrap">New Help Tickets</th> <th class="ms-vh" nowrap="nowrap">Closed Help Tickets</th> </tr> <xsl:call-template name="dvt_1.body"> <xsl:with-param name="Rows" select="$Rows"/> </xsl:call-template> </table> </xsl:template> <xsl:template name="dvt_1.body"> <xsl:param name="Rows"/> <xsl:for-each select="$Rows"> <xsl:call-template name="dvt_1.rowview"/> </xsl:for-each> </xsl:template> <xsl:template name="dvt_1.rowview"> <tr> <xsl:if test="position() mod 2 = 1"> <xsl:attribute name="class">ms-alternating</xsl:attribute> </xsl:if> <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1"> <td class="ms-vb" width="1%" nowrap="nowrap"> <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span> </td> </xsl:if> <td class="ms-vb"> <xsl:value-of select="@Title"/> </td> <td class="ms-vb"> <xsl:value-of select="format-number(@NewHelpTickets, '#,##0.00;-#,##0.00')"/> </td> <td class="ms-vb"> <xsl:value-of select="format-number(@ClosedHelpTickets, '#,##0.00;-#,##0.00')"/> </td> </tr> </xsl:template>
Yes, delete it! Don't worry--we're going to add some other code instead.
Step 5: Paste the following code into the section you just deleted--naturally, placement is key, so make sure you put it in the right spot:
<!-- Load the chart tools -->
<script type="text/javascript" src="Visifire2.js"></script> <!-- Create the JavaScript variable that holds the data to plot. -->
<!-- Note the xsl:for-each statement which loops over all the list items and creates the necessary DataPoint entries in the Chart XML. -->
<xsl:text disable-output-escaping="yes"><![CDATA[<script type="text/javascript">
var xmlString =
' <vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"'
+ ' Width="600" Height="400" BorderThickness="1" CornerRadius="15" Theme="Theme3" View3D="False" AnimationEnabled="True" Watermark="False" Bevel="False" LightingEnabled="True" >'
+ ' <vc:Chart.AxesX>'
+ ' </vc:Chart.AxesX>'
+ ' <vc:Chart.AxesY>'
+ ' <vc:Axis Interval="50" />'
+ ' </vc:Chart.AxesY>'
+ ' <vc:Chart.Titles><vc:Title Text="Closed Tickets vs. New Tickets" FontSize="24" FontColor="#33CCFF" Enabled="True" FontFamily="Arial"/></vc:Chart.Titles>'
+ ' <vc:Chart.Series>'
+ ' <vc:DataSeries LegendText="Closed Tickets" RenderAs="StackedColumn" ShowInLegend="True" Bevel="True" LabelEnabled="True" LabelFontSize="14">'
+ ' <vc:DataSeries.DataPoints>'
]]></xsl:text>
<xsl:for-each select="/dsQueryResponse/Rows/Row">
<xsl:text disable-output-escaping="yes"><![CDATA[ + ' <vc:DataPoint AxisXLabel="]]></xsl:text><xsl:value-of select="@Title" />
<xsl:text disable-output-escaping="yes"><![CDATA[" YValue="]]></xsl:text><xsl:value-of select="@ClosedHelpTickets" />
<xsl:text disable-output-escaping="yes"><![CDATA["/>']]></xsl:text> </xsl:for-each>
<xsl:text disable-output-escaping="yes">
<![CDATA[
+ ' </vc:DataSeries.DataPoints>'
+ ' </vc:DataSeries>'
+ ' <vc:DataSeries LegendText="New Tickets" RenderAs="StackedColumn" ShowInLegend="True" Bevel="True" LabelEnabled="True" LabelFontSize="14">'
+ ' <vc:DataSeries.DataPoints>'
]]></xsl:text>
<xsl:for-each select="/dsQueryResponse/Rows/Row">
<xsl:text disable-output-escaping="yes"><![CDATA[ + ' <vc:DataPoint AxisXLabel="]]></xsl:text><xsl:value-of select="@Title" />
<xsl:text disable-output-escaping="yes"><![CDATA[" YValue="]]></xsl:text><xsl:value-of select="@NewHelpTickets" />
<xsl:text disable-output-escaping="yes"><![CDATA["/>']]></xsl:text>
</xsl:for-each>
<xsl:text disable-output-escaping="yes">
<![CDATA[
+ ' </vc:DataSeries.DataPoints>'
+ ' </vc:DataSeries>'
+ ' </vc:Chart.Series>'
+ ' </vc:Chart>';
</script> ]]></xsl:text>
<!-- Create the div to hold the chart and then run -->
<!-- the JavaScript code to actually show the chart. -->
<div id="VisifireChart1">
<script language="javascript" type="text/javascript">
var vChart = new Visifire2("SL.Visifire.Charts.xap",600,400);
vChart.setDataXml(xmlString);
vChart.render("VisifireChart1");
</script> </div> </xsl:template>
Step 6: The code I have provided refers to specific list fields which I created in my custom list. If your fields are different, then obviously replace those within the code. @Title refers to the "Month" column, and the other two columns (@NewHelpTickets and @ClosedHelpTickets) are self-explanatory.
Step 7: Fire away! You're done.
So here's is a live example for you to view as well, which implements the exact code mentioned above. I hope this helps--enjoy!
7/24/2009
Okay, so hopefully you've found this post quickly and with minimal effort, because I couldn't imagine anyone going through the pure XSL hell that I just did these last 2 days. Yes, that's correct—two days I spent trying to figure out how to get a data view to dynamically group on a people-type column. When I say dynamically, I mean not by applying a static grouping through SharePoint Designer (although that too has its own issues), I'm talking about the nifty toolbar you can add to your data view to allow users to perform sorting, grouping, and filtering of your custom view. This is absolutely critical unless you want to spend you days and nights copying and modifying individual views to accommodate every possible sort and grouping scenario your users might come up with. At any rate, it sounds like it should be really simply, huh? Perhaps a built-in feature even, eh? Or at a minimum just using the sorting and grouping dialog correctly, right? Pffftt…yeah, I thought so too. 
(diagram above shows normal behavior when working with views within SharePoint’s end-user interface)
Here's what happens: In SharePoint designer, you first try to apply static grouping to your data view. Sure, it adds the need grouping headers, but unfortunately every entry is displayed within its own "group", which is obviously completely pointless. Here’s what it looks like:
Through some quick research you'll find that these people columns actually output a whole slew of data that's not actually rendered on the screen. Here's an example:
You see this: Doe, John
Sharepoint is hiding this: "<nobr><span><A HREF="/cl/XY/XYpeople/_layouts/userdisp.aspx?ID=231">Doe, John</A><img border="0" height="1" width="3" src="/_layouts/images/blank.gif"/><a href='javascript:' onclick='IMNImageOnClick();return false;' class='ms-imnlink'><img name='imnmark' title='' border='0' height='12' width='12' src='/_layouts/images/blank.gif' alt='No presence information' sip='John.Doe@Anycorp.com' id='imn_522,type=sip'/></a></span></nobr>"
Aside from being information overload for most purposes, it creates the very thing hated by the Group function: Uniqueness. If you look closely at the information, you see that there is a unique number embedded. What does it do? I have no idea, nor do I care. All I know is that by making each individual entry unique, my grouping won't work. So yes, don't worry, there is an easy way to truncate it so that you end up with a value that will not necessarily be unique, so you can get some grouping action going on.
No, it's not the usual "disable-output-escaping" statement…UGH!! That only fixes the display of the field in your html—it does nothing to fix the grouping problem.
Okay, so it's actually a really easy substring statement that you may have already found in your Google searches because you're better than me. If not, it looks like this:
<xsl:value-of select="substring-before(substring-after(substring-after(@ContactPerson, '?ID='), '>'), '<')" />
Which returns this:
"<nobr><span><A HREF="/cl/XY/XYpeople/_layouts/userdisp.aspx?ID=231">Doe, John
Notice that the id=imn_522 isn't there, only repeatable data that can easily be grouped together now. Sure, you can substring it even more to get just "Doe, John" returned, but after two days of banging my head against the keyboard trying to solve the grouping problem, I didn't bother. I'm fairly certain you could find about 2,000 other blogs with this information if you're interested.
Okay, so we have unique values and we're ready to watch SharePoint do some killer grouping, right!?? BUZZZ Wrong. This next part is really the key, and was the thing that eluded me for two days because it's just not documented anywhere that I could find. Now I'm sure as soon as I say that, I'll get 30 comments with links to everyone's blog with clear and easy instructions that have been out there for 2 years. Sure, maybe's it's out there. Heck, with as little sleep I've gotten lately, I'd probably miss it in my searches even if my wife posted a note on the fridge with the code. Okay, just in case you DON'T have the answer, Smarty-Pants, here it is:
Within your xsl, there is a section that deals specifically with evaluating the row data and grouping it. The problem, is that for some wholly ungodly reason, there is nothing in the code to deal with the people data type, so it just treats it as regular data and and it reads the entire string of the people column, which means that unique identifier slips in an ruins our grouping.
So in order to fix it, we need to tell the XSL to do something differently when we encounted this particular people field so that we can strip out the uniqueness part, before the grouping happens. To do this, you simply add an xsl:choose branch to tell it to deal with people columns in the fashion mentioned above (substringing it to remove the unique identifier). The section of code you need to find is the dvt_1.body template section. In it, you'll find this block of code:
<xsl:variable name="NewGroup_adhoc">
<xsl:choose>
<xsl:when test="$dvt_groupfield">
<xsl:value-of select="ddwrt:NameChanged(string(*[name()=$dvt_groupfield] | @*[name()=$dvt_groupfield] | current()[name(.) = $dvt_groupfield]), 0)" /></xsl:otherwise>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
Replace it with this block:
<xsl:variable name="NewGroup_adhoc">
<xsl:choose>
<xsl:when test="$dvt_groupfield">
<xsl:choose>
<xsl:when test="contains($dvt_groupfield, 'ContactPerson')"> <xsl:value-of select="ddwrt:NameChanged(string(substring-before(@ContactPerson,'</A>')), 0)"/></xsl:when>
<xsl:otherwise><xsl:value-of select="ddwrt:NameChanged(string(*[name()=$dvt_groupfield] | @*[name()=$dvt_groupfield] | current()[name(.) = $dvt_groupfield]), 0)" /></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
WAIT!! There's one little tweak you need to make, and it's only because I'm a hack. Yes, that's right, I had to hard-code <crowd gasp> the contains criteria to distinguish the specific people field from other normal fields. I'm certain there is a way around this to make it more generic and reusable, and I actually intend to track that down later, so I'll certainly pass it along when I figure it out. For now though, in hopes that I can save you some frustration, just replace the word 'IT' in the code above with something that resembles the people field name that you're trying to group on. In my case, the actual field name was @ContactPerson. Okay, okay, it's a hack…I already said that…geez. But, it works for now, and that's all that matters.
Okay, I'm done here—just wanted to pass this along while it was fresh in my mind (and before I got too lazy to bother posting it). Hope it helps.
5/23/2009
I saw this killer bird hanging out at the North Hills pond, so I caught him on film using our new Sony High Definition video camera. I thought I’d also try my hand at video editing, and here is the result. Let me know what you think :-)
Watch Out Fishy!!! 5/20/2009
If you haven't checked out this website yet, hit it now. It takes any picture you've got and blends it into a variety of scenes that look REAL! Very clever. 5/12/2009
Inspired by my last badge and how many followers I gained as a result, I created another fun badge to show off on your blog or twitter background. In this new era of customer-service is king, you can now back your tweets with a solid, iron-clad, no if's, and's, or but's guarantee that shows your followers you are committed to their satisfaction. Well, okay, maybe not their satisfaction, but you can sure point out that they didn't actually pay a single dime for your awesome and witty tweets, so quit complaining! ;-)
Feel free to link to the source picture located here for your blog, or let me know if you'd like a different size. Also, you can find the badge version here on my Badges page! 5/4/2009
After reading a thousand or so tweets about Swine Flu, I felt compelled to create this badge. This is not meant to offend anyone, just trying to keep things light hearted in a mad world. If necessary, flame on…heck, the blog participation would be nice for a change ;-)
Feel free to link to the source picture located here for your blog, or let me know if you'd like a different size.
By the way, if anybody knows the original creator of the pre-modified version of this blue bird, please let me know so I can give credit where it's due. I downloaded the image from this blog. 5/2/2009 A short while ago, I started noticing that every time I would close Microsoft Word, it would crash. Very annoying, but I figured that maybe a recent automatic update caused the problem and was hopeful that soon another automatic update would fix it J Well, after about a month of it I finally got frustrated, particularly since I was observing additional behavior that was the last straw—it was preventing me from posting blog posts to my SharePoint Blog via MS Word (which btw is far better than the rich text editor on SharePoint).
I finally did a search to see if I could find someone else that was having the same problem and came across this awesome quick fix from Ruth Ellison on her blog, http://www.RuthEllison.com. She discovered a knowledgebase article that instructed her to simply delete a registry key, and viola…Fixed! Check out her post and get your MS Word healthy again.
Ever wonder how to hide the site title without deleting the text under Site Title/Description setting, or even worse, using SharePoint Designer (SPD) to just completely zap it from existence?
This quick and easy tip from the Tech Training Notes Blog will show you how to simply hide it using a couple quick lines of CSS. Head over to Mike Smith's site and check out this link to see how it's done.
|
|
|
1. Are you a Mac or a PC? (don't get hung up on personality attributes--it's just for fun ya know)
|
| | I'm a Mac (Shiny screens, tie dye shirts, and just totally kewl!) |
| | | 9 (28%) | |
|
|
| | I'm a PC (Brainiac, rebooting again, and practical!) |
| | | 23 (72%) | |
|
|
Total: 32 |
|
|
|
|
|
|
|
|
|