Skip to content

Commit

Permalink
Merge pull request #1695 from lat-lon/fix/deegreeAdminConsole-1654
Browse files Browse the repository at this point in the history
Fix deegree admin console: scan beans, implement serializable
  • Loading branch information
stephanr authored Jun 5, 2024
2 parents 0cf466e + 9e9e190 commit d11ad43
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
import jakarta.faces.event.PhaseEvent;
import jakarta.faces.event.PhaseId;
import jakarta.faces.event.PhaseListener;

import org.slf4j.Logger;

import java.util.Map;
import java.util.Map.Entry;

/**
* TODO add class documentation here
*
Expand All @@ -60,6 +62,14 @@ public void afterPhase(PhaseEvent event) {

public void beforePhase(PhaseEvent event) {
LOG.debug("Before phase: {}", event.getPhaseId());
if (LOG.isDebugEnabled()) {
Map<String, Object> sessionMap = event.getFacesContext().getExternalContext().getSessionMap();
for (Entry<String, Object> beanEntry : sessionMap.entrySet()) {
String beanName = beanEntry.getKey();
Object bean = beanEntry.getValue();
LOG.debug(" - {}: {}", beanName, bean);
}
}
}

public PhaseId getPhaseId() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
version="3.0">

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.remoteows.RemoteOWSManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new remote OWS connection" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateRemoteOwsBean extends AbstractCreateResourceBean {
public class CreateRemoteOwsBean extends AbstractCreateResourceBean implements Serializable {

public CreateRemoteOwsBean() {
super(RemoteOWSManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@
import jakarta.faces.application.FacesMessage;
import jakarta.faces.context.ExternalContext;
import jakarta.faces.context.FacesContext;

import jakarta.inject.Named;
import org.deegree.console.workspace.WorkspaceBean;
import org.deegree.db.ConnectionProvider;
import org.deegree.db.ConnectionProviderProvider;
import org.deegree.workspace.Workspace;

import java.io.Serializable;

/**
* JSF Bean for testing the availability of connections offered by
* {@link ConnectionProvider}s.
Expand All @@ -58,7 +59,7 @@
*/
@Named
@SessionScoped
public class ConnectionTester {
public class ConnectionTester implements Serializable {

private Workspace getWorkspace() {
ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.db.ConnectionProviderManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new database connection" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateSqlConnectionBean extends AbstractCreateResourceBean {
public class CreateSqlConnectionBean extends AbstractCreateResourceBean implements Serializable {

public CreateSqlConnectionBean() {
super(ConnectionProviderManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.coverage.persistence.CoverageManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new coverage" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateCoverageBean extends AbstractCreateResourceBean {
public class CreateCoverageBean extends AbstractCreateResourceBean implements Serializable {

public CreateCoverageBean() {
super(CoverageManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.feature.persistence.FeatureStoreManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new feature store" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateFeatureStoreBean extends AbstractCreateResourceBean {
public class CreateFeatureStoreBean extends AbstractCreateResourceBean implements Serializable {

public CreateFeatureStoreBean() {
super(FeatureStoreManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
e-mail: info@deegree.org
----------------------------------------------------------------------------*/
package org.deegree.console.datastore.feature;

import static jakarta.faces.application.FacesMessage.SEVERITY_ERROR;
import static org.apache.commons.io.FileUtils.readFileToByteArray;
import static org.deegree.feature.types.property.GeometryPropertyType.CoordinateDimension.DIM_2;
Expand Down Expand Up @@ -91,14 +90,16 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;

/**
* JSF bean that helps with creating configurations for the {@link SQLFeatureStore}.
*
* @author <a href="mailto:schneider@lat-lon.de">Markus Schneider</a>
*/
@Named
@SessionScoped
public class MappingWizardSQL {
public class MappingWizardSQL implements Serializable {

private static transient Logger LOG = LoggerFactory.getLogger(MappingWizardSQL.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.metadata.persistence.MetadataStoreManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new metadata store" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateMetadataStoreBean extends AbstractCreateResourceBean {
public class CreateMetadataStoreBean extends AbstractCreateResourceBean implements Serializable {

public CreateMetadataStoreBean() {
super(MetadataStoreManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.tile.persistence.TileStoreManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new tile store" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateTileStoreBean extends AbstractCreateResourceBean {
public class CreateTileStoreBean extends AbstractCreateResourceBean implements Serializable {

public CreateTileStoreBean() {
super(TileStoreManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.layer.persistence.LayerStoreManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new layer" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateLayerBean extends AbstractCreateResourceBean {
public class CreateLayerBean extends AbstractCreateResourceBean implements Serializable {

public CreateLayerBean() {
super(LayerStoreManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.style.persistence.StyleStoreManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new style" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateStyleBean extends AbstractCreateResourceBean {
public class CreateStyleBean extends AbstractCreateResourceBean implements Serializable {

public CreateStyleBean() {
super(StyleStoreManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.theme.persistence.ThemeManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new theme" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateThemeBean extends AbstractCreateResourceBean {
public class CreateThemeBean extends AbstractCreateResourceBean implements Serializable {

public CreateThemeBean() {
super(ThemeManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.services.wps.ProcessManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new process" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateProcessBean extends AbstractCreateResourceBean {
public class CreateProcessBean extends AbstractCreateResourceBean implements Serializable {

public CreateProcessBean() {
super(ProcessManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package org.deegree.console.proxy;

import java.io.IOException;
import java.io.Serializable;

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
Expand All @@ -38,7 +39,7 @@
*/
@Named
@RequestScoped
public class ProxyBean {
public class ProxyBean implements Serializable {

public ProxyConfig getProxyConfig() throws IOException {
return new ProxyConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.deegree.console.AbstractCreateResourceBean;
import org.deegree.services.OwsManager;

import java.io.Serializable;

/**
* JSF backing bean for "Create new webservice" view.
*
Expand All @@ -40,7 +42,7 @@
*/
@Named
@ViewScoped
public class CreateServiceBean extends AbstractCreateResourceBean {
public class CreateServiceBean extends AbstractCreateResourceBean implements Serializable {

public CreateServiceBean() {
super(OwsManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.console.webservices.wps;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -49,7 +50,7 @@
*/
@Named
@RequestScoped
public class ProcessExecutionsBean {
public class ProcessExecutionsBean implements Serializable {

private final List<ProcessExecution> executions = new ArrayList<ProcessExecution>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.console.webservices.wps;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -50,7 +51,7 @@
*/
@Named
@RequestScoped
public class WPSBean {
public class WPSBean implements Serializable {

private final String version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package org.deegree.console.workspace;

import java.io.File;
import java.io.Serializable;

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
Expand All @@ -42,7 +43,7 @@
*/
@Named
@RequestScoped
public class CreateWorkspaceBean {
public class CreateWorkspaceBean implements Serializable {

private String workspaceName;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
version="3.0">

</beans>

0 comments on commit d11ad43

Please sign in to comment.