Page 1 of 1

Facing issues while loading class from JavaScript side

Posted: Wed Mar 01, 2023 2:51 pm
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

Re: Facing issues while loading class from JavaScript side

Posted: Wed Mar 01, 2023 4:22 pm
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.

Re: Facing issues while loading class from JavaScript side

Posted: Thu Mar 02, 2023 8:30 am
by SmitaPatil
Hi Bogdan,
I have added @WebappRestSafe annotation for my custom class, But still I am facing this issue.

Thanks & Regards,
Smita

Re: Facing issues while loading class from JavaScript side

Posted: Thu Mar 02, 2023 11:10 am
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());
}