Class: IntentHandlerProviderByFile

IntentHandlerProviderByFile

new IntentHandlerProviderByFile(file, options)

Provides an intent from a single file Intent is loaded asynchronously but if a intent is requested before being loaded it will be immediately loaded and then skipped by the asychronous processing.
Parameters:
Name Type Description
file String The file that represnts an intent
options Object Options for the file loading
Properties
Name Type Attributes Default Description
preload Boolean <optional>
false Should the file be preloaded or only loaded when an intent is requested. It is generally more efficient to load only when the intent is requested.
filenameFormatter FileNameFormatter <optional>
DefaultJSFilenameFormatter The FilenameFormmatter to use to parse the filenames if there are no intents specified by getIntentsList() (or if getIntentsList is not implemented)
Implements:
Source:
See:

Methods

processItem(items, itemId, fileName, options)

Load the file and registers it based on the list of intents specified by IntentHandler.getIntentsList. If IntentHandler.getIntentsList does not exist the intent will be registered under the name of the file as parsed by the defined FilenameFormatter.
Parameters:
Name Type Description
items Map Map of the items being processed
itemId String The Id of the item to process
fileName String The name of the file being processed
options Object Any options that are being passed to the ItemProcessor (can be null)
Source:

processItems(items, fileName, options)

Load the file and registers it based on the list of intents specified by IntentHandler.getIntentsList. If IntentHandler.getIntentsList does not exist the intent will be registered under the name of the file as parsed by the defined FilenameFormatter.
Parameters:
Name Type Description
items Map Map of the item to process
fileName String The name of the file being processed
options Object Any options that are being passed to the ItemProcessor (can be null)
Source: