WHFSFolder (open)
WHFS folder object
Syntax
LOADLIB "mod::system/lib/internal/whfs/objects.whlib";
OBJECTTYPE WHFSFolder
Properties
- PROPERTY creationdate
Creationdate
- PROPERTY description
Description
- PROPERTY fullpath
Full path within this site
- PROPERTY highestparent
Id of the highest in-site parent (ie, parentsite->root)
- PROPERTY highestparentobject
- PROPERTY id
Id of this object
- PROPERTY indexdoc
Id of the index document of this folder
- PROPERTY isacceptableindex
Whether files of this type can function as index
- PROPERTY isactive
Whether this object is active (not in the trash)
- PROPERTY isfolder
Whether this is a folder
- PROPERTY ispinned
Whether this object is pinned (locked for renaming/deleting)
- PROPERTY keywords
Keywords
- PROPERTY link
Direct link to this object, empty if not published
- PROPERTY modificationdate
Modificationdate
- PROPERTY modifiedby
Modified by
- PROPERTY name
Name
- PROPERTY needstemplate
Whether this object needs a template
- PROPERTY ordering
Ordering number
- PROPERTY parent
Id of parent object of this file/folder
- PROPERTY parentobject
Parent object
- PROPERTY parentsite
Id of the parent site
- PROPERTY title
Title
- PROPERTY type
Id of the type of this whfs object
- PROPERTY typens
Namespace of the type of this whfs object
- PROPERTY whfspath
Full path whfs path
Functions
- OBJECT FUNCTION CopyTo(OBJECT destfolder, STRING newname)
Create a copy of this file/folder in the destination folder, with optional rename.
- OBJECT FUNCTION CreateFile(RECORD metadata, RECORD options)
Create a new file
- OBJECT FUNCTION CreateFolder(RECORD metadata, RECORD options)
Create a new folder
- MACRO DeleteSelf()
Deletes this file or folder
- OBJECT FUNCTION EnsureFile(RECORD requiredmetadata, RECORD optionalmetadata, RECORD options)
Get a file, create if it doesn't exist.
- OBJECT FUNCTION EnsureFolder(RECORD requiredmetadata, RECORD optionalmetadata, RECORD options)
Get an folder, create if it doesn't exist.
- MACRO EnsureOrdering(BOOLEAN force_ordering)
Ensures that ordering is set for every child of this folder Assumes the default ordering defined as 'ORDER BY ordering, ToUpperCase(title), ToUpperCase(name), id'; if you wish to use a different ordering, please override the query.
- RECORD FUNCTION ExportFolder(RECORD options)
Export this folder
- RECORD FUNCTION FilterInstanceDataUpdates(STRING typenamespace, RECORD newdata)
Filters instancedata updates, cells with the same value as currently on disk will be removed
- STRING FUNCTION GenerateUniqueName(STRING suggestion, RECORD options)
Generate an unique name, based on a base name
- INTEGER ARRAY FUNCTION GetDescendantFileIds(INTEGER maxdepth)
Get the ids of all descendant files in this folder, not including the current folder
- INTEGER ARRAY FUNCTION GetDescendantFolderids(INTEGER maxdepth)
Get the ids of all descendant folders of this folder, not including the current folder
- INTEGER ARRAY FUNCTION GetDescendantObjectIds(INTEGER maxdepth)
Get the ids of all descendant objects in this folder, not including the current folder
- STRING ARRAY FUNCTION GetEventMasks()
Returns the event masks for broadcasts fired for this object
- INTEGER ARRAY FUNCTION GetFullTree()
Get the tree from the publisher root to this object
- RECORD FUNCTION GetInstanceData(STRING typenamespace)
Returns the instance data for a specific whfs type
- RECORD FUNCTION GetInstanceDataByType(OBJECT type)
- INTEGER FUNCTION GetNewFSObjectId()
Allocates an id for a new whfs object
- BLOB FUNCTION GetResource(STRING resourcepath)
Get a resource relative to this location. Implements relative path and currentsite:: support. Throws if file not found
- STRING FUNCTION GetResourceName()
Return the resource name for the current object
- INTEGER ARRAY FUNCTION GetWHFSTree()
Get the tree from the publisher root to this object
- BOOLEAN FUNCTION IsChildOf(INTEGER otherobj)
Returns whether this object is a child of another object
- BOOLEAN FUNCTION IsParentOf(INTEGER otherobj)
Returns whether this object is a parent of another object
- OBJECT FUNCTION MakeBulkReceiver()
Set up an object capable of receiving actions in bulk.
- MACRO MoveTo(OBJECT destfolder, STRING newname)
Moves this file/folder to the destination folder, with optional rename.
- OBJECT FUNCTION OpenByName(STRING findname, RECORD options)
Looks up a file or folder within this folder by name
- OBJECT FUNCTION OpenByPath(STRING findpath, RECORD options)
Looks up a file or folder within this folder by relative path
- MACRO RecycleSelf()
Move this file or folder to the trash
- BOOLEAN FUNCTION Refresh()
Refresh all metadata from the database
- MACRO RemoveOrdering()
Resets the ordering for this folder Legacy behaviour has always been 'unordered equals ordering = 0' so we preserve this behaviour.
- MACRO ReorderObjectsBefore(INTEGER ARRAY objectids, INTEGER before)
Reorders (changes ordering field) files/folders within this object so that the objects in @a objectids are ordered just before @a before. Keeps the original ordering (with the changes), but renumbers all ordering fields.
- MACRO RestoreSelf()
Restores this file or folder from the recycle bin to its original location
- RECORD FUNCTION RetrieveResource(STRING resourcepath)
Retrieve a resource with path and modtime. Implements relative path and currentsite:: support. Throws if file not found
- MACRO SetInstanceData(STRING typenamespace, RECORD newdata, RECORD options)
Sets the instance data for a specific WHFS type
- MACRO SetInstanceDataByType(OBJECT type, RECORD newdata, RECORD options)
- MACRO UpdateMetadata(RECORD newmetadata, RECORD options)
Update the metadata for this whfs object. Throws on invalid data.