com.sebtools Build 12 Documentation: Managing Records

Managing Records

Manager.cfc has the following methods for managing records:

For the most part, these methods work the same as the corresponding methods in DataMgr. They do, however, offer a few additional benefits.

Getting Records

The "getRecord" and "getRecords" methods will potentially add a few columns to the query returned by the method.

For any file field with a folder, it will add a "***Path" field with the full file path and a "***URL" field with the browser path (assuming that "UploadURL" was passed to FileMgr when it was initialized.

For example, with the following field:

<field name="ImageFile" Label="Image/Photo" type="image" Length="180" folder="page-images" nameconflict="MAKEUNIQUE" />

The query returned by "getRecord" or "getRecords" would have an "ImageFilePath" column with the full system path to the file and an "ImageFileURL" column with the full relative browser path (starting with "/") to the file. The columns will only be added if they don't already exist in the query. If the "ImageFile" column is empty for a record, then each of the columns created for that record will also remain empty.

Removing Records

The "removeRecord" method operation will delete any associated files as well as the record.

Saving Records

The "saveRecord" method will rename any file field values to safe values. It will also resize any images and/or add thumbnail files as needed per the metadata definitions. If any file field is passed in as an empty string, Manager will delete that file.