Goobi workflow
Documentation homeGoobi workflow PluginsGoobi workflow Digests
English
English
  • Overview
    • Goobi workflow Handbook
    • Overview of documentation
    • What is Goobi?
  • Users
    • Goobi for Users
    • The basics
      • Logging in
      • Menu
      • Logging out
      • Switch between available languages
      • Help function
      • Personal settings
      • Changing your password
      • My tasks
      • Processes
      • How to find a process
      • How to create a new process
      • Edit task details
    • How different user groups work with Goobi
      • Scanning
      • Quality control
      • Manual script steps and plugin steps
      • Automatic script-run steps
      • Metadata processing
      • Export to the DMS
    • Metadata Editor
      • User interface
        • Structure tree
        • Page display
        • Menu options
      • Metadata indexing
        • Pagination
        • Structuring
          • Create new structure element
          • Moving structure elements
          • Copying structure elements from other processes
      • Modifying and verifying data
        • Subsequent changes to pagination
        • Uploading files
        • Downloading files
        • Server-based exports
        • Server-based imports
      • Edit OCR results
      • Overview of the keyboard combinations
  • Management
    • Goobi Management
    • Structure of the extended user interface
    • Rulesets
    • LDAP groups
    • Users
    • User groups
    • Processes
      • Searching processes
      • Activity
      • Activities for hit lists
      • GoobiScript
    • Variables
    • Harvester
  • Administration
    • Goobi Administration
    • File system
      • Global directory structure
        • ‘config’ sub-directory
        • ‘import’ sub-directory
        • ‘metadata’ sub-directory
        • ‘plugins’ sub-directory
        • ‘rulesets’ sub-directory
        • ‘scripts’ sub-directory
        • ‘xslt’ sub-directory
      • Directory structure of the application
      • Integrating external storage
      • Integration of S3 as storage
    • Services
      • MySQL database
      • Apache Tomcat servlet container
      • User authentication using LDAP
      • File system access using Samba
    • Exporting to digital libraries
      • Technical data
      • Mets parameters
      • Mets file groups
      • Export configuration in the Goobi configuration file
    • Working with the intranda Task Manager
    • Automatic workflow steps
      • Example combination for an automatic script task
      • Migration of technical data to METS files
      • Automatic image deletion
    • Configuration files
      • goobi_activemq.xml
      • goobi_config.properties
      • goobi_digitalCollections.xml
      • goobi_exportXml.xml
      • goobi_mail.xml
      • goobi_metadataDisplayRules.xml
      • goobi_normdata.xml
      • goobi_opac.xml
      • goobi_opacUmlaut.txt
      • goobi_processProperties.xml
      • goobi_projects.xml
      • goobi_rest.xml
      • goobi_webapi.xml
      • messages_xx.properties
      • config_contentServer.xml
    • Installation guide
      • Installation guide - Ubuntu 20.04
    • Update guide
      • Preparation of an update
      • Update steps
        • 2020
        • 2021
        • 2022
        • 2023
        • 2024
        • 2025
    • Authentication options
      • Authentication via the database
      • Authentication via HTTP header
      • Authentication via OpenID Connect
    • Use cases
      • Create thumbnails for accelerated image display
      • Handling of 3D Objects
      • Export of 3D-Objects into the Goobi viewer
  • Developer
    • Setting up a development environment
      • Preparatory work
      • Setting up Eclipse
      • Resetting the data
      • Best practice for developing Goobi and working with Eclipse
    • Using the REST API
    • Snippets for the development on Goobi workflow
      • HTML
      • JavaScript
Bereitgestellt von GitBook
Auf dieser Seite
  • Basic module
  • Add-on module
Als PDF exportieren
  1. Developer
  2. Snippets for the development on Goobi workflow

JavaScript

Basic module

The JavaScript is modular and based on a base module that is initialised when the page is called. It creates a global object with the name goobiWorkflowJS. Methods are attached to this object through further modules and can thus be called in its scope.

goobiWorkflowJS.js
var goobiWorkflowJS = ( function() {
    'use strict';

    // global object
    var goobiWorkflow = {};

    // private variables
    var _debug = false;
    var _defaults = {};

    goobiWorkflow.init = function( config ) {
        if ( _debug ) {
            console.log( 'Initializing: goobiWorkflow.init' );
            console.log( '--> config = ', config );
        }

        $.extend( true, _defaults, config );
    }

    return goobiWorkflow;

} )( jQuery );

Add-on module

The global object goobiWorkflow is passed to the add-on module, thus allowing the object to be extended with additional methods. In a module, methods or variables can be defined that can only be called in the module (private) or in the global object(public).

goobiWorkflowJS.module.js
var goobiWorkflowJS = ( function( goobiWorkflow ) {
    'use strict';

    // private variables
    var _debug = false;
    var _defaults = {};

    goobiWorkflow.module = {
        /**
         * @description Method to initialize the module.
         * @method init
         */
        init: function( config ) {
            if ( _debug ) {
                console.log( 'Initializing: goobiWorkflow.module.init' );
                console.log( '--> config = ', config );
            }

            $.extend( true, _defaults, config );
        },
        /**
         * @description Method to ...
         * @method myPublicMethod
         */
        myPublicMethod: function() {
            if ( _debug ) {
                console.log( 'EXECUTE: goobiWorkflow.module.myPublicMethod' );
            }

            // magic happens here...
        },
        /**
         * @description Public variable
         */
        myPublicVariable: 'can be String, Boolean, Array or Object',
    };

    /**
     * @description Method to ...
     * @method _myPrivateMethod
     */
    function _myPrivateMethod() {
        if ( _debug ) {
            console.log( 'EXECUTE: _myPrivateMethod' );
        }

        // magic happens here...
    }

    return goobiWorkflow;

} )( goobiWorkflowJS || {}, jQuery );
VorherigeHTML

Zuletzt aktualisiert vor 6 Monaten