|
|
|
@ -73,15 +73,13 @@ class FormApp extends AbstractAppProvider {
|
|
|
|
|
@Override |
|
|
|
|
public JTemplate<?, ?> call() throws Exception { |
|
|
|
|
OpenResult<Form, Parameter[]> result = worker.getResult(); |
|
|
|
|
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, |
|
|
|
|
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); |
|
|
|
|
return getJForm(result.getBaseBook(), tplFile, result.getRef()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
worker.start(tplFile.getPath()); |
|
|
|
|
OpenResult<Form, Parameter[]> result = worker.getResult(); |
|
|
|
|
if (result != null) { |
|
|
|
|
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, |
|
|
|
|
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); |
|
|
|
|
return getJForm(result.getBaseBook(), tplFile, result.getRef()); |
|
|
|
|
} |
|
|
|
|
return emptyForm; |
|
|
|
|
} else { |
|
|
|
@ -90,6 +88,16 @@ class FormApp extends AbstractAppProvider {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
|
private JForm getJForm(Form form, FILE file, Parameter[] parameters) { |
|
|
|
|
try { |
|
|
|
|
return new JForm(form, file, parameters); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
|
private Form getForm(FILE tplFile) { |
|
|
|
|
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); |
|
|
|
|