Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.
/ content-butler Public archive

Content server with Apache Jackrabbit (backend) and Nginx proxy (frontend)

License

Notifications You must be signed in to change notification settings

gpupo/content-butler

Repository files navigation

Content Butler

Content server with Apache Jackrabbit (backend) and Nginx proxy (frontend)

Paypal Donations

Build Status Actions Status

Requirements

Features

  • Content Repository with Apache Jackrabbit
  • Webpage server with Image resize

Install

git clone [email protected]:gpupo/content-butler.git;
cd content-butler;
make setup;

Set passwords: default user is admin with admin password. You must edit htpasswd file with new values and that generator is a usefull tool.

Install dependencies

make install

Copy files to machines (optional)

docker cp config/empty.gif "$(docker-compose ps -q nginx)":/usr/share/nginx/html/empty.gif;

If previous repository exists (see backup):

docker cp var/opt/jackrabbit/repository "$(docker-compose ps -q content-server)":/opt/jackrabbit/;
docker cp var/opt/jackrabbit/workspaces "$(docker-compose ps -q content-server)":/opt/jackrabbit/;
docker cp var/opt/jackrabbit/version "$(docker-compose ps -q content-server)":/opt/jackrabbit/;

Up services

make start

Register node types

docker-compose run php bin/console doctrine:phpcr:register-system-node-types;

Alternative storage location

docker cp  "$(docker-compose ps -q content-server)":/opt/jackrabbit var/jackrabbit;

add volume to docker file:

- $PWD/var/jackrabbit:/opt/jackrabbit

Backup

Export

Export repository with Filesystem Copy:

docker cp "$(docker-compose ps -q content-server)":/opt/jackrabbit var/opt/;

Clone (SVN style)

docker-compose run java bin/clone var/dest_directory;

Import

Example, load fixture:

docker-compose run php ./bin/console butler:import:directory Resources/fixture/ --splitter=Resources;

or

docker-compose run php bin/fixture

Load SVN style

docker-compose run php bin/console butler:import:directory var/clone;

Explore

Content Repository

  1. First, import fixtures;
  2. Check Jackrabbit dashboard
  3. Browse files and see some Sheeps

Nginx frontend

  1. Check if you keep seen sheeps
  2. Check if you can seen litle sheeps
  3. Browse default repository

Library usage

Install

composer require gpupo/content-butler

Add Documents

Versionable, Overshadow and Millenial Tree:

//...
use Gpupo\ContentButler\Helpers\DocumentHelper;
$documentHelper = new DocumentHelper($this->documentManager, $spliter = 'Resources', $versionable = true);
$document = $documentHelper->factoryDocument('var/file/path.jpg', 8068, true);

if ($this->documentManager->find(null, $document->getEndpoint())) {
    throw new \Exception(sprintf('Node %s already exists', $document->getEndpoint()));
}

$output->writeln(sprintf('Saving node <info>%s</>', $document->getEndpoint()));
$this->documentManager->persist($document);
$this->documentManager->flush();

Links

See

About

Content server with Apache Jackrabbit (backend) and Nginx proxy (frontend)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published