addCustomEditorVariablesResolver exception in trasformation

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

addCustomEditorVariablesResolver exception in trasformation

Fri Jul 17, 2015 9:31 am

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 :
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.

Posts: 653

Re: addCustomEditorVariablesResolver exception in trasformat

Fri Jul 17, 2015 10:13 am


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,
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 2 guests