1 package org.simantics.export.core.intf;
5 import org.eclipse.core.runtime.IProgressMonitor;
6 import org.osgi.service.prefs.Preferences;
7 import org.simantics.databoard.binding.mutable.Variant;
8 import org.simantics.databoard.type.RecordType;
9 import org.simantics.export.core.ExportContext;
10 import org.simantics.export.core.error.ExportException;
11 import org.simantics.export.core.manager.Content;
14 * Interface for publisher implementations.
16 * @author toni.kalajainen@semantum.fi
18 public interface PublisherClass {
25 * @param options all options
26 * @param location location settings
27 * @param progress (Optional) progress monitor
28 * @throws ExportException
30 void publish( ExportContext ctx, List<Content> contents, Variant options, Variant location, IProgressMonitor progress ) throws ExportException;
33 * Validate before publish
37 * @param options overall all options
38 * @param location location settings
40 * @throws ExportException
42 List<String> validate( ExportContext ctx, List<Content> contents, Variant options, Variant location ) throws ExportException;
44 //// Location Management ////
47 * Get all location options (even the ones that are hidden from the end-user)
50 * @param contents contents to publish
51 * @param options all options
53 * @throws ExportException
55 RecordType locationOptions( ExportContext ctx, List<Content> contents ) throws ExportException;
58 * Create or edit location. This may cause blocking UI operation.
61 * @param location Some location settings
62 * @return new or modified location
63 * @throws ExportException
65 Variant createLocation( ExportContext ctx, Variant location ) throws ExportException;
68 * Checks if location exists.
72 * @return true if location exists
73 * @throws ExportException
75 boolean locationExists( ExportContext ctx, Variant location ) throws ExportException;
78 * Fill default location values to location
83 * @param locationOptions
84 * @throws ExportException
86 void fillDefaultPrefs( ExportContext ctx, List<Content> contents, Variant options, Variant locationOptions ) throws ExportException;
89 * Save location options to preferences node(s).
91 * @param locationOptions
92 * @param contentScopePrefs
93 * @param workspaceScopePrefs
94 * @throws ExportException
96 void savePref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;
99 * Load location options from preferences node(s).
101 * @param locationOptions
102 * @param contentScopePrefs
103 * @param workspaceScopePrefs
104 * @throws ExportException
106 void loadPref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;