Friday, October 30, 2009
#
This post is the eighth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here.
#8 – Twitter
Many times since I originally posted about it months ago, I’ve been asked for more details about including Twitter searches and streams inside their SharePoint pages. Thanks to the Twitter API and feeds, this is very simple to do, and to change from showing searches, mentions, direct messages, or other Twitter streams, all you have to do is use a different RSS or Atom feed to start from. Here’s what one of mine looks like:
Step one is to make sure you have the RSSBus Web Part installed. See here for instructions.
Step two, find the RSS or Atom feed URL for the Twitter stream you want to display. For this example, I’ll show Twitter search results for the keywords “SharePoint” , “PowerShell”, and “RSSBus”. You can skip the step if you just want to see it work. When you’re ready to try it with your own search or some other Twitter stream, you’ll need to use your own URL. If you’re unsure how to get this RSS feed, here are instructions:
Twitter Search: just visit search.twitter.com, perform your search, and look for the “Feed for this query” icon on the top right of the page.
Your Public Timeline: just visit your profile and look for the “RSS feed of <username>’s tweets” icon on the right side of the page.
Your Twitter Friends Timeline: just visit your profile and look for the “RSS feed” icon on the bottom right of the page.
Your Twitter Favorites: just visit your favorites page on Twitter and look for the “RSS feed for favorites” icon on the bottom right of the page.
Your Friends Timelines: just visit your friend’s page and look for the “RSS feed of <friendname>’s tweets” icon on the right side of the page.
Advanced Tip: you can make your own custom Twitter feeds out of @replies, direct messages, or combined feeds by using the TwitterOps Connector. With the TwitterOps Connector, you have complete control – you can even send direct messages, send replies, get following and follower lists, or combine two or more of the things into one feed. If you’re curious about this, give it a shot. The easiest way to tinker with TwitterOps before importing it into an actual web part is by using the RSSBus Server Admin Console.
Step three, add the RSSBus WebPart to your page, paste the following template into its source editor, and click “Apply”. You’ll see the web part rendered with the results of the Twitter search results for SharePoint, PowerShell, and RSSBus.
Step four is to customize this template for your own needs. If you’ve clicked “Apply” in the source editor of the web part, you should now see a new property appear in the properties editor of the web part in your browser. Under “Web Part Inputs”, you’ll see a new “SearchPhrase” input. You can put your own search criteria here. If you want to forget the search and just show a stream such as your friends timeline, just replace the following line:
<rsb:call op="http://search.twitter.com/search.rss?q=[[SearchPhrase]]" pagesize="10">
with this:
<rsb:call op=”ENTER_YOUR_URL_HERE” pagesize=”10”>
Note the pagesize=”10” – this tells the web part to only show 10 of the items in the feed. You can change this to whatever value you like, or completely remove it to show all the items.
As always, you can customize the html in the template if you want, or leave it as is.
See all posts in this series: 10 DIY SharePoint Web Parts.
Browse RSSBus Connectors.
Basic RSSBus Scripting Cheat Sheet.
Technorati Tags: SharePoint, RSSBus, WebPart, Twitter
Wednesday, October 21, 2009
#
This post is the seventh in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here.
#7 – Search Email History
One of my good friends here recently asked me to give him an easy way to quickly bring up a list of email correspondence to and from a particular email address over the past 6 months. This way, if he is assisting someone on the telephone or email, he can quickly get up-to-date on what has gone on with this particular person in the recent past. In theory this is easy to do, but doing it in SharePoint would be difficult - well…it used to be. Now you can just copy and paste this template into an RSSBus Web Part and voila. :) Customize to your liking.
Step one is to make sure you have the RSSBus Web Part installed. See here for instructions.
Step two, make sure you have the Imap Connector installed. If you don’t already know the hostname/ip address of your IMAP mail server (e.g. MS Exchange) and a username/password to authenticate to that server, find that information next. This is the same information that you would enter into Outlook when configuring it to connect to your mail server.
Step three, add the RSSBus WebPart to your page, paste the following template into its source editor, and click “Apply”.
Step four is to specify your IMAP server and authentication credentials. If you’ve clicked “Apply” in the source editor of the web part, you should now see a new property appear in the properties editor of the web part in your browser. Under “Web Part Inputs”, you’ll see “server”, “email”, “password”, “mailbox” inputs. These inputs will need to be populated with the values corresponding to your IMAP server, mailbox name (e.g. “Inbox”), and account credentials. Optionally you can change the “months” and “sortcriteria” inputs to alter the output generated. By default, this web part will display messages to/from a specified email address in the past 6 months (the “months” input property) and then sort them by reverse-date (most recent first – the “sortcriteria” input).
After you have set these inputs appropriately, click “Apply” in the properties window and the page will reload. Enter an email address in the search box and click “Search”. The emails sent to or from that email address will be displayed inside the web part! Click on any one of those messages to load a plain text or html view of that email.
As always, you can customize the html in the template if you want, or leave it as is.
Advanced Tip – Note that the “sortcriteria” input expects a sort order formatted according to the IMAP Sort RFC (RFC 5256). Other common sort criteria: ARRIVAL, DATE, CC, FROM, SUBJECT, TO, SIZE. Any of those criteria can be preceeded with REVERSE as I’ve shown in my example. Similarly, the searchcriteria specified inside the template itself can also be modified in the format specified in the IMAPv4 RFC (Section 6.4.4 in RFC 3501).
See all posts in this series: 10 DIY SharePoint Web Parts.
Browse RSSBus Connectors.
Basic RSSBus Scripting Cheat Sheet.
Technorati Tags: SharePoint, RSSBus, WebPart, Exchange, IMAP, Email
Tuesday, October 20, 2009
#
I’ve talked about this before, but it came up again today so I thought I’d do a quick post about it. Here’s a function I use in my PowerShell profile that uses NetCmdlets to send quick “todo” emails:
During the day, when I need to send myself a reminder, I can just say:
PS>todo home “remember to buy apples”
or
PS>todo work "schedule meeting with Mark and his team"
This is always faster than bringing up my email client, composing a new message and clicking send. You’ll notice that my function uses the send-email function from NetCmdlets, but just substitute your own email code if necessary.
Tuesday, September 22, 2009
#
This post is the sixth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here.
#6 – Shipment Tracking Web Part!
I’ve been holding on to this one for a while. Until recently it was just a FedEx shipment tracker, but now the UPS and USPS Connectors have been published at RSSBus.com so this can be what I wanted it to be. This sample will allow the user to input a tracking number for UPS, USPS, or Fedex, and then display tracking events for that shipment in an easy to read table.
Step one is to make sure you have the RSSBus Web Part installed. See here for instructions.
Step two, make sure you have the UPS, USPS, and/or FedEx Connectors installed. You don’t need them all if you don’t want them all, you only need the ones you want to be able to track packages for. Make sure that you have service credentials for the shipping companies you want to use. UPS, USPS, and Fedex all require user/password/etc in order to reach their package tracking web services.
Step three, add the RSSBus WebPart to your page and paste the following template into its source editor, and click “Apply”.
Step four is to specify your account credentials. If you’ve clicked “Apply” in the source editor of the web part, you should now see a new property appear in the properties editor of the web part in your browser. Under “Web Part Inputs”, you’ll see “ups-accesskey”, “ups-accountnumber”, and several other credential inputs. These inputs will need to be populated with the values corresponding to your web service account credentials obtained from UPS, USPS, and/or FedEx. If you’re not using one or more of these shipping companies, just insert a dummy value or modify the template so that that input is not required.
After you have set these inputs appropriately, click “Apply” in the properties window and the page will reload. Enter a tracking number, select the shipping company, and click “Track”. The tracking events will be displayed inside the web part!
As always, you can customize the html in the template if you want, or leave it as is.
See all posts in this series: 10 DIY SharePoint Web Parts.
Browse RSSBus Connectors.
Basic RSSBus Scripting Cheat Sheet.
Thursday, September 17, 2009
#
- Go to the forum control panel, Templates.
- If want to modify the ForumView, click on it and insert your Adsense code after the very first [BREADCRUMB], ie:
<%@ Register TagPrefix="am" TagName="ForumJump" Src="~/DesktopModules/NTForums/controls/af_forumjump.ascx"%>
<%@ Register TagPrefix="am" TagName="Stats" Src="~/DesktopModules/NTForums/controls/af_stats.ascx"%>
<%@ Register TagPrefix="am" TagName="WhosOnline" Src="~/DesktopModules/NTForums/controls/af_whosonline.ascx"%>
[BREADCRUMB]
<p align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-8897283981585073";
/* RTC-ImgTxtMiddleContent 728x90, created 6/29/09 */
google_ad_slot = "0335233866";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
[GROUPSECTION]
- If you want to modify the TopicView, click on it and insert your Adsense code in a new table row just before the end of the [TOPIC] section, ie:
<tr><td colspan="2" style="border: 1px solid #ccc;text-align:center">
<script type="text/javascript"><!--
google_ad_client = "pub-8897283981585073";
/* RTC-ImgTxtMiddleContent 728x90, created 6/29/09 */
google_ad_slot = "0335233866";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr>
[/TOPIC]
- If you want to modify the TopicsView, you’re on your own. Just follow the above examples.
Note: I did this with ActiveForums v3.7.0.12761.
Here is how to add a “Tweet” button to your ActiveForums threads, using John Resig’s (@jeresig) “Easy Retweet Button”. I added a “Tweet” button to the header of each post, right next to the existing quote/reply buttons.
First, modified the default styling of John’s retweet.js so that the tweet button matches ActiveForums. I modified retweet in the following ways:
- Set the link_text to just “ Tweet”.
- I killed the click count by setting count_type to “none”.
- Completely deleted the “styling:” section at the top of retweet.js.
- Near the bottom of the script, I removed the line of code that adds the title of the page to the content of the tweet (this line: elem.title = document.title). Not doing so results in an ugly tweet text.
- I added a tiny twitter logo to the “Tweet” link text by modifying the setting of elem.innerHTML:
elem.innerHTML = "<span><img align='absMiddle' src='http://www.rat-terrier.com/images/Twitter_16x16.png' border='0'>" + RetweetJS.link_text + "</span>";
Here is the modified retweet.js. Copy your own retweet.js file to your own server and include it in your DNN page by adding the following line to the top of your skins ascx file.:
<script src="http://www.textbox1.com/retweet.js"></script>
Update: Previously I'd suggested adding the above line to the root default.aspx. Stephen Webster of bikeclicks.com corrected me and suggested adding this line to the skin within your DNN portal instead. This keeps the functionality limited to a specific portal (even if it's portal 0) and when you upgrade DNN the next time your changes won't get over-written.
Next, modify the ActiveForums TopicView template to make use of the retweet code (easiest way is to modify TopicView.txt in DesktopModules/NTForums/templates/). Here is an example snippet:
[TOPIC]
<tr>
<td valign=top class="[POSTINFOCSS]" height=100>[POSTINFO]<br>[SPACER:1:125]</td>
<td valign=top class="[POSTREPLYCSS]" width=100%>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td class="afsubrow"><a name="[POSTID]"></a>[POSTDATE]</td>
<td class="afsubrow" align=right valign=top>[ACTIONS:DELETE]
[ACTIONS:EDIT]
[ACTIONS:QUOTE]
[ACTIONS:REPLY]
<a class='retweet self'>[SUBJECT]</a>
[ACTIONS:ALERT]
</td>
</tr>
Note: I did this with ActiveForums v3.7.0.12761.
- Download and install owc11.
- Run AxImp on OWC11.dll, which will have been installed in the microsoft shared\web components directory (ie C:\Program Files\Common Files\microsoft shared\Web Components\11\). AxImp.exe can be found in the Windows SDK (ie, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\AxImp.exe).
- In Visual Studio project, drag OWC11.dll to a toolbox tab and drop the Excel component on form.
Voila. When it comes deployment time, you’ll need the AxInterop.OWC11.dll.
Some sample code:
Set a specific cell value:
Spreadsheet1.Cells.get_Item(row, col).set_Value(System.Reflection.Missing.Value, "BSXBW2183NN");
Get the string value of a specific cell:
Spreadsheet1.Cells.get_Item(row, col).get_Value(System.Reflection.Missing.Value).ToString()
or
Spreadsheet1.Cells.get_Item(i, 1).Text.ToString();
Set the background color of a row:
Object ob = "#66FF66";
Spreadsheet1.Rows.get_Item(row, System.Reflection.Missing.Value).Font.set_Color(ref ob);
Technorati Tags:
Excel,
.NET
I was asked to evaluate SlickEdit 2009, so I dropped Ultra-Edit for about three weeks and used only SlickEdit 2009. Here is a little “log” of my thoughts on the switch:
- SE setup asked to add to my system path – I don’t like having to add stuff to my path. What is the benefit of adding this?
[SE Staff:] Many of our customers are heavy keyboard and command line users. Adding SlickEdit to the path allows you to invoke it and its related utilities using the command line.
- The first thing I went to edit was an .htm file. I couldn’t find a way to quickly launch the browser to see the browser view of the document. Ultra-Edit has this and I use it a lot. Later on, I discovered that I can add an “HTML” toolbar, but I wish it would just automatically add that toolbar when I am editing an .htm/.aspx/etc document.
- The next thing I went to edit was a .cs file containing one small class. I loved the way SE showed me a list of all the class members, and when I click a class member it jumps to that spot in the code. I wished it could let me “collapse to definition” like Visual Studio does – and it turns out, it does!
[SE Staff:] Check out View > Function headers. You can also invoke a SlickEdit command to do this. Press ESC to bring up the command line and type in “collapse-to-definitions”. There’s a lot of different ways to collapse text. Look through the items on the View menu plus View > Selective Display. That’s what we call this feature.
- I seemed to recall a slow startup time the last time I tried SlickEdit. There was none of that this time. But, when SE sits unused for a while, and then later I want to drag some files into it…it takes upwards of 4-5 seconds for it to even start responding. I’m not sure what its doing, but the cpu % is at about 5-6 during that time.
- It took me 3 clicks to integrate SE with SVN! Love this feature. At this point I am blaming the slow responsiveness on Vista, and I am thinking I might just be hooked on SE now.
Conclusion:
There are so many features in this editor that it can be hard to find the ones you want (ie, view in browser and the many “selective displays”). Its not as lightweight as UltraEdit, but has many more features than Ultra-Edit. It is a much more functional and powerful editor, but one that requires some system resources.
Monday, August 24, 2009
#
This post is the fifth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here.
#5 – QuickBooks Web Part!
I accidently overwrote the original post. Sorry about that. Below are the steps for the QuickBooks webpart. If there are other QB searches you need to do, I can help with that. The RSSBus QBOps Connector has a ton of functionality.
Step one is to make sure you have the RSSBus Web Part installed. See here for instructions.
Step two, make sure you have the QB Connector installed.
Step three, make sure QuickBooks is accessible. This means that either QB must be installed on the SharePoint machine, OR you’ll need the assistance of the QB Remote Connector, available for free at RSSBus.com. The QB Remote Connector should be running on the QB machine. Then your web part will connect to it remotely over secure HTTP.
Step three, add the RSSBus WebPart to your page and paste the following template into its source editor, and click “Apply”.
Step four is to set your connection string. If QB is running on some accessible machine, and the Remote Connector is running there as well, you should only need to set the connection string to a URL:
url='http://remoteconnectorserver:2080'
If you’ve clicked “Apply” in the source editor of the web part, you should now see a new property appear in the properties editor of the web part in your browser. Under “Web Part Inputs”, you’ll see “conn”. This inputs will need to be set with the connection string in order to connect to QuickBooks.
After you have set the conn input, click “Apply” in the properties window and the page will reload. Enter a customer name (last name, first name) and click “Search”. The customer details will be displayed inside the web part!
As always, you can customize the html in the template if you want, or leave it as is.
See all posts in this series: 10 DIY SharePoint Web Parts.
Browse RSSBus Connectors.
Basic RSSBus Scripting Cheat Sheet.
Thursday, July 30, 2009
#
This post is the fourth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here.

#4 – List Active Directory Groups and Users
This web part will list each user group and its members, as defined in your Active Directory (or other LDAP server) installation.
Step one is to make sure you have the RSSBus Web Part installed. See here for instructions.
Step two, make sure you have the Ldap Connector installed.
Step two, add the RSSBus WebPart to your page and paste the following template into its source editor, but do not click “Apply” yet.
Step three, we need to modify this template so that it works for your Active Directory server, and not mine! There are several things you’ll need to change:
1. On line 8-10, change the values of the server, authentication dn, and authentication password settings to match your AD installation. See the advanced tip at the bottom of this post to automatically use the logged in user as the authentication dn.
2. On line 13, you’ll want to modify the value of the dn setting to match your domain.
As always, you can customize the html in the template if you want, or leave it as is.
Step four, click “Apply”, and when the page reloads you’ll be presented with a list of the groups on your Active Directory domain. Click on a group to expand it into its list of user members.
And now - an Advanced Tip! Use RSSBus’ special _spuser item in order to get information specific to the currently authenticated SharePoint user. This comes in handy for things like listing documents that were modified by a specific user, authenticating to an Exchange server, and in this example for authenticating to AD. You can set the DN to “[[_spuser.LoginName]]”, and prompt the user to enter their own password.
See all posts in this series: 10 DIY SharePoint Web Parts.
Browse RSSBus Connectors.
Basic RSSBus Scripting Cheat Sheet.