BoxLang Quick Tips – PDF Generation

Today’s BoxLang quick tip is one near and dear to my heart, generating PDFs. Creating dynamic, expressive PDFs is fairly easy. Let me show you how. As before, I’ve got a video version as well so you would rather watch that, just skip to the end. Step One – The Module By default, BoxLang doesn’t ship with PDF capabilities built-in, you need to add it via the PDF Module. This can be done quickly via the CLI: install-bx-module bx-pdf Installing the module adds three new tags to your BoxLang runtime: bx:document – This is the core tag for PDF generation. Everything inside it will either be content or directives (see the items below) to control what’s produced. bx:documentitem... more →
Posted in: JavaScript

Building a Jira Search Tool in BoxLang

Developers seem to have a love/hate (or perhaps hate/despise) relationship with Jira. I’ve never minded it, but the biggest issue for me is that if I haven’t used it in a while, it can be overwhelming. Yesterday I was thinking about this and wondering if perhaps I could build my own tooling to interact with Jira via an API, if it even had one. Turns out, of course they have an API and it’s not terribly difficult to use. With that in mind, I whipped up a quick tool to search Jira via the command line with BoxLang. Jira API Basics The docs for Jira’s API are pretty good and cover the huge set of operations you can perform with it. Your root API url will be based on your... more →
Posted in: JavaScript

BoxLang Quick Tips – Database Access

Today I’m kicking off a new blog/video series of quick tips for people interested in BoxLang. These ‘quick tips’ are just that, a look at how BoxLang can simplify working with the JVM and building CLI scripts, web apps, and serverless applications. Each of these posts will include a video along with sample code and help highlight some of the ways BoxLang can be powerful in just a few lines of code. For my first quick tip, let’s talk database access, which by the way was one of the reasons I got into ColdFusion nearly thirty years ago (I didn’t want to figure out how to do it in Perl!). Working with databases in BoxLang can be done in a few steps. Step One –... more →
Posted in: JavaScript

Using Java Libraries in BoxLang

One of the aspects that makes BoxLang compelling is that it runs on top of the Java Virtual Machine which means you get access to any Java library out there. This is something ColdFusion has as well and in the past, I’ve integrated Java libraries into my web apps to make use of open source from the Java community. Best of all, you don’t really need any Java knowledge to do this. Typically libraries will provide good docs and and examples and the mental model of translating a Java example to BoxLang’s language is fairly simple. A few days ago, I blogged an example of parallel processing in BoxLang and in one of the samples, I did a tiny bit of RSS feed processing. I mentioned... more →
Posted in: JavaScript

Using Parallel Looping in BoxLang

Last week I wrote about converting a Python file search script to BoxLang. In that post (and the original Python version) I mentioned how the utility wasn’t terribly efficient as it needed to recreate an index every time it ran. Despite this, the performance was pretty good, taking about two seconds or so to generate the file index from near seven thousand Markdown files. Right after I shared that post, Luis Majano shared an interesting performance tweak I had missed. In BoxLang (and to be fair, this is a feature both Lucee and ColdFusion have as well), when you loop over arrays, structures, and queries, you can enable parallel execution by simply adding an additional argument to the loop.... more →
Posted in: JavaScript

Building a File Search Script in BoxLang

My initial blog post on BoxLang used a simple script example to demonstrate how the language can be used to build shell script type utilities and it got me thinking about other ways I could use BoxLang for my own personal tools. A little over three years ago, I blogged about a Python script I built to perform searches, locally, against my blog. My blog content comes from near seven thousand Markdown files and while I’ve got a good client-side search feature, I was curious what I could from the terminal. That script did two things: Index each of the thousands of Markdown files by reading in the content and parsing the filename into a date and path value Taking search input and checking... more →
Posted in: JavaScript

Building a Web App with BoxLang

I’ve been building web apps for thirty years now, which frankly is kind of scary to see explicitly spelled out. For a large chunk of that time I built web apps using an application server, ColdFusion, where my templates would dynamically output HTML (or other formats like JSON) to return to the browser. For my non-ColdFusion readers out there, you can just replace ColdFusion with PHP or ASP and you get the basic idea. Most recently, I’ve spent a lot less time on the server and more on the front-end, but I kept coming back from time to time. Earlier this year I looked at building a simple blog in the Python-based Flask framework. I thought it would be a good exercise to try something... more →
Posted in: JavaScript

Building Serverless Lambda Functions with BoxLang

I’ve been a fan of serverless for quite some time. My introduction to it was OpenWhisk, way back in 2016. It’s been appealing to me for a long time as an easy way to deploy lightweight services quickly. As much as I’ve been a fan of the technology, I’ve yet to really embrace Amazon’s Lambda product. I’ve played with it a bit off and on in the past, but it always felt incredibly overwhelming. Netlify Functions, Pipedream, and Cloudflare Workers have been my main tools for serverless just because of how simple they are. That being said, the last few days I’ve been playing with BoxLang on AWS and thought I’d share my experience. The Basics So let’s... more →
Posted in: JavaScript
1 2