Ferreteria/modules/files/rf node: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
m (9 revisions imported: moving this project here)
 
(5 intermediate revisions by one other user not shown)
Line 6: Line 6:
** maximum [[URL]] length is somewhere around 1024 characters (varies by browser and server; presumably there is an official limit that is ≤ this).
** maximum [[URL]] length is somewhere around 1024 characters (varies by browser and server; presumably there is an official limit that is ≤ this).
** This is related to [[FileFerret/SQL/entry]], but not the same; that system tracks user-managed files.
** This is related to [[FileFerret/SQL/entry]], but not the same; that system tracks user-managed files.
** Wrinkle I'm still working out: this actually needs to track two different representations of the file -- one for how to retrieve it from the native filesystem, and the other by which it will be represented to the user. There are issues to consider.
==Fields==
* '''IFSpec*''': These are related to where the file is actually stored in the filesystem. They are not exposed to non-admin users unless direct access is desired (no security). It should be optimized for access time or whatever metrics are prioritized:
** '''IFSpecName''': this node's name as known to the filesystem
** '''IFSpecFull''': full filespec to this node (including name) from repository base spec
** '''ID_IFParent'''
* '''OFSpec*''': These are related to the hierarchy that is exposed to the user:
** '''OFSpecName''': name by which the user knows the node (how it's displayed)
** '''OFSpecFull''': full path to this node (including name) from external URI base
** '''ID_OFParent''': parent node as seen by user
* '''Descr''': This is kind of a quick-n-dirty field for descriptive notes; eventually there should be a field-tagging system.
==History==
==History==
* '''2017-07-22''' created for reworking file-management
* '''2017-07-22''' created for reworking file-management
* '''2017-07-24''' moved from [[VbzCart]] to Ferreteria (RepoFerret module); renamed from '''fm_node''' to '''rf_node'''
* '''2017-07-25''' decided to try having separate internal and external filespec; rearranged stuff
==SQL==
==SQL==
<mysql> CREATE TABLE `fm_node` (
<mysql> CREATE TABLE `rf_node` (
   ID       INT          NOT NULL AUTO_INCREMENT,
   ID         INT          NOT NULL AUTO_INCREMENT,
   ID_Parent INT          DEFAULT NULL,
   IFSpecPart  VARCHAR(255) NOT NULL,
   FSpecPart VARCHAR(255) NOT NULL COMMENT "relative filespec - the part of the path from parent to this file/folder",
  IFSpecFull  TEXT        NOT NULL,
   FSpecFull TEXT        NOT NULL COMMENT "full filespec (calculated)",
  ID_IFParent INT          DEFAULT NULL,
   WFullPath TEXT        NOT NULL COMMENT "full web URL (calculated)",
   OFSpecPart  VARCHAR(255) NOT NULL,
   WhenAdded DATETIME   NOT NULL COMMENT "when the file was first added to the repository",
   OFSpecFull  TEXT        NOT NULL,
   WhenCreated DATETIME   NOT NULL COMMENT "file's creation timestamp",
   ID_OFParent INT          DEFAULT NULL,
   WhenEdited  DATETIME   DEFAULT NULL COMMENT "file's last-modified timestamp",
   WhenAdded   DATETIME     NOT NULL COMMENT "when the file was first added to the repository",
   WhenDeleted DATETIME   DEFAULT NULL COMMENT "when the file was removed from the repository (NULL = still here)",
   WhenCreated DATETIME     NOT NULL COMMENT "file's creation timestamp",
   Descr     VARCHAR(255) DEFAULT NULL COMMENT "brief name or description",
   WhenEdited  DATETIME     DEFAULT NULL COMMENT "file's last-modified timestamp",
   WhenDeleted DATETIME     DEFAULT NULL COMMENT "when the file was removed from the repository (NULL = still here)",
   Descr       TEXT        DEFAULT NULL COMMENT "brief name or description",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
) ENGINE = InnoDB;</mysql>
) ENGINE = InnoDB;</mysql>

Latest revision as of 16:42, 22 May 2022

About

  • Meaning: can represent any filesystem entity
  • Purpose: for code-managed repositories
  • Notes:
    • directory size optimization - For now, we'll just set use a constant and set it to a best-guess limit, probably 1000.
    • maximum URL length is somewhere around 1024 characters (varies by browser and server; presumably there is an official limit that is ≤ this).
    • This is related to FileFerret/SQL/entry, but not the same; that system tracks user-managed files.
    • Wrinkle I'm still working out: this actually needs to track two different representations of the file -- one for how to retrieve it from the native filesystem, and the other by which it will be represented to the user. There are issues to consider.

Fields

  • IFSpec*: These are related to where the file is actually stored in the filesystem. They are not exposed to non-admin users unless direct access is desired (no security). It should be optimized for access time or whatever metrics are prioritized:
    • IFSpecName: this node's name as known to the filesystem
    • IFSpecFull: full filespec to this node (including name) from repository base spec
    • ID_IFParent
  • OFSpec*: These are related to the hierarchy that is exposed to the user:
    • OFSpecName: name by which the user knows the node (how it's displayed)
    • OFSpecFull: full path to this node (including name) from external URI base
    • ID_OFParent: parent node as seen by user
  • Descr: This is kind of a quick-n-dirty field for descriptive notes; eventually there should be a field-tagging system.

History

  • 2017-07-22 created for reworking file-management
  • 2017-07-24 moved from VbzCart to Ferreteria (RepoFerret module); renamed from fm_node to rf_node
  • 2017-07-25 decided to try having separate internal and external filespec; rearranged stuff

SQL

<mysql> CREATE TABLE `rf_node` (

 ID          INT          NOT NULL AUTO_INCREMENT,
 IFSpecPart  VARCHAR(255) NOT NULL,
 IFSpecFull  TEXT         NOT NULL,
 ID_IFParent INT          DEFAULT NULL,
 OFSpecPart  VARCHAR(255) NOT NULL,
 OFSpecFull  TEXT         NOT NULL,
 ID_OFParent INT          DEFAULT NULL,
 WhenAdded   DATETIME     NOT NULL COMMENT "when the file was first added to the repository",
 WhenCreated DATETIME     NOT NULL COMMENT "file's creation timestamp",
 WhenEdited  DATETIME     DEFAULT NULL COMMENT "file's last-modified timestamp",
 WhenDeleted DATETIME     DEFAULT NULL COMMENT "when the file was removed from the repository (NULL = still here)",
 Descr       TEXT         DEFAULT NULL COMMENT "brief name or description",
 PRIMARY KEY(`ID`)

) ENGINE = InnoDB;</mysql>