Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3353

Re: Message bundle getText fails in job scheduled xsjs

$
0
0

Trying to work out the correct specification of parameters to hardcode the locale (shame the text lib cannot taking them directly from the invoking job schedule), with


var textBundle = textAccess.loadBundle("<packagepath","messageBundle","hdbtextbundle","EN");


 

But this is incorrect, when text.xsjslib is trying to parse the arguments, connection becomes "EN" and obviously fails on the prepareStatement.

 

Appreciate any suggestions to correct issue.

 

 

 

function _TextBundle(currentFunction, packageName, objectName, objectSuffix, locale, connection) {

 

 

    var checkInput = function(functionName, inputName, inputValue) {

        if (typeof(inputValue) !== "string") {

            throw new Error("Function '" + functionName + "': Parameter '" + inputName + "' must be a string");

        }

    };

 

 

    checkInput(currentFunction, "package", packageName);

    checkInput(currentFunction, "object", objectName);

    checkInput(currentFunction, "suffix", objectSuffix);

    checkInput(currentFunction, "locale", locale);

 

 

    if (locale.contains('-')) {

        // The Repository uses underscore, while $.request.language (default locale) uses a dash

        locale = locale.replace('-', '_');

    }

 

 

    var texts = {};

 

 

    var statement = connection.prepareStatement("SELECT TEXT_ID, CONTENT FROM _SYS_REPO.TEXT_ACCESSOR(?, ?, ?, ?)");


Viewing all articles
Browse latest Browse all 3353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>