Page 1 of 1

Get the WebApp URL through Java

Posted: Thu Jul 18, 2024 11:45 pm
by vitorhugovm
Hello!

I'm trying to extract a parameter that is presented on the browser's URL of an opened XML file in the WebApp.
Is there any function in Java that does this or at least returns the complete URL so I can manipulate the string?
I'm currently using the version 25 of the SDK.

Thanks!
Vitor

Re: Get the WebApp URL through Java

Posted: Fri Jul 19, 2024 11:21 am
by Bogdan Dumitru
Hello Vitor,

The URL parameters are forwarded to the sync.api.Workspace.LoadingOptions. As a side-note, plugins that contribute/intercept sync.api.Workspace.LoadingOptions by listening on the sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED event. The LoadingOptions are forwarded to the server where they end up in ro.sync.ecss.extensions.api.access.EditingSessionContext. So you can access the URL parameters from EditingSessionContext. The EditingSessionContext object can be obtained like this: EditingSessionContext editingSessionContext = authorDocumentModel.getAuthorAccess().getEditorAccess().getEditingContext();

URL parameters -> LoadingOptions (client-side) -> EditingSessionContext (server-side)

Re: Get the WebApp URL through Java

Posted: Mon Jul 22, 2024 10:19 pm
by vitorhugovm
Hello Bogdan!

I did as you said and it solved my issue.

Thank you very much!
Vitor