addCustomEditorVariablesResolver exception in trasformation

Post here questions and problems related to oXygen frameworks/document types.
miquik
Posts: 7

addCustomEditorVariablesResolver exception in trasformation

Fri Jul 17, 2015 9:31 am

Hi,
I just finished my first plugin and everythings works well. One of the task of my plugin is to set a custom id to new docs; I do that using addCustomEditorVariablesResolver function based on this code :https://github.com/digicademy/CustomUUID/blob/master/java/src/main/java/net/namenforschung/customUUID/workspace/CustomWorkspaceAccessPluginExtension.java.
Everything works well except that this line of code throw an "java.lang.NullPointerException" when I perform a Transformation Task (I use DITA to PDF but I try every transformations and gave me same results).
If I remove this line of code, everything works as expected.

Thanks
alex_jitianu
Posts: 604

Re: addCustomEditorVariablesResolver exception in trasformat

Fri Jul 17, 2015 10:13 am

Hello,

What happens is that at some point, in CustomUUIDResolver .resolveEditorVariables(), parameter contentWithEditorVariables has a null value. Just check it for null before trying to expand:

Code: Select all

public String resolveEditorVariables(String contentWithEditorVariables, String currentEditedFileURL){         
if (contentWithEditorVariables != null) {
  return contentWithEditorVariables.replaceAll("\\$\\{customUUID\\}", createCustomUUID().toString());
}
return contentWithEditorVariables;
}


we will also change the code a bit so that in the future you wont get a callback for a null value.

Best regards,
Alex
miquik
Posts: 7

Re: addCustomEditorVariablesResolver exception in trasformat

Fri Jul 17, 2015 10:35 am

Thank you very much,
it was easier than I think.

Thanks again

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest