Browse Source

Refine documentation wording for normalizer, validation and comment checks

pull/25826/head
maliming 2 months ago
parent
commit
44216a74a8
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      docs/en/framework/api-development/auto-controllers.md
  2. 2
      docs/en/framework/fundamentals/localization.md
  3. 4
      docs/en/framework/fundamentals/validation.md
  4. 7
      docs/en/framework/infrastructure/interceptors.md
  5. 2
      docs/en/modules/cms-kit/comments.md

2
docs/en/framework/api-development/auto-controllers.md

@ -93,7 +93,7 @@ Then the route for getting a book will be '**/api/volosoft/book-store/book/{id}*
* Normalization can be customized by setting the `UrlActionNameNormalizer` option. It's an action delegate that is called for every method. * Normalization can be customized by setting the `UrlActionNameNormalizer` option. It's an action delegate that is called for every method.
* If there is another parameter with 'Id' postfix, then it's also added to the route as the final route segment (like '/phoneId'). * If there is another parameter with 'Id' postfix, then it's also added to the route as the final route segment (like '/phoneId').
When the `UrlControllerNameNormalizer` option is not set, the final controller name also removes suffixes configured in `AbpConventionalControllerOptions.IgnoredUrlSuffixesInControllerNames` (a custom normalizer takes over the whole controller-name calculation and the ignored suffixes are not applied). The default list contains `Integration`, so `PaymentIntegrationService` uses `payment` as its controller route name. You can replace the list when another suffix convention is required: When the `UrlControllerNameNormalizer` option is not set, the final controller name also removes suffixes configured in `AbpConventionalControllerOptions.IgnoredUrlSuffixesInControllerNames` (a custom normalizer replaces this ignored-suffix step, so the ignored suffixes are not applied). The default list contains `Integration`, so `PaymentIntegrationService` uses `payment` as its controller route name. You can replace the list when another suffix convention is required:
```csharp ```csharp
Configure<AbpConventionalControllerOptions>(options => Configure<AbpConventionalControllerOptions>(options =>

2
docs/en/framework/fundamentals/localization.md

@ -363,7 +363,7 @@ var serialized = localizableStringSerializer.Serialize(
var localizableString = localizableStringSerializer.Deserialize(serialized!); var localizableString = localizableStringSerializer.Deserialize(serialized!);
```` ````
The default serializer uses `L:<resource-name>,<key>` for `LocalizableString` and `F:<value>` for `FixedLocalizableString`. A value without a recognized prefix is deserialized as a `FixedLocalizableString`; values too short to carry a prefix and a content (like the literal `L:`) are treated the same way. An `L:` value without a comma or with an empty key throws an `AbpException`. Serializing `null` returns `null`; serializing another `ILocalizableString` implementation throws an `AbpException`. The default serializer uses `L:<resource-name>,<key>` for `LocalizableString` and `F:<value>` for `FixedLocalizableString`. A value without a recognized prefix is deserialized as a `FixedLocalizableString`; values too short to carry both a prefix and content (like the literal `L:`) are treated the same way. An `L:` value without a comma or with an empty or whitespace-only key throws an `AbpException`. Serializing `null` returns `null`; serializing another `ILocalizableString` implementation throws an `AbpException`.
### Format Arguments ### Format Arguments

4
docs/en/framework/fundamentals/validation.md

@ -145,6 +145,10 @@ public class InputClass
If a class that is subject to automatic validation (it implements `IValidationEnabled`, like application services do) has `[DisableValidation]`, add `[EnableValidation]` to a method to re-enable automatic validation for that method (`[EnableValidation]` does not activate validation for a class that isn't intercepted at all): If a class that is subject to automatic validation (it implements `IValidationEnabled`, like application services do) has `[DisableValidation]`, add `[EnableValidation]` to a method to re-enable automatic validation for that method (`[EnableValidation]` does not activate validation for a class that isn't intercepted at all):
````csharp ````csharp
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Validation;
[DisableValidation] [DisableValidation]
public class MyService : IValidationEnabled, ITransientDependency public class MyService : IValidationEnabled, ITransientDependency
{ {

7
docs/en/framework/infrastructure/interceptors.md

@ -209,9 +209,10 @@ You can also disable ABP class interceptors for all registrations or for types s
// Disable all class interceptors. // Disable all class interceptors.
context.Services.DisableAbpClassInterceptors(); context.Services.DisableAbpClassInterceptors();
// Or disable them only for selected types. The predicate receives the // Or disable them only for selected types. The predicate runs for class
// exposed service type, which differs from the implementation type when // service registrations and receives the exposed class service type,
// a class is exposed through its interfaces or base classes. // which is the exposed base class rather than the implementation type
// when a class is exposed through a base class.
context.Services.DisableAbpClassInterceptors( context.Services.DisableAbpClassInterceptors(
new NamedTypeSelector( new NamedTypeSelector(
"MyHotPathServices", "MyHotPathServices",

2
docs/en/modules/cms-kit/comments.md

@ -45,7 +45,7 @@ Configure<CmsKitCommentOptions>(options =>
- `EntityTypes`: List of defined entity types (`CommentEntityTypeDefinition`) in the comment system. - `EntityTypes`: List of defined entity types (`CommentEntityTypeDefinition`) in the comment system.
- `IsRecaptchaEnabled`: This flag enables or disables the reCaptcha for the comment system. You can set it as **true** if you want to use reCaptcha in your comment system. - `IsRecaptchaEnabled`: This flag enables or disables the reCaptcha for the comment system. You can set it as **true** if you want to use reCaptcha in your comment system.
- `AllowedExternalUrls`: The allowed external URLs for each entity type. When it is specified for an entity type, a comment is rejected when it contains an external URL that doesn't include any of the configured values. The check is a case-insensitive substring comparison of the normalized URLs (`www.` prefixes and trailing slashes are ignored), not an exact origin match. - `AllowedExternalUrls`: The allowed external URLs for each entity type. When it is specified for an entity type, every detected HTTP(S) URL in a comment text is checked, and the comment is rejected when a detected URL doesn't include any of the configured values. The comparison is a case-insensitive substring check on the normalized URLs, not an exact origin match.
`CommentEntityTypeDefinition` properties: `CommentEntityTypeDefinition` properties:

Loading…
Cancel
Save