NAME

Liz::FileSet::File - module for File objects of the FileSet


SYNOPSIS

 use Liz::FileSet;
 $fileset = new Liz::FileSet;

 $file = $fileset->File;
 $file = $fileset->File( $fileID );

 $file->update;


EXAMPLES


DESCRIPTION

Provide object oriented access to files in a FileSet. Usually not accessed directly, but rather through the Liz::FileSet object and its File method.


BASIC METHODS


new

Create a new File object from a FileSet object.

Input Parameters

 1 Liz::FileSet object
 2 ID to created File object with
   (default: none = new file)
Output Parameters

 1 instantiated object
Note

It is not intended to call this method directly, but rather indirectly through the Liz::FileSet module.

Example

 $fileset = new Liz::FileSet;
 $file = $fileset->File;
 $file = $fileset->File( $fileID );


update

Update a File object in the Liz::FileSet database.

Output Parameters

 1 ID with which the object was updated (undef = error)
Example

 $fileID = $file->update;


delete

Delete a Liz::FileSet::File object from the database.

Output Parameters

 1 flag: whether action was successful
Example

 $file->delete;


CONTENT METHODS

The following methods allow you to inspect and/or change certain fields of the Liz::FileSet::File object.


AbsoluteFileName

Return the absolute filename of file, specified by ID. Usually used in connection with the AsIs function of Liz::Perl. Use method Contents to obtain the contents of the file.

Output Parameters

 1 absolute filename of the file
Example

 <PERL>
 AsIs( $file->AbsoluteFileName( $ID ) );
 </PERL>


Alt

Return or set the Alt (alternate text) information of the Liz::FileSet::File object.

Input Parameters

 1 new value of the Alt
   (default: no change)
Output Parameters

 1 current/old value of the Alt
Example

 $file->Alt( $alt );
 $alt = $file->Alt;


Author

Return or set the Author information of the Liz::FileSet::File object.

Input Parameters

 1 new name value of the Author
   (default: no change)
Output Parameters

 1 current/old name value of the Author
Example

 $file->Author( $author );
 $author = $file->Author;


AuthorID

Return the AuthorID information of the Liz::FileSet::File object. It is usually easier and more transparant to use the Author method instead.

Output Parameters

 1 current value of the AuthorID
Example

 $authorID = $file->AuthorID;


Bytes

Return the number of bytes that are used for the graphics file.

Output Parameters

 1 number of bytes for the graphics file
Example

 $bytes = $file->Bytes;


Contents

Return or set the contents of the Liz::FileSet::File object.

Input Parameters

 1 new value of the contents
   (default: no change)
Output Parameters

 1 current/old value of the contents
Example

 $file->Contents( $newfile );
 $oldfile = $file->Contents;


Copyright

Return or set the Copyright information of the Liz::FileSet::File object.

Input Parameters

 1 new name value of the Copyright
   (default: no change)
Output Parameters

 1 current/old name value of the Copyright
Example

 $file->Copyright( $copyright );
 $copyright = $file->Copyright;


CopyrightID

Return the CopyrightID information of the Liz::FileSet::File object. It is usually easier and more transparant to use the Copyright method instead.

Output Parameters

 1 current value of the CopyrightID
Example

 $copyrightID = $file->CopyrightID;


Created

Return the Created timestamp of the Liz::FileSet::File object.

Output Parameters

 1 current timestamp value of the Created date
Example

 $created = $file->Created;


Data

Return or set the Data (of which the meaning is entirely up to the developer) of the Liz::FileSet::File object. The maximum amount of data is 64K bytes.

Input Parameters

 1 new value of Data
   (default: no change)
Output Parameters

 1 current/old value of Data
Example

 $file->Data( $data );
 $data = $file->Data;


Extension

Return or set the Extension information of the Liz::FileSet::File object. The Extension information does not necessarily mean anything about the type of contents of the file. Use method MIMEType for that.

Input Parameters

 1 new value of the Extension
   (default: no change)
Output Parameters

 1 current/old value of the Extension
Example

 $file->Extension( 'txt' );
 $extension = $file->Extension;


ID

Return the ID of the Liz::FileSet::File object.

Output Parameters

 1 current ID of the object
Example

 $ID = $file->ID;


MIMEType

Return or set the MIMEType information of the Liz::FileSet::File object. The MIMEType information indicates the type of contents in the file. Use method Extension to set the extension of the file.

Input Parameters

 1 new value of the MIMEType
   (default: no change)
Output Parameters

 1 current/old value of the MIMEType
Example

 $file->MIMEType( 'text/plain' );
 $mimetype = $file->MIMEType;


Options

Return or set the Options information of the Liz::FileSet::File object.

Input Parameters

 1 new name value of the Options
   (default: no change)
Output Parameters

 1 current/old name value of the Options
Example

 $file->Options( $options );
 $options = $file->Options;


Published

Return or set the Published timestamp of the Liz::FileSet::File object.

Input Parameters

 1 new timestamp value of the Published date
   (default: no change)
Output Parameters

 1 current/old timestamp value of the Published date
Example

 $file->Published( $published );
 $published = $file->Published;


Status

Return or set the Status information of the Liz::FileSet::File object.

Input Parameters

 1 new value of the Status
   (default: no change)
Output Parameters

 1 current/old value of the Status
Example

 $file->Status( $status );
 $status = $file->Status;


Title

Return or set the Title information of the Liz::FileSet::File object.

Input Parameters

 1 new title
   (default: no change)
Output Parameters

 1 current/old title
Example

 $file->Title( 'The next best thing to honey' );
 $title = $file->Title;


Updated

Return the Updated timestamp of the Liz::FileSet::File object.

Output Parameters

 1 current timestamp value of the Updated date
Example

 $updated = $file->Updated;


Uploaded

Set a number of fields in the object according to a file that was just uploaded with Liz::Perl, as specified by the name of the field in the script with which the file was uploaded.

The following fields will be automatically set when possible: 1 Title (the complete filename on the originating filesystem) 2 Extension (the extension of the uploaded file) 3 File (the contents of the uploaded file)

Output Parameters

 1 number of bytes in the file
   (0 if failed)
Example

 $bytes = $file->Uploaded( 'file' );


HTML METHODS

The following methods create HTML of Liz::Perl's pseudo HTML from information in a fileset.


HREF

Return the (almost) complete HTML for the display of a link to the file.

Input Parameters

 1 ALT-text to be used
   (default: as specified with the file)
Output Parameters

 1 HTML for a link
Example

 <A <PRINT "$file->HREF">>file</A>


SRC

Return the (almost) complete HTML for the display of the file as an IMG.

Input Parameters

 1 ALT-text to be used
   (default: as specified with the file)
Output Parameters

 1 HTML for a link
Example

 <IMG <PRINT "$file->SRC">>


AUTHOR

Elizabeth Mattijsen ( lizperl@INC.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

Version 0.26, 30 September 1999

Now no longer adds Exporter to ISA: it wasn't necessary.

Version 0.25, 20 August 1999

Adapted methods new and update so that extra fields are now handled correctly.

Changed to new source typography.

Version 0.24, 6 July 1999

Added documentation for the Title object: it was somehow forgotten and basically only indirectly documented in the Uploaded method.

Version 0.23, 27 April 1999

Fixed problem in method update which would not return the ID of the object if the object was not changed.

Version 0.22, 18 April 1999

Fixed problem that would cause a new file object to be created if a new object was updated, then changed, and then updated again.

Version 0.21, 15 April 1999

Added support and documentation for HREF and SRC methods.

Added support for extra Data associated with the File object.

Fixed problem in Uploaded which would not set the changed flag, hence preventing a file from being updated if it was the only action on the File object.

Version 0.2, 11 March 1999

Renamed method File to the more appropriate Contents.

Added support for method AbsoluteFileName.

Added support for MIME-types with method MIMEType and updated other parts of the module accordingly.

Version 0.1, 10 March 1999

First version of this true Perl module. Copied from the Liz::PictureSet::Picture module, which is less general.