Page tree
Skip to end of metadata
Go to start of metadata

This page is for programers and describes the programming of PicApport-Add-ons in the Groovy language.

General

Add-ons have to be written in the groovy-programming language and have been introduced in PicApport V9.0. 

All Add-ons provided by Contecon are available in source code, so it's a good idea to understand our Add-ons before you start your own projects.

Development cycle / infrastructure

See PicApport Add-on Installation Guide for information about directory structure, naming conventions and the groovy run-time environment.

Because Add-ons are written in Groovy they can be updated while the PicApport-Server is running. This helps a lot to speed up the programming process of an Add-on.

To start we recommend to use one of our template-groovy-add-ons  and copy it to a new directory below .picapport/groovy

The Add-ons will be loaded automatically during the server startup or when the reloadaddons command is entered on the server console or automatically when an add-on of type procedure is executed.

An Add-on must have the file extension .groovy.

If an Add-on needs special support of java library's (.jar files) make sure that these jar files are in the classpath of your picapport server.

Best practices

  • For development use a separate PicApport Server with a small amount of photos

  • Make a backup copy of the photos

  • During loading and recompiling errors and problems are reported on the PicApport server console, so it's good to have access to the console.

  • check the .picapport\groovy\logfiles\currentConfiguration.log for problems and loaded configuration

    Sample currentConfiguration.log
    Groovy configuration log created: Fri Sep 11 09:30:53 CEST 2020
    
           GroovyManager.loadGroovyFromClasspath: Groovy not found on classpath. Now try to load from C:\Users\Eric\.picapport\groovy
           Search for Groovy runtime (apache-groovy-binary-*.zip) in C:\Users\Eric\.picapport\groovy
           Load Groovy runtime C:\Users\Eric\.picapport\groovy\apache-groovy-binary-3.0.5.zip
                Groovy directory C:\Users\Eric\.picapport\groovy\groovy-3.0.5 exists
                Adding Groovy jar to new URLClassLoaderC:\Users\Eric\.picapport\groovy\groovy-3.0.5\lib\groovy-3.0.5.jar
           Groovy runtime loaded from C:\Users\Eric\.picapport\groovy: 3.0.5
           
           Search for new Add-ons (pag?AddonName-v.v.v.zip) in C:\Users\Eric\.picapport\groovy
           0 Add-ons installed/updated
    
           Start (re)loading Groovy Addons: Fri Sep 11 09:30:54 CEST 2020
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagcPrivateFileFilter\PrivateFileFilter.groovy Version:1.0.0 addontype:PathFilter of class:PrivateFileFilter
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagfNonJpgTitleField\NonJpgTitleField.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:NonJpgTitleField
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpExifToolSimpleInfo\ExifToolSimpleInfo.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:ExifToolSimpleInfo
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpGroovyProceduresTestTool\GroovyProceduresTestTool.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:GroovyProceduresTestTool
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpMetadataAnalyser\MetadataAnalyser.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:MetadataAnalyser
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOpenrouteGeoJSONRoute\OpenrouteGeoJSONRoute.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:OpenroutGeoJSONRoute
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOSMGeoReverseEncoder\OSMFields.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:OSMFields
                             Field:osm of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=true addToGlobalKeywords=false addToReport=true
                             Field:osmCountry of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:osmState of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:osmPostcode of type DATA_TYPE_STRING index=INDEX_TYPE_ID addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:osmCity of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:osmRoad of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOSMGeoReverseEncoder\OSMGeoReverseEncoder.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:OSMGeoReverseEncoder
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpTagYourPhotos\TagYourPhotos.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:TagYourPhotos
           Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagpTagYourPhotos\TagYourPhotosFields.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:TagYourPhotosFields
                             Field:TagYourPhotos of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=true addToGlobalKeywords=false addToReport=true
                             Field:typTags of type DATA_TYPE_STRING index=INDEX_TYPE_HIERARCHICAL addToGlobalFulltext=false addToGlobalKeywords=true addToReport=true
                             Field:typLandmarks of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:typCountry of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:typState of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:typCity of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
                             Field:typDistrict of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=true
    
           Check for new photofields.
           Field osm already exists.
           Field osmCountry already exists.
           Field osmState already exists.
           Field osmPostcode already exists.
           Field osmCity already exists.
           Field osmRoad already exists.
           Field TagYourPhotos already exists.
           Field typTags already exists.
           Field typLandmarks already exists.
           Field typCountry already exists.
           Field typState already exists.
           Field typCity already exists.
           Field typDistrict already exists.
    
    

Add-on types

Currently the following add-on type are supported:

Crawler filter (pagc)

see Add-on type: Crawler filter (pagc) for more Information

Procedures (pagp)

see Add-on type: Procedure (pagp) for more Information

Database Field extensions (pagf)

see Add-on type: Database Field extension (pagf) for more Information


  • No labels