Package: File\Ingest
This abstract class encapsulates all the behavior that facilitates file ingest based on the assumption that each file can be retrieved via a string containing both the name and location of that file.
Applies to: URLs, file paths on a server. Does not apply to: direct HTTP uploads.
Also, if the original filename is not properly represented by the sourceidentifier (incorrect file extension, etc.), a more accurate filename can beprovided via the ‘filename’ attribute.
Set of arbitrary options to use when ingesting files.
Set of validators implementing Zend_Validate_Interface.
The current validated file MIME type.
The ‘source’ key of the file info is parsed out by default.
Parameters: |
|
---|---|
Returns: | string |
Normalize a file info array.
Files can be represented as one of the following:
Parameters: |
|
---|---|
Returns: | array Formatted info array. |
Modify the set of info about each file to ensure that it is compatible with the Zend_Validate_File_* validators.
Parameters: |
|
---|---|
Returns: | array |
Retrieve the original filename.
By default, this is stored as the ‘name’ attribute in the array.
Parameters: |
|
---|---|
Returns: | string |
Transfer the file to Omeka.
Parameters: |
|
---|---|
Returns: | string Path to file in Omeka. |
Transfer the file from the original location to its destination.
Examples would include transferring the file via wget, or making use ofstream wrappers to copy the file.
Parameters: |
|
---|---|
Returns: | void |
Determine whether or not the file source is valid.
Examples of this would include determining whether a URL exists, orwhether read access is available for a given file.
Parameters: |
|
---|---|
Returns: | void |
Set the item to use as a target when ingesting files.
Parameters: |
|
---|---|
Returns: | void |
Factory to retrieve Omeka_File_Ingest_* instances.
Parameters: |
|
---|---|
Returns: | Omeka_File_Ingest_AbstractIngest |
Set options for ingesting files.
Parameters: |
|
---|---|
Returns: | void |
Ingest based on arbitrary file identifier info.
If this is an array that has a ‘metadata’ key, that should be an arrayrepresenting element text metadata to assign to the file. SeeActsAsElementText::addElementTextsByArray() for more details.
Parameters: |
|
---|---|
Returns: | array Ingested file records. |
Determine whether or not to ignore file ingest errors. Based on ‘ignore_invalid_files’, which is false by default.
Returns: | boolean |
---|
Log any exceptions that are thrown as a result of attempting to ingest invalid files.
These are logged as warnings because they are being ignored by the script,so they don’t actually kill the file ingest process.
Parameters: |
|
---|---|
Returns: | void |
Insert a File record corresponding to an ingested file and its metadata.
Parameters: |
|
---|---|
Returns: | File |
Retrieve the destination path for the file to be transferred.
This will generate an archival filename in order to prevent naming conflicts between ingested files.
This should be used as necessary by Omeka_File_Ingest_AbstractIngestimplementations in order to determine where to transfer any given file.
Parameters: |
|
---|---|
Returns: | string |
Add Zend Framework file validators.
Emulates the way Zend Framework adds validators.
Parameters: |
|
---|---|
Returns: | Omeka_File_Ingest_AbstractIngest |
Validate a file that has been transferred to Omeka.
Implementations of Omeka_File_Ingest_AbstractIngest should use this to validate the uploaded file based on user-defined security criteria.
Important: $fileInfo may need to contain the following keys in order to work with particular Zend_Validate_File_* validation classes:
Parameters: |
|
---|---|
Returns: | boolean True if valid, otherwise throws an exception. |