--- /dev/null
+package org.simantics.export.core.intf;\r
+\r
+import java.util.List;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.osgi.service.prefs.Preferences;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.type.RecordType;\r
+import org.simantics.export.core.ExportContext;\r
+import org.simantics.export.core.error.ExportException;\r
+import org.simantics.export.core.manager.Content;\r
+\r
+/**\r
+ * Interface for publisher implementations.\r
+ *\r
+ * @author toni.kalajainen@semantum.fi\r
+ */\r
+public interface PublisherClass {\r
+ \r
+ /**\r
+ * Publish content\r
+ * \r
+ * @param ctx\r
+ * @param contents\r
+ * @param options all options \r
+ * @param location location settings\r
+ * @param progress (Optional) progress monitor\r
+ * @throws ExportException \r
+ */\r
+ void publish( ExportContext ctx, List<Content> contents, Variant options, Variant location, IProgressMonitor progress ) throws ExportException;\r
+ \r
+ /**\r
+ * Validate before publish \r
+ * \r
+ * @param ctx\r
+ * @param contents\r
+ * @param options overall all options\r
+ * @param location location settings\r
+ * @return\r
+ * @throws ExportException \r
+ */\r
+ List<String> validate( ExportContext ctx, List<Content> contents, Variant options, Variant location ) throws ExportException;\r
+ \r
+ //// Location Management ////\r
+ \r
+ /**\r
+ * Get all location options (even the ones that are hidden from the end-user) \r
+ * \r
+ * @param ctx\r
+ * @param contents contents to publish\r
+ * @param options all options\r
+ * @return\r
+ * @throws ExportException\r
+ */\r
+ RecordType locationOptions( ExportContext ctx, List<Content> contents ) throws ExportException;\r
+ \r
+ /**\r
+ * Create or edit location. This may cause blocking UI operation.\r
+ * \r
+ * @param ctx\r
+ * @param location Some location settings\r
+ * @return new or modified location\r
+ * @throws ExportException\r
+ */\r
+ Variant createLocation( ExportContext ctx, Variant location ) throws ExportException;\r
+ \r
+ /**\r
+ * Checks if location exists.\r
+ * \r
+ * @param ctx\r
+ * @param location\r
+ * @return true if location exists\r
+ * @throws ExportException\r
+ */\r
+ boolean locationExists( ExportContext ctx, Variant location ) throws ExportException;\r
+ \r
+ /**\r
+ * Fill default location values to location\r
+ * \r
+ * @param ctx\r
+ * @param contents\r
+ * @param options\r
+ * @param locationOptions\r
+ * @throws ExportException\r
+ */\r
+ void fillDefaultPrefs( ExportContext ctx, List<Content> contents, Variant options, Variant locationOptions ) throws ExportException;\r
+ \r
+ /**\r
+ * Save location options to preferences node(s).\r
+ * \r
+ * @param locationOptions\r
+ * @param contentScopePrefs\r
+ * @param workspaceScopePrefs\r
+ * @throws ExportException\r
+ */\r
+ void savePref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;\r
+ \r
+ /**\r
+ * Load location options from preferences node(s).\r
+ * \r
+ * @param locationOptions\r
+ * @param contentScopePrefs\r
+ * @param workspaceScopePrefs\r
+ * @throws ExportException\r
+ */\r
+ void loadPref( Variant locationOptions, Preferences contentScopePrefs, Preferences workspaceScopePrefs ) throws ExportException;\r
+\r
+}\r