Skip to content

Commit

Permalink
MCR-3342 fix viewer
Browse files Browse the repository at this point in the history
* viewer opens now in preview
* viewer opens now in fullscreen
  • Loading branch information
Mewel committed Feb 26, 2025
1 parent 0d1bd6e commit 5b39dd2
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@
*/
public class MCRViewerConfiguration {

private static final Logger LOGGER = LogManager.getLogger(MCRViewerConfiguration.class);
private static final Logger LOGGER = LogManager.getLogger();

public enum ResourceType {
SCRIPT, MODULE, CSS
SCRIPT, MODULE, CSS;

@Override
public String toString() {
return super.toString().toLowerCase(Locale.ROOT);
}
}

private final Multimap<ResourceType, String> resources;
Expand Down Expand Up @@ -353,7 +358,7 @@ public final List<MCRIViewClientProperty> getProperties() {
@XmlRootElement(name = "resource")
private static class MCRIViewClientResource {

@XmlAttribute(name = "type", required = true)
@XmlTransient
public ResourceType type;

@XmlValue
Expand All @@ -368,6 +373,11 @@ private static class MCRIViewClientResource {
this.url = url;
}

@XmlAttribute(name = "type", required = true)
public String getType() {
return type.name().toLowerCase(Locale.ROOT);
}

@Override
public boolean equals(Object obj) {
if (obj instanceof MCRIViewClientResource rhs) {
Expand Down Expand Up @@ -412,7 +422,6 @@ public String getXMLValue() {

private static final class MultimapSerializer implements JsonSerializer<Multimap<ResourceType, String>> {

@SuppressWarnings("serial")
private static final Type T = new TypeToken<Map<ResourceType, Collection<String>>>() {
}.getType();

Expand Down

0 comments on commit 5b39dd2

Please sign in to comment.