Skip to content

Commit

Permalink
#2349 Introduce a default stub implementation of IEntityMasterUrlProv…
Browse files Browse the repository at this point in the history
…ider to correct the IoC configuration

4ae670e introduced IUrlGenerator but bound it only in IBasicWebApplicationServerModule,
which caused some other IoC modules to break (TgTestApplicationServerModule in particular, which
is used by DataPopulationConfig in PopulateDb).
  • Loading branch information
homedirectory committed Dec 2, 2024
1 parent b260604 commit 01cbfa4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package ua.com.fielden.platform.web.interfaces;

import com.google.inject.ImplementedBy;
import ua.com.fielden.platform.entity.AbstractEntity;

import java.util.Optional;

/**
* A contract to generate an entity master URI for a specific entity.
* <p>
* An implementation should be bound in an IoC module.
* The default implementation doesn't provide meaningful results.
*
* @author TG Team
*/
@FunctionalInterface
@ImplementedBy(StubEntityMasterUrlProvider.class)
public interface IEntityMasterUrlProvider {

static String PARTIAL_URL_PATTERN = "#/master/%s/%s";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ua.com.fielden.platform.web.interfaces;

import ua.com.fielden.platform.entity.AbstractEntity;

import java.util.Optional;

final class StubEntityMasterUrlProvider implements IEntityMasterUrlProvider {

@Override
public Optional<String> masterUrlFor(final AbstractEntity<?> entity) {
return Optional.empty();
}

}

0 comments on commit 01cbfa4

Please sign in to comment.