-
Notifications
You must be signed in to change notification settings - Fork 6
/
archidora.install
143 lines (134 loc) · 3.44 KB
/
archidora.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
/**
* @file
* Various installation hook implementations.
*/
/**
* Implements hook_schema().
*/
function archidora_schema() {
$schema = array();
$schema['archidora_aip_base_state'] = array(
'description' => '',
'fields' => array(
'object' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'part' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'id' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
),
'primary key' => array('object'),
'indexes' => array(
'id' => array('id'),
),
);
$schema['archidora_aips'] = array(
'description' => 'Information regarding AIPs.',
'fields' => array(
'id' => array(
'description' => 'The ID of this AIP.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'created_time' => array(
'description' => 'Timestamp when this AIP was created.',
'type' => 'int',
'not null' => TRUE,
),
'em_iri' => array(
'description' => 'The Edit Media IRI for this AIP.',
'type' => 'blob',
'not null' => TRUE,
),
'se_iri' => array(
'description' => 'The SE-IRI for this AIP.',
'type' => 'blob',
'not null' => TRUE,
),
'finalized' => array(
'description' => 'Indicate whether or not this AIP was finalized.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => '0',
),
'size' => array(
'description' => 'The total size of the OBJs currently in the AIP.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => '0',
),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Adds the AIP finalized column to the AIPs table.
*/
function archidora_update_7100() {
db_add_field('archidora_aips', 'finalized', array(
'description' => 'Indicate whether or not this AIP was finalized.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => '0',
));
}
/**
* Adds the size column to the AIPs table used to calculating total size.
*/
function archidora_update_7101() {
db_add_field('archidora_aips', 'size', array(
'description' => 'The total size of the OBJs currently in the AIP.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => '0',
));
}
/**
* Change name of Drupal variable.
*/
function archidora_update_7102() {
$space_uuid = variable_get('archidora_space', FALSE);
if ($space_uuid !== FALSE) {
variable_set('archidora_deposit_location', variable_get('archidora_archivematica_url', 'http://localhost') . "/api/v1/location/$space_uuid/sword/collection/");
variable_del('archidora_space');
}
}
/**
* Implements hook_uninstall().
*/
function archidora_uninstall() {
$vars = array(
'archidora_archivematica_url',
'archidora_deposit_location',
'archidora_user',
'archidora_api_key',
'archidora_islandora_api_key',
'archidora_em_iri_solr_field',
'archidora_max_age',
'archidora_max_age_custom',
'archidora_max_size',
'archidora_max_size_custom',
'archidora_cron_time',
'archidora_cron_time_custom',
);
array_map('variable_del', $vars);
}