]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/src/org/simantics/export/core/intf/PublisherClass.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / intf / PublisherClass.java
1 package org.simantics.export.core.intf;\r
2 \r
3 import java.util.List;\r
4 \r
5 import org.eclipse.core.runtime.IProgressMonitor;\r
6 import org.osgi.service.prefs.Preferences;\r
7 import org.simantics.databoard.binding.mutable.Variant;\r
8 import org.simantics.databoard.type.RecordType;\r
9 import org.simantics.export.core.ExportContext;\r
10 import org.simantics.export.core.error.ExportException;\r
11 import org.simantics.export.core.manager.Content;\r
12 \r
13 /**\r
14  * Interface for publisher implementations.\r
15  *\r
16  * @author toni.kalajainen@semantum.fi\r
17  */\r
18 public interface PublisherClass {\r
19         \r
20         /**\r
21          * Publish content\r
22          * \r
23          * @param ctx\r
24          * @param contents\r
25          * @param options all options \r
26          * @param location location settings\r
27          * @param progress (Optional) progress monitor\r
28          * @throws ExportException \r
29          */\r
30         void publish( ExportContext ctx, List<Content> contents, Variant options, Variant location, IProgressMonitor progress ) throws ExportException;\r
31         \r
32         /**\r
33          * Validate before publish \r
34          * \r
35          * @param ctx\r
36          * @param contents\r
37          * @param options overall all options\r
38          * @param location location settings\r
39          * @return\r
40          * @throws ExportException \r
41          */\r
42         List<String> validate( ExportContext ctx, List<Content> contents, Variant options, Variant location ) throws ExportException;\r
43         \r
44         //// Location Management ////\r
45         \r
46         /**\r
47          * Get all location options (even the ones that are hidden from the end-user)  \r
48          * \r
49          * @param ctx\r
50          * @param contents contents to publish\r
51          * @param options all options\r
52          * @return\r
53          * @throws ExportException\r
54          */\r
55         RecordType locationOptions( ExportContext ctx, List<Content> contents ) throws ExportException;\r
56         \r
57         /**\r
58          * Create or edit location. This may cause blocking UI operation.\r
59          * \r
60          * @param ctx\r
61          * @param location Some location settings\r
62          * @return new or modified location\r
63          * @throws ExportException\r
64          */\r
65         Variant createLocation( ExportContext ctx, Variant location ) throws ExportException;\r
66         \r
67         /**\r
68          * Checks if location exists.\r
69          * \r
70          * @param ctx\r
71          * @param location\r
72          * @return true if location exists\r
73          * @throws ExportException\r
74          */\r
75         boolean locationExists( ExportContext ctx, Variant location ) throws ExportException;\r
76         \r
77         /**\r
78          * Fill default location values to location\r
79          * \r
80          * @param ctx\r
81          * @param contents\r
82          * @param options\r
83          * @param locationOptions\r
84          * @throws ExportException\r
85          */\r
86         void fillDefaultPrefs( ExportContext ctx, List<Content> contents, Variant options, Variant locationOptions ) throws ExportException;\r
87         \r
88         /**\r
89          * Save location options to preferences node(s).\r
90          * \r
91          * @param locationOptions\r
92          * @param contentScopePrefs\r
93          * @param workspaceScopePrefs\r
94          * @throws ExportException\r
95          */\r
96         void savePref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;\r
97         \r
98         /**\r
99          * Load location options from preferences node(s).\r
100          * \r
101          * @param locationOptions\r
102          * @param contentScopePrefs\r
103          * @param workspaceScopePrefs\r
104          * @throws ExportException\r
105          */\r
106         void loadPref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;\r
107 \r
108 }\r