Subject: How to configure the ExceptionRecognizer in Isis + how to return different HTTP status codes

  Manasingarao Shitole 2017-11-16, 10:48
In order for the framework to recognize classes as domain-services you
need to

(1) annotate your ServiceExceptionRecognizer class with
@DomainService(nature = NatureOfService.DOMAIN)

(2) make sure your ServiceExceptionRecognizer class resides in a Java
package, that is scanned by the framework.
To include Java packages for scanning, you have to register a module
class in your DomainAppAppManifest class.

public class DomainAppAppManifest implements AppManifest {
   
    /**
     * Load all services and entities found in (the packages and
subpackages within) these modules
     */
    @Override
    public List<Class<?>> getModules() {
        final List<Class<?>> modules = new ArrayList<>();
        modules.addAll(Arrays.asList(
                ...
                MyModul.class
        ));
        return modules;
    }

}

Service scanning will be done in the package where MyModul class resides
(and in any sub-packages recursively).
Regards, Andi

On 2017-11-16 11:48, Manasingarao Shitole <[EMAIL PROTECTED]>
wrote:
following exceptions, ex:
propagating entire stack trace for the expected recoverable errors.
ExceptionRecognizerForType {
ofTypeIncluding(BadRequestException.class, new String[]{"Only long comma
separated values allowed"}), prefix("Bad Request"));
property in isis.properties but it doesn't recognize:
>
isis.services=com.isis.modules.source.dom.exception.ServiceExceptionRecognizer
>
> Where as Isis document says you cant put "isis.services" along with
"isis.appManifest"
> isis.appManifest=com.isis.application.manifest.DomainAppAppManifest
>
> If we remove the "isis.appManifest" then application will fail to
bootstrap.
>
> Of-course I havn't understood correctly and going somewhere wrong. I
dont find any clue in docs nor there are any examples on that.
> Could someone guide us with examples, that will be of great help.
>
> Thank you in anticipation.
>
> Kind regards,
> -Mansingh
>
>
>
  Dan Haywood 2017-11-17, 06:36
  Manasingarao Shitole 2017-11-17, 10:13