<commit_before>/*
 * Copyright 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 * Please see distribution for license.
 */
$.register_module({
    name: 'og.views.config_forms.viewdefinition',
    dependencies: [
        'og.api.rest',
        'og.common.util.ui',
        'og.views.config_blocks.Constraints'
    ],
    obj: function () {
        var ui = og.common.util.ui, Form = ui.Form, blocks = og.views.config_blocks, api = og.api.rest,
            RMDF = 'resultModelDefinition',     SETS = 'calculationConfiguration',
            DEFP = 'defaultProperties',         COLS = 'portfolioRequirementsBySecurityType',
            RLTR = 'resolutionRuleTransform',   SPEC = 'specificRequirement',
            SPVN = 'valueName',                 SPCT = 'computationTargetIdentifier',
            SPTT = 'computationTargetType',     REQS = 'portfolioRequirement',
            SECU = 'securityType',              REQO = 'requiredOutput',
            CONS = 'constraints',               WITH = 'with',
            WTHO = 'without',                   INDX = '<INDEX>',
            ORDS = 'columns',                   EMPT = '<EMPTY>',
            type_map = [
                ['0',                                                                           Form.type.STR],
                [[SETS, 'name'].join('.'),                                                      Form.type.STR],
                // <constraints>
                [[SETS, INDX, DEFP, WITH, '*'].join('.'),                                       Form.type.IND],
                [[SETS, INDX, DEFP, WITH, '*', 'optional'].join('.'),                           Form.type.IND],
                [[SETS, INDX, DEFP, WITH, '*', '*'].join('.'),                                  Form.type.STR],
                [[SETS, INDX, DEFP, WTHO].join('.'),                                            Form.type.STR],
                [[SETS, INDX, DEFP, WTHO, '*'].join('.'),                                       Form.type.STR],
                // </constraints>
                [[SETS, INDX, 'name'].join('.'),                                                Form.type.STR],
                // <constraints>
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*'].join('.'),               Form.type.IND],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*', 'optional'].join('.'),   Form.type.IND],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*', '*'].join('.'),          Form.type.STR],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WTHO].join('.'),                    Form.type.STR],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WTHO, '*'].join('.'),               Form.type.STR],
                // </constraints>
                [[SETS, INDX, COLS, INDX, REQS, INDX, REQO].join('.'),                          Form.type.STR],
                [[SETS, INDX, COLS, INDX, SECU].join('.'),                                      Form.type.STR],
                [[SETS, INDX, RLTR, '0'].join('.'),                                             Form.type.STR],
                [[SETS, INDX, RLTR, '*'].join('.'),                                             Form.type.STR],
                [[SETS, INDX, SPEC, INDX, SPCT].join('.'),                                      Form.type.STR],
                [[SETS, INDX, SPEC, INDX, SPTT].join('.'),                                      Form.type.STR],
                // <constraints>
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*'].join('.'),                           Form.type.IND],
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*', 'optional'].join('.'),               Form.type.IND],
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*', '*'].join('.'),                      Form.type.STR],
                [[SETS, INDX, SPEC, INDX, CONS, WTHO].join('.'),                                Form.type.STR],
                [[SETS, INDX, SPEC, INDX, CONS, WTHO, '*'].join('.'),                           Form.type.STR],
                // </constraints>
                // <new column order stuff>
                [[SETS, ORDS, EMPT, INDX, 'header'].join('.'),                                  Form.type.STR],
                [[SETS, ORDS, EMPT, INDX, 'valueName'].join('.'),                               Form.type.STR],
                    // <constraints>
                [[SETS, ORDS, EMPT, INDX, CONS, WITH, '*'].join('.'),                           Form.type.IND],
                [[SETS, ORDS, EMPT, INDX, CONS, WITH, '*', 'optional'].join('.'),               Form.type.IND],
                [[SETS, ORDS, EMPT, INDX, CONS, WITH, '*', '*'].join('.'),                      Form.type.STR],
                [[SETS, ORDS, EMPT, INDX, CONS, WTHO].join('.'),                                Form.type.STR],
                [[SETS, ORDS, EMPT, INDX, CONS, WTHO, '*'].join('.'),                           Form.type.STR],
                    // </constraints>
                // </new column order stuff>
                [[SETS, INDX, SPEC, INDX, SPVN].join('.'),                                      Form.type.STR],
                [[SETS, RLTR, '0'].join('.'),                                                   Form.type.STR],
                [[SETS, SPEC, INDX, SPCT].join('.'),                                            Form.type.STR],
                [[SETS, SPEC, INDX, SPTT].join('.'),                                            Form.type.STR],
                [[SETS, SPEC, INDX, SPVN].join('.'),                                            Form.type.STR],
                ['currency',                                                                    Form.type.STR],
                ['identifier',                                                                  Form.type.STR],
                ['maxDeltaCalcPeriod',                                                          Form.type.LNG],
                ['maxFullCalcPeriod',                                                           Form.type.LNG],
                ['minDeltaCalcPeriod',                                                          Form.type.LNG],
                ['minFullCalcPeriod',                                                           Form.type.LNG],
                ['name',                                                                        Form.type.STR],
                ['persistent',                                                                  Form.type.IND],
                [[RMDF, 'aggregatePositionOutputMode'].join('.'),                               Form.type.STR],
                [[RMDF, 'positionOutputMode'].join('.'),                                        Form.type.STR],
                [[RMDF, 'primitiveOutputMode'].join('.'),                                       Form.type.STR],
                [[RMDF, 'securityOutputMode'].join('.'),                                        Form.type.STR],
                [[RMDF, 'tradeOutputMode'].join('.'),                                           Form.type.STR],
                ['uniqueId',                                                                    Form.type.STR],
                [['user', 'ipAddress'].join('.'),                                               Form.type.STR],
                [['user', 'userName'].join('.'),                                                Form.type.STR]
            ].reduce(function (acc, val) {return acc[val[0]] = val[1], acc;}, {}),
            arr = function (obj) {return arr && $.isArray(obj) ? obj : typeof obj !== 'undefined' ? [obj] : [];},
            constructor;
        constructor = function (config) {
            var load_handler = config.handler || $.noop, selector = config.selector,
                loading = config.loading || $.noop, deleted = config.data.template_data.deleted, is_new = config.is_new,
                orig_name = config.data.template_data.name,
                resource_id = config.data.template_data.object_id,
                save_new_handler = config.save_new_handler, save_handler = config.save_handler, prefix = 'viewdef',<commit_msg>View def editor works with column definitions<commit_after>/*
 * Copyright 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 * Please see distribution for license.
 */
$.register_module({
    name: 'og.views.config_forms.viewdefinition',
    dependencies: [
        'og.api.rest',
        'og.common.util.ui',
        'og.views.config_blocks.Constraints'
    ],
    obj: function () {
        var ui = og.common.util.ui, Form = ui.Form, blocks = og.views.config_blocks, api = og.api.rest,
            RMDF = 'resultModelDefinition',     SETS = 'calculationConfiguration',
            DEFP = 'defaultProperties',         COLS = 'portfolioRequirementsBySecurityType',
            RLTR = 'resolutionRuleTransform',   SPEC = 'specificRequirement',
            SPVN = 'valueName',                 SPCT = 'computationTargetIdentifier',
            SPTT = 'computationTargetType',     REQS = 'portfolioRequirement',
            SECU = 'securityType',              REQO = 'requiredOutput',
            CONS = 'constraints',               WITH = 'with',
            WTHO = 'without',                   INDX = '<INDEX>',
            ORDS = 'columns',                   EMPT = '<EMPTY>',
            type_map = [
                ['0',                                                                           Form.type.STR],
                [[SETS, 'name'].join('.'),                                                      Form.type.STR],
                // <constraints>
                [[SETS, INDX, DEFP, WITH, '*'].join('.'),                                       Form.type.IND],
                [[SETS, INDX, DEFP, WITH, '*', 'optional'].join('.'),                           Form.type.IND],
                [[SETS, INDX, DEFP, WITH, '*', '*'].join('.'),                                  Form.type.STR],
                [[SETS, INDX, DEFP, WTHO].join('.'),                                            Form.type.STR],
                [[SETS, INDX, DEFP, WTHO, '*'].join('.'),                                       Form.type.STR],
                // </constraints>
                [[SETS, INDX, 'name'].join('.'),                                                Form.type.STR],
                // <constraints>
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*'].join('.'),               Form.type.IND],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*', 'optional'].join('.'),   Form.type.IND],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WITH, '*', '*'].join('.'),          Form.type.STR],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WTHO].join('.'),                    Form.type.STR],
                [[SETS, INDX, COLS, INDX, REQS, INDX, CONS, WTHO, '*'].join('.'),               Form.type.STR],
                // </constraints>
                [[SETS, INDX, COLS, INDX, REQS, INDX, REQO].join('.'),                          Form.type.STR],
                [[SETS, INDX, COLS, INDX, SECU].join('.'),                                      Form.type.STR],
                [[SETS, INDX, RLTR, '0'].join('.'),                                             Form.type.STR],
                [[SETS, INDX, RLTR, '*'].join('.'),                                             Form.type.STR],
                [[SETS, INDX, SPEC, INDX, SPCT].join('.'),                                      Form.type.STR],
                [[SETS, INDX, SPEC, INDX, SPTT].join('.'),                                      Form.type.STR],
                // <constraints>
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*'].join('.'),                           Form.type.IND],
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*', 'optional'].join('.'),               Form.type.IND],
                [[SETS, INDX, SPEC, INDX, CONS, WITH, '*', '*'].join('.'),                      Form.type.STR],
                [[SETS, INDX, SPEC, INDX, CONS, WTHO].join('.'),                                Form.type.STR],
                [[SETS, INDX, SPEC, INDX, CONS, WTHO, '*'].join('.'),                           Form.type.STR],
                // </constraints>
                // <new column order stuff>
                [[SETS, INDX, ORDS, EMPT, INDX, 'header'].join('.'),                            Form.type.STR],
                [[SETS, INDX, ORDS, EMPT, INDX, 'valueName'].join('.'),                         Form.type.STR],
                    // <constraints>
                [[SETS, INDX, ORDS, EMPT, INDX, CONS, WITH, '*'].join('.'),                     Form.type.IND],
                [[SETS, INDX, ORDS, EMPT, INDX, CONS, WITH, '*', 'optional'].join('.'),         Form.type.IND],
                [[SETS, INDX, ORDS, EMPT, INDX, CONS, WITH, '*', '*'].join('.'),                Form.type.STR],
                [[SETS, INDX, ORDS, EMPT, INDX, CONS, WTHO].join('.'),                          Form.type.STR],
                [[SETS, INDX, ORDS, EMPT, INDX, CONS, WTHO, '*'].join('.'),                     Form.type.STR],
                // </constraints>
                // </new column order stuff>
                [[SETS, INDX, SPEC, INDX, SPVN].join('.'),                                      Form.type.STR],
                [[SETS, RLTR, '0'].join('.'),                                                   Form.type.STR],
                [[SETS, SPEC, INDX, SPCT].join('.'),                                            Form.type.STR],
                [[SETS, SPEC, INDX, SPTT].join('.'),                                            Form.type.STR],
                [[SETS, SPEC, INDX, SPVN].join('.'),                                            Form.type.STR],
                ['currency',                                                                    Form.type.STR],
                ['identifier',                                                                  Form.type.STR],
                ['maxDeltaCalcPeriod',                                                          Form.type.LNG],
                ['maxFullCalcPeriod',                                                           Form.type.LNG],
                ['minDeltaCalcPeriod',                                                          Form.type.LNG],
                ['minFullCalcPeriod',                                                           Form.type.LNG],
                ['name',                                                                        Form.type.STR],
                ['persistent',                                                                  Form.type.IND],
                [[RMDF, 'aggregatePositionOutputMode'].join('.'),                               Form.type.STR],
                [[RMDF, 'positionOutputMode'].join('.'),                                        Form.type.STR],
                [[RMDF, 'primitiveOutputMode'].join('.'),                                       Form.type.STR],
                [[RMDF, 'securityOutputMode'].join('.'),                                        Form.type.STR],
                [[RMDF, 'tradeOutputMode'].join('.'),                                           Form.type.STR],
                ['uniqueId',                                                                    Form.type.STR],
                [['user', 'ipAddress'].join('.'),                                               Form.type.STR],
                [['user', 'userName'].join('.'),                                                Form.type.STR]
            ].reduce(function (acc, val) {return acc[val[0]] = val[1], acc;}, {}),
            arr = function (obj) {return arr && $.isArray(obj) ? obj : typeof obj !== 'undefined' ? [obj] : [];},
            constructor;
        constructor = function (config) {
            var load_handler = config.handler || $.noop, selector = config.selector,
                loading = config.loading || $.noop, deleted = config.data.template_data.deleted, is_new = config.is_new,
                orig_name = config.data.template_data.name,
                resource_id = config.data.template_data.object_id,
                save_new_handler = config.save_new_handler, save_handler = config.save_handler, prefix = 'viewdef',
{'fraction_non_alphanumeric': 0.15256014805675508, 'fraction_numerical': 0.001110425663170882, 'mean_word_length': 0.9731012658227848, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 113, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2283061', 'n_tokens_mistral': 4369, 'n_tokens_neox': 3998, 'n_words': 834}