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 4-41 lists actuate.reportexplorer.File functions.
actuate.reportexplorer.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;}
actuate.reportexplorer.File.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;}
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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;}
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.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( );
actuate.reportexplorer.File.setAccessType
Syntax
void File.setAccessType(string accessType)
Sets the access type.
Parameters
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")
actuate.reportexplorer.File.setDescription
Syntax
void File.setDescription(string description)
Sets the description from the file.
Parameters
description
String. The description.
Example
To clear a file’s description, use code similar to the following:
file.setDescription("");
actuate.reportexplorer.File.setFileType
Syntax
void File.setFileType(string fileType)
Sets the file type for this file.
Parameters
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");}
actuate.reportexplorer.File.setId
Syntax
void File.setId(integer id)
Sets the file ID value.
Parameters
id
Integer. A file ID number.
Example
To set a file’s ID to 42, use code similar to the following:
file.setId("42");
actuate.reportexplorer.File.setName
Syntax
void File.setName(string name)
Sets the name of the file.
Parameters
name
String. The name.
Example
To set a file’s name to releasedates, use code similar to the following:
file.setName("releasedates");
actuate.reportexplorer.File.setOwner
Syntax
void File.setOwner(string owner)
Sets the name of the owner.
Parameters
owner
String. A user name.
Example
To set a file’s owner to Administrator, use code similar to the following:
file.setOwner("Administrator");
actuate.reportexplorer.File.setPageCount
Syntax
void File.setPageCount(integer pageCount)
Sets the number pages in the file.
Parameters
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);}
actuate.reportexplorer.File.setSize
Syntax
void File.setSize(integer size)
Sets the size of the file.
Parameters
size
Integer. File size in bytes.
Example
To set a file’s size to 0, use code similar to the following:
file.setSize(0);
actuate.reportexplorer.File.setTimeStamp
Syntax
void File.setTimeStamp(string timeStamp)
Sets the time stamp.
Parameters
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( ));
actuate.reportexplorer.File.setUserPermissions
Syntax
void File.setUserPermissions(string userPermissions)
Sets the user permissions.
Parameters
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( ));
actuate.reportexplorer.File.setVersion
Syntax
void File.setVersion(integer version)
Sets the version of the file.
Parameters
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);
actuate.reportexplorer.File.setVersionName
Syntax
void File.setVersionName(string versionName)
Sets the version name.
Parameters
versionName
String. A version name.
Example
To set a file’s version name to 2004, use code similar to the following:
file.setVersionName("2004");

Additional Links:

Copyright Actuate Corporation 2012