[MGNLOBS-30] Add listener implementation that observes nodes with a specific template Created: 12/Aug/14  Updated: 11/Sep/14  Resolved: 10/Sep/14

Status: Closed
Project: Observation
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.3

Type: New Feature Priority: Neutral
Reporter: Vivian Steller Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File config.modules.observation.config.listenerConfigurations.htmlResourcesOnChange.xml     File patch-observe-nodes-with-template-listener.diff     XML File resources.static-templates.xml    
Issue Links:
dependency
is depended upon by MGNLRES-123 Add HTML resource Closed
relation
is related to MGNLRES-123 Add HTML resource Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

We're missing the possibility to observe events on nodes with a specific template. For instance, this is useful to observe changes on "files" (nodes) in the resources workspace of a given type, e.g. "html" (identified by the node's template). This functionality is required for kickstart.io

Patch included! The patch simply adds a new Listener implementation to the observation module, which can be used in custom configurations.

Thank you!



 Comments   
Comment by Christoph Meier [ 21/Aug/14 ]

Vivian
Could you please provide a configuration-example for RestrictToTemplateEventListener.
Thnx in advance

Comment by Christoph Meier [ 25/Aug/14 ]

I added a config and some resources to test (for the reviewer). I hope this "fits" what Vivian was requesting.
For testing reasons, the command info.magnolia.module.activation.commands.ActivationCommand will be executed.

Comment by Christoph Meier [ 25/Aug/14 ]

Changes are committed onto branch MGNLOBS-30.

Comment by Roman Kovařík [ 01/Sep/14 ]

QA: works but I noticed:

  1. Wrong copyright years in the new files.
  2. Please look for typos in javadoc, e.g. info.magnolia.module.observation.commands.RestrictToTemplateEventListener.getRelevantPath(String, Node)
  3. Optionally: info.magnolia.module.observation.commands.AbstractRestrictionEventListener.getPath(Event): SystemContext should be injected. This would require also adding deprecated constructor to RestrictToNodeTypeEventListener so I don't know if it's worth the effort.
Comment by Roman Kovařík [ 09/Sep/14 ]

Sorry for reopening again:

  1. With the 'wrong copyright year in the new files' I meant: 2012-2013 -> 2014}
  2. The typo is still not fixed: // if a parent has that template, command is executed fo the path of that parent-node
Generated at Mon Feb 12 10:23:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.