-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRealtimePluginInterface.java
More file actions
75 lines (66 loc) · 3.38 KB
/
RealtimePluginInterface.java
File metadata and controls
75 lines (66 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.chemaxon.designhub.plugin.interfaces;
import com.chemaxon.designhub.plugin.settings.util.CustomSettings;
import lombok.NonNull;
public interface RealtimePluginInterface<T extends CustomSettings> {
/**
* Implement code that does plugin calculation and returns calculated data. Client data is accessible in JavaScript code
* provided by getTemplate method. Report data can be are added into a report based in report property setting in Design Hub.
*
* @param structure MRV formatted structure as string.
* @param pinnedStructure MRV formatted pinned structure as string. Can be null if no pinned structure is provided.
* @param settings If provided by getSetting these are actual values of your setting that are set up
* in Design Hub.
* @param context The rest of calculation request provided by Design Hub containing raw data.
* @return Results set containing two parts: Client data is an object that is send to Design Hub and is available for JavaScript code in template given by getTemplate.
* Second - report data is a Map of key/value to be copied to reports (exports). If not report data is needed this field can be null.
*/
ResultSet getResultSet(String structure, String pinnedStructure, T settings, Object context);
/**
* @return Null in no settings are required or return an instance of class extending
* com.chemaxon.designhub.plugin.settings.util.CustomSettings with fields
* chosen from com.chemaxon.designhub.plugin.settings.types.BooleanPluginSetting,
* com.chemaxon.designhub.plugin.settings.types.EnumPluginSetting,
* com.chemaxon.designhub.plugin.settings.types.NumberPluginSetting,
* com.chemaxon.designhub.plugin.settings.types.StringPluginSetting containing labels (name of setting visible
* to the user) and default values. These settings will be visible in Design Hub and can be used to configure
* this plugin from Design Hub.
*/
default T getSettings() {
return null;
}
/**
* Not supported at this moment. Will be used to separate multiple plugin implementations in the same running
* Spring application.
*
* @return an empty string.
*/
default @NonNull String getPath() {
return "";
}
/**
* @return Name of this plugin. Will be visible to user in Design Hub.
*/
@NonNull String getLabel();
/**
* @return Name of the plugin used to store plugin setup in Design Hub. Not visible to the user.
*/
@NonNull String getName();
/** Tell Design Hub whether this plugin provides report data.
* This information is used to show or hide this plugin in design set Add Property menu.
* @return {@code true} show this plugin in design set menu or {@code false} hide this plugin
* in design set menu
*/
boolean hasReport();
/**
* @return Piece of JavaScript code used to display data in Design Hub.
* Please see https://docs.chemaxon.com/display/docs/design-hub-developer-guide-real-time-plugin-templates.md
*/
@NonNull String getTemplate();
/**
* @return Array of strings with domains in Design Hub to limit for whose domains shall this plugin be used.
* Value {"*"} used by default means use plugin in all domains.
*/
default @NonNull String[] getDomains() {
return new String[]{"*"};
}
}