====== Registry ======
The registry graph is used by GroIMP as registry for platform elements. Each project get its own registry that is a children of the Main registry. For the project, the registry stores how different resources are linked to the way GroIMP loads them — including which Java classes are used and with which parameters.
===== Structure =====
The registry use the [[:01_user_documentation:06_graph:01_edge:01_successor|successor]] and [[:01_user_documentation:06_graph:01_edge:02_branch|branch]] edges for the structural informations between the nodes. Nodes of the registry are [[https://javadoc.grogra.de/platform.core/de/grogra/pf/registry/Item.html|items]]. In order to loop over all children of an Item, the edge loop over the first branch and then the successors:
for (Item n = (Item) getBranch (); n != null; n = (Item) n.getSuccessor ()){
}
===== Plugin registry (TODO: refactor this section) =====
The platform is structured by the registry, which has a tree structure. All elements loaded by the platform have to be defined in the platform registry. Upon startup GroIMP load the platform registry based on all the ''plugin.xml'' files defined in the project repositories.
Hence, new items to the platform must be added in the ''plugin.xml'' files, in the '''' section.
The platform registry consists of a tree of items. Each item has a name and can be referenced in a file system. The path for selecting an item is similar to a unix path (//i.e.// ''/ui/commands'').
==== Platform registry structure ====
The main directories in the registry are:
/
│ application/
│ attributes/
│
└─── objects/
│ │ graph/
│ │ R'files/
│ └─── R'datasets/
│
│ cmdline/
│
└─── ui/
│ │ options
│ │ commands/
│ │ editors/
│ │ panels/
│ │ layouts/
│ └─── iconthemes/
│
│ export/
│ help/
│
└─── io/
│ │ filetypes/
│ │ mimetypes
│ └─── streamhandlers
│
└─── hooks/
│ │ postboot/
│ │ startup/
│ │ shutdown/
│ └─── configure/
│ │ main/
│ │ │ workbench/
│ │ └─── classes/
│ │
│ └─── project
│ │ objects/
│ └─── layouts/
│ │
│ └─── complete/
│ └─── project/
│ └─── workbench/
│ │
│ │ projectloaded
│ │ close
│ └─── rgg
│ │ finished/
│ └─── saving/
==== Main repositories ====
=== Application ===
On start GroIMP launch the method in the application repository. Currently ''de.grogra.imp.IMP.run''.
=== Attributes ===
The attributes repository contains the Attributes (classes derived from ''de.grogra.imp.objects.Attributes''), which are linked with the ui attributes items and persistence mechanism.
GroIMP objects need to describe their attribute for them to be accessible in the GUI. (see [[:05_developer_tutorials:02_extending_groimp:creating-node-class|how to create nodes in groimp]]).
=== Objects ===
All objects are inserted in this repository.
The objects added to a project are usually added to one of its resources sub directories (files, images, objects, datasets, ...). Resource directories where associated object factories have been registered (FileFactory, FixedImageAdapter, ...).
It also where math, 2d and 3d objects are registered with their factories, so they can be created in a GroIMP project.
=== UI ===
This is where the ui components are registered, including Panels, ui commands, layouts.
All panels should be registered in the ''/ui/panels'' directory before being added to the hooks (where they become accessible from menu entries) even if they are not accessible through the ''menu/src/panels'' entry. (see also [[:05_developer_tutorials:02_extending_groimp:create-windows|how to create windows and make them available in GroIMP]]).
=== IO ===
This is where the readable file types, mimetypes and streamholders are registered.
New data, file or mime types, should be added to this repository. (see [[:01_user_documentation:03_interacting_with_groimp:14_io|how to add new mime, or file types]]).
=== Hooks ===
This is where the executables are registered. The startup , postboot, shutdown, and close hooks are run at the designated GroIMP event.
Once elements have been defined in other repositories, they can be inserted in the hooks, so they are loaded at the designated GroIMP event (_e.g._ upon opening a new window).
For instance, the menu entries of the main window (the ones available from the default GroIMP window) are inserted in ''/hooks/configure/main/workbench/menu/src/''.
==== Registry tags ====
Each tag is see a node in the registry tree, and children nodes inherit their parents added tags.
The complete list of predefined registry elements is found in _Platform-Core_ in the class ''de.grogra.pf.registry.Root'' (see [[:GroIMP-Platform:Complete-registry-tags-list|complete list of defined tags]]).
=== Most used tags ===
The most used tags (defined in _Root_ and added in _Platform_) are:
- ''''
- ''''
- ''''
- ''''
- ''''
- ''''
- ''