Content Server Manual / Version 2204
Table Of Contents
The tool validate-link-type
can be used to check if links in existing content point to
documents of the correct type as declared with the LinkType
attribute in the document 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 {-uuser
} [-ppassword
] {-tcontent type
} {-llink property
} [-a] [-n]
Parameter | Description |
---|---|
{ -t | --content-type }
|
The name of the content type to check links in. |
{ -l | --link-property }
|
The name of the link list property in the specified content type. |
-n | --new-link-type
|
New link type to use as expected target content type for the link list property instead of the
|
-a | --all-versions | Check links in all document 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
document versions only links to documents of the type as declared in the document 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:
".