Crafter CMS is an open source, Java-based CMS that was designed to handle innovation, scale, and distribution challenges. In this section, we’ll walk you through getting Crafter CMS installed and up and running with two types of digital content experiences: a traditional website, and a catalog of products that can be accessed by an external native application or single page application (SPA) via APIs.
Crafter CMS Background/Architecture
- 100% open-source, Java-based CMS.
- Allows you to create or manage any kind of content.
- Decoupled CMS (disconnected global delivery).
- Dynamic/personalized delivery of every request at speed.
- API-first CMS (content as a service).
- Git-based CMS.
- Share-nothing delivery architecture.
- Front-end agnostic (bring your favorite UI framework or use as a headless CMS).
- Equal support for all three CMS stakeholders: content authors, developers and system administrators.
Crafter CMS is a true decoupled content management system, yet it supports dynamic and personalized content delivery.
Installing and Starting Crafter CMS
- Download the Crafter CMS install zip file from http://craftercms.org/v/craftercms-bundle. The zip file will install a fully functional Crafter Studio instance and a Crafter Engine in “Preview Mode.” Out of the box, the Studio instance uses a local directory as the repository and a Derby database, which allows a quick and easy set up for local development.
- Unzip the contents in any directory.
Starting Crafter CMS Using the Startup Script
To start Crafter CMS Server: From the command line, navigate to the INSTALL_PATH/crafter directory and execute the startup script:
- Unix/Linux systems: startup.sh
- Windows: startup.bat
Note: It takes a few moments for Crafter CMS to start up.
Stopping Crafter CMS Using the Shutdown Script
To stop Crafter CMS Server: From the command line, navigate to the INSTALL_PATH/crafter directory and execute the shutdown script:
- Unix/Linux systems: shutdown.sh
- Windows: shutdown.bat
Now that Crafter CMS is installed and started, let’s get a few projects set up.
Open Crafter Studio
- In your browser, go to http://localhost:8080/studio.
Log in with the following:
- username: admin
- password: admin
- After logging in, you should be redirected to the My Sites screen. You’re now ready to create your first project!
Working With Crafter CMS
Understanding the User Interface and content editing
Working with content modeling
Creating a Traditional Website Project
A very typical use of a CMS is the creation and management of a website. Using Crafter CMS, we can create and manage beautiful responsive websites based on the front end framework and design of your choosing. To illustrate this point, let’s leverage an out-of-the-box editorial website blueprint to quickly get up going.
After logging in, you’ll see the MySites screen (below). Click on Create Site .
Give the site a friendly name for the Site Id, give it a description, and then choose a blueprint. We’re going to be using the “Website_Editorial” blueprint. Blueprints offer you a starting point for your website. New blueprints can be created and installed on the system. As you are entering the site id, spaces are removed and uppercase letters are converted to lowercase letters.
Click on Create and wait for the system to create your site based on the blueprint. It’s creating configurations, site content, and permissions based on the template provided by the blueprint. When it’s done, you will be taken to the home page of your site:
Figure 2: Once the blueprinting process is complete, the information architecture, content, and code of a project can be modified. Figure 2 illustrates an editorial website based on editorial blueprint ready to be edited.
Now that the site has been created from the blueprint, you can modify it by editing existing pages or by creating new pages and components.
Creating a Headless Content Management Project
An increasingly common use case for CMS is delivering content via APIs (Headless/Content as a Service). This approach allows applications of any kind, running on any platform and any technology, to easily access content managed by the CMS. In recent years, native mobile applications, single page web applications, game consoles, and even business applications with frequently updated application/business rule content have moved to this approach. To illustrate this point, let’s leverage an out-of-the-box headless_store project blueprint to quickly get us going.
After logging in, you’ll see the MySites screen (Below). Click on Create Site .
Give the site a friendly name for the Site Id, give it a description, and then choose a blueprint. We’re going to be using the “Headless_Store” blueprint. Blueprints offer you a starting point for your project. New blueprints can be created and installed into the system. As you are entering the site id, spaces are removed and uppercase letters are converted to lowercase letters.
Click on Create and wait for the system to create your site based on the blueprint. It’s creating configurations, site content, and permissions based on the template provided by the blueprint. When it’s done, you will be taken to the preview of your project:
Figure 3: Once the blueprinting process is complete, the information architecture, content, and code of a project can be modified. Figure 3 illustrates a headless content project based on a headless catalog blueprint ready to be edited.
Note that unlike a website, you are not really looking at a webpage but rather a simple catalog of the products your project is managing. This allows your authors to quickly and easily preview and edit these items. This catalog or “console” also serves as a reference implementation for consumers of the APIs that your project will provide to external applications.
With a headless content project, the real rubber meets the road when you begin to define APIs and deliver the content through them. For many headless CMS technologies, you do not get to choose what your APIs look like or the format of the JSON that is returned. Crafter CMS allows you to define your API URLs and response data structures through simple Groovy scripting:
Figure 4: Crafter CMS gives developers complete control over RESTful response urls, formats and content via Groovy scripting.
Developers define their URLs, parameters, and HTTP methods by convention using a combination of folders and file naming patterns. Using Groovy code in the script file, they define the controller that determines the response content and data structure:
def id = pathVars.id
def products = new ProductSearchHelper(searchService)
Once the script is complete, the service can be tested and published so that it is available to consumers.
Figure 5: Once a RESTful service is created, it can quickly be tested and published from Crafter Studio. Figure 5 shows the output of a given RESTful service controller.