close

Filter

loading table of contents...

Content Server Manual / Version 2401

Table Of Contents

3.13.1.10 Validate Link Type

The tool validate-link-type can be used to check if links in existing content point to content items of the correct type as declared with the LinkType attribute in the content type definition. It can also be used to check in advance whether the LinkType can be changed to a different possibly more specific type without causing issues for existing content. The purpose of the tool is to help during schema update. For details, see Section 4.3.8.4, “Changing LinkType of LinkListProperty”.

cm validate-link-type {-u user} [-p password] {-t content type} {-l link property} [-a] [-n]

ParameterDescription

{ -t | --content-type } content-type

The name of the content type to check links in.

{ -l | --link-property } property

The name of the link list property in the specified content type.

-n | --new-link-type content-type

New link type to use as expected target content type for the link list property instead of the LinkType from the content type definition. Use it to check in advance if the LinkType attribute can be changed in the content type definition.

-a | --all-versions

Check links in all content item versions, instead of just checking the latest version.

Table 3.18. Parameters of validate-link-type


Example

For example, use the following command to check whether the master property of all Article content item versions only links to content items of the type as declared in the content type definition:

cm validate-link-type -u admin -t Article -l master -a

If no invalid links are found, the tool will output:

No links with wrong type found.

In another example, let's imagine you are thinking about changing the LinkType attribute for property pictures of type Teasable from Media to subtype Picture. In that case, you should first check whether such a restriction would be violated by existing content in current or old versions:

cm validate-link-type -u admin -t Teasable -l pictures -n Picture -a

In this example, the tool reports two links that would violate the new link type Picture. In this example, it's the same link in an old and in the latest version of the same content. If option -a (--all-versions) were omitted, only the link in the latest version would have been reported.

Checking 2654 contents. This may take some time...
Found link of wrong type: coremedia:///cap/version/4638/2 -> coremedia:///cap/content/5134
Found link of wrong type: coremedia:///cap/version/4638/3 -> coremedia:///cap/content/5134

Note, that the tool outputs an additional line here at the start to warn about its expected runtime. If you intend to use the output in a script, make sure to ignore all rows that don't start with "Found link of wrong type:".

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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