This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Home > Class Reference > %SYS namespace > %ZEN.Dialog.fileSelect

%ZEN.Dialog.fileSelect

class %ZEN.Dialog.fileSelect extends %ZEN.Dialog.standardDialog

This dialog page displays a file selection window listing directories and files on the server. This is intended for use within server portal pages.
To use this dialog, the current user must hold USE privileges on one of the following resources:
%Admin_Manage,%Admin_Operate,%Admin_Secure,%Development
For an Ensemble enabled namespace, resource %Ens_ViewFileSystem is required.

How to Use This Dialog

Example invoking the fileSelect dialog to open in a popup window:

  	zenLaunchPopupWindow('%ZEN.Dialog.fileSelect.cls?Dir='+encodeURIComponent(Dir)+'&wildcard='+wildcard,'FileSelect','resizable,width=600,height=700');
  

If Dir is null, then Caché Manager directory is used when the dialog is opened. If Dir contains a partial directory, then the last valid level of directory, if can be found, is used. If Dir contains a filename or a partical name without a directory then the Cache Manager directory is used for the filename. When OK is pressed, whatever is shown in the File name field is returned to the calling page.

If you are opening the dialog as a popup window such as shown in the above example, then you should have an onPopupAction method defined on the calling page. In the following example, a Zen control "FileName" is defined on your calling page, and upon returning from the fileSelect dialog by clicking "OK", the returned value will be set into your Zen control "FileName":

  ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
  {
  	if (action == "ok") {
  		if (popupName == "FileSelect") zen("FileName").setValue(value);
  	}
  }
  

ISC Developers: Please use caution when modifying logic in this class. Your change needs to be tested in Windows, Unix, and VMS for all cases.

Property Inventory (Including Private)

Method Inventory (Including Private)

Parameters

parameter DOMAIN = %ZEN;
Inherited description: Localization domain
parameter VALIDATEXML = 0;
Inherited description: Validate user pages

Properties (Including Private)

property DefaultDirectory as %ZEN.Datatype.string;
Composed Default Directory path. After much checking, this is the final default directory that is used as default.
Property methods: DefaultDirectoryDisplayToLogical(), DefaultDirectoryGet(), DefaultDirectoryIsValid(), DefaultDirectoryLogicalToDisplay(), DefaultDirectoryLogicalToOdbc(), DefaultDirectoryNormalize(), DefaultDirectorySet()
property DirFile as %ZEN.Datatype.string (ZENURL = "Dir");
Original Directory path and/or filename passed in. If null is passed in, then manager directory will be used.
Property methods: DirFileDisplayToLogical(), DirFileGet(), DirFileIsValid(), DirFileLogicalToDisplay(), DirFileLogicalToOdbc(), DirFileNormalize(), DirFileSet()
property FileName as %ZEN.Datatype.string (ZENURL = "File");
Original File name passed in (optional)
Property methods: FileNameDisplayToLogical(), FileNameGet(), FileNameIsValid(), FileNameLogicalToDisplay(), FileNameLogicalToOdbc(), FileNameNormalize(), FileNameSet()
property isVMS as %Boolean [ InitialExpression = "0" ];
Property methods: isVMSDisplayToLogical(), isVMSGet(), isVMSIsValid(), isVMSLogicalToDisplay(), isVMSLogicalToXSD(), isVMSNormalize(), isVMSSet(), isVMSXSDToLogical()
property isWINDOWS as %Boolean [ InitialExpression = "0" ];
Property methods: isWINDOWSDisplayToLogical(), isWINDOWSGet(), isWINDOWSIsValid(), isWINDOWSLogicalToDisplay(), isWINDOWSLogicalToXSD(), isWINDOWSNormalize(), isWINDOWSSet(), isWINDOWSXSDToLogical()
property showdirectoryonly as %ZEN.Datatype.string (ZENURL = "showdirectoryonly");
Whether to show directory only or with files
Property methods: showdirectoryonlyDisplayToLogical(), showdirectoryonlyGet(), showdirectoryonlyIsValid(), showdirectoryonlyLogicalToDisplay(), showdirectoryonlyLogicalToOdbc(), showdirectoryonlyNormalize(), showdirectoryonlySet()

Methods (Including Private)

method %OnAfterCreatePage() as %Status
This callback is called after the server-side page object and all of its children are created.
Subclasses can override this to add, remove, or modify items within the page object model, or to provide values for controls.
method %OnGetSubtitle() as %String
Get the (localized) subtitle string for the dialog. This should be implemented in a subclass.
method %OnGetTitle() as %String
Get the (localized) title string for the dialog. This should be implemented in a subclass.
method BuildDrive(Output drives As %String, drive As %String, Output lastexistingdir As %String)
Get drive list
classmethod CheckFileExt(File, FileType) as %String [ ZenMethod ]
Check if file has extension. If not, add it.
classmethod CheckPath(Path As %String, File As %String, FileType As %String) as %String [ ZenMethod ]
****** The Following Methods are Called from UtilFile*.csp Also ******
If user enters a directory but without drive, we add the drive here. This overrides the "Look in" directory. For Windows and VMS only.
classmethod CheckRootDir(File As %String) as %String [ ZenMethod ]
Check if user entered filename ends with ":". If yes, then we should add "/" or [000000] to make valid drive.
For Windows: If user enters : without \ then we add it here.
For VMS: If user enters : without any [directory] then add [000000] here.
If we don't do this then directory would be invalid.
classmethod GetDirFile(LookinDir, File, FileType) as %String [ ZenMethod ]
Construct new new file name, if it does not have dir yet
method GetDirectory(Dir As %String) as %String [ ZenMethod ]
Check if user entered directory exists. Return a valid directory.
classmethod GetSubDir(LookinDir, Dir) as %String [ ZenMethod ]
Construct new directory given the Look in directory and selected directory from the middle frame
method GetViewContents(ByRef pParms As %String, Output pContents As %String, ByRef pHeader As %String) as %Status
Build file and directory list
classmethod IsTopLevel(currentDir, newDir) as %Boolean [ ZenMethod ]
This is mainly for Windows. e.g. If you are already on the D:\ drive then don't go up to C:\.
method RebuildLookin(Dir, wildcard) [ ZenMethod ]
Construct new directory given the Look in directory and selected directory from the middle frame
clientmethod changeDrive(thisobj) [ Language = javascript ]
User selected a different directory from "Lookin" drop-down. If FileName is available, add to the newly selected directory.
clientmethod changeFileType() [ Language = javascript ]
This method refreshes the contents with the current file type and directory/file name
clientmethod changeView(viewtype) [ Language = javascript ]
changeView
clientmethod getDialogValue() [ Language = javascript ]
Inherited description: Get the value that will be applied when the user presses the OK button. This is implemented by subclasses.
clientmethod hasdelimiter(file) [ Language = javascript ]
clientmethod itemClicked(viewobj) [ Language = javascript ]
User clicked an item. We put it in the File name field. User can OK it or [Enter] to drill down.
clientmethod itemSelected(viewobj) [ Language = javascript ]
User has selected a new item (double click).
clientmethod ondialogFinish(action) as %Boolean [ Language = javascript ]
This callback, if defined, is called when the user presses the OK or Apply action buttons. If this returns false, then the action is cancelled.
Check FileName value. If user entered a path, then return as is.
If user enters something but not including a path, then add selected path in front of it.
It is possible that user is entering a sub directory or file, therefore as a curtersey we add the path for them.
In addition, if user enters a filename without a file extension, then we add the filetype choice from the drop-down.
clientmethod ondialogStart() [ Language = javascript ]
This callback, if defined, is called when the dialog page is loaded.
clientmethod onkeydownHandler(evt) [ Language = javascript ]
Examine if user hit the Return key. If yes, start the search. This method handles all keydown events on the window. Works for both IE and NS.
clientmethod onresizeHandler() [ Language = javascript ]
This client event, if present, is fired when the page is resized.
clientmethod reloadLookin(driveobj, tvalue) [ Language = javascript ]
clientmethod upOneLevel() [ Language = javascript ]
up one level

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)