PicApport Add-on Programming Reference
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.logGroovy configuration log created: Fri Sep 11 09:30:53 CEST 2020GroovyManager.loadGroovyFromClasspath: Groovy not found on classpath. Now try to load from C:\Users\Eric\.picapport\groovySearch for Groovy runtime (apache-groovy-binary-*.zip) in C:\Users\Eric\.picapport\groovyLoad Groovy runtime C:\Users\Eric\.picapport\groovy\apache-groovy-binary-3.0.5.zipGroovy directory C:\Users\Eric\.picapport\groovy\groovy-3.0.5 existsAdding Groovy jar to new URLClassLoaderC:\Users\Eric\.picapport\groovy\groovy-3.0.5\lib\groovy-3.0.5.jarGroovy runtime loaded from C:\Users\Eric\.picapport\groovy: 3.0.5Search for new Add-ons (pag?AddonName-v.v.v.zip) in C:\Users\Eric\.picapport\groovy0 Add-ons installed/updatedStart (re)loading Groovy Addons: Fri Sep 11 09:30:54 CEST 2020Load Groovy Addon C:\Users\Eric\.picapport\groovy\pagcPrivateFileFilter\PrivateFileFilter.groovy Version:1.0.0 addontype:PathFilter of class:PrivateFileFilterLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagfNonJpgTitleField\NonJpgTitleField.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:NonJpgTitleFieldLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpExifToolSimpleInfo\ExifToolSimpleInfo.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:ExifToolSimpleInfoLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpGroovyProceduresTestTool\GroovyProceduresTestTool.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:GroovyProceduresTestToolLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpMetadataAnalyser\MetadataAnalyser.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:MetadataAnalyserLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOpenrouteGeoJSONRoute\OpenrouteGeoJSONRoute.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:OpenroutGeoJSONRouteLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOSMGeoReverseEncoder\OSMFields.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:OSMFieldsField:osm of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=true addToGlobalKeywords=false addToReport=trueField:osmCountry of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:osmState of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:osmPostcode of type DATA_TYPE_STRING index=INDEX_TYPE_ID addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:osmCity of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:osmRoad of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpOSMGeoReverseEncoder\OSMGeoReverseEncoder.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:OSMGeoReverseEncoderLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpTagYourPhotos\TagYourPhotos.groovy Version:1.0.0 addontype:PhotoFileProcessor of class:TagYourPhotosLoad Groovy Addon C:\Users\Eric\.picapport\groovy\pagpTagYourPhotos\TagYourPhotosFields.groovy Version:1.0.0 addontype:PhotoFieldProvider of class:TagYourPhotosFieldsField:TagYourPhotos of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=true addToGlobalKeywords=false addToReport=trueField:typTags of type DATA_TYPE_STRING index=INDEX_TYPE_HIERARCHICAL addToGlobalFulltext=false addToGlobalKeywords=true addToReport=trueField:typLandmarks of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:typCountry of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:typState of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:typCity of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueField:typDistrict of type DATA_TYPE_STRING index=INDEX_TYPE_FULLTEXT addToGlobalFulltext=false addToGlobalKeywords=false addToReport=trueCheck 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