-
Notifications
You must be signed in to change notification settings - Fork 39
/
islandora_paged_content.install
90 lines (85 loc) · 2.42 KB
/
islandora_paged_content.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* @file
* Install hooks for this module.
*/
/**
* Implements hook_install().
*
* @see islandora_paged_content_islandora_required_objects()
*/
function islandora_paged_content_install() {
variable_set('islandora_paged_content_gs', '/usr/bin/gs');
}
/**
* Implements hook_uninstall().
*/
function islandora_paged_content_uninstall() {
$variables = array(
'islandora_paged_content_gs',
'islandora_paged_content_pdfinfo',
'islandora_paged_content_pdftotext',
'islandora_paged_content_pdftotext_use_raw',
);
array_walk($variables, 'variable_del');
}
/**
* Implements hook_schema().
*/
function islandora_paged_content_schema() {
$schema = array();
$schema['islandora_paged_content_pdf_ingest'] = array(
'description' => 'Tracks PDFs uploaded to be extracted into paged content for deletion after ingest is complete.',
'fields' => array(
'pid' => array(
'description' => 'The PID of the paged content object that has a PDF file associated with it to be deleted.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'fid' => array(
'description' => 'The Drupal file identifier of the file to be deleted.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
'primary key' => array('pid'),
'foreign keys' => array(
'fid' => array(
'table' => 'file_managed',
'columns' => array('fid' => 'fid'),
),
),
);
return $schema;
}
/**
* Adds a database table used to delete managed files on ingest.
*/
function islandora_paged_content_update_7001() {
db_create_table('islandora_paged_content_pdf_ingest', array(
'description' => 'Tracks PDFs uploaded to be extracted into paged content for deletion after ingest is complete.',
'fields' => array(
'pid' => array(
'description' => 'The PID of the paged content object that has a PDF file associated with it to be deleted.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'fid' => array(
'description' => 'The Drupal file identifier of the file to be deleted.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
'primary key' => array('pid'),
'foreign keys' => array(
'fid' => array(
'table' => 'file_managed',
'columns' => array('fid' => 'fid'),
),
),
));
}