Repositories and services overview
This section lists the most important repositories and services that are provided by WebCmsModule. These beans are all exposed and can be use in all modules that depend on WebCmsModule.
Use repositories to directly access the datastore. Repository methods are multi-domain agnostic and usually require an explicit WebCmsDomain as parameter to your queries. Repositories will also never return cached items.
Repositories are all implemented using Spring Data JPA.
Services usually are domain aware and will inspect the WebCmsMultiDomainConfiguration to automatically adjust queries to match for the domain bound to a thread. This makes them transparent in use, especially for front-end application building. Services will also use available caches and can return cached items.
Administration UIs will often require more direct use of repositories, whereas services provide convenience methods to avoid too much domain related clotter in your application code.
Repository beans
Repositories provide direct access to the stored entities.
Use these if you want to interact directly with the datastore.
All repositories of WebCmsModule entities implement both JpaSpecificationExecutor
and QueryDslPredicateExecutor
.
Q classes (e.g. QWebCmsArticle
) are also available for all WebCmsModule entities. Pretty much every entity has its own repository.
-
general
-
WebCmsDomainRepository
-
WebCmsComponentRepository
-
WebCmsMenuRepository
-
WebCmsMenuItemRepository
-
-
types
-
WebCmsTypeSpecifierRepository
-
WebCmsArticleTypeRepository
-
WebCmsComponentTypeRepository
-
WebCmsPageTypeRepository
-
WebCmsPublicationTypeRepository
-
-
assets
-
WebCmsAssetRepository
-
WebCmsArticleRepository
-
WebCmsImageRepository
-
WebCmsPageRepository
-
WebCmsPublicationRepository
-
-
endpoints
-
WebCmsEndpointRepository
-
WebCmsAssetEndpointRepository
-
WebCmsRemoteEndpointRepository
-
WebCmsUrlRepository
-
-
entity links
-
WebCmsTypeSpecifierLinkRepository
-
Working with WebCmsComponent is usually not done directly but through a WebCmsComponentModel . The WebCmsComponentModelService is probably all you need, but if not, you will almost always want to build the WebCmsComponentModel for your fetched components using the WebCmsComponentModelService .
|
When implementing your own WebCmsAsset
, WebCmsTypeSpecifier
or basic WebCmsObject
, you should check the generic interfaces for reuse:
-
WebCmsObjectRepository
: basic contract for fetching aWebCmsObject
by object id -
WebCmsObjectEntityRepository
: base Spring Data repository interface for entities extendingWebCmsObjectSuperClass
-
BaseWebCmsTypeSpecifier
: base Spring Data repository for customWebCmsTypeSpecifier
implementations
Service beans
Core services
The core services are always created when WebCmsModule is enabled in your application.
Service | Description |
---|---|
|
|
|
Generic asset related functions (e.g. generate preview URL for an asset). |
|
URL (for asset) related functions. |
|
|
|
|
|
|
|
Loading and updating components. |
|
Request scoped bean that can be used to register components to render on the current request. |
|
Functionality for working with content markers in text. |
|
Specific Spring |
|
General service for importing WebCmsModule data from generic |
|
Service for creating default components for any |
|
Service for retrieving domains and related metadata. |
|
Service for accessing the current domain context and inspecting the multi-domain configuration. Extends the |
|
Request scoped service for retrieving placeholder content registered on the current request. |
|
Request scoped bean to set and retrieve placeholder data for the current request. |
|
Provides utility functions for using during output rendering. |
|
Functionality for retrieving type specifiers. |
|
Utility service for creating a |
|
Service for automatic creation of |
Admin UI services
These are only available when EntityModule and AdminWebModule are enabled in your application. The focus of these services is to help you build or customize the administration UI.
Service | Description |
---|---|
|
Service for building |
|
Helper service for retrieving multi-domain configuration for the current request in an admin web context. Utility functions for building domain-aware filters. |