Facing issues while loading class from JavaScript side

Having trouble installing Oxygen? Got a bug to report? Post it all here.
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

Facing issues while loading class from JavaScript side

Post by SmitaPatil »

Hi Team,

I have implemented one functionality related to table for that I have extended AbstractTableOperation.
and I am overriding below mentioned method in my custom class(AlignTableContentOperation) and I am trying to call my custom class from javascript side using invokeoperation.
@Override
protected void doOperationInternal(AuthorAccess authorAccess, ArgumentsMap args) throws AuthorOperationException {
}
But I am getting error as Author operation com.judicial.west.content.author.plugin.actions.table.AlignTableContentOperation could not be loaded.
Usually we extend AuthorOperationWithResult class to make it callable from javascript side.
In above example I am extending AbstractTableOperation which implements AuthorOperation so I think it should get loaded.
Can you please tell me if there is any way to make it callable from Javascript side.
Please let me know if you have any doubt.

Thanks & Regards,
Smita
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Facing issues while loading class from JavaScript side

Post by Bogdan Dumitru »

Hello,

To invoke a ro.sync.ecss.extensions.api.AuthorOperation programmatically, from JavaScript you have to use sync.api.ActionsManager.invokeOperation().
A possible error may be caused by missing the WebappRestSafe declaration, please see this page. If that doesn't help you please give us more details about the error that you're encountering.
Bogdan Dumitru
http://www.oxygenxml.com
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

Re: Facing issues while loading class from JavaScript side

Post by SmitaPatil »

Hi Bogdan,
I have added @WebappRestSafe annotation for my custom class, But still I am facing this issue.

Thanks & Regards,
Smita
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Facing issues while loading class from JavaScript side

Post by Bogdan Dumitru »

Hi Smita,

We've analyzed the ro.sync.ecss.extensions.commons.table.operations.AbstractTableOperation API and we sense that a problem may arise if in your AlignTableContentOperation class that extends it, the constructor without arguments is missing. Without it, the application cannot instantiate objects for this class. We'll try to improve the JavaDoc in order to clarify this aspect.

It might work with something like this:

Code: Select all

public AlignTableContentOperation () {
  super(new CALSDocumentTypeHelper());
}
Bogdan Dumitru
http://www.oxygenxml.com
Post Reply