Libraries object

Top 

libraries

obj=new("libraries")

 

The libraries object provides access to the list of libraries that are known on a system.

 

Lists are returned in linefeed-delimited ($0A$) format, and each list row can be in one of two formats: just library path names, or all library details.
 
A template can be obtained that describes the library information that is returned, so it is possible to develop routines that parse a list and obtain specific library information.

 

A name-only template contains one field: pathname$.

 

A detail template contains the following fields, delimited by a tab ($09$) or other character, if specified:

 

•basename$ - the base filename of the library path.
•dirname$ - the directory portion of the library path.
•path$ - the full library path.
•category$ - the category, if any, of the library.
•description$ - the library description
•created$ - the library creation date, in yyyymmdd format
•defperms$ - default permissions (r, w, and/or d) in semicolon-delimited format
•forceseq - true (1) to force sequencers on sub IDs
•inactive - true (1) if the library is inactive an no longer can be updated
•count - the number of document records in the library
 

 

Methods

 


•getall$([detail[,delim$])

 

returns the names of all libraries, including inactive ones.  If detail is true (1), then lines of detail are returned; if not, only path names are returned.  If delim$ is not null, that is used as a template delimiter character; if it is null, a tab ($09$) delimiter is used.

 


•getdelete$(userid$,[detail[,delim$])

 

returns the names of all libraries the specified user can delete from.  If detail is true (1), then lines of detail are returned; if not, only path names are returned.  If delim$ is not null, that is used as a template delimiter character; if it is null, a tab ($09$) delimeter is used.
 


•getnames$([detail[,delim$])

 

returns the names of all active libraries.  If detail is true (1), then lines of detail are returned; if not, only path names are returned.  If delim$ is not null, that is used as a template delimiter character; if it is null, a tab ($09$) delimeter is used.
 


•getread$(userid$,[detail[,delim$])

 

returns the names of all libraries the specified user can read from.  If detail is true (1), then lines of detail are returned; if not, only path names are returned.  If delim$ is not null, that is used as a template delimiter character; if it is null, a tab ($09$) delimeter is used.
 


•gettemplate$(detail[,delim$])

 

returns a string template definition for detail or non-detail return lines, optionally with the specified delimiter.  If no delimiter is specified, a tab delimiter ($09$) is assumed.
 


•getwrite$(userid$,[detail[,delim$])

 

returns the names of all libraries the specified user can write to.  If detail is true (1), then lines of detail are returned; if not, only path names are returned.  If delim$ is not null, that is used as a template delimiter character; if it is null, a tab ($09$) delimeter is used.

 


 

 

The following code fragment illustrates how one could parse a library list.

 

obj=new("libraries")

dim row$:obj'gettemplate$(1)

rows$=obj'getnames$(1)

x=pos($0a$=rows$)

while x>0

       row$=rows$(1,x-1)

       rows$=rows$(x+1)

       libname$=row.basename$

       libpath$=row.dirname$

       libcount=row.count

       x=pos($0a$=rows$)

wend

drop object obj