Anonymous Session provides the ability to offer tokens to store assets against like Zoom call ids.
You can also combine them with passwords as an extra security step.
QuickReference
Anonymous Session provides the ability to offer tokens to store assets against like Zoom call ids.
You can also combine them with passwords as an extra security step.
The barcode scanner makes use of the Quagga javascript library.
We have chosen to only capture EAN barcodes at present.
Quick Start Code
In your pages page.js file, include the barcode scanner script. If you want to keep a reference to your barcode scanner, add a variable to hold it.
OpenForum.includeScript("/OpenForum/AddOn/BarcodeScanner/BarcodeScanner.js");
var barcodeScanner;
Within your OpenForum init function, request a barcode scanner, passing it the element where you want the video feed to be displayed and the function you want called when a barcode has been detected.
If you want to keep a reference to your barcode scanner, add a callback function to recieve a reference to the created scanner.
The scanner will immediately start scanning for barcodes. When one is found, the callback function will be called passing in the code.
The content editor is a two panel editor. It is intended for pages that just contain text and images rather than those that are part of a web application.
Content Editor - Quick Reference
The content editor is a two panel editor. It is intended for pages that just contain text and images rather than those that are part of a web application.
Editor Panels
The two panels can be resized by dragging the separator between them.
The left hand panel gives an over view of the page being edited at the top, a list of pages to edit in the middle and a view of the image library at the bottom.
The right hand panel gives a view of the page content for editing. At the top is the title as shown on the browser tab and below are the sections of the page.
Adding Blocks
Above and below each page section are + buttons that will add content either above or below existing elements of content. There are also up and down buttons to move the content up and down the sections in the page.
On clicking + you are presented with a list of blocks that can be added to the page.
For simple formatted text and images, the WYSIWYG block allows you to enter text and type set it adding text styles, links and lists etc.
Images
To add an image into the WYSIWYG panel, find the image in the image library in the left hand pane or select to upload one. Drag the image into the WYSIWYG content block. Click on it to set any alternative text or its placement in the text.
A number of other block types are available that add either configurable page elements or page layouts.
Preview and Publish
To see how your page will look once published, click on Preview at the top of the left hand pane. This will save the page to a space for unpublished pages and make the page visible in another browser tab. Saving the page once the preview has been opened will automatically update the preview tab.
Once you are happy with your page, click Publish and the page will be published to the live area of your website.
New Pages
To create a new page select Create A New Page. In the popup window, enter the new pages title and optionally select a category. Select Create New Page and a new page will be added to the list and the editor for the page opened.
The data transformer is intended take text from the input and transform it, then place it in the output. No data is shared or sent to our server unless you choose to save it. To do this you will need to have an Electric Llama Company account
To perform a data transformation, you have to do all the hard work, by writing Javascript in the code editor at the bottom of the screen.
The text in the input editor is made available as the variable input and the text in the output can be set by setting the output variable.
A number of useful transformer examples are given below to get you started.
If you have an Electric Llama Company account, you can save any transformers you have written for later use, alternatively each text editor has a download to desktop option.
You can drag and drop files into any of the editors on the transformer page.
Data Transformer - Quick Reference
The data transformer is intended take text from the input and transform it, then place it in the output. No data is shared or sent to our server unless you choose to save it. To do this you will need to have an Electric Llama Company account
To perform a data transformation, you have to do all the hard work, by writing Javascript in the code editor at the bottom of the screen.
The text in the input editor is made available as the variable input and the text in the output can be set by setting the output variable.
A number of useful transformer examples are given below to get you started.
If you have an Electric Llama Company account, you can save any transformers you have written for later use, alternatively each text editor has a download to desktop option.
You can drag and drop files into any of the editors on the transformer page.
Examples
The Data Transformer has a few helper functions to make common actions easier.
These functions are provided by an instance of the DataTransformer or DT for short.
Often input data is based on a record per line.
DT.toLines( data, rowSeparator ) converts the data to an array of lines of text.
Returns a string array
If you don't supply data, it defaults to input
If you don't supply rowSeparator, it defaults to new line
DT.linesToString( lines, separator ) converts an array of lines to a string
lines should be an array of strings
If you don't supply separator, it defaults to new line
DT.forEachLine( fn, data) apply a function to each line of text in the data.
Returns an array of strings
If you don't supply data, it defaults to the input
DT.toTable(data, rowSeparator, cellSeparator);
Returns an array of arrays
If you don't supply rowSeparator, it defaults to new line
If you don't supply cellSeparator, it defaults to tab
The Publisher AddOn enables the publishing of packages from the developent area of a site into prodction.
All text files in the package (page and sub pages) are translated before publishing. References to Development are removed so a path /MyPage becomes /MyPage
Deletions are not processed immediately, but placed in a deletions script file to run later.
QuickReference
The Publisher AddOn enables the publishing of packages from the developent area of a site into prodction.
All text files in the package (page and sub pages) are translated before publishing. References to Development are removed so a path /MyPage becomes /MyPage
Deletions are not processed immediately, but placed in a deletions script file to run later.
Special files
development-translation.sjs - This is an optional script that will translate the contents of files. The script is passed the contents of each text file as the variable data and is expected to return the transformed version.
publish-config.json - Can contain a list of files to exclude eg. { excludedFiles: 'do-not-publish.me' }
do-not-release.txt - Marks a page as not to be published. Should contain text stateing the reason
process-deletions.sjs - A script that is generated with files to be deleted after publishing
release-notes.html.fragment - Notes generated during the release are saved here
var DB = js.getObject("/OpenForum/AddOn/SQL","DB.sjs");
DB.setAlias("your database name");
// Create a new DB object for each database you need access to
Create a Simple DB Select
var sql = {
action: "select",
table: "my_table",
columns:
"column_a", "column_b"
};
var rows = DB.execute( SQL );
Create a DB Select that returns all columns
var sql = {
action: "select",
table: "my_table"
};
var rows = DB.execute( SQL );
The OpenForum tester is based around a simple idea. There are three stages to a test:
given some set of data
when some event happens
then some output is expected
The testing frame work is based on a fluent style interface. Methods are chained together to create meaningful flows of actions.
OpenForum Tester - A Quick Reference
The OpenForum tester is based around a simple idea. There are three stages to a test:
given some set of data
when some event happens
then some output is expected
The testing frame work is based on a fluent style interface. Methods are chained together to create meaningful flows of actions.
To create a simple test on the server, first import the test framework:
var tester = js.getObject("/OpenForum/AddOn/Tester","Test.sjs");
Then create or load something to test:
var MyTestClass = function() {
this.increment = function(value) {
return value+1;
};
this.decrement = function(value) {
return value+1;
};
};
Currently you have to wrap the function under test in a method that returns the method under test when requsted.
function testMyClass(fn) {
return function (input) {
return MyTestClassfn(input);
};
}
Optionally log a mesage about the test
tester.log("Running tests for MyTestClass");
Then create a test instance:
tester.unitTest("Can add one to a number").
given(122).
when( testMyClass("increment") ).
thenOutputEquals(123).
run();
Then create another test instance:
tester.unitTest("Can subtract one from a number").
given(123).
when( testMyClass("decrement") ).
thenOutputEquals(122).
run();
You can then retrieve the results and display them.
var results = tester.getResults();
tester.log("Completed example tests Tests:"+results.tests+" Passed:"+results.passed+" Failed:"+results.failed);
Test Results
Starting
MESSAGE: Started Tester v0.002 The Jester
MESSAGE: Running tests for MyTestClass
PASSED: Can add one to a number
FAILED: Can subtract one from a number. Input (123)
Expected (122)
but found (124)
MESSAGE: Completed example tests Tests:2 Passed:1 Failed:1
As you can see, the second test failed as it is incrementing rather than decrementing.