close

Filter

loading table of contents...

Content Server Manual / Version 2204

Table Of Contents

4.3.7 Renaming Properties

The Content Server does not support automatic renaming of properties, as it is hard to detect this situation without additional operator assistance. In the following, you find the steps necessary to consistently rename properties in the doctypes.xml file and in the database.

Generally, all Content Servers should be updated at the same time, because an attempt to replicate or publish content between Content Servers with different schema will fail. Alternatively, it should be made certain that a Replication Live Server cannot connect to a Master Live Server while their schemata differ, or that a Content Management Server cannot publish to a Master Live Server while their schemata differ.

Since property names do not occur in the repository ChangeLog, it is possible to update the Servers even when the Content Server and repository listeners are not idle before shutdown.

For properties of the type XmlProperty, proceed as follows:
  1. Stop the Content Server.

  2. Rename the property in the content types definition file.

  3. Execute the following SQL statement with the declaring content type and all its subtypes:

    UPDATE Texts SET propertyName = 'myNewName'
    WHERE propertyName='myOldName' AND EXISTS
    (SELECT * FROM Resources WHERE id_=documentId
    AND documentType_ IN
    ('myType', 'mySubtype1', 'mySubtype2',...));
  4. Rename the internal links. Execute the following SQL statement with the declaring content type and all its subtypes:

    UPDATE LinkLists SET propertyName = 'myNewName'
    WHERE propertyName='myOldName' AND EXISTS
    (SELECT * FROM Resources WHERE id_=documentId
    AND documentType_ IN
    ('myType', 'mySubtype1', 'mySubtype2',...));
  5. Start the Content Server.
For properties of the type BlobProperty, proceed as follows:
Note

Note

If inline images in XmlMarkup contain the property name of the referenced image blob, CoreMedia recommends not to change the property name. You would need to program a Unified API client to change the current versions of the XmlMarkup properties and there is no trivial way to change older versions.

  1. Stop the Content Server.

  2. Rename the property in the content types definition file.

  3. Execute the following SQL statement with the declaring content type and all its subtypes:

    UPDATE Blobs SET propertyName = 'myNewName'
    WHERE propertyName='myOldName' AND EXISTS
    (SELECT * FROM Resources WHERE id_=documentId
    AND documentType_ IN
    ('myType', 'mySubtype1', 'mySubtype2',...));
  4. Start the Content Server.

For properties of the type LinkListProperty, proceed as follows:
  1. Stop the Content Server.

  2. Rename the property in the content types definition file.

  3. Execute the following SQL statement with the declaring content type and all its subtypes:

    UPDATE LinkLists SET propertyName = 'myNewName'
    WHERE propertyName='myOldName' AND EXISTS
    (SELECT * FROM Resources WHERE id_=sourceDocument
    AND documentType_ IN
    ('myType', 'mySubtype1', 'mySubtype2',...))
  4. Start the Content Server.

For properties of the type IntProperty or StringProperty, proceed as follows:
  1. Stop the Content Server.

  2. Rename the property in the content types definition file.

  3. Rename the database column representing the property in the database tables for the declaring document type and all its subtypes. Depending on the database, this is possible either

    1. using an ALTER TABLE statement renaming the column, or

    2. by adding a new column using an ALTER TABLE statement, copying the data from the old to the new column, and setting the old column to NULL, or

    3. by creating a new table, copying all data, and deleting the old table.

  4. When the property is observed, execute the following SQL statement with the declaring content type and all its subtypes:

    UPDATE ObservedValues SET propertyName = 'myNewName'
    WHERE propertyName='myOldName' AND EXISTS
    (SELECT * FROM Resources WHERE id_=sourceDocument
    AND documentType_ IN
    ('myType', 'mySubtype1', 'mySubtype2',...))
  5. Start the Content Server.

For properties of the type DateProperty, proceed as follows:
  1. Stop the Content Server.

  2. Rename the property in the content types definition file.

  3. Rename the database column representing the property in the database tables for the declaring document type and all its subtypes, as described in the IntProperty / StringProperty case above.

  4. Rename the database column storing the property's time zone, in the database tables representing the declaring document type and all its subtypes. The column name is the property name suffixed with "_tz".

  5. Start the Content Server.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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