[TYPO3-dam] DAM API questions

Karl-Ernst Kiel kekiel at kekiel.de
Fri Nov 24 17:26:58 CET 2006


Hi!

Currently I am developing a FE Plugin for DAM downloads and I try to use 
the DAM API.
Special thanks to René for providing the phpdoc and the dam_demo_pi 
examples. This is very helpful!

There are some things I can´t find any matching API´s - maybe I 
overlooked some or I´m looking in the wrong place so (trying to avoid 
direct DB-access as much as possible) here is my list:

1) Download link
Get a download link to the media file, using the download name and 
automatically applying user rights.
(Maybe an optional counter... :-)

My way would be to "compose" it by using
$media = tx_dam::media_getByUid($myuid);
[...]
$filename = $media->getDownloadName();
$mime = $media->getMimeContentType();
... and retrieving the original file-path, making php deliver the data, 
etc...

Is there an easier way?
"tx_dam::downloadlink_getByUid($myuid,$linktext);" would be nice :-)


2) getting list of DAM elements matching a category
Currently I´m doing it this way:
  $tmp_where = 'AND tx_dam_cat.uid IN ('.$catUidList1.')';
  $tmp_where .= $this->cObj->enableFields('tx_dam');
  $res = 
$GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('tx_dam.uid','tx_dam','tx_dam_mm_cat','tx_dam_cat',$tmp_where);

I tried using  tx_dam_db::getReferencesUidList() but I did not manage 
because it uses tx_dam_mm_ref and not tx_dam_mm_cat...


3) getting category infos
something like
$cat = tx_dam::category_getByUid($myuid);

Is there anything like this? Otherwise I will query the dam_cat table 
"directly". (OK - seems to be no reason not to do, or? ...)


Greetings,
Karl-E.



More information about the TYPO3-project-dam mailing list