Archive | March 2016

getFragment() Doesn’t

The XSPUrl object that you can access via the XPages context has a lot of handy methods. getFragement() isn’t one of them.

I was looking through the help documentation for XSPUrl recently and noticed that the object includes a method for getting the url fragment (i.e. the part of the URL after the hash). It was unexpected, but I figured it could be handy since I was working with some (non-XPages) tabs on pages in a recent application.

However, as shown on Dave Leedy’s helpful XPages URL Cheatsheet, getFragment() doesn’t return anything when referring to the URL gleaned from the current context!

This makes sense, as the hash is a client-side redirect and is not even sent to the server, so a server-side method wouldn’t be able to see it. But it’s included in the XPages Documentation which, hilariously, references Chris Toohey’s post about this from several years ago.

Fortunately, if you need to work with the hash, you can use client-side Javascript’s location.hash property and pass it to server-side code as needed.

Transferring a Bitbucket Repository

I recently needed to move control of a source control repository on Bitbucket from a personal account to a company account. Fortunately, there’s a relatively easy built-in process to transfer it between accounts. In this post, I’ll show how it’s done.

  1. Open the repository in Bitbucket
  2. Click on Settings at the bottom of the left navigation
  3. TransferBitbucket1

  4. Click on Transfer repository under General
  5. TransferBitbucket2

  6. Choose the new owner and click the Transfer Ownership button
  7. TransferBitbucket3

  8. Login to Bitbucket as with the account of the new owner
  9. Click on the user icon in the upper right and select “Inbox”
  10. TransferBitbucket4

  11. You’ll see a message with the transfer request. (It will also be e-mailed to the account owner.)
  12. TransferBitbucket5

  13. Open the message and click the link that it contains
  14. TransferBitbucket6

  15. Click the Accept button to transfer the repository
  16. TransferBitbucket7

  17. Now that the repository has been transferred, it takes you to the Access management screen so you can add users to the repository as needed.
  18. If anyone already had Source Tree set up to use the repository, they will need to update the repository settings to point to the new location.
    • If you try to commit to the original repo url, you get a 404 error when trying to push:
    • TransferBitbucket8

    • Open the repository in Source Tree
    • Click on the Settings button in the upper right hand corner (or select Repository > Repository Settings)
    • Click on the default repository to select it
    • TransferBitbucket11

    • Click the Edit button
    • Update the URL to replace the previous Bitbucket account name to the new one in two places in the URL
    • TransferBitbucket12