Have a question? Want to report an issue? Contact JFrog support

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Realm and Job plugin types already execute under the "system" role. This cannot be changed.

Including AQL Queries

User plugins may include AQL queries opening up the full set of search capabilities that AQL has to offer. AQL queries are implemented within the Searches object as shown in the example below.

Code Block
import org.artifactory.addon.AddonsManager
import org.artifactory.addon.gems.GemsAddon
import org.artifactory.api.context.ContextHelper
import org.artifactory.repo.RepoPathFactory
import org.artifactory.search.Searches
import org.artifactory.search.aql.AqlResult

executions {
   gemPropsPopulator() {
       def gemAddon = ContextHelper.get().beanForType(AddonsManager.class).addonByType(GemsAddon.class)
       def repoKey = "gem-local"

       ((Searches) searches).aql(
               "items.find({" +
                       "\"repo\": \"" + repoKey + "\"," +
                       "\"\$or\":[" +
                       "{\"property.key\":{\"\$ne\":\"gem.name\"}}," +
                       "{\"property.key\":{\"\$ne\":\"gem.version\"}}" +
                       "]})" +
                       ".include(\"path\", \"name\")") {
           AqlResult result ->
               result.each {
                ...
                ...
                ...
               }
       }
   }
}

 

...

Plugin Template Source

General Info

...