Document Manager Group Object

DocumentManagerGroup objects collect together sets of files to display to the user.

DocumentManagerGroup Properties

.name v1.3

The name of the group, as displayed to the user. If the group is a folder backed group changing the name of the group has no effect on the name of the folder.

.groupType v1.3

A string indicating how the group is defined and behaves. Read-only. The return value is one of the following:

Returns

For Group Type

'folder'

Folder backed groups always contain exactly the files found in the backing folder on the file system.

'user'

User defined groups store alias records to arbitrary files found anywhere on the file system. Files can be added/removed from the group as the user pleases.

'search'

Search groups filter all managed files and display only those files that match the saved search criteria.

'special'

Special groups are those built-in to Nisus Writer with special behaviors, eg: Open Files or Style Library.

.allowsAddingFiles v1.3

Returns @true if arbitrary files can be added to the group using the addFilePath command, otherwise returns @false. Read-only.

.searchQuery v1.3

If the group is a search group returns the FileQuery object that is used to match files to be displayed in the group. If not a search group, returns the @undefined value. Read-only.

DocumentManagerGroup Commands

.allFilePaths v1.3

Returns an array of paths to all the files that should be displayed in the group. Not all of the returned files may exist and the order of the array is undefined.

Warning: Using this command may not be cheap. Especially if the group is a search group, then this command will start the search query and wait for it to complete, which can take some time. If you want to do other tasks while the search is running, check the searchQuery property and run the search manually.

.addFilePath path, [behavior] v1.3

Adds a file to the group. How the file is added to the group depends on the group type:

Group Type

Behavior

'folder'

By default the source file is moved to the destination backing folder. Optionally this command can take a second argument which is a string that specifies the behavior and should be either 'move', 'copy', or  'link'. Using the link behavior creates a symlink in the destination folder that points to the source file.

'user'

Will always capture an alias record for the added file.

'search'

You cannot add files to search groups and this command is ignored.

'special'

Some special groups allow adding files to them. Those that do are backed by a folder and also accept a second behavior string argument.


Previous Chapter
Document Manager
<<  index  >>
 
Next Chapter
FileQuery Object