Samstag, 3. Juni 2017

Hello CoreMedia CMS 9

In any project based on the CoreMedia CMS where sites have to be created from scratch, at one point we ran into the need of the minimal content set for that site. That content area should be unrelated and unconnected to any other data and content in the system - so be really self-contained. It should make clear, which elements and settings are really needed from the wealth of options for that very project or site within the instance of the software.

Too much Content


For really some time now, CoreMedia provides a load of demo-site contents for different scenarios of the usage of their products. It is quite easy to set up a system that really shows something.

From my point of view, taking one of these demo sites and ripping out the unnecessary parts was not helpful, since you might end up - especially for new releases - with too much data that might be needed. At least a feeling of unknown dependencies sometimes remained.

URL found through Google search for "coremedia chef corp"

A small content snippet with as few elements as ever possible still seemed to be missing. And this still holds true for the latest release CoreMedia CMS-9 (and LiveContext 3 as well) as shown from a small personal survey.

Hello World


Again involved in a project based on CoreMedia products, I am now using the latest - and greatest - version of the CMS product - CoreMedia CMS 9, and asked some old friends to help me.

After showing the system and demos one of the first questions: "Ok, nice, where is the minimal Hello World site?".

From that feedback without any prior CoreMedia-related background, I assume that developers expect that part of a software - any software - to be there.

The first step now was, to ask people for their starting point content sets or Hello World sites. The result was then reworked as a CoreMedia CMS 9 Hello World site as depicted below:


It could be imported into the repository and instantly be used as a Hello World site, - and with its static content only as a Hello World site.

Configurable Content


This is a nice missing piece - I think - for CoreMedia CMS 9, but it is not really the last step for a starting point for a project. For every re-use that Hello World content has to be reworked to use the needed
  • Local
  • Path
  • Title
  • URL Segments
and the like. So there still is some work to do. But this kind of work is even more schematic and boring than the setup of the minimally needed elements.
This ended in a rewrite script and a content workspace which I now would like to make available to any interested developer in the CoreMedia-sphere.

Find the resulting code at Bitbucket, GitLab, and Github.
Enjoy. Feedback is welcome.

Dienstag, 17. Januar 2017

CoreMedia Build Docker

CoreMedia releases 7 and 8 had one very nice advantage: You didn't have to install anything else than stock Java and Maven to be able to build the workspaces.

Where we come from

This is one of the reasons, why it was possible to use standard services like travis-ci and Gitlab CI with their current container based approach to build these rather large and complex workspaces. Official docker containers for maven just did the job.

GitLab CI example to build a CoreMedia 7 workspace:
image: maven:3-jdk-7

stages:
  - build

build_modules:
  stage: build
  script:
  - mvn install -s workspace-configuration/maven-settings.xml -B

  artifacts:    paths:
    - packages/*/*/target/*.rpm
    expire_in: 3 days
    name: ${CI_BUILD_STAGE}-${CI_BUILD_REF_NAME}


cache:
  paths:
  - mvnrepo/


Where we go to

With the upcoming new CoreMedia platform for CMS and LiveContext this again changes a bit. And that bit is really that tiny, that I didn't want to lose the possibility to use the container based CI tools and go back to Jenkins (which is, what my customers provide me with).
That being said a basic docker file is prepared very quickly to include
Java 8
Maven 3
PhantomJS
The missing part is the command line tool for Sencha ExtJS, the framework the CoreMedia studio heavily relies on. This tool comes with a graphical installer and cannot be installed script based (as far as I can see).
Since I already installed that tool locally, I decided to write a little preparation script, to convert the installation to a copy-able artifact, changing an absolute symbolic link to a relative one.

Prepare a copy-able sencha Cmd copy:
S=`which sencha`
DIR=`dirname $S`
(cd build ; cp -rdp $DIR .)

SD=`(cd build/Cmd ; find -type d -name "6\.[0-9]*")|sed -e 's/^.\///g'`
(cd build/Cmd ; rm sencha-$SD ; ln -s $SD/sencha sencha-$SD)


What's left

Left out intentionally is the authentication part for maven with the CoreMedia repositories and the integration with GitLab CI, what I will be using, since these two are not really generic.

How to get it

As usual you find the sources for this small code piece on GitHub to clone, fork, and use it. And also as usual feedback is highly welcome.