use of com.centurylink.mdw.plugin.designer.Exporter in project mdw-designer by CenturyLinkCloud.
the class ExportAttributesWizard method performImportExport.
void performImportExport(ProgressMonitor progressMonitor) throws IOException, XmlException, DataAccessException, ActionCancelledException {
Exporter exporter = new Exporter(getProject().getDesignerDataAccess());
progressMonitor.start("Exporting Attributes...");
progressMonitor.progress(15);
String xmlString;
if (getProcess() != null)
xmlString = exporter.exportAttributes(getPrefix(), getProcess(), progressMonitor);
else
xmlString = exporter.exportAttributes(getPrefix(), getPackage(), progressMonitor);
progressMonitor.progress(10);
progressMonitor.subTask("Writing XML file");
writeFile(getPage().getFilePath(), xmlString.getBytes());
progressMonitor.progress(5);
}
use of com.centurylink.mdw.plugin.designer.Exporter in project mdw-designer by CenturyLinkCloud.
the class ExportPackageWizard method performImportExport.
void performImportExport(ProgressMonitor progressMonitor) throws IOException, JSONException, XmlException, DataAccessException, ActionCancelledException {
Exporter exporter = new Exporter(getProject().getDesignerDataAccess());
boolean exportJson = false;
boolean includeTaskTemplates = false;
boolean inferReferencedImpls = false;
boolean exportZip = false;
IPreferenceStore prefsStore = MdwPlugin.getDefault().getPreferenceStore();
if (getProject().isFilePersist()) {
exportJson = prefsStore.getBoolean(PreferenceConstants.PREFS_EXPORT_JSON_FORMAT);
includeTaskTemplates = !prefsStore.getBoolean(PreferenceConstants.PREFS_SUPPRESS_TASK_TEMPLATES_IN_PKG_EXPORT);
exportZip = prefsStore.getBoolean(PreferenceConstants.PREFS_EXPORT_ZIP_FORMAT);
} else {
inferReferencedImpls = !prefsStore.getBoolean(PreferenceConstants.PREFS_SUPPRESS_INFER_REFERENCED_IMPLS_DURING_EXPORT);
}
List<WorkflowPackage> packages = getPackages();
String export = null;
if (exportZip) {
File assetDir = getProject().getAssetDir();
List<File> includes = new ArrayList<>();
for (WorkflowPackage pkg : packages) includes.add(new File(assetDir + "/" + pkg.getName().replace('.', '/')));
ZipHelper.zipWith(assetDir, new File(getPage().getFilePath()), includes);
} else if (packages.size() == 1 && !exportJson)
export = exporter.exportPackage(packages.get(0), includeTaskTemplates, inferReferencedImpls, progressMonitor);
else
export = exporter.exportPackages(packages, exportJson, includeTaskTemplates, progressMonitor);
progressMonitor.progress(10);
progressMonitor.subTask("Writing " + (exportJson ? "JSON" : "XML") + " file");
if (export != null)
writeFile(getPage().getFilePath(), export.getBytes());
progressMonitor.progress(5);
}
use of com.centurylink.mdw.plugin.designer.Exporter in project mdw-designer by CenturyLinkCloud.
the class ExportProcessWizard method performImportExport.
void performImportExport(ProgressMonitor progressMonitor) throws IOException, XmlException, DataAccessException {
Exporter exporter = new Exporter(getProject().getDesignerDataAccess());
String xmlString = exporter.exportProcess(getProcess().getName(), getProcess().getVersionString(), false);
progressMonitor.progress(10);
progressMonitor.subTask("Writing XML file");
String fileName = getPage().getFilePath();
writeFile(fileName, xmlString.getBytes());
progressMonitor.progress(5);
}
use of com.centurylink.mdw.plugin.designer.Exporter in project mdw-designer by CenturyLinkCloud.
the class ExportTaskTemplatesWizard method performImportExport.
void performImportExport(ProgressMonitor progressMonitor) throws IOException, XmlException, DataAccessException, ActionCancelledException {
Exporter exporter = new Exporter(getProject().getDesignerDataAccess());
progressMonitor.start("Exporting Task Templates...");
progressMonitor.progress(15);
String xmlString = exporter.exportTaskTemplates(getPackage(), progressMonitor);
progressMonitor.progress(10);
progressMonitor.subTask("Writing XML file");
writeFile(getPage().getFilePath(), xmlString.getBytes());
progressMonitor.progress(5);
}
Aggregations