Your CMS has the following API extension points:
- An event model for native code
- A webhook system for code publishing
- A remote API for content access
- A scheduled/batch job system
The events that are available are (all “ing” events happen before; all “ed” events happen after):
- Content Creating
- Content Created
- Content Saving (with save cancellation)
- Content Saved
- Content Publishing (with publish cancellation)
- Content Published
- Content Deleting
- Content Deleted
Below are some requirements that would normally be resolved using some type of extension point. For each, explain which extension point you would use. If this is an event, further identify which event you would hook/attach to.
You don’t have to explain how the code would be organized or written, just explain what extension point would be the most appropriate tool to enable this functionality.
(Note: there might be more than one correct answer.)
- Your CEO is concerned about the use of profanity. She would like ensure that no content can be stored in the repository with a swear word.
- Your CEO now wants to find and permanently fix content (by replacing the offending word with something less profane) that might have been posted before this new policy.
- You want published content to also be posted to Twitter.
- Every night at midnight, your compliance department requires that all content be written to a backup system.
- Your mobile app needs to load the last five news articles published.
- Your CDN caches your content. When new content is published or deleted, it needs to be notified by calling a specific URL so it can clear the existing cache.
- Your HR department is convinced that people post more pleasant blog posts to the intranet when the weather is warmer. They would like the current temperature at the time of publish captured and displayed on the page with the blog post.