Class actuate.reportexplorer.File
Description
A reference object for displaying and controlling a file reference.
Constructor
Syntax
actuate.reportexplorer.File( )
Constructs a new File object.
Function summary
Table 44‑41 lists actuate.reportexplorer.File functions.
Table 44‑41 actuate.reportexplorer.File functions
Function
Description
Gets the accessType value for this File
Gets the description value for this File
Gets the fileType value for this File
getId( )
Gets the id value for this File
Gets the name value for this File
Gets the owner value for this File
Gets the pageCount value for this File
Gets the size value for this File
Gets the timeStamp value for this File
Gets the userPermissions value for this File
Gets the version value for this File
Gets the versionName value for this File
Sets the accessType value for this File
Sets the description value for this File
Sets the fileType value for this File
setId( )
Sets the id value for this File
Sets the name value for this File
Sets the owner value for this File
Sets the pageCount value for this File
Sets the size value for this File
Sets the timeStamp value for this File
Sets the userPermissions value for this File
Sets the version value for this File
Sets the versionName value for this File
getAccessType
Syntax
string File.getAccessType( )
Gets the access type.
Returns
String. Either "private" or "shared" according to whether the file has been shared or not.
Example
To stop a script from running if a file is private, use code similar to the following:
if(file.getAccessType( ) == "private"){ return;}
getDescription
Syntax
string File.getDescription( )
Gets the description from the file.
Returns
String. The description.
Example
To stop a script from running if a file does not have a description, use code similar to the following:
if(file.getDescription( ) == (null || "")){ return;}
getFileType
Syntax
string File.getFileType( )
Gets the file extension for this File.
Returns
String. The file type.
Example
To store the file extension of the File object file in a variable called type, use code similar to the following:
var type = file.getFileType( );
getId
Syntax
integer File.getId( )
Gets the file ID value.
Returns
Integer. The file ID.
Example
To store the file id of the File object file in a variable called id, use code similar to the following:
var id = file.getFileId( );
getName
Syntax
string File.getName( )
Gets the name of the file.
Returns
String. The file name.
Example
To store the name of the File object file in a variable called name, use code similar to the following:
var name = file.getName( );
getOwner
Syntax
string File.getOwner( )
Gets the name of the File’s owner.
Returns
String. The owner’s name
Example
To store the name of the owner of the File object file in a variable called owner, use code similar to the following:
var owner = file.getOwner( );
getPageCount
Syntax
integer File.getPageCount( )
Gets the number pages in the file, if applicable.
Returns
Integer. The number of pages.
Example
To halt a script if the number of pages exceeds 100 in the file referenced by the File object largefile, use code similar to the following:
if (largefile.getPageCount( ) > 100) {return;}
getSize
Syntax
integer File.getSize( )
Gets the size value for this File.
Returns
Integer.
Example
To store a File object size in a variable called size, use code similar to the following:
var size = file.getSize( );
getTimeStamp
Syntax
string File.getTimeStamp( )
Gets the time stamp for this file.
Returns
String. A date and time of the file’s creation or last modification.
Example
To store the time stamp for the file referenced by the File object oldfile in a variable called timestamp, use code similar to the following:
var timestamp = oldfile.getTimeStamp( );
getUserPermissions
Syntax
string File.getUserPermissions( )
Gets the user permissions.
Returns
String. The current user’s permissions for this file.
Example
To store a file’s permissions in the permissions variable, use code similar to the following:
var permissions = file.getUserPermissions( );
getVersion
Syntax
integer File.getVersion( )
Gets the version of the file.
Returns
Integer. The version.
Example
To store the file version in the version variable, use code similar to the following:
var version = file.getVersion( );
getVersionName
Syntax
string File.getVersionName( )
Gets the version name.
Returns
String. The version name.
Example
To store a version name in the version variable, use code similar to the following:
var version = file.getVersionName( );
setAccessType
Syntax
void File.setAccessType(string accessType)
Sets the access type.
Parameter
accessType
String. "private" or "shared" indicating whether the file has been shared or not.
Example
To make a file private, use code similar to the following:
file.setAccessType("private")
setDescription
Syntax
void File.setDescription(string description)
Sets the description from the file.
Parameter
description
String. The description.
Example
To clear a file’s description, use code similar to the following:
file.setDescription("");
setFileType
Syntax
void File.setFileType(string fileType)
Sets the file type for this file.
Parameter
fileType
String. The file type, which is a file extension.
Example
To assign a file’s type if none is assigned, use code similar to the following:
if (file.getFileType == null) {file.setFileType("txt");}
setId
Syntax
void File.setId(integer id)
Sets the file ID value.
Parameter
id
Integer. A file ID number.
Example
To set a file’s ID to 42, use code similar to the following:
file.setId("42");
setName
Syntax
void File.setName(string name)
Sets the name of the file.
Parameter
name
String. The name.
Example
To set a file’s name to releasedates, use code similar to the following:
file.setName("releasedates");
setOwner
Syntax
void File.setOwner(string owner)
Sets the name of the owner.
Parameter
owner
String. A user name.
Example
To set a file’s owner to Administrator, use code similar to the following:
file.setOwner("Administrator");
setPageCount
Syntax
void File.setPageCount(integer pageCount)
Sets the number pages in the file.
Parameter
pageCount
Integer. The number of pages, which must be less than the current number of pages.
Example
To set a File object’s page to 100 if available, use code similar to the following:
if(file.getPageCount( ) > 100) {file.setPageCount(100);}
setSize
Syntax
void File.setSize(integer size)
Sets the size of the file.
Parameter
size
Integer. File size in bytes.
Example
To set a file’s size to 0, use code similar to the following:
file.setSize(0);
setTimeStamp
Syntax
void File.setTimeStamp(string timeStamp)
Sets the time stamp.
Parameter
timeStamp
String. A date and time of the file’s creation or last modification.
Example
To set a file’s time stamp to the current time, use code similar to the following:
var currenttime = new Date( );
file.setTimeStamp(currenttime.toLocaleString( ));
setUserPermissions
Syntax
void File.setUserPermissions(string userPermissions)
Sets the user permissions.
Parameter
userPermissions
String. The current user’s permissions for this file.
Example
To apply the user permissions for file1 to file2, use code similar to the following:
file2.setUserPermissions(file1.getUserPermissions( ));
setVersion
Syntax
void File.setVersion(integer version)
Sets the version of the file.
Parameter
version
Integer. The version.
Example
To set the file’s version to 1 for the first version, use code similar to the following:
file.setVersion(1);
setVersionName
Syntax
void File.setVersionName(string versionName)
Sets the version name.
Parameter
versionName
String. A version name.
Example
To set a file’s version name to 2004, use code similar to the following:
file.setVersionName("2004");