Get the WebApp URL through Java

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
vitorhugovm
Posts: 25
Joined: Fri Jan 26, 2024 3:31 pm

Get the WebApp URL through Java

Post 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
Bogdan Dumitru
Site Admin
Posts: 157
Joined: Tue Mar 20, 2018 5:28 pm

Re: Get the WebApp URL through Java

Post 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)
Bogdan Dumitru
http://www.oxygenxml.com
vitorhugovm
Posts: 25
Joined: Fri Jan 26, 2024 3:31 pm

Re: Get the WebApp URL through Java

Post by vitorhugovm »

Hello Bogdan!

I did as you said and it solved my issue.

Thank you very much!
Vitor
Post Reply