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