loading table of contents...

Studio Developer Manual / Version 2310

Table Of Contents Register PropertyFields for Editorial Comments

As mentioned in the above list, property fields have to be registered in a global editorialCommentPropertyRegistryService. The Service lets you register PropertyRegistryModels based on any combination of a property name, a component's xtype or the CapType of a content in a content form. Please note, that Editorial Comments have been enabled per default for a variety of property field, such as text areas, text fields and link lists. The xtypes of these components are already registered in the editorialCommentPropertyRegistryService.

Just like the registration of property fields, the registry service can also exclude property fields from the Editorial Comments feature. See the example below to understand how registration and exclusion is done:

import Config from "@jangaroo/runtime/Config";
import session from "@coremedia/studio-client.cap-rest-client/common/session";
import CapType from "@coremedia/studio-client.cap-rest-client/common/CapType";
import StudioPlugin from "@coremedia/studio-client.main.editor-components/configuration/StudioPlugin";
import IEditorContext from "@coremedia/studio-client.main.editor-components/sdk/IEditorContext";
import editorialCommentPropertyRegistryService from "@coremedia/";
import PropertyRegistryModel from "@coremedia/";
import CoreMediaRichTextArea from "@coremedia/studio-client.main.ckeditor4-components/CoreMediaRichTextArea";

class EditorialCommentsStudioPluginBase extends StudioPlugin {
  constructor(config: Config<StudioPlugin> = null) {

  override init(editorContext: IEditorContext): void {

    // enable comments for title property in article content forms
      new PropertyRegistryModel(null, "title", this.#getCapType("CMArticle"))

    // enable comments for all richtext areas
      new PropertyRegistryModel(CoreMediaRichTextArea.xtype, null, null)

    // disable comments for detailText richtext property in pages
      new PropertyRegistryModel(null, "detailText", this.#getCapType("CMChannel"))

  #getCapType(contentName: String): CapType {
    return session._.getConnection().getContentRepository()

export default EditorialCommentsStudioPluginBase;

As you can see, the propertyName must be passed without its "properties." prefix. You can use the editorialCommentPropertyRegistryService in your own Studio plugins to customize the default configuration.



Please note, that the order of registrations and exclusions is important, since excluded property fields might be registered again by a following registration.

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.