DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Tools>Media>Cron

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2005-07-26T11:18:07
Author:René Fritz
Email:r.fritz@colorcube.de
Info 3:
Info 4:

Tools>Media>Cron

Extension Key: dam_cron

Copyright 2005, René Fritz, <r.fritz@colorcube.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Tools>Media>Cron 1

Introduction 1

Users manual 1

Administration 2

To-Do list 3

Changelog 3

Introduction

This module is part of the TYPO3 Digital Asset Management System (DAM).

The extension has two parts: a backend module to define and save setups for indexing and a script that can be called from a shell or as a cron job.

While the indexing with the cron script works the same way like in the manual indexing module it provides following features.

Features:

  • mass indexing of files and folder
  • apply rules while indexing (eg. assign category from folder name)
  • preset meta data before indexing
  • set preset meta data not to be overwritten while indexing
  • save index setup

((generated))

((generated))
Important

To get additional meta data out of files the DAM needs services of the types metaExtract, textExtract and textLang installed.

Users manual

The sense of this extension is to provide a shell script that can be used to index files to add these to the DAM index. The difference to the indexing module is that the shell script could be started automatically by a cron job (Unix). Of course it would be handy to have all the configuration options for the shell script like the manual indexing module has. This feature is provided by the module Tools>Media>Cron Job which can save setups for the shell script.

You'll find the 'Cron Job' indexing setup module inside the module 'Tools>Media'. The main menu provide the following functions:

  • get an overview about the available setups
  • Define an indexing setup
  • get an overview about the installed services of the types metaExtract, textExtract and textLang

To define an indexing setup you have to go through 4 steps which should be self explained by the module. This is very much the same as in the normal indexing module. After the final step you can save the setup.

((generated))

Cron/Shell script

To make the indexing shell script work you need the CLI version of PHP installed.

The Cron Job module give you an overview about the stored setups and an example how to call the indexer script. The example assumes that the CLI version of PHP is /usr/bin/php. This might be different on your machine!

If you call the indexer script without parameter a usage message will be shown:

Usage: dam_indexer.php --setup=<filename> [--dry-run] [--exec="<command FILE>"] [<files and folders overriding setup>]

Therefore a call of the indexer script looks like that for example (should be one line):

/usr/bin/php /var/www/dam/typo3conf/ext/dam_cron/cron/dam_indexer.php
--setup=/var/www/dam/uploads/tx_damcron/example.xml

As you see the first parameter of the indexer script is the setup file. But the script allows to add a second parameter. This is a command which will be called for every file before indexing. The string FILE will be replaced with the current filename.

An example that call convert (ImageMagick) to scale and crop images to 800x600 looks like this (should be one line):

/usr/bin/php /var/www/dam/typo3conf/ext/dam_cron/cron/dam_indexer.php
--setup=/var/www/dam/uploads/tx_damcron/example.xml
--exec='/usr/bin/convert -resize 800 -crop 800x600+0+0 FILE FILE'

(However older versions of ImageMagick don't know “-resize”. Use “-geometry here.)

Hint

It might be needed to call the indexer script with the full absolute path, otherwise init.php (module initialization) will not find the path to the typo3/ directory.

Script parameter

The script knows following parameter:

dam_indexer.php --setup=<filename> [--dry-run] [--exec="<command FILE>"] [<files and folders overriding setup>]

--setup

This parameter defines the file with the indexing setup.

Example:

--setup=/path/to/mysetup.xml

--dry-run

If set the indexing will be simulated only.

--exec

A file preprocessing command can be given with this parameter. The placeholder FILE will be substituted with the real filename (in quotes) that should be processed.

Example:

--exec='/usr/bin/convert -resize 800 -crop 800x600+0+0 FILE FILE'

Additional parameter will be used as a list of files and path that overrides the given path from the setup. That way you can use a setup with any file or folder. Files and folders can be mixed in this list:

/usr/bin/php /var/www/dam/typo3conf/ext/dam_cron/cron/dam_indexer.php
--setup=/var/www/dam/uploads/tx_damcron/example.xml
/var/www/dam/fileadmin/myfolder/ /var/www/dam/fileadmin/myfile.jpg

Administration

During install of the extension you have to activate the indexing script. This is for security reasons.

img-1

To get additional meta data out of files the DAM needs services of the types metaExtract, textExtract and textLang installed. You can check if those services are installed if you select 'Services Info' in the modules main menu.

To-Do list

  • Offer the possibility to move files while indexing (importing).#
  • Import and edit setups.
  • Nicer GUI in the module (Volunteers?!)

Changelog

  • setup file format changed (old files will not work anymore)
  • changed dam_indexer.php parameters
  • FILE will be substituted with filename in single quotes to protect spaces in filenames

img-2 Tools>Media>Cron - 3