Highlighted

java class not found in cf code

New Here ,
May 30, 2019

Copy link to clipboard

Copied

J'd like to manage libreooffice api for replace text in odf.

i've done a running java cfx but when i transate to cf sintax i get an error

this is the working java/cfx code

com.sun.star.util.XReplaceable xReplaceable = null;

com.sun.star.util.XReplaceDescriptor xReplaceDescr = null;

xReplaceable = UnoRuntime.queryInterface(com.sun.star.util.XReplaceable.class, xTextDocument);

xReplaceDescr = xReplaceable.createReplaceDescriptor();

and this is the cf code

<cfset xReplaceable = CreateObject("java", "com.sun.star.util.XReplaceable")>

<cfset xReplaceableClass = xReplaceable.getClass()>

<cfset xReplaceable = UnoRuntime.queryInterface(XTextDocumentClass, xTextDocument)>

<cfset xReplaceDescr = xReplaceable.createReplaceDescriptor()>

the error is in the last line

class not found: com.sun.star.util.XReplaceable.createReplaceDescriptor

any ideas?

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Do you mean:

<cfset xReplaceable                 = createObject("java", "com.sun.star.util.XReplaceable")>

<cfset xReplaceableClass        = xReplaceable.getClass()>

<cfset xReplaceableInterface  = UnoRuntime.queryInterface(xReplaceableClass, xTextDocument)>

<cfset xReplaceDescr              = xReplaceableInterface.createReplaceDescriptor()>

Views

119

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

java class not found in cf code

New Here ,
May 30, 2019

Copy link to clipboard

Copied

J'd like to manage libreooffice api for replace text in odf.

i've done a running java cfx but when i transate to cf sintax i get an error

this is the working java/cfx code

com.sun.star.util.XReplaceable xReplaceable = null;

com.sun.star.util.XReplaceDescriptor xReplaceDescr = null;

xReplaceable = UnoRuntime.queryInterface(com.sun.star.util.XReplaceable.class, xTextDocument);

xReplaceDescr = xReplaceable.createReplaceDescriptor();

and this is the cf code

<cfset xReplaceable = CreateObject("java", "com.sun.star.util.XReplaceable")>

<cfset xReplaceableClass = xReplaceable.getClass()>

<cfset xReplaceable = UnoRuntime.queryInterface(XTextDocumentClass, xTextDocument)>

<cfset xReplaceDescr = xReplaceable.createReplaceDescriptor()>

the error is in the last line

class not found: com.sun.star.util.XReplaceable.createReplaceDescriptor

any ideas?

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Do you mean:

<cfset xReplaceable                 = createObject("java", "com.sun.star.util.XReplaceable")>

<cfset xReplaceableClass        = xReplaceable.getClass()>

<cfset xReplaceableInterface  = UnoRuntime.queryInterface(xReplaceableClass, xTextDocument)>

<cfset xReplaceDescr              = xReplaceableInterface.createReplaceDescriptor()>

Views

120

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 30, 2019 0
Adobe Community Professional ,
May 30, 2019

Copy link to clipboard

Copied

Do you mean:

<cfset xReplaceable                 = createObject("java", "com.sun.star.util.XReplaceable")>

<cfset xReplaceableClass        = xReplaceable.getClass()>

<cfset xReplaceableInterface  = UnoRuntime.queryInterface(xReplaceableClass, xTextDocument)>

<cfset xReplaceDescr              = xReplaceableInterface.createReplaceDescriptor()>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2019 0
bagigio LATEST
New Here ,
May 30, 2019

Copy link to clipboard

Copied

yes, last nigth i was so tired that i didt'see the macroscopic transale error.....

tanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2019 0