Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Using Google Blogger API v3

Mike's Notes

On a Sandy Beach is a publication of Ajabbi Research.

Changes needed

Enable other people at Ajabbi Research to also contribute to On a Sandy Beach using the Workspaces for Research UI.

It looks very straightforward. This job will be done once the Workspaces for Research are available for researchers to use.

Preparation

Last year, all existing blog posts were reformatted.

New setup

The Pipi CMS Engine (cms) will format, store in a database, and export content to On a Sandy Beach, hosted on Google Blogger, using the Blogger API ver 3.

Either XML/Atom or JSON can be used.

Steps

  1. Import the existing blog posts into the CMS Engine via the Blogger API
  2. Reformat every post (see 4th resource link below)
  3. Store in the CMS database
  4. Render posts
  5. Export back to Blogger via the Blogger API.
  6. All future posts will be created by a human using a workspace, transferred to the CMS Engine, processed, and then published to Google Blogger.

Notes

Here are some initial notes taken from the Google Blogger API documentation and other sites, tweaked using Gemini and rewritten by Grammarly.

These notes will be presented using slides at tomorrow night's online Open Research Group meeting.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

09/02/2026

Using Google Blogger API v3

By: Mike Peters
On a Sandy Beach: 07/02/2026

Mike is the inventor and architect of Pipi and the founder of Ajabbi.

Blogger supports manual import and export of blog content via the Blogger dashboard or the Blogger API. The export file format for both methods is Atom, an XML-based format that includes all posts and comments. 

Blogger API for Import/Export

Developers can use the Blogger API (v3 is the current version) to programmatically manage blog content. The export file generated via the manual process uses the same Atom format as the API's feed requests. 

Key Points for API Use

  • Authentication: All operations for private data (including import/export) require authentication, typically using OAuth 2.0.
  • Format: The API uses REST APIs and JSON for standard operations. The specific import/export functions rely on the raw XML/Atom format described in the developer guides.
  • Functionality: The API allows retrieving, creating, updating, and deleting posts, comments, and pages, enabling the creation of custom import/export tools. For example, you can use API clients for Python, Java, or Node.js to manage content programmatically.
  • Custom Import Scripts: Developers can write scripts (e.g., in PHP or Python) to import content from other sources into Blogger via the API, which involves parsing the source data and making POST requests to Blogger API endpoints. 

For detailed API documentation, refer to the Blogger API Developer site.

REST

The Blogger API is a RESTful interface provided by Google that allows developers to integrate Blogger content and functionality into their own applications. It enables programmatic access to resources such as blogs, posts, comments, pages, and users via HTTP requests and JSON. 

Key Features and Concepts

  • Resources: The API revolves around five core resource types:
    • Blogs: The central container for all content and metadata.
    • Posts: The primary published content items, meant to be timely.
    • Comments: User reactions to specific posts.
    • Pages: Static content (e.g., about me, contact info).
    • Users: Represents a non-anonymous person interacting with Blogger, as an author, admin, or reader.
  • Operations: Developers can perform various operations on these resources, including list, get, insert (create), update, patch, and delete.
  • Authentication:
    • Public Data: Requests for public data (e.g., retrieving a public blog post) only require an API key.
    • Private Data: Operations involving private user data (e.g., creating a post, editing a comment) must be authorised using OAuth 2.0 tokens.
  • API Version: The latest recommended version is Blogger API v3. Support for the older v2.0 API ended on September 30, 2024, so applications must be updated to continue functioning. 

How to Access the API

Google recommends using their client libraries, which handle much of the authorisation and request/response processing for you. Libraries are available for a variety of programming languages: 

  • Go
  • Java (get started with the Java client library)
  • JavaScript
  • .NET (install the Google APIs NuGet package)
  • Node.js
  • PHP
  • Python (install the client library using pip install google-api-python-client)
  • Ruby 

Alternatively, you can interact with the API directly using RESTful HTTP requests. The Google APIs Explorer tool lets you test API calls in your browser. 

  • Pipi API Engine (api)  using CFML
  • BoxLang API using BX

For full documentation and developer guides, visit the official Blogger API documentation site on Google for Developers. 

Older Data API (v1/v2) Format: Atom XML 

The previous versions of the Blogger API relied heavily on the Atom Publishing Protocol (AtomPub) and Google Data API feeds for managing blog content. The API used standard HTTP methods (GET, POST, PUT, DELETE) to transport Atom-formatted XML payloads. 

Important: Support for the v2.0 Google Data API ended on September 30th, 2024, so applications must use the latest version to continue functioning. 

Exporting and Accessing Feeds via XML

Blogger still uses Atom XML for blog syndication and content backup: 

  • Public Blog Feed: Every Blogger blog has a public Atom feed, typically at an address like yourblogname.blogspot.com/feeds/posts/default or://yourblogname.blogspot.com.
  • Content Backup: Users can back up their blog's posts and comments as a single .xml file from the Blogger dashboard.

    • Sign in to Blogger.
    • Select your blog.
    • Go to Settings > Manage Blog.
    • Click Back up content and Download XML file. 
    • This downloaded file is in a specific Atom format for import and export. 

REST in the Blogger API

The supported Blogger operations map directly to REST HTTP verbs, as described in Blogger API operations.

The specific format for Blogger API URIs are:

  • https://www.googleapis.com/blogger/v3/users/userId
  • https://www.googleapis.com/blogger/v3/users/self
  • https://www.googleapis.com/blogger/v3/users/userId/blogs
  • https://www.googleapis.com/blogger/v3/users/self/blogs
  • https://www.googleapis.com/blogger/v3/blogs/blogId
  • https://www.googleapis.com/blogger/v3/blogs/byurl
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts/bypath
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts/search
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments
  • https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments/commentId
  • https://www.googleapis.com/blogger/v3/blogs/blogId/pages
  • https://www.googleapis.com/blogger/v3/blogs/blogId/pages/pageId

The full explanation of the URIs used and the results for each supported operation in the API is summarised in the Blogger API Reference document.

Examples

List the blogs that the authenticated user has access rights to:

  • GET https://www.googleapis.com/blogger/v3/users/self/blogs?key=YOUR-API-KEY

Get the posts on the code.blogger.com blog, which has blog ID 3213900:

  • GET https://www.googleapis.com/blogger/v3/blogs/3213900?key=YOUR-API-KEY

REST from JavaScript

You can invoke the Blogger API from JavaScript using the callback query parameter and a callback function. When the browser loads the script, the callback function is executed, and the response is passed to it. This approach allows you to write rich applications that display Blogger data without requiring server-side code.

The following example retrieves a post from the code.blogger.com blog, after you replace YOUR-API-KEY with your API key.

<html>
  <head>
    <title>Blogger API Example</title>
  </head>
  <body>
    <div id="content"></div>
    <script>
      function handleResponse(response) {
        document.getElementById("content").innerHTML += "<h1>" + response.title + "</h1>" + response.content;
      }
    </script>
    <script     src="https://www.googleapis.com/blogger/v3/blogs/3213900/posts/8398240586497962757?callback=handleResponse&key=YOUR-API-KEY"></script>
  </body>
</html>

Data format

JSON (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see json.org.

Blogger API operations

You can invoke a number of different methods on collections and resources in the Blogger API, as described in the following table.

Operation Description REST HTTP mappings
list Lists all resources within a collection. GET on a collection URI.
get Gets a specific resource. GET on a resource URI.
getByUrl Gets a resource, looking it up by URL. GET with the URL passed in as a parameter.
getByPath Gets a resource by looking it up by its path. GET with the Path passed in as a parameter.
listByUser Lists resources owned by a User. GET on a user owned collection.
search Search for resources, based on a query parameter. GET on a Search URL, with the query passed in as a parameter.
insert Create a resource in a collection. POST on a collection URI.
delete Deletes a resource. DELETE on a resource URI.
patch Update a resource, using Patch semantics. PATCH on a resource URI.
update Update a resource. PUT on a resource URI.

The table below shows which methods are supported by each resource type. All list and get operations on private blogs require authentication.

Resource Type Supported Methods
list get getByUrl getByPath listByUser search insert delete patch update
Blogs N Y Y N Y N N N N N
Posts Y Y N Y N Y Y Y Y Y
Comments Y Y N N N N N N N N
Pages Y Y N N N N N N N N
Users N Y N N N N N N N N

How can I loop over an XML structure using Coldfusion

Mike's Notes

Note to me. This was listed in CFBreak from Foundeo.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library > Subscriptions > CFBreak
  • Home > Handbook > 

Last Updated

25/11/2025

How can I loop over an XML structure using Coldfusion

By: ColdFusionDude
Stackoverflow: 08/11/2025

ColdFusionDude

I'm trying to loop over an XML file and output the structure. However, I'm only getting one set of data on the second loop. Below is my code, and below that is a snippet of the XML structure.

<!--
Source - https://stackoverflow.com/q
Posted by ColdFusionDude, modified by community. See post 'Timeline' for change history
Retrieved 2025-11-08, License - CC BY-SA 4.0
-->

<cffile action="read" file="\\srv-cfdev\stcnet1\employee_management\users.xml" variable="xmlContent">
<cfset xmlDoc = XmlParse(xmlContent)>

<cfloop array="#xmlDoc.GroupUserData.Group#" index="Group">
    <ul>
     <cfoutput>
        <li>Group: #Group.XmlAttributes.GroupName#</li>
          <ul>
          <cfloop array="#xmlDoc.GroupUserData.Group.User#" index="Username">
          <li>Username: #UserName.XmlAttributes.Username#</li>
          </cfloop>
          </ul>
    </cfoutput>
     </ul>
</cfloop>

<!--
Source - https://stackoverflow.com/q
Posted by ColdFusionDude, modified by community. See post 'Timeline' for change history
Retrieved 2025-11-08, License - CC BY-SA 4.0
-->
<GroupUserData>
  <Group GroupName="cwadmin">
    <User UserName="badams" UserDescription="Brandon Adams" />
    <User UserName="cardwizuser" UserDescription="" />
    <User UserName="cwdatacard" UserDescription="" />
    <User UserName="cwuser" UserDescription="" />
    <User UserName="wizard" UserDescription="" />
  </Group>
  <Group GroupName="CWBRSUPPORT">
    <User UserName="akopp" UserDescription="Adam Kopp" />
    <User UserName="albert" UserDescription="Paula Albert" />
    <User UserName="iknotter" UserDescription="Isaac Knotter" />
    <User UserName="kknotts" UserDescription="Kelly Knotts" />
    <User UserName="spickett" UserDescription="Skye Pickett" />
  </Group>
  <Group GroupName="CWIT">
    <User UserName="" UserDescription="" />
  </Group>
  <Group GroupName="CWMGMT">
    <User UserName="aallison" UserDescription="Alexis Allison" />
    <User UserName="ababick" UserDescription="Amy Babick" />
    <User UserName="abarnett" UserDescription="Ashley Barnett" />
    <User UserName="abuchholz" UserDescription="Amelia Buchholz" />
    <User UserName="acuster" UserDescription="Amanda Custer" />
    <User UserName="adennis" UserDescription="April Dennis" />
    <User UserName="adickey" UserDescription="Adain Dickey" />
    <User UserName="afleegle" UserDescription="Austin Fleegle" />
    <User UserName="aflesik" UserDescription="Andrew Flesik" />
    <User UserName="agavin" UserDescription="Amanda Gavin" />
    <User UserName="ahenderson" UserDescription="Amy Henderson" />
    <User UserName="aklimchock" UserDescription="Adam Klimchock" />
    <User UserName="aknight" UserDescription="Adam Knight" />
    <User UserName="alowery" UserDescription="Allison Lowery" />
    <User UserName="amcvay" UserDescription="Amy McVay" />
    <User UserName="amyers" UserDescription="Amanda Myers" />
    <User UserName="anaugle" UserDescription="Amy Naugle" />
    <User UserName="apatel" UserDescription="Avani Patel" />
    <User UserName="apecoraro" UserDescription="Alethea Pecoraro" />
    <User UserName="asilbaugh" UserDescription="Alyssa Silbaugh" />
    <User UserName="astrauser" UserDescription="Abigail Strauser" />
    <User UserName="atannous" UserDescription="Aida Tannous" />
    <User UserName="aurban" UserDescription="Andy Urban" />
    <User UserName="awellings" UserDescription="Abigail Wellings" />
    <User UserName="awilson" UserDescription="Toni Wilson" />
    <User UserName="azapotosky" UserDescription="Alison Zapotosky" />
    <User UserName="bdaugherty" UserDescription="Brittany Daugherty" />
    <User UserName="bhenry" UserDescription="Bonnie Henry" />
    <User UserName="bhershberger" UserDescription="Branden Hershberger" />
    <User UserName="billy" UserDescription="Kathryn Billy" />
    <User UserName="bkeener" UserDescription="Breanna Keener" />
    <User UserName="bknecht" UserDescription="Bobbie Jo Knecht" />
    <User UserName="bmurphy" UserDescription="Brenda Murphy" />
    <User UserName="bnulton" UserDescription="Billi Nulton" />
    <User UserName="bparastar" UserDescription="Behnaz Parastar" />
    <User UserName="brehm" UserDescription="Ethny Brehm" />
    <User UserName="bschrock" UserDescription="Beth Schrock" />
    <User UserName="bsnyder" UserDescription="Blair Snyder" />
    <User UserName="bsnyder" UserDescription="Blair Snyder" />
    <User UserName="bweimer" UserDescription="Brandy Weimer" />
    <User UserName="bwertz" UserDescription="Brandy Wertz" />
    <User UserName="cbrumley" UserDescription="Christina Brumley" />
    <User UserName="cbryner" UserDescription="Cindy Bryner" />
    <User UserName="cchurch" UserDescription="Caitlin Church" />
    <User UserName="cdamico" UserDescription="Carson D'Amico" />
    <User UserName="cfike" UserDescription="Charlene Fike" />
    <User UserName="cgarlick" UserDescription="Cheryl Garlick" />
    <User UserName="chahn" UserDescription="Constance Hahn" />
    <User UserName="cjmyers" UserDescription="Candy Myers" />
    <User UserName="cjohns" UserDescription="Chad Johns" />
    <User UserName="cknaus" UserDescription="Cindy Knaus" />
    <User UserName="cmaruca" UserDescription="Caitlin Maruca" />
    <User UserName="cmcelhaney" UserDescription="Colleen McElhaney" />
    <User UserName="costlow" UserDescription="Nancy Costlow" />
    <User UserName="cparks" UserDescription="Christy Parks" />
    <User UserName="cphilip" UserDescription="Cheryl Philip" />
    <User UserName="cpulido" UserDescription="China Pulido" />
    <User UserName="craftis" UserDescription="Caroline Raftis" />
    <User UserName="cschrock" UserDescription="Cindy Schrock" />
    <User UserName="cwilt" UserDescription="Caitlin Wilt" />
    <User UserName="dalcorn" UserDescription="Danielle Alcorn" />
    <User UserName="dcost" UserDescription="Deborah Cost" />
    <User UserName="dcrump" UserDescription="Daniel Crump" />
    <User UserName="dfisher" UserDescription="Desiree Fisher" />
    <User UserName="dgarlitz" UserDescription="Dashanti Garlitz" />
    <User UserName="dkelly" UserDescription="Dixie Kelly" />
    <User UserName="dking" UserDescription="Donna King" />
    <User UserName="dremaley" UserDescription="David Remaley" />
    <User UserName="dringer" UserDescription="Donni Ringer" />
    <User UserName="dshanner" UserDescription="Deven Shanner" />
    <User UserName="dshirley" UserDescription="Doran Shirley" />
    <User UserName="dtate" UserDescription="Diana Tate" />
    <User UserName="dzamarelli" UserDescription="Deborah Zamarelli" />
    <User UserName="edeal" UserDescription="Emily Deal" />
    <User UserName="eglessner" UserDescription="Erin Glessner" />
    <User UserName="emishler" UserDescription="Emily Mishler" />
    <User UserName="epalmer" UserDescription="Elizabeth Palmer" />
    <User UserName="epeltier" UserDescription="Eleanor Peltier" />
    <User UserName="ewilson" UserDescription="Eboni Wilson" />
    <User UserName="fbecker" UserDescription="Faith Becker" />
    <User UserName="fbontrager" UserDescription="Faitha Bontrager" />
    <User UserName="flubovinsky" UserDescription="Faitha Lubovinsky" />
    <User UserName="fthomas" UserDescription="Faith Thomas" />
    <User UserName="fwozniak" UserDescription="Frank Wozniak" />
    <User UserName="ggrippo" UserDescription="Gina Grippo" />
    <User UserName="gzoeller" UserDescription="Gideon Zoeller" />
    <User UserName="harpster" UserDescription="Sharon Harpster" />
    <User UserName="hedmonson" UserDescription="Heather Edmonson" />
    <User UserName="hhaer" UserDescription="Teresa Haer" />
    <User UserName="hharding" UserDescription="Heather Harding" />
    <User UserName="hhudson" UserDescription="Haley Hudson" />
    <User UserName="hkohan" UserDescription="Hannah Kohan" />
    <User UserName="hsherbine" UserDescription="Heather Sherbine" />
    <User UserName="idemopoulos" UserDescription="Ioanna Demopoulos" />
    <User UserName="jalviar" UserDescription="Jeanie Liston-Alviar" />
    <User UserName="jbarber" UserDescription="Judith Barber" />
    <User UserName="jbehory" UserDescription="Jessica Behory" />
    <User UserName="jberger" UserDescription="Justin Berger" />
    <User UserName="jbillie" UserDescription="Jeanette Billy" />
    <User UserName="jbillie" UserDescription="Jeanette Billy" />
    <User UserName="jcuster" UserDescription="Jacob Custer" />
    <User UserName="jevans" UserDescription="John Evans" />
    <User UserName="jgross" UserDescription="Jennifer Gross" />
    <User UserName="jheeney" UserDescription="Jeanine Heeney" />
    <User UserName="jleahey" UserDescription="James Leahey" />
    <User UserName="jlucas" UserDescription="Jeremy Lucas" />
    <User UserName="jmarker" UserDescription="Jensen Marker" />
    <User UserName="jmock" UserDescription="Joann Mock" />
    <User UserName="jorr" UserDescription="Jennifer Orr" />
    <User UserName="jpetruska" UserDescription="Joshua Petruska" />
    <User UserName="jreynolds" UserDescription="Jenifer Reynolds" />
    <User UserName="jschmid" UserDescription="Jessica Schmid" />
    <User UserName="jschmid" UserDescription="Jessica Schmid" />
    <User UserName="jsmith" UserDescription="Jolene Smith" />
    <User UserName="jstewart" UserDescription="James Stewart" />
    <User UserName="jtwigg" UserDescription="Josay Twigg" />
    <User UserName="jwassil" UserDescription="Jacob Wassil" />
    <User UserName="jweaver" UserDescription="Jody Weaver" />
    <User UserName="jzembower" UserDescription="Jodie Zembower" />
    <User UserName="kadams" UserDescription="Kaitlyn Adams" />
    <User UserName="kallan" UserDescription="Katelyn Allan" />
    <User UserName="kanderson" UserDescription="Kimberly Anderson" />
    <User UserName="kbuchanan" UserDescription="Karley Buchanan" />
    <User UserName="kcostello" UserDescription="Kate Costello" />
    <User UserName="kcrocetti" UserDescription="Karen Crocetti" />
    <User UserName="kdehart" UserDescription="Kaitlyn DeHart" />
    <User UserName="kdehart" UserDescription="Kaitlyn DeHart" />
    <User UserName="keaster" UserDescription="Kerri Easter" />
    <User UserName="kerrett" UserDescription="Kaedan Errett" />
    <User UserName="kfullem" UserDescription="Kelley Fullem" />
    <User UserName="kfultz" UserDescription="Kathryn Fultz" />
    <User UserName="khayes" UserDescription="Karen Hayes" />
    <User UserName="khumphrey" UserDescription="Kaitlin Humphrey" />
    <User UserName="klaskoski" UserDescription="Kelsey Laskoski" />
    <User UserName="klazar" UserDescription="Karen Lazar" />
    <User UserName="kleone" UserDescription="Kaitlin Leone" />
    <User UserName="kmcclain" UserDescription="Kim McClain" />
    <User UserName="kmckenzie" UserDescription="Kyle McKenzie" />
    <User UserName="kmcquillis" UserDescription="Kathleen McQuillis" />
    <User UserName="kowade" UserDescription="Kimberly OWade" />
    <User UserName="krichards" UserDescription="Katie Richards" />
    <User UserName="krogers" UserDescription="Kennedi Rogers" />
    <User UserName="kstiffler" UserDescription="Kylie Stiffler" />
    <User UserName="kswink" UserDescription="Kayla Swink" />
    <User UserName="kswink" UserDescription="Kayla Swink" />
    <User UserName="ktomasic" UserDescription="Kristin Tomasic" />
    <User UserName="kvarljen" UserDescription="Katherine Varljen" />
    <User UserName="latuch" UserDescription="Susan Latuch" />
    <User UserName="lbriesmeister" UserDescription="Linda Briesmeister" />
    <User UserName="lehman" UserDescription="Carol Lehman" />
    <User UserName="lgeary" UserDescription="Lisa Geary" />
    <User UserName="lluckett" UserDescription="Lilly Luckett" />
    <User UserName="lmcnamara" UserDescription="Lynn McNamara" />
    <User UserName="lotto" UserDescription="Lisa Otto" />
    <User UserName="ltorruiso" UserDescription="Laurie Torruiso" />
    <User UserName="lwascak" UserDescription="Luke Wascak" />
    <User UserName="macy" UserDescription="Denise Macy" />
    <User UserName="mbaldwin" UserDescription="Melanie Baldwin" />
    <User UserName="mboyer" UserDescription="Melanie Boyer" />
    <User UserName="mdmiller" UserDescription="Michael Miller" />
    <User UserName="metheney" UserDescription="Sherry Metheney" />
    <User UserName="mfrankenberry" UserDescription="McKenna Frankenberry" />
    <User UserName="mgraham" UserDescription="Madison Graham" />
    <User UserName="mhare" UserDescription="Megan Hare" />
    <User UserName="mhixson" UserDescription="Mary Jo Hixson" />
    <User UserName="mkondrich" UserDescription="Marilyn Kondrich" />
    <User UserName="mkoontz" UserDescription="Madison Koontz" />
    <User UserName="mkopera" UserDescription="Melanie Kopera" />
    <User UserName="mlippert" UserDescription="Madison Lippert" />
    <User UserName="mlittle" UserDescription="Mary Ellen Little" />
    <User UserName="mmears" UserDescription="Megan Mears" />
    <User UserName="mmitchell" UserDescription="Mary Mitchell" />
    <User UserName="molinzock" UserDescription="Marla Olinzock" />
    <User UserName="mreisling" UserDescription="Morgan Reisling" />
    <User UserName="mritchey" UserDescription="Mindy Ritchey" />
    <User UserName="mrodgers" UserDescription="Maura Rodgers" />
    <User UserName="msheeder" UserDescription="Maddie Sheeder" />
    <User UserName="mspiker" UserDescription="Mary Ann Spiker" />
    <User UserName="myuko" UserDescription="Markus Yuko" />
    <User UserName="nhornfeck" UserDescription="Natalie Hornfeck" />
    <User UserName="nicklow" UserDescription="Rebecca Nicklow" />
    <User UserName="nmunson" UserDescription="Nico Munson" />
    <User UserName="odiehl" UserDescription="Olivia Diehl" />
    <User UserName="ofabian" UserDescription="Olivia Fabian" />
    <User UserName="omoore" UserDescription="Owen Moore" />
    <User UserName="pminnick" UserDescription="Pamela Minnick" />
    <User UserName="pmoore" UserDescription="Pamela Moore" />
    <User UserName="psipe" UserDescription="Paula Sipe" />
    <User UserName="qpham" UserDescription="Christine Pham" />
    <User UserName="rbutina" UserDescription="Rose Butina" />
    <User UserName="rfike" UserDescription="Rebecca Fike" />
    <User UserName="rfrankenberry" UserDescription="Riley Frankenberry" />
    <User UserName="rgoins" UserDescription="Roxanne Goins" />
    <User UserName="rola" UserDescription="Richard Ola" />
    <User UserName="rthomas" UserDescription="Robby Thomas" />
    <User UserName="satchison" UserDescription="Savannah Atchison" />
    <User UserName="sbritt" UserDescription="Sean Britt" />
    <User UserName="schero" UserDescription="Samantha Chero" />
    <User UserName="schmucker" UserDescription="Kamala Schmucker" />
    <User UserName="sfolton" UserDescription="Sean Folton" />
    <User UserName="sgrote" UserDescription="Sherry Grote" />
    <User UserName="shawkins" UserDescription="Shelby Hawkins" />
    <User UserName="shess" UserDescription="Sherry Hess" />
    <User UserName="shillen" UserDescription="Sara Hillen" />
    <User UserName="showe" UserDescription="Samantha Howe" />
    <User UserName="sleasure" UserDescription="Sasha Leasure" />
    <User UserName="smeyers" UserDescription="Seth Meyers" />
    <User UserName="smorris" UserDescription="Sarah Morris" />
    <User UserName="smundorf" UserDescription="Sharon Mundorf" />
    <User UserName="spickett" UserDescription="Skye Pickett" />
    <User UserName="sscarpelli" UserDescription="Sarah Scarpelli" />
    <User UserName="ssensabaugh" UserDescription="Shynia Sensabaugh" />
    <User UserName="sshivler" UserDescription="Seth Shivler" />
    <User UserName="stasker" UserDescription="Shelby Tasker" />
    <User UserName="svivis" UserDescription="Stephen Vivis" />
    <User UserName="swomack" UserDescription="Skylar Womack" />
    <User UserName="tappleby" UserDescription="Teri Appleby" />
    <User UserName="tbalogh" UserDescription="Teresa Balogh" />
    <User UserName="tbouch" UserDescription="Tawni Bouch" />
    <User UserName="tbutala" UserDescription="Timothy Butala" />
    <User UserName="teshaulis" UserDescription="Tanner Shaulis" />
    <User UserName="thaer" UserDescription="Teresa Haer" />
    <User UserName="thubbard" UserDescription="Terry Hubbard" />
    <User UserName="tmarker" UserDescription="Tammy Marker" />
    <User UserName="tmartin" UserDescription="Tremoi Martin" />
    <User UserName="tmasterson" UserDescription="Trent Masterson" />
    <User UserName="tmcintosh" UserDescription="Trish McIntosh" />
    <User UserName="tmorris" UserDescription="Tonya Morris" />
    <User UserName="triehl" UserDescription="Tyler Riehl" />
    <User UserName="trodman" UserDescription="Tyler Rodman" />
    <User UserName="tshaulis" UserDescription="Tanner Shaulis" />
    <User UserName="tspruell" UserDescription="Tabitha Spruell" />
    <User UserName="tstairs" UserDescription="Tina Stairs" />
    <User UserName="vguynn" UserDescription="Victoria Guynn" />
    <User UserName="vmankey" UserDescription="Vanessa Mankey" />
    <User UserName="vmatieszyn" UserDescription="Vicki Matieszyn" />
    <User UserName="waldron" UserDescription="Carrie Waldron" />
    <User UserName="whixen" UserDescription="Wendy Hixen" />
    <User UserName="wright" UserDescription="Barbara Wright" />
    <User UserName="wshaulis" UserDescription="William Shaulis" />
    <User UserName="zhenry" UserDescription="Zachary Henry" />
  </Group>
  <Group GroupName="CWUSERS">
    <User UserName="abarr" UserDescription="Ava Barr" />
    <User UserName="abuchholz" UserDescription="Amelia Buchholz" />
    <User UserName="agrimes" UserDescription="Ashlee Grimes" />
    <User UserName="bburkhart" UserDescription="Brionna Burkhart" />
    <User UserName="bburt" UserDescription="Brionna Burt" />
    <User UserName="bknecht" UserDescription="Bobbie Jo Knecht" />
    <User UserName="bussard" UserDescription="Wanda Bussard" />
    <User UserName="bwertz" UserDescription="Brandy Wertz" />
    <User UserName="costlow" UserDescription="Nancy Costlow" />
    <User UserName="cstutzman" UserDescription="Corinne Stutzman" />
    <User UserName="dgunby" UserDescription="Dasia Gunby" />
    <User UserName="emowery" UserDescription="Emma Mowery" />
    <User UserName="garrety" UserDescription="Michael Garrety" />
    <User UserName="gzoeller" UserDescription="Gideon Zoeller" />
    <User UserName="hmiller" UserDescription="Heather Miller" />
    <User UserName="jmarker" UserDescription="Jensen Marker" />
    <User UserName="jromesburg" UserDescription="Jonna Romesburg" />
    <User UserName="kmiller" UserDescription="Kurt Miller" />
    <User UserName="kmiller" UserDescription="Kurt Miller" />
    <User UserName="leaburkett" UserDescription="Lea Burkett" />
    <User UserName="lsmith" UserDescription="Leanne Smith" />
    <User UserName="mmccusker" UserDescription="Melissa McCusker" />
    <User UserName="nmallison" UserDescription="Noah Allison" />
    <User UserName="rmerridith" UserDescription="Robert Merridith" />
    <User UserName="showman" UserDescription="Kimberly Showman" />
    <User UserName="spickett" UserDescription="Skye Pickett" />
    <User UserName="swomack" UserDescription="Skylar Womack" />
    <User UserName="tray" UserDescription="Todd Ray" />
    <User UserName="trodman" UserDescription="Tyler Rodman" />
    <User UserName="wshaulis" UserDescription="William Shaulis" />
  </Group>
  <Group GroupName="global">
    <User UserName="cwdatacard" UserDescription="" />
    <User UserName="wizard" UserDescription="" />
  </Group>
  <Group GroupName="OSI Group">
    <User UserName="cardwizuser" UserDescription="" />
    <User UserName="cwuser" UserDescription="" />
  </Group>
  <Group GroupName="Test Group">
    <User UserName="Justin Herman" UserDescription="Testing" />
  </Group>
  <Group GroupName="UserAdmin">
    <User UserName="gilbert" UserDescription="Michelle Gilbert" />
    <User UserName="kblack" UserDescription="Kristi Black" />
    <User UserName="lichty" UserDescription="Cathy Lichty" />
  </Group>
</GroupUserData>

The loop is outputting the first section of Users for every iteration of the Group loop. What am I doing wrong?


mykaf

It seems your inner loop isn't utilizing what it knows from the outer loop, namely the #group# variable. So it's as if the inner loop is starting over each time. Try using that #group# variable in the inner loop, like this:

<cfloop array="#group.xmlchildren#" index="child">
     <li>#child.xmlAttributes.username#</li>
</cfloop>

Jack Poe

It's not super elegant but this will get you a loop over the outer and inner elements of the XML

<!--
Source - https://stackoverflow.com/a
Posted by Jack Poe
Retrieved 2025-11-08, License - CC BY-SA 4.0
-->

<cfif fileExists('#expandpath('.')#\users.xml')>
    
        <!--- read and parse the XML --->
        <cffile action="READ" variable="xmlText" file="#expandpath('.')#\users.xml">
        <cfset xmlDoc = XMLParse(xmlText)>
        <!--- set a variable for the top level of the data --->
        <cfset aAccount = xmlDoc.GroupUserData>
        
        <cfoutput>
                
            <!--- loop over the outer element - the groups --->
            <cfloop index="x" from="1" to="#arraylen(aAccount.Group)#">

                <h1>#aAccount.Group[x].XMLAttributes.groupname#</h1>

                    <!--- loop over the inner elements - users --->
                    <cfloop index="i" from="1" to="#arrayLen(aAccount.Group[x].User)#">

                        #aAccount.Group[x].User[i].XMLAttributes.UserDescription# 
                        &bull;
                        #aAccount.Group[x].User[i].XMLAttributes.UserName#<br>

                    </cfloop>

            </cfloop>
                
        </cfoutput>
                
    </cfif>

Supercharge Your BoxLang Applications with Maven Integration

Mike's Notes

This is an excellent addition to BoxLang. Pipi 9 is capable of generating these code samples. It could also edit the pom.xml file.

The question remains how to get this code from Pipi into BoxLang, so Pipi can run BoxLang autonomously.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

13/06/2025

Supercharge Your BoxLang Applications with Maven Integration

By: Luis Majeno
Ortus Solutions: 06/06/2025

Luis is the CEO of Ortus.

We're excited to announce a supercharged feature for BoxLang developers: Maven Integration! This powerful addition opens the door to the entire Java ecosystem, allowing you to seamlessly incorporate thousands of Java libraries into your BoxLang applications with just a few simple commands.

Why Maven Integration Matters

BoxLang has always been about combining the best of both worlds - the simplicity of dynamic languages with the power of the JVM. With Maven integration, we're taking this philosophy to the next level by giving you instant access to:

Thousands of Java libraries from Maven Central

  • Automatic dependency management - no need to manage it manually or copy jars around
  • Zero configuration - it just works out of the box
  • Clean management - add and remove dependencies with simple commands

This integration that we ship with BoxLang is at the runtime home level. However, it can easily be adapted to individual applications if needed, in case you are in shared environments.

How It Works

The magic happens through BoxLang's pre-configured pom.xml file located in your BoxLang home directory (~/.boxlang). The workflow is simple:

Add dependencies to the pom.xml file

Run mvn install to download libraries

Start using Java libraries immediately in your BoxLang code

That's it! BoxLang automatically loads all JARs from the lib/ folder, making them available throughout your runtime. For our full documentation please visit our book: https://boxlang.ortusbooks.com/getting-started/configuration/maven-integration

Real-World Examples

Let's see this in action with some practical examples that showcase the power of this integration.

Generate QR Codes in Seconds

Need to create QR codes? Just add the ZXing dependency:

<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>core</artifactId>
    <version>3.5.2</version>
</dependency>

Then use it in your BoxLang code:

function createQRCodeGenerator() {
    return {
        "saveToFile": ( text, filePath, size = 300 ) => {
            var writer = new com.google.zxing.qrcode.QRCodeWriter()
            var bitMatrix = writer.encode( 
                text, 
                new com.google.zxing.BarcodeFormat().QR_CODE, 
                size, 
                size 
            )
            
            var image = new com.google.zxing.client.j2se.MatrixToImageWriter()
                .toBufferedImage( bitMatrix )
            var file = new java.io.File( filePath )
            
            new javax.imageio.ImageIO().write( image, "PNG", file )
            return filePath
        }
    }
}
// Generate QR code for your website
qrGenerator = createQRCodeGenerator()
qrFile = qrGenerator.saveToFile( 
    "https://boxlang.ortussolutions.com", 
    "/tmp/boxlang-qr.png", 
    400 
)
println( "QR code saved to: " & qrFile )
Create Professional PDFs
Want to generate dynamic PDFs? Add iText and you're ready to go:
<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itext7-core</artifactId>
    <version>8.0.2</version>
    <type>pom</type>
</dependency>

Now create beautiful PDFs programmatically:

function createStyledPDF( filePath, title, content ) {
    var writer = new com.itextpdf.kernel.pdf.PdfWriter( filePath )
    var pdf = new com.itextpdf.kernel.pdf.PdfDocument( writer )
    var document = new com.itextpdf.layout.Document( pdf )
    
    // Add styled title
    var titleParagraph = new com.itextpdf.layout.element.Paragraph( title )
        .setFontSize( 20 )
        .setBold()
    document.add( titleParagraph )
    
    // Add content
    var contentParagraph = new com.itextpdf.layout.element.Paragraph( content )
        .setFontSize( 12 )
    document.add( contentParagraph )
    
    document.close()
    return filePath
}
// Generate a professional report
reportPDF = createStyledPDF(
    "/tmp/quarterly-report.pdf",
    "Q4 2024 Business Report",
    "BoxLang continues to revolutionize dynamic programming on the JVM."
)

Getting Started

Getting started with Maven integration is incredibly simple:

1. Install Maven

macOS (Homebrew):

brew install maven

Windows (Chocolatey):

choco install maven

Linux (Ubuntu/Debian):

sudo apt install maven

2. Navigate to BoxLang Home

cd ~/.boxlang

3. Add Dependencies

Edit the pom.xml file and add your desired dependencies. Search Maven Central for libraries.

4. Install Dependencies

mvn install

5. Start Coding!

All dependencies are now available in your BoxLang applications immediately.

Why This Changes Everything

Maven integration fundamentally transforms what's possible with BoxLang:

Instant Access to Specialized Libraries

Need machine learning? Add Weka or DL4J. Want advanced image processing? Add ImageIO extensions. Need specialized data formats? There's probably a Java library for that.

Dependency Management Made Simple

Gone are the days of manually downloading JARs and managing versions. Maven handles transitive dependencies, version conflicts, and updates automatically.

Enterprise-Ready from Day One

Access to mature, battle-tested Java libraries means your BoxLang applications can handle enterprise requirements without reinventing the wheel.

Easy Experimentation

Want to try a new library? Add it to your pom.xml, run mvn install, and start experimenting. Don't like it? Run mvn clean and it's gone.

What's Next?

This is just the beginning! Maven integration opens up a world of possibilities for BoxLang developers. We're excited to see what amazing applications you'll build with access to the entire Java ecosystem.

Some areas we're particularly excited about:

  • Machine Learning: Integrate Weka, DL4J, or other ML libraries
  • Scientific Computing: Use Apache Commons Math for statistical operations
  • Data Formats: Work with Excel files, XML processing, and specialized formats
  • External Integrations: Connect to cloud services, databases, and APIs with dedicated clients

Try It Today!

Maven integration is available now in the latest version of BoxLang. Here's how to get started:

  • Update BoxLang to the latest version
  • Navigate to your BoxLang home (cd ~/.boxlang)
  • Edit the pom.xml file to add dependencies
  • Run mvn install
  • Start building amazing applications!