contentbox.models.updates

Class UpdateService

lucee.Component
    extended by contentbox.models.updates.UpdateService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Manages Auto-Updates in ContentBox

Class Attributes:
  • threadsafe
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any appPath


    • access = public
    • returntype = any
    • inject = coldbox:setting:ApplicationPath
    true false
    any moduleConfig


    • access = public
    • returntype = any
    • inject = coldbox:moduleConfig:contentbox
    true false
    any patchesLocation
          The patches location in the system.

    • access = public
    • returntype = any
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    any zipUtil


    • access = public
    • returntype = any
    • inject = zipUtil@cb
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    UpdateService activateORMUpdate()
         Activate ORM Update.
    struct applyUpdateFromUpload(any fileField)
         Apply updates from an upload, return results struct: [error,logInfo].
    struct applyUpdateFromURL(string downloadURL)
         Apply updates from a download URL, return results struct: [error,logInfo].
    private boolean applyUpdateOnDisk(any log)
         Apply an already downloaded update on disk.
    any buildUpdater()
         Build an updater CFC from our patch locations.
    UpdateService deactivateORMUpdate()
         Deactivate ORM Update.
    boolean downloadPatch(string downloadURL, any log)
         Download the patch from URL and mark it as ok or not.
    boolean extractPatch(string filename, any log)
         extract a patch in the updates location.
    string getAppPath()
    string getModuleConfig()
    string getPatchesLocation()
    string getWirebox()
    string getZipUtil()
    boolean isNewVersion(string cVersion, string nVersion)
         Check for version updates.
    void onDIComplete()
         onDIComplete startup the layouting services.
    private struct parseSemanticVersion(string version)
         Parse the semantic version.
    any processRemovals(any path, any log)
         Process patch update removals if any.
    any processUpdates(any path, any log)
         Process updated files.
    any setAppPath(any appPath)
    any setModuleConfig(any moduleConfig)
    any setPatchesLocation(any patchesLocation)
    any setWirebox(any wirebox)
    any setZipUtil(any zipUtil)
    struct uploadUpdate(any fileField)
         Upload an update file to disk.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    appPath

    property any appPath

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:setting:ApplicationPath
    serializable - true

    moduleConfig

    property any moduleConfig

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleConfig:contentbox
    serializable - true

    patchesLocation

    property any patchesLocation

    The patches location in the system

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

    wirebox

    property any wirebox

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

    zipUtil

    property any zipUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - zipUtil@cb
    serializable - true

    Method Detail

    activateORMUpdate

    public UpdateService activateORMUpdate()

    Activate ORM Update


    applyUpdateFromUpload

    public struct applyUpdateFromUpload(any fileField)

    Apply updates from an upload, return results struct: [error,logInfo]

    Parameters:
    fileField - The file field form name
    Returns:
    results struct : { error:boolean, logInfo:string }

    applyUpdateFromURL

    public struct applyUpdateFromURL(string downloadURL)

    Apply updates from a download URL, return results struct: [error,logInfo]

    Parameters:
    downloadURL - The download URL for the update
    Returns:
    results struct : { error:boolean, logInfo:string }

    applyUpdateOnDisk

    private boolean applyUpdateOnDisk(any log)

    Apply an already downloaded update on disk

    Parameters:
    log - The log buffer

    buildUpdater

    public any buildUpdater()

    Build an updater CFC from our patch locations

    Returns:
    contentbox.models.updates.IUpdate

    deactivateORMUpdate

    public UpdateService deactivateORMUpdate()

    Deactivate ORM Update


    downloadPatch

    public boolean downloadPatch(string downloadURL, any log)

    Download the patch from URL and mark it as ok or not

    Parameters:
    downloadURL - The download URL
    log - The log file buffer

    extractPatch

    public boolean extractPatch(string filename, any log)

    extract a patch in the updates location

    Parameters:
    filename - The file to extract
    log - The log file buffer

    getAppPath

    public string getAppPath()


    getModuleConfig

    public string getModuleConfig()


    getPatchesLocation

    public string getPatchesLocation()


    getWirebox

    public string getWirebox()


    getZipUtil

    public string getZipUtil()


    isNewVersion

    public boolean isNewVersion(string cVersion, string nVersion)

    Check for version updates

    Parameters:
    cVersion - The current version of the system
    nVersion - The newer version received

    onDIComplete

    public void onDIComplete()

    onDIComplete startup the layouting services


    parseSemanticVersion

    private struct parseSemanticVersion(string version)

    Parse the semantic version

    Parameters:
    version - The version string
    Returns:
    struct:{major,minor,revision,beid,buildid}

    processRemovals

    public any processRemovals(any path, any log)

    Process patch update removals if any

    Parameters:
    path - The path of the patch
    log - The log buffer

    processUpdates

    public any processUpdates(any path, any log)

    Process updated files

    Parameters:
    path - The path of the patch
    log - The log buffer

    setAppPath

    public any setAppPath(any appPath)

    Parameters:
    appPath

    setModuleConfig

    public any setModuleConfig(any moduleConfig)

    Parameters:
    moduleConfig

    setPatchesLocation

    public any setPatchesLocation(any patchesLocation)

    Parameters:
    patchesLocation

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    setZipUtil

    public any setZipUtil(any zipUtil)

    Parameters:
    zipUtil

    uploadUpdate

    public struct uploadUpdate(any fileField)

    Upload an update file to disk

    Parameters:
    fileField - The file field on the form