Display updated Illustration

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Display updated Illustration

Post by Isabelle »

Hello,

We use Author web in version 25.1.0, and we have issues to display updated illustration in document.
We have a process which updates illustrations from our database directly in the webdav.
But at the end of this process, the previous version the illustration is still displayed in the document.

How can we do to display the new version of the illustration without using F5 key ?

Here is a use case :
- Open document in Author web
- Add the illustration
- The illustration is well downloaded in webdav
- Then modify the content of the illustration in webdav but keep the same name and extension file
- The new content of the illustration is not displayed

Thanks,
Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display updated Illustration

Post by Radu »

Hi Isabelle,
The author component has a cache of already loaded images.
This API method "ro.sync.exml.workspace.api.images.ImageUtilities.clearImageCache()" should clear the entire image cache.

Code: Select all

PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities().clearImageCache();
.

Once the cache is cleared you would also need to refresh the image node so that the Author visual editor re-computes the visual layout for it "ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.refresh(AuthorNode)":
https://www.oxygenxml.com/InstData/Edit ... uthorNode-

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Display updated Illustration

Post by Isabelle »

Hello Radu,
I tried these :

Code: Select all

@WebappCompatible
@WebappRestSafe
public class RefreshMediaInCacheOperation extends AuthorOperationWithResult {

    @Override
    public String doOperation(AuthorDocumentModel authorDocumentModel, ArgumentsMap argumentsMap) throws IllegalArgumentException, AuthorOperationException {
        PluginWorkspaceProvider.getPluginWorkspace().getImageUtilities().clearImageCache();

        AuthorAccess authorAccess = authorDocumentModel.getAuthorAccess();
        AuthorDocumentController documentController = authorAccess.getDocumentController();
        AuthorEditorAccess authorEditorAccess = authorAccess.getEditorAccess();

        AuthorNode[] nodesByXPath = documentController.findNodesByXPath("//graphic", true, true, true);
        Arrays.stream(nodesByXPath).toList().forEach(authorEditorAccess::refresh);

        return null;
    }
}
But it does not solve my problem.

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

Re: Display updated Illustration

Post by Bogdan Dumitru »

Hello,

There is no way to clear the image cache in Oxygen XML Web Author.
There might be a way in the next version that will be released soon, but just a solution that uses non-API. If you are interested in this, please write us on the support email address: support@oxygenxml.com.
Bogdan Dumitru
http://www.oxygenxml.com
Post Reply