<commit_before>package eu.xenit.de.testing.behaviours;

import com.github.dynamicextensionsalfresco.behaviours.annotations.Behaviour;
import com.github.dynamicextensionsalfresco.behaviours.annotations.ClassPolicy;
import eu.xenit.de.testing.Model;
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Behaviour("test:document")
@SuppressWarnings("unused")
public class TestBehaviour implements OnCreateNodePolicy {

    private static final Logger logger = LoggerFactory.getLogger(TestBehaviour.class);

    @Autowired
    private NodeService nodeService;

    @Override
    @ClassPolicy
    public void onCreateNode(ChildAssociationRef childAssocRef) {

        nodeService.setProperty(
                childAssocRef.getChildRef(),
                Model.PROP_TESTBEHAVIOURPROPERTY,
                "TestBehaviour successfully processed");

    }
}<commit_msg>#275 TestBehavior move type limitation to ClassPolicy annotation<commit_after>package eu.xenit.de.testing.behaviours;

import com.github.dynamicextensionsalfresco.behaviours.annotations.Behaviour;
import com.github.dynamicextensionsalfresco.behaviours.annotations.ClassPolicy;
import eu.xenit.de.testing.Model;
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Behaviour
@SuppressWarnings("unused")
public class TestBehaviour implements OnCreateNodePolicy {

    private static final Logger logger = LoggerFactory.getLogger(TestBehaviour.class);

    @Autowired
    private NodeService nodeService;

    @Override
    @ClassPolicy("test:document")
    public void onCreateNode(ChildAssociationRef childAssocRef) {

        nodeService.setProperty(
                childAssocRef.getChildRef(),
                Model.PROP_TESTBEHAVIOURPROPERTY,
                "TestBehaviour successfully processed");

    }
}
{'fraction_non_alphanumeric': 0.08260689082606891, 'fraction_numerical': 0.0029057700290577005, 'mean_word_length': 4.9950248756218905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4503862', 'n_tokens_mistral': 712, 'n_tokens_neox': 693, 'n_words': 111}