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

Feature/drpldcx 65/notify article on pubinfo deletion #12

Merged

Conversation

goechsler
Copy link
Contributor

This adds an new possible parameter to the DC-X Notification Responder, to be able to notify articles of a change in DC-X.

STR:

  • Call the notification callback with a valid path to node, e.g. dcx-notification?url=node/28
    • The parameter is called url because that's the name of the respective variable in the DC-X data
    • Find the respective node queued for archiving in queue 'dcx_article_archiver' (in the database)

The reasoning behind this can be found in a lengthy mail on the topic:

Man kann in Drupal ein auf Artikeln in Verwendung befindliches Bild löschen. An den Artikeln bleibt diese Bild-Referenz allerdings erhalten. Drupal kommt damit zurecht und ignoriert diese Dateninkonsistenz einfach. Sie wird erst behoben, wenn ein Artikel mit einem solchen fehlenden Bild über die Weboberfläche neu gespeichert wird.

Implementiert ist bereits folgendes:
Wenn wir ein Bild aus Drupal löschen, werden alle Verwendungsmeldungen welche die aktuelle Drupal-Instanz betreffen automatisch in DC-X gelöscht.

Unangetastet bleiben allerdings die Story-Dokumente welche zur Archivierung der Artikel automatisch angelegt wurden. Diese halten nach wie vor eine (valide) Referenz auf das DC-X Pendant des nunmehr in Drupal gelöschten Bildes.

Daher müssen wir den Story-Dokumenten mitteilen, dass sich in Drupal etwas geändert hat.

Das stelle ich mir so vor:

Vor dem Löschen der Verwendungsmeldungen wird nochmal der Notification-Callback ($pubinfo['info']['callback_url']) gerufen. Allerdings muß er um die URI des jeweiligen Artikel erweitert werden ($pubinfo['properties']['uri']) damit wir feststellen könne, welcher Artikel davon betroffen ist.

In der Praxis sieht das dann so aus:

Bei jeder Änderung an einem Image-Dokument feuern die Notification-Callbacks so wie sie sind:
http://www.bunte.de/dcx-notification?id=dcxapi:document/doc123 (+ url_encode, geschenkt)

Bei Löschung einer Verwendungsmeldung feuern die Notification-Callbacks erweitert um den Parameter 'url':

http://www.bunte.de/dcx-notification?id=dcxapi:document/doc123&url=node/42

@chrfritsch chrfritsch merged commit ca1f7f3 into 8.x-1.x May 11, 2016
@chrfritsch chrfritsch deleted the feature/DRPLDCX-65/notify-article-on-pubinfo-deletion branch May 11, 2016 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants