<commit_before>/*
 *  Copyright 2014 <NAME>
 *
 *  Licensed under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.estatio.lease.fixture.seed;

import java.io.IOException;
import java.util.Objects;

import javax.inject.Inject;

import com.google.common.io.Resources;

import org.apache.commons.io.Charsets;

import org.apache.isis.applib.fixturescripts.FixtureScript;

import org.incode.module.docfragment.dom.impl.DocFragment;
import org.incode.module.docfragment.dom.impl.DocFragmentRepository;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum DocFragmentData {

    InvoiceDescriptionIta(
            "org.estatio.dom.invoice.Invoice", "description", "/ITA",
            "Invoice_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescriptionIta(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/ITA",
            "InvoiceItem_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescriptionFra(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/FRA",
            "InvoiceItem_description_FRA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },

    // for demos only
    InvoiceItemDescription_DemoGbr(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/GBR",
            "InvoiceItem_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescription_DemoNld(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/NLD",
            "InvoiceItem_description_FRA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },
    ;

    @Getter
    private final String objectType;
    @Getter
    private final String name;
    @Getter
    private final String atPath;
    private final String templateResourceName;

    public String getTemplateText() {
        return read(templateResourceName);<commit_msg>EST-891: adds demo DocFragmentData for prototyping<commit_after>/*
 *  Copyright 2014 <NAME>
 *
 *  Licensed under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.estatio.lease.fixture.seed;

import java.io.IOException;
import java.util.Objects;

import javax.inject.Inject;

import com.google.common.io.Resources;

import org.apache.commons.io.Charsets;

import org.apache.isis.applib.fixturescripts.FixtureScript;

import org.incode.module.docfragment.dom.impl.DocFragment;
import org.incode.module.docfragment.dom.impl.DocFragmentRepository;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum DocFragmentData {

    InvoiceDescriptionIta(
            "org.estatio.dom.invoice.Invoice", "description", "/ITA",
            "Invoice_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescriptionIta(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/ITA",
            "InvoiceItem_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescriptionFra(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/FRA",
            "InvoiceItem_description_FRA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },

    // for demos only
    InvoiceDescription_DemoGbr(
            "org.estatio.dom.invoice.Invoice", "description", "/GBR",
            "Invoice_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceDescription_DemoNld(
            "org.estatio.dom.invoice.Invoice", "description", "/NLD",
            "Invoice_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            // subclasses are necessary because
            // FixtureScriptsSpecificationProvider's MultipleExecutionPolicy set to ONCE_PER_CLASS
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescription_DemoGbr(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/GBR",
            "InvoiceItem_description_ITA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },
    InvoiceItemDescription_DemoNld(
            "org.estatio.dom.invoice.InvoiceItem", "description", "/NLD",
            "InvoiceItem_description_FRA.docFragment.txt") {
        public FixtureScript script() {
            return new DocFragmentScript() {};
        }
    },
    ;

    @Getter
    private final String objectType;
    @Getter
    private final String name;
    @Getter
    private final String atPath;
    private final String templateResourceName;

    public String getTemplateText() {
        return read(templateResourceName);
{'fraction_non_alphanumeric': 0.09162266305123448, 'fraction_numerical': 0.0027115741401455688, 'mean_word_length': 2.814915623298857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '835361', 'n_tokens_mistral': 1920, 'n_tokens_neox': 1885, 'n_words': 460}