<directory>
<directory>
returns a table that provides information about the
child objects of a particular folder. These include any tables, folders, and queries that have
been saved to that folder.
Syntax
<directory folder="[NAME_OF_FOLDER]"/>
Attributes
folder
- Accepts a folder name (e.g.,
pub.demo.retail
).folder="0"
will display all root directories. title
- Accepts arbitrary text that overrides the title of the table returned by
<directory>
. sdesc
- Accepts arbitrary text that overrides the short description of the table returned by
<directory>
. ldesc
- Accepts arbitrary text that overrides the long description of the table returned by
<directory>
. depth
- Accepts an integer value specifying the recursive depth to which the
<directory>
operation will return folder information.For example,
depth="2"
returns two levels of directory information starting from the directory provided in thefolder
attribute.The default if the
depth
attribute is omitted is1
, which returns information only for the current directory.depth="0"
returns directory information for all available levels in the current directory.
will display every object that a user has access to.folder="0" depth="0"
will display all the top level folder paths that a user has access to.folder="0" depth="1"
(Available as of prod-9)
find
- Used as
<directory find="string"/>
, returns a table with the metadata for all tables and folders in the session whose path or title contain string.Because it only retrieves the metadata for matching objects, if the number of matches is small it is much faster (especially for users with a large number of tables/folders) than using
<directory folder="0">
to get metadata for all tables, then selecting on that table.
Return Value
The <directory>
operation returns a table containing information about
any child objects (i.e., tables, folders, and queries) under the specified
folder
.
path
- Full path to the object
title
- The label associated with the object
type
- The type of objectValid values are:
dir
folder tab
table ctype
- Integer representation of the type of dataValid values are:
0
table 1
non-parameterized Quick Query 2
parameterized Quick Query 3
uploaded query (deprecated) 4
merged table 5
tolerant merged table (ignores missing tables) ttype
- Character representation of the type of dataValid values are:
table
table query
Quick Query id
- Integer value representing a unique identifier
link
- Link header
owner
- Boolean value indicating whether the user currently logged in is the owner of the object
navto
- Boolean value indicating whether or not the user can directly access the
tableNote: This item has been deprecated.
owneris
- Username of the owner
ts
- Integer value representing the timestamp of the last modification
date
- Integer value representing the date of the last modification
time
- Integer value representing the time of the last modification
secure
- Boolean value indicating whether SSL encryption is required
(deprecated)Note: Since SSL encryption is always required when using 1010data, this value no longer has any significance.
bytes
- Decimal value representing the physical size of the object in bytes
sdesc
- Short description
ldesc
- Long description
Example
This example returns a table with information about the contents of the folder
pub.demo.retail as specified by the folder
attribute.
<directory folder="pub.demo.retail"/>
Returns the following table:
Example - find
attribute
The following simple QuickApp demonstrates most of the features available for the
find
attribute.
<dynamic l="100" f="" s="path,title" m="" t="" c="0" > <do> <set m="" t=""/> <do queryvalue_="@t"> <directory search="{@s}" find="{@f}" foldcase="{@c}" limit="{@l}" hard="1"/> </do> <do onerr_="* matches"> <set m="{@doerr_}"/> </do> </do> <layout arrange_="v"> <layout arrange_="h"> <widget class_="field" label_="Search string:" immediate_="1" value_="@f"/> <widget class_="checkbox" label_="Ignore case" value_="@c"/> <widget class_="field" type_="numeric" label_="Show results:" value_="@l"/> </layout> <widget class_="checklist" value_="@s"> <table>path;title;sdesc;ldesc;owner</table> </widget> <widget class_="text" require_="@m" invmode_="hide" text_="There are {@m}, too many to display"/> <widget class_="grid" require_="@t" invmode_="hide"> <table data="{@t}"/> </widget> </layout> </dynamic>
Returns the following table: