Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
metamod:user_database [2010-03-10 11:54:50] egils |
metamod:user_database [2010-07-07 12:39:20] egils |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Design ===== | ===== Design ===== | ||
+ | |||
Line 12: | Line 13: | ||
==== Database tables ==== | ==== Database tables ==== | ||
- | **User** | + | **UserTable** |
|__U_id__ |A_id |U_name |U_email |U_password |U_institution |U_telephone |U_session | | |__U_id__ |A_id |U_name |U_email |U_password |U_institution |U_telephone |U_session | | ||
Line 22: | Line 23: | ||
**Info** | **Info** | ||
- | |__DS_id__ |__I_type__ | + | |__DS_id__ |__I_type__ |I_content | |
**File** | **File** | ||
Line 46: | Line 47: | ||
- | ==== User ==== | + | ==== UserTable |
^U_id |Unique user id (autoincremented number). Primary key | | ^U_id |Unique user id (autoincremented number). Primary key | | ||
Line 73: | Line 74: | ||
The combination of the '' | The combination of the '' | ||
+ | |||
Line 93: | Line 95: | ||
==== Info ==== | ==== Info ==== | ||
- | This table is used to contain various information about a dataset. Each piece of information is identified by the dataset it belongs to (DS_id) and a type tag (I_type) that is a short acronym for a limited set of information types. One piece of information can be contained in one or several table rows (these are all the rows identified by a DS_id, | + | This table is used to contain various information about a dataset. Each piece of information is identified by the dataset it belongs to (DS_id) and a type tag (I_type) that is a short acronym for a limited set of information types. |
- | + | ||
- | Two extra identification fields are used to implement structure to each piece of information: | + | |
- | + | ||
- | * Single entity (as described above). | + | |
- | * Two-level hierarchy: Multiple entities where each entity has children or attributes. | + | |
- | * Three-level hierarchy: Like a two-level hierarchy with an additional entity alone at the top. This entity may have its own attributes. | + | |
- | + | ||
- | I1_id will always represent a consecutive set of integers starting from 0, and for each of these numbers, I2_id will comprise a similar consecutive set of integers starting from 0. The max value for I2_id will vary between different I1_id values. | + | |
^DS_id |Identifiles the dataset this info-row belongs to | | ^DS_id |Identifiles the dataset this info-row belongs to | | ||
^I_type |Type tag. Short acronym that identifies the information type. | | ^I_type |Type tag. Short acronym that identifies the information type. | | ||
- | ^I1_id |Major integer identifier (see above). | | + | ^I_content |The text string representing |
- | ^I2_id |Minor integer identifier (see above). | | + | |
- | ^I_attribute |Attribute name. Optional acronym to identify an attribute. If found, the I_content field is interpreted as an attribute value that software may treat specially. | | + | |
- | ^I_content | The actual | + | |
For the time being, the following information types (I_type) will be needed: | For the time being, the following information types (I_type) will be needed: | ||
^DSKEY |Dataset key (also called directory key or dirkey) as provided by the user. Single entity | | ^DSKEY |Dataset key (also called directory key or dirkey) as provided by the user. Single entity | | ||
- | ^LOCATION |Location. Single entity. Absolute path to the directory under which all files belonging to the dataset are found. The files may be found directly in the location | + | ^LOCATION |Location. Single entity. Absolute path to the directory under which all files belonging to the dataset are found. The files may be found directly in the location |
^CATALOG |Partial URL to a THREDDS dataset. Single entity. Combined with the file name, this URL can be used to access the content of a file through a TDS server. It can also provide the URL that points to the THREDDS catalog containing the METAMOD dataset. | | ^CATALOG |Partial URL to a THREDDS dataset. Single entity. Combined with the file name, this URL can be used to access the content of a file through a TDS server. It can also provide the URL that points to the THREDDS catalog containing the METAMOD dataset. | | ||
^WMS_URL |URL to the WMS service that can display data from the dataset. Single entity. | | ^WMS_URL |URL to the WMS service that can display data from the dataset. Single entity. | | ||
- | ^WMS_PARAM | + | ^WMS_XML |
Additional information types may be added later, for example to implement projection information: | Additional information types may be added later, for example to implement projection information: | ||
- | ^PROJECTION | + | ^PROJECTION_XML |
Line 129: | Line 120: | ||
^DS_id |Dataset this file belongs to. Part of primary key. | | ^DS_id |Dataset this file belongs to. Part of primary key. | | ||
- | ^F_name |Name of file. Part of primary key. | | + | ^F_name |Local path to file. The full path is given by " |
^F_timestamp |Timestamp of last change | | ^F_timestamp |Timestamp of last change | | ||
^F_size |File size (bytes) | | ^F_size |File size (bytes) | | ||
Line 174: | Line 165: | ||
|user_set |Set user properties for the current user |IN: Property name (one of ' | |user_set |Set user properties for the current user |IN: Property name (one of ' | ||
|user_get |Get user properties for the current user. |IN: Property name (one of ' | |user_get |Get user properties for the current user. |IN: Property name (one of ' | ||
- | |user_first |Make the first user in the database the current user. |OUT: true if found, | + | |user_first |Make the first user in the database the current user. |OUT: 1 if found, |
- | |user_next |Make the next user in the database the current one. |OUT: true if found, | + | |user_next |Make the next user in the database the current one. |OUT: 1 if found, |
==== Dataset functions ==== | ==== Dataset functions ==== | ||
Line 188: | Line 179: | ||
^Method ^Purpose ^Parameters ^ | ^Method ^Purpose ^Parameters ^ | ||
- | |info_get_structure | + | |info_get |
- | |info_get |Get information from the current dataset. |IN: Information type (I_type), I1 (value for the I1_id field), I2 (value for the I2_id field). OUT (array of two elements): Attribute name (empty if no attribute), | + | |info_put |Add or replace |
- | |info_get_by_attribute |Get information from the current dataset for a given attribute. |IN: Information type (I_type), I1 (value for the I1_id field), attribute name. OUT: attribute value, false if not found. | | + | |
- | |info_put |Add or replace | + | |
==== File functions ==== | ==== File functions ==== |