Alan,
I see that I have to create main object first and then create
derivative objects.
I am confused with the order of all functions. Just to summarize. In
my simple example I want to generate TN from PDF like in PDF solution
pack but instead of adding TN as a datastream I want to create
derivative object and add TN there.
(1)
TN file is created in PDF solution pack but remove the last part:
//$_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_suffix;
(2)
In my module I add my hook function and build my derived object, right?:
function my_hook_form_alter(&$form, &$form_state, $form_id){
$my_pid = $form_state['values']['pid'];
$deriv_object = Fedora_Item::ingest_new_item($my_pid, 'A',
'Label_for_derived_object');
$deriv_item->add_datastream_from_file($file . $file_suffix, 'TN',
'Label_for_TN_datastream', '', 'M');
}
(3)
Where do I call my_hook_form_alter function?
(4)
In fedora_repository.module I add additional submit handler to the
function fedora_repository_ingest_form? So is it like this?:
$ingestForm = new formClass();
$form_state['storage']['content_model'] = $content_model;
$form_state['storage']['collection_pid'] = $collection_pid;
//My handler:
$form_state['storage']['???'] = ???;
return $ingestForm->createIngestForm($collection_pid,
$collection_label, $form_state);
(5)
I delete my derived TN file at the end of my module.
file_delete($file . $file_suffix);
Thank you for additional clarification,
Serhiy
On Wed, May 2, 2012 at 7:00 AM, Alan Stanley