Pastebin.com
November 25, 2010
People who read this blog probably need to share bits of source code or other text on a regular basis, eh?
I just stumbled upon the Pastebin.com site, which lets anyone share chunks of text, then provide a link so others can access it. Most clippings are shared publicly and have no identifying information. You can also create private text clips or create folders for sharing multiple chunks privately, though the protection is limited to those who know the name of your private folder, so very weak!
It’s ad-supported, searchable and even provides an API for posting (anyone interested in building an Apex application to create and share a private folder???). It has a syntax-formatter to highlight your source for a variety of languages.
There’s not much to it, but it definitely fills a need. While I was looking it over (on Thanksgiving Day), dozens of people were adding new clippings every few minutes. Though many of them are just posts of BitTorrent download sites for various search phrases (e.g. Harry Potter Goblets of Fire), so I doubt anyone would want to spend time searching the archives for other people’s clippings.
Mystery: Interactive Report broken for end-users!
November 4, 2010
A friend dropped me a line saying her Apex app’s Interactive Report wasn’t working for her users anymore and she asked if I knew what could cause it. She said it worked for her in the Apex development environment, but not outside. I talked her into giving me an account on her Apex workspace and started digging through it.
For me in the developer environment, it wouldn’t do any of the JSON updates, like search for text, filter, change columns, sort, etc. – all the cool things we love about IRs. I’d seen this before, but it’d been so long I’d forgotten. I finally dug into the page template and noticed that there wasn’t much inclusion of external CSS going on and when I added that in, the report worked. So I sent her that as “fixed!” I couldn’t figure out how this application could have worked before, but had stopped!
Unfortunately, she wrote back saying that didn’t do it for someone running outside the development environment! Aaagh!
But I love a good challenge, so I dug back in. I got another session going in another browser so it was outside Apex’s environment. I noticed a difference between the two user sessions, that in the Development Environment, it showed my username on the top of the page, but not when I wasn’t. That was the hint I needed! It reminded me that the Interactive Reports store your queries by the APP_USER name into the database. No user name, no interactivity!
It turned out that this was a new application, she was using a custom authentication method that was new to her and she wasn’t setting the APP_USER value!
I’d used this same custom authentication method and found I needed to call
APEX_CUSTOM_AUTH.SET_USER(p_user => 'some custom value');
in the Post section of the authentication method.
Once that was set, everything worked great.
It was only after I told my friend the solution that she said that this was a new application she was building. Oops! If she’d said that up front, I might have figured out what was wrong sooner! :-/