<commit_before>package org.incode.module.document.dom.impl.docs;

import javax.activation.DataSource;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
import javax.inject.Inject;
import javax.jdo.JDOHelper;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.DatastoreIdentity;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Index;
import javax.jdo.annotations.Indices;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.VersionStrategy;

import org.apache.isis.applib.annotation.BookmarkPolicy;
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.services.factory.FactoryService;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.spec.AbstractSpecification2;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;

import org.incode.module.document.DocumentModule;
import org.incode.module.document.dom.impl.types.DocumentType;
import org.incode.module.document.dom.types.AtPathType;

import lombok.Getter;
import lombok.Setter;

@PersistenceCapable(
        identityType=IdentityType.DATASTORE,
        schema = "incodeDocuments"
)
@Inheritance(
        strategy = InheritanceStrategy.NEW_TABLE)
@DatastoreIdentity(
        strategy = IdGeneratorStrategy.NATIVE,
        column = "id")
@Version(
        strategy = VersionStrategy.VERSION_NUMBER,
        column = "version")
@Indices({
        @Index(
                name = "DocumentAbstract_type_atPath_IDX",
                members = { "type", "atPath" }
        ),
        @Index(
                name = "DocumentAbstract_atPath_type_IDX",
                members = { "atPath", "type" }
        ),
})
@DomainObject(
        editing = Editing.DISABLED
)
@DomainObjectLayout(
        bookmarking = BookmarkPolicy.AS_ROOT
)
public abstract class DocumentAbstract<T extends DocumentAbstract> implements Comparable<T> {

    //region > domain event classes
    public static abstract class PropertyDomainEvent<T> extends DocumentModule.PropertyDomainEvent<DocumentAbstract, T> { }
    public static abstract class CollectionDomainEvent<T> extends DocumentModule.CollectionDomainEvent<DocumentAbstract, T> { }
    public static abstract class ActionDomainEvent extends DocumentModule.ActionDomainEvent<DocumentAbstract> { }
    //endregion

    //region > constructors
    DocumentAbstract() {
        // for testing only
    }

    public DocumentAbstract(
            final DocumentType type,
            final String atPath) {
        this.type = type;
        this.atPath = atPath;
        this.sort = DocumentSort.EMPTY;
    }
    //endregion


    //region > type (property)
    public static class TypeDomainEvent extends PropertyDomainEvent<DocumentType> { }
    @Getter @Setter
    @Column(allowsNull = "false", name = "typeId")<commit_msg>EST-1866: adds HasAtPath to DocumentAbstract in order for categorisation tasks to be visible based on user atPath<commit_after>package org.incode.module.document.dom.impl.docs;

import javax.activation.DataSource;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
import javax.inject.Inject;
import javax.jdo.JDOHelper;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.DatastoreIdentity;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Index;
import javax.jdo.annotations.Indices;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.VersionStrategy;

import org.apache.isis.applib.annotation.BookmarkPolicy;
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.services.factory.FactoryService;
import org.apache.isis.applib.services.i18n.TranslatableString;
import org.apache.isis.applib.spec.AbstractSpecification2;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;

import org.isisaddons.module.security.dom.tenancy.HasAtPath;

import org.incode.module.document.DocumentModule;
import org.incode.module.document.dom.impl.types.DocumentType;
import org.incode.module.document.dom.types.AtPathType;

import lombok.Getter;
import lombok.Setter;

@PersistenceCapable(
        identityType=IdentityType.DATASTORE,
        schema = "incodeDocuments"
)
@Inheritance(
        strategy = InheritanceStrategy.NEW_TABLE)
@DatastoreIdentity(
        strategy = IdGeneratorStrategy.NATIVE,
        column = "id")
@Version(
        strategy = VersionStrategy.VERSION_NUMBER,
        column = "version")
@Indices({
        @Index(
                name = "DocumentAbstract_type_atPath_IDX",
                members = { "type", "atPath" }
        ),
        @Index(
                name = "DocumentAbstract_atPath_type_IDX",
                members = { "atPath", "type" }
        ),
})
@DomainObject(
        editing = Editing.DISABLED
)
@DomainObjectLayout(
        bookmarking = BookmarkPolicy.AS_ROOT
)
public abstract class DocumentAbstract<T extends DocumentAbstract> implements Comparable<T>, HasAtPath {

    //region > domain event classes
    public static abstract class PropertyDomainEvent<T> extends DocumentModule.PropertyDomainEvent<DocumentAbstract, T> { }
    public static abstract class CollectionDomainEvent<T> extends DocumentModule.CollectionDomainEvent<DocumentAbstract, T> { }
    public static abstract class ActionDomainEvent extends DocumentModule.ActionDomainEvent<DocumentAbstract> { }
    //endregion

    //region > constructors
    DocumentAbstract() {
        // for testing only
    }

    public DocumentAbstract(
            final DocumentType type,
            final String atPath) {
        this.type = type;
        this.atPath = atPath;
        this.sort = DocumentSort.EMPTY;
    }
    //endregion


    //region > type (property)
    public static class TypeDomainEvent extends PropertyDomainEvent<DocumentType> { }
    @Getter @Setter
    @Column(allowsNull = "false", name = "typeId")
{'fraction_non_alphanumeric': 0.09620538863027225, 'fraction_numerical': 0.001410636196924813, 'mean_word_length': 4.093390804597701, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '1468953', 'n_tokens_mistral': 2086, 'n_tokens_neox': 2039, 'n_words': 378}