Lava Additions

Version 1.0.0

Last Updated Dec 29, 2017

Table Of Contents


Naming Conventions

In order to prevent naming collisions in the future, all Lava filters provided by this plug-in are prefixed with BBM_ to ensure uniqueness. Below you can find all the filters that are made available once this plug-in has been installed.

Array Filters

BBM_AddToArray

Add a new item to an existing array, also will create a new array if null or '' is used as the source array. While the examples use simple strings, you can add anything to an array - even entity objects such as a Group or Person.

BBM_Distinct

Takes an array as input and returns the distinct (unique) elements of the array.

BBM_GroupBy

Takes a collection of items and groups them by the specified property tree value. The returned data is a dictionary. Each distinct property tree value is represented as a key in the dictionary with all associated original objects as values of that key. As such, when iterating through the result you need to use the PropertyToKeyValue filter to get the key and the array of values.

BBM_OrderBy

Orders a collection of elements by the specified property tree and returns a new collection in that order.

You can sort by multiple keys, for example you can sort by LastName and then by FirstName at once. Each key to sort by is separated by a comma (,) character. Each sorted property can change the default order from ascending (default) to descending by appending a space and desc to the property name.

For example, if you specify the order by property of FirstName desc then the collection will be sorted by FirstName and the results will be returned in descending order.

BBM_RemoveFromArray

Take a collection of objects and return a new collection which does not contain the specified value.

Dictionary Filters

BBM_AddToDictionary

Takes an existing (or empty) dictionary and returns a new dictionary with the added key and value. Can pass null or '' to initialize a new dictionary.

BBM_AllKeysFromDictionary

Retrieves all keys that exist in the dictionary object and returns them in an array.

BBM_RemoveFromDictionary

Removes the specified key from a dictionary of keys and values.

Miscellaneous

BBM_AddHttpHeader

Adds a header to the HTTP Response of the current web request.

BBM_Function

Calls a function that was previously defined with the bbm_function command. The function to be called is the first parameter and any extra parameters are passed on to the function itself.

Function calls can be recursive, so you can call a single method from within itself. This can be useful when you want to build a list-item tree of groups.

BBM_RunLava

Executes Lava that is inside a string. Very useful when taking Lava from an Attribute Value and wanting to process it to display it to the user. The Lava executes in the same security context as the existing Lava. So if you have Entity Commands enabled in your parent Lava then the child Lava you execute will also be able to run Entity Commands.

Commands

bbm_function

Defines a function that can be called later in the Lava code. The first parameter is the name of the function to define. Further parameters define the names of variables that will be provided to the function body. The data passed to the filter is made available as the Input variable.