• cbyrne

    Finally got a working solution. Posted the basic custom module below for anyone else who comes across this thread.

    define(['angular', 'require'], function(angular, require) {
    'use strict';
    var userModule = angular.module('userModule', ['maUiApp']);
    userModule.component('userComponent', {
        bindings: {},
        controller: ['$scope', '$http', 
            function($scope, $http){
                $scope.msg = null;
                $scope.sendPost = function(point_xid, date_from, date_to, email_recipients){
                    var from = JSON.stringify(date_from);
                    var to = JSON.stringify(date_to);
                    var emails = JSON.stringify(email_recipients);
                    var script = "send_HTTP_debug(point_xid, " + from + ", " + to + ", " + emails + ")"
                    var address= "/rest/v2/script/run";
                    var content = {'Content-Type': 'application/json;charset=UTF-8'};
                    var data = {
                          "context": [
                              "contextUpdate": true,
                              "variableName": "point_xid",
                              "xid": point_xid
                          "logLevel": "DEBUG",
                          "permissions": [
                          "script": script,
                          "wrapInFunction": true
                    function success(response){$scope.msg=response;};
                    function error(response){$scope.msg=response;};
                    $http.post(address, JSON.stringify(data),content).then(success, error);
        template: '\
        <div flex layout="column">\
            <md-input-container md-no-float="">\
                <ma-point-list ng-model="point" query="query_tmpVal" start="start_tmpVal" limit="limit_tmpVal" sort="sort_tmpVal"></ma-point-list>\
            <div flex layout="row">\
                <md-input-container style="flex-grow:1">\
                    <ma-date-picker ng-model="date_from" mode="date" format="DD/MM/YYYY"></ma-date-picker>\
                <div style="width="10vw">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>\
                <md-input-container style="flex-grow:1">\
                    <ma-date-picker ng-model="date_to" mode="date" format="DD/MM/YYYY"></ma-date-picker>\
                <ma-email-recipients ng-model="email_recipients"></ma-email-recipients>\
            <md-button class="md-primary md-raised" ng-click="sendPost(point.xid, date_from, date_to, email_recipients)">Request Report</md-button>\
    return userModule;
    }); // define

    posted in User help read more
  • cbyrne

    @terrypacker Just updated the module and saw that you added the filename regex, thanks so much!

    posted in User help read more
  • cbyrne

    Perfect, thanks @terrypacker! I'll try that and update this post.

    update 1:
    The H2 database shell doesn't recognise LIKE in CREATE TABLE. It may not be supported, The H2 command info for CREATE DATABASE doesn't show LIKE - https://www.h2database.com/html/commands.html#create_table

    update 2
    I just did a DELETE FROM EVENTS; instead.

    So yeah, there might have been a few too many events... 12 million. The database has gone from ~6 Gb to 76 Mb.

    posted in User help read more