Skip to content
Snippets Groups Projects
Commit ca14c715 authored by uhensler's avatar uhensler
Browse files

OO-3937: Open even view only supported file formats in Collabora

parent 9922aff5
No related branches found
No related tags found
No related merge requests found
......@@ -129,12 +129,19 @@ public class CollaboraServiceImpl implements CollaboraService, GenericEventListe
public String getEditorBaseUrl(File file) {
String suffix = FileUtils.getFileSuffix(file.getName());
Action action = wopiService.getAction(getDiscovery(), "edit", suffix);
if (action == null) {
action = wopiService.getAction(getDiscovery(), "view", suffix);
}
return action != null? action.getUrlSrc(): null;
}
@Override
public boolean accepts(String suffix, Mode mode) {
return wopiService.hasAction(getDiscovery(), "edit", suffix);
boolean accepts = wopiService.hasAction(getDiscovery(), "edit", suffix);
if (!accepts && Mode.VIEW.equals(mode)) {
accepts = wopiService.hasAction(getDiscovery(), "view", suffix);
}
return accepts;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment