npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aem-content-builder

v2.2.0

Published

NodeJS utility to rapidly define AEM components, structures, set associated content and issue Sling POST requests to a target AEM instance. Can be used as a stand-alone content creation library or as part of a migration tool for AEM.

Downloads

75

Readme

Adobe Experience Manager Content Builder

This is a nodeJS module that is intended to assist with the creation and migration of content from legacy websites into new AEM installations and projects. This tool utilizes the Sling POST methods of content manipulation in AEM.

:exclamation: This will now be released as version 2.x.x. This is major breaking changes to previous releases and has no compatibility with previous usage-scenarios. Apologies to anyone whom has used this repository that this will impact; however it was deemed necessary and the benefits outweighed the current usage. Future updates will follow proper notices.

Context

This package is to be used as the bases for creating customized content building systems. This package will maintain consistency with release AEM Core Components, however the expectation is that implementors will use this package as a basis and then create extensions of the core components in a similar manner to how AEM projects structures using core components. See the examples folder for details on usage.

Usage Notes

The target of this framework is to enable rapid development of new content creation and migration tools. Single or multi-value property setting and the setting of properties and content (e.g. adding under jcr:content) are accounted for in the AbstractComponent. The AbstractPage adds the ability to add components and page-related properties, such as the associated template, as would be expected in an AEM Page.

Structure

The current component structure is provided via a single framework entry-point at index.js. Calling require on this module will return the following object:

{
  components: {
    core: {
      Accordian,
      Breadcrumb,
      Button,
      Carousel,
      Commons,
      Container,
      ContentFragment,
      ContentFragmentList,
      Download,
      Image,
      Page,
      Teaser,
      Text,
      Title
    },
    AbstractComponent,
    AbstractPage
  },
  sling: {
    Resource,
    Folder
  }, 
  request: {
    AbstractRequest,
    GET, 
    POST,
    Handler
  }
}

Usage

The below is an example of how implementations are expected to utilize this script, including use of extension.

// Declare the objects we'll need
const aem = require('aem-content-builder');

// Create new component for the implementation
class MyComponent extends aem.components.AbstractComponent {
  constructor() {
    super();
    this.setResourceType("my/resource/type");
  }
}

// Create new page for the implementation
class MyPage extends aem.components.core.Page {
  construtor() {
    super();
    this.setResourceType("my/project/structure/page");
  }
}

// Instantiate and add components
let page = new MyPage();
page.setContent("jcr:title", "About Us"); 
let component = new MyComponent();
page.addComponent(component);

// Build new AEM request
const pageUrl = "http://localhost:4502/content/wknd/us/en/about";
let req = new aem.request.POST(pageUrl);
req.credentails("admin","admin").payload(page.getData());

aem.request.Handler.handle(req.build());

Running Examples

:exclamation: Some examples depend on having specific AEM projects, such as the AEM WKND tutorial installed. See the README in the root of each example set.

Users can run the examples by navigating to the folder and running node <file> (e.g. node create-page.js).

Note that this is all clear-text, so don't store sensative or real passwords in this configuration; it's only for local testing!