1. Domino Brix
  2. Routing

Registering routes

Annotate presenters with @BrixRoute and wrap them in @BrixComponent. Generated routing providers register the presenter with Domino History so pushing a token activates the presenter.

			@BrixPresenter
public class AdminPresenter extends Presenter<AdminView> {
  @Override
  public Set<String> getRoles() {
    return Set.of("admin");
  }

  @Override
  public Authorizer getAuthorizer() {
    return RolesAllowedAuthorizer.INSTANCE;
  }
}

		

Parameterized routes

Use :param placeholders in the route path. Brix and Domino History parse path, query, and fragment parts and map them to annotated fields.

			SecurityContext sc = (SecurityContext) Brix.get().getCoreComponent().core().getSecurityContext();
sc.setUser(new MyUser());
sc.setUnauthorizedAccessHandler(() -> window.alert("Access denied"));

		

Access routing state

Annotated fields are refreshed before activation and on token changes. You can also read directly from the routing state for richer access or override setState to map into custom fields.

			public class DepartmentAuthorizer implements Authorizer {
  @Override
  public boolean isAuthorized(IsSecurityContext context, HasRoles hasRoles) {
    return context.isAuthenticated()
        && context.getUser().getAttributes().get("department").ifTypeIs(String.class, dept -> {
             return dept.equals("engineering");
           });
  }
}

		

Child routes & navigation

  • Child presenters merge parent and child token filters so parents activate first.
  • Hash vs path routing: routes containing # use fragment-based filters; others use path filters.
  • Use Brix.get().router().pushToken(...) to navigate programmatically.
  • Views implementing CanConfirmNavigation/ProvidesConfirmNavigation register a history interceptor during activation.

We are a group of passionate people who love what we do

Donate & Support Us