metamod:user_database

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
metamod:user_database [2010-03-10 11:54:50]
egils
metamod:user_database [2022-05-31 09:29:32] (current)
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__ |__I1_id__ |__I2_id__ |I_attribute |I_content |+|__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 ''A_id'' and ''DS_name'' fields will provide an alternative unique key that can be used to find a dataset without knowing the owning user. The combination of the ''A_id'' and ''DS_name'' fields will provide an alternative unique key that can be used to find a dataset without knowing the owning user.
 +
  
  
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,I_type value pair). +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: I1_id and I2_id. These are integers >= 0. In the simplest case, when the piece of information is just a single entity represented as a text string, the piece of information is contained in one row where both of these integers are 0. By using several rows with different I1_id and I2_id, it is possible to implement various structures like: +
- +
-  * 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 a piece of information. This can be a single entity (unstructured text) or an XML document. |
-^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 text string representing an entity or attribute value. |+
  
 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 direcory, 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_URL |URL to the WMS service that can display data from the dataset. Single entity. |
-^WMS_PARAM |ParameterTwo-level hierarchy. Each entity at the top level (I1_id >= 0, I2_id == 0) identifies a parameter that can be displayed in WMS. Each parameter may have one attribute (I1_id >= 0, I2_id == 1) representing a palette (for example “BOXFILL/redblue”) found in a style element in the GetCapabilites document. If no attribute is found, a default palette is used for the parameter. The I_attribute field of the attribute rows are set to "palette". |+^WMS_XML |XML document that describes available alternatives for displaying the dataset in WMSFor example, the parameters that can be displayed. Each parameter may have a palette (for example “BOXFILL/redblue”) found in a style element in the GetCapabilites document. If no palette is found, a default palette is used for the parameter. |
  
 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 |Three-level hierarchy used to represent reprojection information. The top level entity (identified by I1_id,I2_id == 0,0) contains attributes: urlRegex (I1_id,I2_id == 0,1) and urlReplace (I1_id,I2_id == 0,2). The second level (I1_id > 0, I2_id == 0) represents each projection the user has asked for ("Lat/Long", "Stereo" etc.). Each projection has attributes: method, projString, xAxis, yAxis and toDegree (I2_id > 0).  |+^PROJECTION_XML |XML document used to represent reprojection information. The document contains, among other things, each projection the user has asked for ("Lat/Long", "Stereo" etc.). Each projection contains attributes: method, projString, xAxis, yAxis and toDegree.  |
  
  
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 "LOCATION/F_name" where LOCATION is the dataset LOCATION found in the Info table. Part of primary key. |
 ^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 'U_name', 'U_password', 'U_institution', 'U_telephone', 'U_session'), property value | |user_set |Set user properties for the current user |IN: Property name (one of 'U_name', 'U_password', 'U_institution', 'U_telephone', 'U_session'), property value |
 |user_get |Get user properties for the current user. |IN: Property name (one of 'U_name', 'U_password', 'U_institution', 'U_telephone', 'U_session'). OUT: property value | |user_get |Get user properties for the current user. |IN: Property name (one of 'U_name', 'U_password', 'U_institution', 'U_telephone', 'U_session'). OUT: property value |
-|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. |
  
 ==== Dataset functions ==== ==== Dataset functions ====
Line 188: Line 179:
  
 ^Method ^Purpose ^Parameters ^ ^Method ^Purpose ^Parameters ^
-|info_get_structure |Get an integer array describing the structure of one "piece of information" in the current dataset. |IN: Information type (I_type). OUT: Integer array indexed by the I1_id values. Each array element represents the number of rows in the given "piece of information" where I1_id == the array index value. In other words: for each I1_id value, the correspnding number of I2_id values. | +|info_get |Get information from the current dataset. |IN: Information type (I_type). OUT: Value of I_content field (single entity or XML). | 
-|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), entity or attribute value. | +|info_put |Add or replace content fields in the current dataset. |IN: Information type (I_type), value of I_content field (single entity or XML). |
-|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 entities/attributes in the current dataset. |IN: Information type (I_type), I1 (value for the I1_id field), I2 (value for the I2_id field), attribute name (empty means no attribute), attribute/entity value. |+
  
 ==== File functions ==== ==== File functions ====
  • metamod/user_database.1268222090.txt.gz
  • Last modified: 2022-05-31 09:23:19
  • (external edit)