close

Filter

loading table of contents...

Content Server Manual / Version 2401

Table Of Contents

4.3.8.3 Changing the Observe Attribute of a StringProperty

Note

Note

The length of an observed StringProperty must not exceed 256.

When an existing StringProperty changes its observe attribute then the values of the observed property in the table ObservedValue will be automatically added or removed. In the following SQL statements CMExternalCategory is the example name of the content type and externalId the example name of the property.

Proceed as follows:

  1. Be sure to have a backup of your data.

  2. Stop the Content Server.

  3. When the not observed StringProperty property should be observed, change the observe attribute in the content type definition file to 'true'.

    When the already observed StringProperty property should not be observed anymore, remove the observe attribute.

  4. Start the Content Server again.

Check the logs

When the property is newly observed, the existing values of the property will be automatically inserted into the ObservedValues table. You should see log entries like the following in the Content Server log.

 2018-08-22 13:33:11 [INFO] hox.corem.server.sql.SQLStore [] - \
DocumentTypeRegistry: Update observed property:
The property 'externalId' of the document type 'CMExternalCategory' is newly observed. The following command is being executed: \
INSERT INTO ObservedValues (sourceDocument, sourceVersion, propertyName, propertyValue)
SELECT c.id_, c.version_, 'externalId', c."externalId" FROM Resources r, CMExternalCategory c
WHERE r.id_ = c.id_ AND r.latestVersion_ = c.version_ AND c."externalId" IS NOT NULL AND c."externalId" != '' ORDER BY r.id_
2018-08-22 13:33:12 [INFO] hox.corem.server.sql.SQLStore [] - \
DocumentTypeRegistry: The statement took 1000 ms and 1000 rows were affected:
INSERT INTO ObservedValues (sourceDocument, sourceVersion, propertyName, propertyValue)
SELECT c.id_, c.version_, 'externalId', c."externalId" FROM Resources r, CMExternalCategory c
WHERE r.id_ = c.id_ AND r.latestVersion_ = c.version_ AND c."externalId" IS NOT NULL AND c."externalId" != '' ORDER BY r.id_

Example 4.9.  Log entries when an existing string property is newly observed


When the property isn't any longer observed, the values of the property will be removed from the ObservedValues table. You should see log entries like the following in the content server log.

 2018-08-22 13:33:11 [INFO] hox.corem.server.sql.SQLStore [] - \
DocumentTypeRegistry: Update observed property:
The property 'externalId' of the document type 'CMExternalCategory' is not observed anymore. The following command is being executed: \
DELETE FROM CMExternalCategory WHERE propertyname = 'externalId' AND sourceDocument = (SELECT DISTINCT id_ FROM CMExternalCategory WHERE id_ = sourceDocument)
2018-08-22 13:33:12 [INFO] hox.corem.server.sql.SQLStore [] - \
DocumentTypeRegistry: The statement took 1000 ms and 1000 rows were affected:
DELETE FROM CMExternalCategory WHERE propertyname = 'externalId' AND sourceDocument = (SELECT DISTINCT id_ FROM CMExternalCategory WHERE id_ = sourceDocument)

Example 4.10.  Log entries when an existing string property is not observed anymore


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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