#
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you 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.
#
#
[feature name=sling]

[artifacts]
    # HTL
    org.apache.sling/org.apache.sling.scripting.sightly.runtime
    org.apache.sling/org.apache.sling.scripting.sightly.compiler
    org.apache.sling/org.apache.sling.scripting.sightly.compiler.java
    org.apache.sling/org.apache.sling.scripting.sightly
    org.apache.sling/org.apache.sling.scripting.sightly.js.provider
    org.apache.sling/org.apache.sling.scripting.sightly.testing-content
    org.apache.sling/org.apache.sling.scripting.sightly.testing


    org.apache.sling/org.apache.sling.scripting.api/2.2.0
    org.apache.sling/org.apache.sling.scripting.spi
    org.apache.sling/org.apache.sling.scripting.core
    org.apache.sling/org.apache.sling.scripting.javascript/3.1.2
    org.apache.sling/org.apache.sling.scripting.jsp/2.4.0
    org.apache.sling/org.apache.sling.scripting.jsp-api/1.0.2
    org.apache.sling/org.apache.sling.scripting.el-api/1.0.0
    org.apache.sling/org.apache.sling.scripting.jsp.taglib/2.4.0
    org.antlr/antlr4-runtime/4.7.2
    org.apache.sling/org.apache.sling.scripting.sightly.repl/1.0.6
    org.apache.servicemix.bundles/org.apache.servicemix.bundles.rhino/1.7.10_1

[:repoinit]
    #<<< SLING-5848 - Define service user and ACLs for Scripting
    create service user sling-scripting

    create path (sling:Folder) /libs
    create path (sling:Folder) /apps

    set ACL for sling-scripting
        deny    jcr:all     on /
        allow   jcr:read    on /libs,/apps
    end

    create path (sling:Folder) /sightlytck/scripts
    set ACL for sling-scripting
        allow   jcr:read    on /sightlytck/scripts
    end


[configurations]
    # configure the ScriptCache for scripts used by org.apache.sling.scripting.sightly.js.provider
    org.apache.sling.scripting.core.impl.ScriptCacheImpl
        org.apache.sling.scripting.cache.additional_extensions=["js"]

    org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-scripting
        user.mapping=[
            "org.apache.sling.scripting.core\=sling-scripting",
            "org.apache.sling.scripting.sightly.js.provider\=sling-scripting",
        ]

    org.apache.sling.commons.log.LogManager.factory.config-2ef75700-a318-4eae-bed4-86777e1bdfd2
        org.apache.sling.commons.log.pattern="{0,date,dd.MM.yyyy\ HH:mm:ss.SSS}\ *{4}*\ [{2}]\ {3}\ {5}"
        org.apache.sling.commons.log.names=["org.apache.sling.scripting.sightly.js.impl.jsapi.ProxyAsyncScriptableFactory"]
        org.apache.sling.commons.log.file="logs/error.log"
        org.apache.sling.commons.log.level="error"

    org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl
        resource.resolver.searchpath=["/apps", "/libs", "/sightlytck/scripts"]

    org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration
      scriptResolutionCacheSize=I"4096"
