Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
metamod:user_database_revised [2010-09-14 11:49:43] egils |
metamod:user_database_revised [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
Contains changes to the User database design and API that are needed for subscription information and possibly other needs. | Contains changes to the User database design and API that are needed for subscription information and possibly other needs. | ||
- | **2010-09-13: Changes due to the introduction of a U_loginname field are rendered in bold**. | + | 2010-09-13: Changes due to the introduction of a U_loginname field. |
- | **2010-09-14: Names of various methods are changed. These changes are also rendered in bold**. | + | 2010-09-14: Names of various methods are changed. |
+ | |||
+ | **2010-09-24: | ||
+ | |||
+ | **2010-09-28: | ||
+ | |||
+ | 2010-11-11: Removed WMS_URL and WMS_XML entries from the InfoDS table | ||
===== Overview ===== | ===== Overview ===== | ||
Line 15: | Line 21: | ||
**UserTable** | **UserTable** | ||
- | |__U_id__ |A_id |U_name |U_email |**U_loginname** |U_password |U_institution |U_telephone |U_session | | + | |__U_id__ |A_id |U_name |U_email |U_loginname |U_password |U_institution |U_telephone |U_session | |
**DataSet** | **DataSet** | ||
Line 23: | Line 29: | ||
**InfoDS** | **InfoDS** | ||
- | |**__I_id__** |DS_id |I_type |I_content | | + | |__I_id__ |DS_id |I_type |I_content | |
**InfoUDS** | **InfoUDS** | ||
- | |**__I_id__** |U_id |DS_id |I_type |I_content | | + | |__I_id__ |U_id |DS_id |I_type |I_content | |
**File** | **File** | ||
- | |__DS_id__ | + | |__U_id__ |
Line 46: | Line 52: | ||
^U_name |User name as given in registration form | | ^U_name |User name as given in registration form | | ||
^U_email |User E-mail address as given in registration form | | ^U_email |User E-mail address as given in registration form | | ||
- | ^U_loginname |**Login name for user authentication** | | + | ^U_loginname |Login name for user authentication | |
^U_password |User password | | ^U_password |User password | | ||
^U_institution |User institution acronym as given in registration form | | ^U_institution |User institution acronym as given in registration form | | ||
Line 73: | Line 79: | ||
A type tag (I_type) field tells what kind of information is contained in the row. The value is a short acronym for a limited set of information types. The piece of information is found in the I_content text field. | A type tag (I_type) field tells what kind of information is contained in the row. The value is a short acronym for a limited set of information types. The piece of information is found in the I_content text field. | ||
- | ^**I_id** |Unique id (autoincremented number). Primary key | | + | ^I_id |Unique id (autoincremented number). Primary key | |
^DS_id |Identifiles a dataset this info-row is connected to. | | ^DS_id |Identifiles a dataset this info-row is connected to. | | ||
^I_type |Type tag. Short acronym that identifies the information type. | | ^I_type |Type tag. Short acronym that identifies the information type. | | ||
Line 84: | Line 90: | ||
^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 directory, or in any subdirectory of the location directory at any level. | | ^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 directory, or in any subdirectory of the location directory at any level. | | ||
^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_XML |XML document that describes available alternatives for displaying the dataset in WMS. For example, the parameters that can be displayed. Each parameter may have a palette (for example " | ||
|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_XML |XML document used to represent reprojection information. The document contains, among other things, each projection the user has asked for (" | ^PROJECTION_XML |XML document used to represent reprojection information. The document contains, among other things, each projection the user has asked for (" | ||
Line 110: | Line 114: | ||
==== File ==== | ==== File ==== | ||
- | ^DS_id |Dataset | + | ^U_id |**User that this file belongs to**. Part of primary key. | |
^F_name |Local path to file. The full path is given by " | ^F_name |Local path to file. The full path is given by " | ||
^F_timestamp |Timestamp of last change | | ^F_timestamp |Timestamp of last change | | ||
Line 140: | Line 144: | ||
^Method ^Purpose ^Parameters ^ | ^Method ^Purpose ^Parameters ^ | ||
|user_find |Search for an existing user in the database and make him/her the current user. |IN: User E-mail address, application id (A_id). | | |user_find |Search for an existing user in the database and make him/her the current user. |IN: User E-mail address, application id (A_id). | | ||
- | |**user_lfind** |**Search for an existing user in the database and make him/her the current user.** |**IN: User login name, application id (A_id).** | | + | |user_lfind |Search for an existing user in the database and make him/her the current user. |IN: User login name, application id (A_id). | |
- | |user_create |Create a new user and make it the current user. |IN: User E-mail address, application id (A_id). | + | |user_create |Create a new user and make it the current user. |IN: User E-mail address, application id (A_id). Initially, the value of the mandatory U_loginname field will be set to the E-mail address, but this can be changed using the user_set method. | |
- | |user_set | + | |user_put |
- | |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, FALSE if no users exist. | | |user_first |Make the first user in the database the current user. |OUT: TRUE if found, FALSE if no users exist. | | ||
|user_next |Make the next user in the database the current one. |OUT: TRUE if found, FALSE if already last user. | | |user_next |Make the next user in the database the current one. |OUT: TRUE if found, FALSE if already last user. | | ||
Line 150: | Line 154: | ||
==== Dataset functions ==== | ==== Dataset functions ==== | ||
+ | Methods for manipulating the DataSet table. | ||
^Method ^Purpose ^Parameters ^ | ^Method ^Purpose ^Parameters ^ | ||
Line 157: | Line 162: | ||
|dset_next |Make the next dataset (owned by the current user) the current dataset. |OUT: true if found, false if already last dataset. | | |dset_next |Make the next dataset (owned by the current user) the current dataset. |OUT: true if found, false if already last dataset. | | ||
|dset_isync |Make the dataset corresponding to the current infoUDS-row (see below) the current dataset. |OUT: TRUE if found, FALSE on error. | | |dset_isync |Make the dataset corresponding to the current infoUDS-row (see below) the current dataset. |OUT: TRUE if found, FALSE on error. | | ||
- | + | |dset_get | |
- | ==== Dataset information functions ==== | + | |dset_put |
- | Methods for manipulating the InfoDS table. These methods will only work if the datasets have only one value for each information type. For the time being, this assumption seems justified. | + | |
- | + | ||
- | ^Method ^Purpose ^Parameters ^ | + | |
- | |infoDS_get | + | |
- | |infoDS_put | + | |
==== Functions for manipulating the InfoUDS table==== | ==== Functions for manipulating the InfoUDS table==== | ||
Line 179: | Line 179: | ||
^Method ^Purpose ^Parameters ^ | ^Method ^Purpose ^Parameters ^ | ||
- | |file_find |Search for an existing file (owned by the curent | + | |file_find |Search for an existing file (**owned by the curent |
- | |file_create |Create a new file (for the current | + | |file_create |Create a new file (**for the current |
- | |file_set | + | |file_put |
|file_get |Get file properties for the current file. |IN: Property name (one of F_name', | |file_get |Get file properties for the current file. |IN: Property name (one of F_name', | ||
- | |file_first |Make the first file (in the current | + | |file_first |Make the first file (**owned by the current |
|file_next |Make the next file in the database the current one. |OUT: true if found, false if already last file. | | |file_next |Make the next file in the database the current one. |OUT: true if found, false if already last file. | | ||
+ | |**file_delete** |**Delete the current file entry from the database.** |**OUT: true if the entry was deleted, false on error.** | | ||
==== Example usecase ==== | ==== Example usecase ==== |