Skip to content

Commit

Permalink
feat: use header config file
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Dec 23, 2024
1 parent c22b095 commit 6ed524f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/gwc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<groupId>org.geoserver</groupId>
<artifactId>gs-gwc</artifactId>
<version>2.25.2-georchestra</version>
<packaging>jar</packaging>
<name>GeoWebCache (GWC) Module</name>
<version>2.25.2-georchestra</version>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/web/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-core</artifactId>
<packaging>jar</packaging>
<version>2.25.2-georchestra</version>
<packaging>jar</packaging>
<name>Core UI Module</name>

<dependencies>
Expand Down
12 changes: 3 additions & 9 deletions src/web/core/src/main/java/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,14 @@
</bean>

<bean id="georchestraHeaderHeight" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.headerHeight:90}" />
<constructor-arg value="${georchestra.headerHeight:80}" />
</bean>
<bean id="georchestraHeaderUrl" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.headerUrl:/header/}" />
<bean id="georchestraHeaderConfigFile" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.headerConfigFile:}" />
</bean>
<bean id="georchestraHeaderScript" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.headerScript:https://cdn.jsdelivr.net/gh/georchestra/header@dist/header.js}" />
</bean>
<bean id="georchestraLegacyHeader" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.useLegacyHeader:false}" />
</bean>
<bean id="georchestraLogoUrl" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.logoUrl:https://www.georchestra.org/public/georchestra-logo.svg}" />
</bean>
<bean id="georchestraStylesheet" class="java.lang.String" factory-method="valueOf">
<constructor-arg value="${georchestra.georchestraStylesheet:}" />
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@

public class GeorchestraHeaderWebComponent extends WebComponent {

private String headerUrl;
private String headerHeight;
private String legacyHeader;
private String logoUrl;
private String headerConfigFile;
private String georchestraStylesheet;
private String headerHeight;

private static Logger LOGGER = Logging.getLogger(GeorchestraHeaderWebComponent.class);

private void init() {
headerHeight = getGeoServerApplication().getBean("georchestraHeaderHeight").toString();
headerUrl = getGeoServerApplication().getBean("georchestraHeaderUrl").toString();
legacyHeader = getGeoServerApplication().getBean("georchestraLegacyHeader").toString();
logoUrl = getGeoServerApplication().getBean("georchestraLogoUrl").toString();
headerConfigFile =
getGeoServerApplication().getBean("georchestraHeaderConfigFile").toString();
georchestraStylesheet =
getGeoServerApplication().getBean("georchestraStylesheet").toString();
}
Expand All @@ -36,11 +33,8 @@ public GeorchestraHeaderWebComponent(String id) {

@Override
protected void onComponentTag(ComponentTag tag) {
tag.put("style", "width:100%;height:" + this.headerHeight + "px;border:none;");
tag.put("active-app", "geoserver");
tag.put("legacy-url", this.headerUrl);
tag.put("legacy-header", this.legacyHeader);
tag.put("logo-url", this.logoUrl);
tag.put("config-file", this.headerConfigFile);
tag.put("stylesheet", this.georchestraStylesheet);
super.onComponentTag(tag);
}
Expand Down

0 comments on commit 6ed524f

Please sign in to comment.