<commit_before>package ua.com.fielden.platform.web.test.server;

import java.util.LinkedHashSet;
import java.util.Optional;

import ua.com.fielden.platform.basic.IValueMatcherWithContext;
import ua.com.fielden.platform.dom.DomElement;
import ua.com.fielden.platform.dom.InnerTextElement;
import ua.com.fielden.platform.sample.domain.TgMessageMap;
import ua.com.fielden.platform.utils.ResourceLoader;
import ua.com.fielden.platform.web.interfaces.IRenderable;
import ua.com.fielden.platform.web.view.master.api.IMaster;
import ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder;

/**
 * An entity master that represents a chart for {@link TgMessageMapMaster}.
 *
 * @author TG Team
 *
 * @param <T>
 */
public class TgMessageMapMaster implements IMaster<TgMessageMap> {

    private final IRenderable renderable;

    public TgMessageMapMaster() {
        final LinkedHashSet<String> importPaths = new LinkedHashSet<>();
        // importPaths.add("gis/tg-gis-component");
        // importPaths.add("gis/message/tg-message-gis-component");
        // importPaths.add("gis/polygon/tg-polygon-gis-component");
        // importPaths.add("gis/realtimemonitor/tg-realtime-monitor-gis-component");
        importPaths.add("gis/stop/tg-stop-gis-component");
        importPaths.add("gis/tg-map");

        final int funcActionSeq = 0; // used for both entity and property level functional actions
        final String prefix = ",\n";
        final int prefixLength = prefix.length();
        final StringBuilder primaryActionObjects = new StringBuilder();
        final DomElement tgMessageMap = new DomElement("tg-map")
                .attr("entity", "[[_currBindingEntity]]")
                .attr("retrieved-entities", "{{retrievedEntities}}")
                .attr("retrieved-totals", "{{retrievedTotals}}");

        final String primaryActionObjectsString = primaryActionObjects.toString();

        final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.html")
                .replace("<!--@imports-->", SimpleMasterBuilder.createImports(importPaths))
                .replace("@entity_type", TgMessageMap.class.getSimpleName())
                .replace("<!--@tg-entity-master-content-->", tgMessageMap.toString())
                .replace("//generatedPrimaryActions", primaryActionObjectsString.length() > prefixLength ? primaryActionObjectsString.substring(prefixLength)
                        : primaryActionObjectsString)
                // use: L.GIS.GisComponent, L.GIS.MessageGisComponent, L.GIS.PolygonGisComponent, L.GIS.RealtimeMonitorGisComponent, L.GIS.StopGisComponent
                .replace("//@ready-callback", "self.classList.remove('canLeave'); "
                        + "new L.GIS.StopGisComponent(self.querySelector('.map'), self.querySelector('.progress'), self.querySelector('.progress-bar'));")
                .replace("@noUiValue", "false")
                .replace("@saveOnActivationValue", "true");

        renderable = new IRenderable() {
            @Override
            public DomElement render() {
                return new InnerTextElement(entityMasterStr);
            }
        };
    }

    @Override
    public IRenderable render() {
        return renderable;
    }

    @Override
    public Optional<Class<? extends IValueMatcherWithContext<TgMessageMap, ?>>> matcherTypeFor(final String propName) {
        return Optional.empty();
    }

}
<commit_msg>#230 Added 'unsupported' implementation of actionConfig method to make custom TgMessageMapMaster compilable.<commit_after>package ua.com.fielden.platform.web.test.server;

import java.util.LinkedHashSet;
import java.util.Optional;

import ua.com.fielden.platform.basic.IValueMatcherWithContext;
import ua.com.fielden.platform.dom.DomElement;
import ua.com.fielden.platform.dom.InnerTextElement;
import ua.com.fielden.platform.sample.domain.TgMessageMap;
import ua.com.fielden.platform.utils.ResourceLoader;
import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig;
import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind;
import ua.com.fielden.platform.web.interfaces.IRenderable;
import ua.com.fielden.platform.web.view.master.api.IMaster;
import ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder;

/**
 * An entity master that represents a chart for {@link TgMessageMapMaster}.
 *
 * @author <NAME>
 *
 * @param <T>
 */
public class TgMessageMapMaster implements IMaster<TgMessageMap> {

    private final IRenderable renderable;

    public TgMessageMapMaster() {
        final LinkedHashSet<String> importPaths = new LinkedHashSet<>();
        // importPaths.add("gis/tg-gis-component");
        // importPaths.add("gis/message/tg-message-gis-component");
        // importPaths.add("gis/polygon/tg-polygon-gis-component");
        // importPaths.add("gis/realtimemonitor/tg-realtime-monitor-gis-component");
        importPaths.add("gis/stop/tg-stop-gis-component");
        importPaths.add("gis/tg-map");

        final int funcActionSeq = 0; // used for both entity and property level functional actions
        final String prefix = ",\n";
        final int prefixLength = prefix.length();
        final StringBuilder primaryActionObjects = new StringBuilder();
        final DomElement tgMessageMap = new DomElement("tg-map")
                .attr("entity", "[[_currBindingEntity]]")
                .attr("retrieved-entities", "{{retrievedEntities}}")
                .attr("retrieved-totals", "{{retrievedTotals}}");

        final String primaryActionObjectsString = primaryActionObjects.toString();

        final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.html")
                .replace("<!--@imports-->", SimpleMasterBuilder.createImports(importPaths))
                .replace("@entity_type", TgMessageMap.class.getSimpleName())
                .replace("<!--@tg-entity-master-content-->", tgMessageMap.toString())
                .replace("//generatedPrimaryActions", primaryActionObjectsString.length() > prefixLength ? primaryActionObjectsString.substring(prefixLength)
                        : primaryActionObjectsString)
                // use: L.GIS.GisComponent, L.GIS.MessageGisComponent, L.GIS.PolygonGisComponent, L.GIS.RealtimeMonitorGisComponent, L.GIS.StopGisComponent
                .replace("//@ready-callback", "self.classList.remove('canLeave'); "
                        + "new L.GIS.StopGisComponent(self.querySelector('.map'), self.querySelector('.progress'), self.querySelector('.progress-bar'));")
                .replace("@noUiValue", "false")
                .replace("@saveOnActivationValue", "true");

        renderable = new IRenderable() {
            @Override
            public DomElement render() {
                return new InnerTextElement(entityMasterStr);
            }
        };
    }

    @Override
    public IRenderable render() {
        return renderable;
    }

    @Override
    public Optional<Class<? extends IValueMatcherWithContext<TgMessageMap, ?>>> matcherTypeFor(final String propName) {
        return Optional.empty();
    }
    
    @Override
    public EntityActionConfig actionConfig(final FunctionalActionKind actionKind, final int actionNumber) {
        throw new UnsupportedOperationException("Getting of action configuration is not supported.");
    }
}

{'fraction_non_alphanumeric': 0.12582247885054385, 'fraction_numerical': 0.0006714113065664026, 'mean_word_length': 3.1984216459977453, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2659396', 'n_tokens_mistral': 2119, 'n_tokens_neox': 2039, 'n_words': 346}