Implementing Auto-Watch


Auto-watch is a feature that automatically adds a user as a watcher after performing an action on that asset. For example, if an editor posts a comment to an article's conversation, that editor can automatically become a watcher on that article.

private static boolean processForm(ToolPageContext page, Recordable content) throws Exception {

    post.save(); 

    Record record = (Record) content; 
    record.sendMessage("watch.autoAdd", page.getUser()); 

/* Return true or false */
}
  • Commits the post associated with the content to the database.
  • Instantiates a record variable based on the passed content.
  • Establishes a watch on the passed content for the user who posted the conversation.

The first parameter for the sendMessage method is one of the following:

  • watch.autoAdd—Adds the user unless the user previously removed the watch.
  • watch.manualAdd—Adds the user regardless if user previously removed the watch.
  • watch.autoRemove—Removes the user unless the user manually created a watch.
  • watch.manualRemove—Adds a user regardless if user previously created a watch.

Browse All Docs

Everything you need to know when creating, managing, and administering content within Brightspot CMS.

Dashboards
Publishing
Workflows
Admin configurations
A guide for installing, supporting, extending, modifying and administering code on the Brightspot platform.

Field types
Content modeling
Rich-text elements
Images
A guide to configuring Brightspot's library of integrations, including pre-built options and developer-configured extensions.

Google Analytics
Shopify
Apple News
Brightspot is packaged with content types that get you up and running in a matter of days, including assets, modules and landing pages.

Assets
Modules
Landing pages
Our robust, flexible Design System provides hundreds of pre-built components you can use to build the presentation layer of your dreams.

Asset types
Module types
Page types