1 |
rodolico |
1 |
<?php
|
|
|
2 |
global $DATABASE_DEFINITION;
|
|
|
3 |
$DATABASE_DEFINITION['document'] = array(
|
|
|
4 |
'table name' => 'document',
|
|
|
5 |
'key field' => 'document_id',
|
|
|
6 |
'display columns' => array('Name','Added','Type','Description'),
|
|
|
7 |
'display query' => 'select document_id,mime_type Type, name Name,added_date Added,description Description from document join document_mime_type using (document_mime_type_id)',
|
|
|
8 |
'field info' => array(
|
|
|
9 |
/* date record was deleted/supserceded */
|
|
|
10 |
'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
|
|
|
11 |
'document_id' => array('display name' => 'document_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
12 |
/* either contents of text document or ::filename:: to be a link to a file on the disk */
|
|
|
13 |
'content' => array('display name' => 'content' , 'type' => 'text'),
|
|
|
14 |
'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
|
|
|
15 |
/* date record was added */
|
|
|
16 |
'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
|
|
|
17 |
'document_mime_type_id' => array('display name' => 'document_mime_type_id' , 'type' => 'lookup', 'table' => 'document_mime_type', 'keyfield' => 'document_mime_type_id', 'display_field' => 'mime_type'),
|
|
|
18 |
/* A brief (or long) description of this document */
|
|
|
19 |
'description' => array('display name' => 'description' , 'type' => 'text')
|
|
|
20 |
)
|
|
|
21 |
);
|
|
|
22 |
$DATABASE_DEFINITION['document_link'] = array(
|
|
|
23 |
'table name' => 'document_link',
|
|
|
24 |
'key field' => 'document_link_id',
|
|
|
25 |
'display columns' => array('site','document_link_id','owner_type','document_id','site_id','owner_id'),
|
|
|
26 |
'display query' => 'select site,document_link_id,owner_type,document_id,site_id,owner_id from document_link',
|
|
|
27 |
'field info' => array(
|
|
|
28 |
'site' => array('display name' => 'site' , 'type' => 'or'),
|
|
|
29 |
'document_link_id' => array('display name' => 'document_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
30 |
'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
|
|
|
31 |
'document_id' => array('display name' => 'document_id' , 'type' => 'lookup', 'table' => 'document', 'keyfield' => 'document_id', 'display_field' => 'name'),
|
|
|
32 |
'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
|
|
|
33 |
'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
|
|
|
34 |
)
|
|
|
35 |
);
|
|
|
36 |
$DATABASE_DEFINITION['document_mime_type'] = array(
|
|
|
37 |
'table name' => 'document_mime_type',
|
|
|
38 |
'key field' => 'document_mime_type_id',
|
|
|
39 |
'display columns' => array('Extension','Type'),
|
|
|
40 |
'display query' => 'select extension Extension ,document_mime_type_id,mime_type Type from document_mime_type',
|
|
|
41 |
'field info' => array(
|
|
|
42 |
/* a file name extension commonly associated with this file */
|
|
|
43 |
'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
|
|
|
44 |
'document_mime_type_id' => array('display name' => 'document_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
45 |
/* The standardized mime type */
|
|
|
46 |
'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
|
|
|
47 |
)
|
|
|
48 |
)
|
|
|
49 |
?>
|