Commit 69b5a835 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

BS-10947

Fix migration + edit wizard 
parent 4454d37d
......@@ -75,6 +75,16 @@ public class DocumentWizard extends Wizard {
setDefaultPageImageDescriptor(Pics.getWizban());
this.document = document;
documentWorkingCopy = EcoreUtil.copy(document);
if (documentWorkingCopy.getUrl() == null) {
final Expression urlExpression = ExpressionHelper.createConstantExpression("", String.class.getName());
urlExpression.setReturnTypeFixed(true);
documentWorkingCopy.setUrl(urlExpression);
}
if (documentWorkingCopy.getMimeType() == null) {
final Expression mimeTypeExpression = ExpressionHelper.createConstantExpression("", String.class.getName());
mimeTypeExpression.setReturnTypeFixed(true);
documentWorkingCopy.setMimeType(mimeTypeExpression);
}
this.editMode = editMode;
}
......
......@@ -170,6 +170,11 @@ public class FileAndImageWidgetMigration extends ReportCustomMigration {
document.set("defaultValueIdOfDocumentStore", defaultValue);
final String doc = attachmentData.get("documentation");
document.set("documentation", doc);
document.set("mimeType",
StringToExpressionConverter.createExpressionInstance(model, "", "", String.class.getName(), ExpressionConstants.CONSTANT_TYPE, true));
document.set("url",
StringToExpressionConverter.createExpressionInstance(model, "", "", String.class.getName(), ExpressionConstants.CONSTANT_TYPE, true));
process.add("documents", document);
addReportChange(name,Messages.document, process.getUuid(),Messages.documentCreationDescription,Messages.documentProperty, IStatus.WARNING);
}else{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment