Monday, February 08, 2010

Confluence wiki: Linking to a diff against a specific old page version

At my office, we use the Confluence wiki for knowledge management.  We recently had some design specifications for a project delivered to us by a 3rd-party consultant; we imported this documentation into Confluence to allow easy tracking of future changes made to the content.

I wanted to be able to add a link to each page along the lines of “click here to see the Confluence diff between the current version of this page, and the 2009 version,” where the aforementioned “2009 version” would be a specific old page version of the page that I would specify when I set up the link on each page.

Unfortunately, Confluence doesn’t provide an “out-of-the-box” way to provide "one click" access such a diff of a specific old page version against the latest version of the page.  You can create a link to a Confluence diff between two specific versions by using the diffpages.action or diffpagesbyversion.action pages that come with Confluence, but both of those take two hard-coded version IDs or page IDs as parameters; they don’t take a parameter or otherwise allow you to specify “latest” as one of the versions to compare.  So you could create a link to a diff between (say) version 1 and version 5 of a page, but that link would become obsolete as new versions beyond 5 were created.

I asked for advice on how to do this (in this thread) on the Atlassian Confluence forum, and got a helpful suggestion from “Rob L.” involving setting up a Confluence user macro to emit the current version of a page, which could then be embedded in a link to a diff page; however, in my Confluence instance at work, I am unable to get a new user macro set up, so while a good solution, it didn’t solve the problem for me.

I then tinkered a bit more on my own, and came up with a way to do this without the need for a user macro. The approach involves using raw HTML (via the Confluence {html} macro) to create a hyperlink with a dummy target (“href”), and then using Javascript (again using the {html} macro) to edit the link target to include the pageId of the Confluence page, which is accessible via the Javascript DOM.

Here's the Confluence markup:

{html}
  <a id="mydiffLink" href="#">Click here to view the diff.</a> 
  <script> 
    document.getElementById('mydiffLink').href=
      "http://myConfluenceHost/confluence/pages/diffpages.action 
      ?originalId=12345678&pageId=" + document.getElementById('pageId').value; 
  </script> 
{html} 

This solution uses diffpages.action rather than diffpagesbyversion.action since the code uses the Confluence page ID, not version ID.

When using this solution, the hard-coded "12345678" in the above example should be replaced with the actual page ID of the old page to compare against.

"http://myConfluenceHost" in the above example should also be replaced with the actual hostname of your Confluence server, of course.

Caveats: This approach relies on (1) the Confluence {html} macro being enabled, and (2) on the user viewing the page having Javascript enabled.

Monday, January 25, 2010

Fix: Thinkpad using Wireless LAN even when connected via wire

This morning, I noticed that my work laptop, a Thinkpad T60 running Windows XP, was using its wireless network connection, even though the machine was docked and plugged in to the wired LAN.  In Control Panel | Network Connections, the “Wireless Network Connection” showed “Connected,” but the “Primary Network Connection” showed “Disabled.”

Right-clicking the “Primary Network Connection” and selecting “Enable” from the context menu resulted in a “Connection Failed!” message in a popup window, with no further details on the problem.

I’m not sure how my “Primary Network Connection” became disabled in the first place, but I was able to re-enable it as follows:

  • In Control Panel |  Network Connections, right-click on “Primary Network Connection” and choose “Properties”
  • In the “Primary Network Connection Properties” dialog that appears, click the Configure button (near the top of the dialog).
  • In the dialog that appears, if a message appears stating that the device is currently disabled, click the “Enable Device” button.

That fixed the problem for me.  The wired connection started successfully, and the wireless connection disconnected automatically (as it normally does when the wired connection is active).

Thursday, January 14, 2010

Microsoft Office 2003: Ctrl+F1 closes the task pane

Just because I couldn’t find this information when I was searching for it now: In Microsoft Office 2003, the keyboard shortcut to close (hide) the task pane is Ctrl+F1.  (The task pane in Office 2003 is the panel on the right side of the window that is usually hidden, but opens to show certain information such as Help (upon a press of F1), “Getting Started”, the Office clipboard ring, and other items.) 

This shortcut applies to Word 2003, Excel 2003, and PowerPoint 2003 (possibly among others).

Saturday, December 19, 2009

Possible fix: Dell Inspiron 1525 won’t power on

Update 12/20/2009: My stepmom is continuing to have the same problem with her laptop, so apparently the possible solution outlined below is not a "real" solution. (She ended up calling Dell tech support and they're going to replace her machine's motherboard.) Still, leaving this post here on the off chance that it might prove helpful to someone.


My Dad and Stepmom came to visit my house for the weekend this weekend.  My stepmom tried to power on her laptop, a Dell Inspiron 1525, to finish up some work; however, the machine wouldn’t power on.  All of the power LED lights on the bottom-left corner of the machine were completely dark; pressing the laptop’s power button had no visible effect at all.

We tried, without success:

  • Reseating the battery (removing and replacing it)
  • Plugging in the AC power
  • Removing the battery, but leaving the AC power plugged in

None of these steps helped; after trying each step, pressing the laptop’s power button had no visible effect, and all of the LED lights on the machine stayed dark.

At this point, I was just about ready to give up and punt the problem to Dell repair (as the machine was still under warranty), but I tried one more thing: I (1) disconnected the AC power (for safety); (2) removed the battery; (3) cleaned/polished the metal contacts both on the battery, and on the laptop itself where the battery connects to the laptop; (4) and then replaced the battery.

After doing this, upon pressing the power button once again, the machine powered on!  The LED lights at the bottom-left came on as normal, and the machine proceeded to boot into Windows.

The machine did power off without warning once during the evening while my stepmom was using it, so the problem apparently isn’t completely resolved.  I did just use my sweater to clean the power contacts on the battery and the laptop; if the connection between the battery and the laptop wasn’t actually the problem -- and I’m not convinced that it was the problem, but the symptoms do seem to be consistent with an issue related to the power supply – then maybe using a better method of cleaning the contacts would yield better results.

In the meantime, though, I thought I would post this, as I didn’t come across this solution in the course of my Googling for inspiron won’t power on – although I did come across many forum posts from users looking for a solution to a problem with this same set of symptoms.

If anyone does give this solution a try, and is successful, please leave a comment to let me and others know!

Thursday, December 17, 2009

Fix: Excel VBA “User-defined type not defined”: DataObject

Problem

An Excel VBA subroutine that involves interaction with the Windows Clipboard fails to run with the error: “Compile error: User-defined type not defined.”  The line of code highlighted by Excel as being the cause of the error includes a reference to the “DataObject” object type.

Solution

(Tested on my machine with Excel 2003 SP3)

In the Microsoft Visual Basic editor:

  • Stop debugging by clicking the “Stop” button on the toolbar (if debugging isn’t already stopped).
  • Tools menu | References
  • In the list of available references, find “Microsoft Forms 2.0 Object Library”, check it, and click OK.  (For me, this was the 2nd unchecked item from the top of the list; it wasn’t sorted alphabetically in the list like most of the rest of the listed items.)
  • Run the macro again.

That’s it!  Hope this helps!