coldbox.system.web.flash

Class AbstractFlashScope

lucee.Component
    extended by coldbox.system.web.flash.AbstractFlashScope
Direct Known Subclasses:
ClientFlash , ColdboxCacheFlash , MockFlash , SessionFlash

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- An abstract flash scope that can be used to build ColdBox Flash scopes. In order to build scopes you must implement the following methods: - clearFlash() A method that will destroy the flash storage - saveFlash() A method that will be called before relocating so the storage can be saved - flashExists() A method that tells ColdBox if the storage exists and if it has content to inflate - getFlash() A method that returns the flash storage All these methds can use any of the concrete methods below. The most important one is the getScope() method which will most likely be called by the saveFlash() method in order to persist the flashed map.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any controller
          ColdBox Controller.

    • access = public
    • returntype = any
    true false
    any defaults
          Flash Defaults.

    • access = public
    • returntype = any
    true false
    any properties
          Flash Properties.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any controller, struct defaults='[runtime expression]')
          Constructor.
    Method Summary
    any clear()
         Clear the temp flash scope and remove all data.
    any clearFlash()
         Clear the flash storage.
    any discard([string keys=''])
         Keep all or a single flash temp variable alive for another relocation.
    boolean exists(any name)
         Check if an object exists in flash scope.
    boolean flashExists()
         Checks if the flash storage exists and IT HAS DATA to inflate.
    any get(any name, [any defaultValue])
         Get an object from flash scope.
    string getController()
    string getDefaults()
    struct getFlash()
         Get the flash storage structure to inflate it.
    string getKeys()
         Get a list of all the objects in the temp flash scope.
    string getProperties()
    any getProperty(any property)
         Get a named property.
    struct getScope()
         Get the flash temp request storage used throughout a request until flashed at the end of a request.
    private any getUtil()
         Get utility object.
    any inflateFlash()
    boolean isEmpty()
         Check if the flash scope is empty or not.
    any keep([string keys=''])
         Keep all or a single flash temp variable alive for another relocation.
    any persistRC([any include=''], [any exclude=''], [boolean saveNow='false'])
         Persist keys from the coldbox request collection in flash scope.
    any propertyExists(any property)
         Check a named property.
    any put(string name, any value, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])
         Keep all or a single flash temp variable alive for another relocation.
    any putAll(struct map, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])
         Put a map of name-value pairs into the flash scope.
    any remove(any name, [boolean saveNow='false'])
         Remove an object from flash scope.
    any removeFlash()
         Remove the entire flash storage.
    any saveFlash()
         Save the flash storage in preparing to go to the next request.
    any setController(any controller)
    any setDefaults(any defaults)
    any setProperties(any properties)
    any setProperty(any property, any value)
         Set a named property.
    numeric size()
         Get the size of the items in flash scope.
    private any statusMarks([string keys=''], [boolean keep='true'])
         Change the status marks of the temp scope entries.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any controller, struct defaults='[runtime expression]')

    Constructor

    Parameters:
    controller - ColdBox Controller
    defaults - Default flash data packet for the flash RAM object=[scope,properties,inflateToRC,inflateToPRC,autoPurge,autoSave]

    Property Detail

    controller

    property any controller

    ColdBox Controller

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    defaults

    property any defaults

    Flash Defaults

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    properties

    property any properties

    Flash Properties

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    clear

    public any clear()

    Clear the temp flash scope and remove all data

    Returns:
    AbstractFlashScope

    clearFlash

    public any clearFlash()

    Clear the flash storage

    Returns:
    AbstractFlashScope

    discard

    public any discard([string keys=''])

    Keep all or a single flash temp variable alive for another relocation

    Parameters:
    keys - The keys in the flash RAM that you want to mark to be kept until the next request
    Returns:
    AbstractFlashScope

    exists

    public boolean exists(any name)

    Check if an object exists in flash scope

    Parameters:
    name - The name of the value

    flashExists

    public boolean flashExists()

    Checks if the flash storage exists and IT HAS DATA to inflate.


    get

    public any get(any name, [any defaultValue])

    Get an object from flash scope

    Parameters:
    name - The name of the value
    defaultValue - The default value if the scope does not have the object"

    getController

    public string getController()


    getDefaults

    public string getDefaults()


    getFlash

    public struct getFlash()

    Get the flash storage structure to inflate it.


    getKeys

    public string getKeys()

    Get a list of all the objects in the temp flash scope


    getProperties

    public string getProperties()


    getProperty

    public any getProperty(any property)

    Get a named property

    Parameters:
    property - The property name

    getScope

    public struct getScope()

    Get the flash temp request storage used throughout a request until flashed at the end of a request.


    getUtil

    private any getUtil()

    Get utility object


    inflateFlash

    public any inflateFlash()

    Returns:
    AbstractFlashScope

    isEmpty

    public boolean isEmpty()

    Check if the flash scope is empty or not


    keep

    public any keep([string keys=''])

    Keep all or a single flash temp variable alive for another relocation

    Parameters:
    keys - The keys in the flash RAM that you want to mark to be kept until the next request
    Returns:
    AbstractFlashScope

    persistRC

    public any persistRC([any include=''], [any exclude=''], [boolean saveNow='false'])

    Persist keys from the coldbox request collection in flash scope. If using exclude, then it will try to persist the entire rc but excluding. Including will only include the keys passed

    Parameters:
    include - MUTEX: A list of request collection keys you want to persist
    exclude - MUTEX: A list of request collection keys you want to exclude from persisting. If sent, then we inspect all rc keys.
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    Returns:
    AbstractFlashScope

    propertyExists

    public any propertyExists(any property)

    Check a named property

    Parameters:
    property - The property name

    put

    public any put(string name, any value, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])

    Keep all or a single flash temp variable alive for another relocation

    Parameters:
    name - The name of the value
    value - The value to store
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    keep - Whether to mark the entry to be kept after saving to the flash storage.
    inflateToRC - Whether this flash variable is inflated to the Request Collection or not
    inflateToPRC - Whether this flash variable is inflated to the Private Request Collection or not
    autoPurge - Flash memory auto purges variables for you. You can control this purging by saying false to autoPurge
    Returns:
    AbstractFlashScope

    putAll

    public any putAll(struct map, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])

    Put a map of name-value pairs into the flash scope

    Parameters:
    map - The map of data to flash
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    keep - Whether to mark the entry to be kept after saving to the flash storage.
    inflateToRC - Whether this flash variable is inflated to the Request Collection or not
    inflateToPRC - Whether this flash variable is inflated to the Private Request Collection or not
    autoPurge - Flash memory auto purges variables for you. You can control this purging by saying false to autoPurge
    Returns:
    AbstractFlashScope

    remove

    public any remove(any name, [boolean saveNow='false'])

    Remove an object from flash scope

    Parameters:
    name - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    saveNow - true
    Returns:
    AbstractFlashScope

    removeFlash

    public any removeFlash()

    Remove the entire flash storage

    Returns:
    SessionFlash

    saveFlash

    public any saveFlash()

    Save the flash storage in preparing to go to the next request

    Returns:
    SessionFlash

    setController

    public any setController(any controller)

    Parameters:
    controller

    setDefaults

    public any setDefaults(any defaults)

    Parameters:
    defaults

    setProperties

    public any setProperties(any properties)

    Parameters:
    properties

    setProperty

    public any setProperty(any property, any value)

    Set a named property

    Parameters:
    property - The property name
    value - The value
    Returns:
    AbstractFlashScope

    size

    public numeric size()

    Get the size of the items in flash scope


    statusMarks

    private any statusMarks([string keys=''], [boolean keep='true'])

    Change the status marks of the temp scope entries

    Parameters:
    keys
    keep