marketo/silverstripe-script-genie

This package is abandoned and no longer maintained. No replacement package was suggested.

A SilverStripe module which produces static JSON data files from specific models on-demand or onAfter{Write,Publish}

Installs: 116

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 15

Forks: 1

Open Issues: 0

Type:silverstripe-module

1.2.0 2017-04-06 20:39 UTC

This package is auto-updated.

Last update: 2024-03-15 17:17:42 UTC


README

Configuration

ObjectType:
  regenerate_scripts: true:
  extensions:
    - GenieExtension

Injector:
  GenieScriptService:
    properties:
      typeConfiguration:
        MyClass:
          target_filename: # just use 'default' if no other needed
            generator: AClassName # Implementing getList
            filter: 
              "arrayKey:GreaterThan": "filter value"
              "CalculatedField": %strtotime|-2 weeks|Y-m-d H:i:s% 
              "OtherProp": "with things"
            order: FieldName DESC, Other ASC
            limit: 10
            template: TemplateName
            fields: ID,LastEdited,Title [optional, otherwise all fields returned]
            rootObject: TopLevelJsObjectName [optional, defaults to Window]

For CalculatedField above, the system will calculate an appropriate value based on the provided arguments, in this case it will perform a strototime on '-2 weeks', followed by converting it to a date in the provided format.

If you're wanting to generate the list completely by hand, create a class that implements the getList method that returns an SS_List (ie DataList or ArrayList) .