protected BrixConfig createBrixConfig(
      final ThreadLocalSessionFactory sf, final WorkspaceManager wm) {
    // create uri mapper for the cms
    // we are mounting the cms on the root, and getting the workspace
    // name from the
    // application properties
    UriMapper mapper =
        new PrefixUriMapper(Path.ROOT) {
          @Override
          public Workspace getWorkspaceForRequest(WebRequestCycle requestCycle, Brix brix) {
            final String name = getProperties().getJcrDefaultWorkspace();
            final SitePlugin sitePlugin = SitePlugin.get(brix);
            return sitePlugin.getSiteWorkspace(name, getProperties().getWorkspaceDefaultState());
          }
        };

    BrixConfig config = new BrixConfig(sf, wm, mapper);
    config.setHttpPort(getProperties().getHttpPort());
    config.setHttpsPort(getProperties().getHttpsPort());
    return config;
  }
  protected void registerBricketPlugins(final BrixConfig config) {
    // register bricket plugins from spring context
    Map<String, BricketPlugin> bricketPlugins =
        getApplicationContext().getBeansOfType(BricketPlugin.class);
    log.info(
        "bricket plugins = {}",
        (bricketPlugins == null ? "no plugins found." : bricketPlugins.keySet()));

    if (bricketPlugins != null) {
      for (BricketPlugin bricketPlugin : bricketPlugins.values()) {
        bricketPlugin.register(config.getRegistry());
      }
    }
  }