1 package org.simantics.export.core.intf;
3 import java.util.Collection;
6 import org.eclipse.core.runtime.IProgressMonitor;
7 import org.osgi.service.prefs.Preferences;
8 import org.simantics.databoard.binding.mutable.Variant;
9 import org.simantics.databoard.type.RecordType;
10 import org.simantics.export.core.ExportContext;
11 import org.simantics.export.core.error.ExportException;
12 import org.simantics.export.core.manager.Content;
13 import org.simantics.utils.datastructures.MapList;
15 public interface ExportClass {
18 * Get extension specific options.
22 * @return a record type describing options
24 RecordType options( ExportContext ctx, Collection<String> contentUris ) throws ExportException;
27 * Validate that the content can be exported. If not, an exception is thrown.
34 * @return list of errors
36 List<String> validate(
38 ExportContext context,
42 * Write format specific content to a content writer.
44 * @param contentUris a list of uris
45 * @param writer a writer object that is created with format extension
46 * @param ctx export context
47 * @param options all export options in a variant
49 * @param attachmentMap (optional) attachments
50 * @throws ExportException
53 List<Content> contents,
57 IProgressMonitor monitor,
58 MapList<Content, Content> attachmentMap
59 ) throws ExportException;
62 * Fill the options object with default values.
67 void fillDefaultPrefs( ExportContext ctx, Variant options ) throws ExportException;
70 * Save export options to preferences node(s).
73 * @param contentScopePrefs
74 * @param workspaceScopePrefs
75 * @throws ExportException
77 void savePref( Variant options, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;
80 * Load export options from preferences node(s).
83 * @param contentScopeNode
84 * @param workspaceScopePrefs
85 * @throws ExportException
87 void loadPref( Variant options, Preferences contentScopeNode, Preferences workspaceScopePrefs ) throws ExportException;