using InvercargillSqlInversion; using Inversion; namespace Spry { /** * Inversion module that registers Spry's user store: the `spry_users` and * `spry_user_permissions` schema (M0001 + M0002 migrations), the * entity/projection * mappings, and the scoped {@link Spry.Authentication.UserService}. * * Register this module with the application container alongside * `StatumModule`; it registers no endpoints. The Spry CSS framework and * its themes are embedded as default Statum resources (see * {@link Spry.Resources}), served from `/_statum/resource/spry.css` and * `/_statum/resource/spry-theme-*.css`. Ready-made actions are bound * separately via {@link SpryAuth.register_actions} or * `StatumConfigurator.action`. */ public class SpryModule : Object, Module { public void register_components(Container container) throws Error { // Sql table setup var sql = container.configure_with(); sql.add_migration(); sql.add_migration(); sql.add_entity(Authentication.UserEntity.entity_mapping); sql.add_entity(Authentication.UserPermissionEntity.entity_mapping); sql.add_projection(Authentication.UserProjection.projection_mapping); // Service setup container.register_scoped(); // Embed the Spry CSS framework as default resources (generated at // build time by statum-mkres, precompressed). Apps get the core // stylesheet and every theme for free and may activate a theme // with a second plus // data-theme on . container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); container.register_startup().as(); } } }