Commit graph

10 commits

Author SHA1 Message Date
Subramanya Sastry
071d368495 Revert "Revert "TransformHandler: Load stashed page bundle based on ETag.""
This reverts commit c4f40bd107.

Change-Id: Iff0f9859a83506059f100ddd60b74cfdd1279071
2023-03-10 13:44:46 -06:00
Subramanya Sastry
c4f40bd107 Revert "TransformHandler: Load stashed page bundle based on ETag."
This reverts commit ee8dd055c8.

Reason for revert: breaks officewiki

Bug: T331629
Depends-On: I46f16eae9c137d43aad22bfd4be460cfb635614b
Change-Id: Ieb0dedfb5ae3168749a9ab6d930be527337348e8
2023-03-09 15:36:54 +00:00
daniel
ee8dd055c8 TransformHandler: Load stashed page bundle based on ETag.
Allow clients to use an If-Match header with the
transform/html/to/wikitext endpoint.

Bug: T310464
Needed-By: Ifb1c40a0044f04fb339b00630fbca9190a1bce51
Change-Id: Ida81a314f015e205f2081c68a82d486145097c92
2023-01-24 20:26:05 +01:00
Derick Alangi
1afd52e3e4 REST: Move Helper classes to their own namespace
Mixing Handlers with Helpers doesn't look nice for consistency
reasons. Helpers should be in their own place (grouped) in the
Handlers directory as they're really "helpers for the handlers".

Change-Id: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
2023-01-16 21:16:09 +01:00
daniel
f31cd9f1d3 REST: HtmlInputTransformHelper: Load original data from stash
Parsoid needs the original rendering in order to apply
selective serialization (selser). The page/{title}/html endpoint
can stash the rendering, and now the transform endpoint can make use
of the stashed rendering.

Bug: T310464
Change-Id: Ia58043ed3aa1eb12731d82aa87606c82ec63f663
2022-09-29 19:52:27 +02:00
daniel
24a26ec25b REST: make ParsoidHandler use HTMLTransformFactory
This also moves the creation of PageConfig from HTMLTransformFactory
into HTMLTransform, to ensure all relevant info, particularly the
page language, is known.

Change-Id: Id354862d6497816e0c007b9cb3b0d183c9d4b719
2022-09-16 18:46:17 +02:00
Máté Szabó
36dd10f9de Migrate use of ${var}-style string interpolation
The "${var}" and "${expr}" style string interpolations are deprecated in
PHP 8.2. Migrate usages in core to "{$var}" as appropriate.

Bug: T314096
Change-Id: I269bad3d4a68c2b251b3e71a066289d4ad9fd496
2022-07-29 02:45:09 +02:00
Derick Alangi
c1c5f3f7f3 Rest: Make transformation endpoints configurable
Page bundles should not be part of the publicly accessible
API and if we really need it, we can expose it and consume
internally. Hence, remove support for this transform from the
endpoint.

This patch falls back to the behavior before for backwards
compatibility before we fully switch over to using the transforms
in core. We still need to support both core & restbase for now.

NOTE: API integration tests have been updated to status code
404 since we're removing support for it now. If we need it,
we'll expose via a different endpoint and introduce tests.

Bug: T311477
Change-Id: I5577f61f7ae7da2a4d3a78d9ce962997466d550c
2022-06-30 13:28:57 +01:00
Derick Alangi
b0d08dcbfc Rest: Remove {domain} param from TransformHandler
RESTBase used this to check if the domain sent by the client
matches the domain in the restbase config under the hood. Since
this code is moving to core, this assertion is no longer needed.

Bug: T301370
Change-Id: I01a4f35b81c31d106671e5c829d317a41687fd7a
2022-06-02 19:37:51 +01:00
Derick Alangi
80ce1fe28f Rest: Move TransformHandler to core (part 1)
Begin moving the transform endpoints and handler class to
MediaWiki core.

Bug: T301370
Change-Id: I94e9d2e8d497c1992c542001afe333fa7537e553
2022-06-02 15:55:06 +01:00