Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a Plack middleware for supporting FilterContent output filters #737

Closed
bschmalhofer opened this issue Jan 19, 2021 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Jan 19, 2021

This is more of a project idea. In OTOBO there are output filters that modify the generated Response. In Plack there are middlewares that do the same thing. So the idea is to implement the OTOBO output filters as one, or several??, Plack midddlewares. This looks like a cleaner architecture.

Note that this would only apply to the filters that are configured as 'FilterConten'.

But first we need to check whether any features would be lost.

@bschmalhofer bschmalhofer added the enhancement New feature or request label Jan 19, 2021
@bschmalhofer bschmalhofer self-assigned this Jan 20, 2021
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Jan 20, 2021
bschmalhofer added a commit that referenced this issue Jan 20, 2021
in order to better reflect the actual usage
bschmalhofer added a commit that referenced this issue Jan 21, 2021
This approach was not practical because $Kernel::OM is localised.
Nevertheless, try to centralise ApplyOutputFilters
bschmalhofer added a commit that referenced this issue Jan 21, 2021
Try to aligne InterfaceAgent.pm and InterfaceCustomer.pm.
So that the behavior that is really different becomes more obvious.
bschmalhofer added a commit that referenced this issue Jan 21, 2021
before a FatalError() or a CustomerFatalError().
The return has no effect as the sub throws an exception.
bschmalhofer added a commit that referenced this issue Jan 21, 2021
@bschmalhofer
Copy link
Contributor Author

I sounded like a good idea, but it didn't pan out. $Kernel::OM is localised in the handle $OTOBOApp. For putting the FilterContent feature we would have to expand the scope of $Kernel::OM or create a separate instance in the middleware. Both workaraounds are not nice.

In order to make at least some progress I have moved the call to ApplyOutputHandlers into $OTOBOApp . This simplifies the interface modules a little bit.
Also: clean up the redundant return statement in the interface modules.

The issue will be closed when rel-10_1 looks stable again.

@bschmalhofer bschmalhofer added the wontfix This will not be worked on label Jan 21, 2021
bschmalhofer added a commit that referenced this issue Jan 21, 2021
@bschmalhofer bschmalhofer changed the title Make better use of Plack Middleware Use a Plack middlewore for supporting FilterContent output filters Jan 21, 2021
@bschmalhofer bschmalhofer changed the title Use a Plack middlewore for supporting FilterContent output filters Use a Plack middleware for supporting FilterContent output filters Jan 21, 2021
@bschmalhofer
Copy link
Contributor Author

Closing as generally 'wontfix', but with some refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant