001 package de.deepamehta.core.service.event; 002 003 import de.deepamehta.core.AssociationType; 004 import de.deepamehta.core.service.ClientState; 005 import de.deepamehta.core.service.EventListener; 006 007 008 009 /** 010 * ### FIXDOC 011 * Allows a plugin to modify type definitions -- exisisting ones <i>and</i> future ones. 012 * Plugins get a opportunity to visit (and modify) each type definition extacly once. 013 * <p> 014 * This hook is triggered in 2 situations: 015 * <ul> 016 * <li>for each type that <i>exists</i> already while a plugin clean install. 017 * <li>for types created (interactively by the user, or programmatically by a migration) <i>after</i> 018 * the plugin has been installed. 019 * </ul> 020 * This hook is typically used by plugins which provide cross-cutting concerns by affecting <i>all</i> 021 * type definitions of a DeepaMehta installation. Typically such a plugin adds new data fields to types 022 * or relates types with specific topics. 023 * <p> 024 * Examples of plugins which use this hook: 025 * <ul> 026 * <li>The "DeepaMehta 4 Workspaces" plugin adds a "Workspaces" field to all types. 027 * <li>The "DeepaMehta 4 Time" plugin adds timestamp fields to all types. 028 * <li>The "DeepaMehta 4 Access Control" plugin adds a "Creator" field to all types and relates them to a user. 029 * </ul> 030 * 031 * @param assocType the type to be modified. The passed object is actually an instance of a {@link AssociationType} 032 * subclass that is backed by the database. That is, modifications by e.g. 033 * {@link AssociationType#addDataField} are persistent. 034 * <p> 035 * Note: at the time the hook is triggered the type exists already in the database, in 036 * particular the underlying type topic has an ID already. That is, the type is ready for 037 * e.g. being related to other topics. 038 */ 039 public interface IntroduceAssociationTypeListener extends EventListener { 040 041 void introduceAssociationType(AssociationType assocType, ClientState clientState); 042 }