content contentRef debugExport

Available for: Content Management Server (up to version 6.0.x, from version 6.5.0 see obj objRef debugExport)

Task: For the purpose of finding errors in the code of layout files, this command simulates the export of the version with the specified ID. It becomes clear from the output which NPSOBJ tags from which source layouts are evaluated in which order and which errors occurred during the evaluation process.

Additional information:

  • The command provides information about the following errors: unclosed tags, unbalanced number of opening and closing tags, disallowed attributes in NPSOBJ tags, disallowed values of NPSOBJ tag attributes, read-access to undefined names.
  • The contents of systemExecute instructions will neither be searched for errors nor formatted. However, the output of such instructions is formatted.

Syntax:

content withId contentId debugExport
  [templateName templateName]
  [detailed (yes | no)]
  [quoteHtml (yes | no)]
  [errorPrefix errorPrefix]
  [errorSuffix errorSuffix]
  [htmlPrefix htmlPrefix]
  [htmlSuffix htmlSuffix]
  [infoPrefix infoPrefix]
  [infoSuffix infoSuffix]
  [preferEditedTemplates (yes | no)]
  [allowEditedContents (yes | no)]

Function parameters:

  • templateName: Specifies the base layout (initial layout file) with which the export test is to be performed. If templateName has not been specified, the user-specific standard layout is used (mastertemplate by default).
  • detailed: Specifies whether the output is to be restricted to error messages (no) or should rather be detailed (yes). The default value is no.
  • quoteHtml: Specifies whether the characters <, >, and & are to be output as HTML entities (yes) or not (no). The prefix und suffix parameters are not affected by this. The default value is no.
  • errorPrefix: Specifies a character string which is output prior to each error message. The default value is "***".
  • errorSuffix: Specifies a character string which is output after each error message (empty by default).
  • htmlPrefix: Specifies a character string which is output prior to HTML text. The default value is "<pre>".
  • htmlSuffix: Specifies a character string which is output after HTML text. The default value is "</pre>".
  • infoPrefix: Specifies a character string which is output prior to each NPSOBJ information message (empty by default).
  • infoSuffix: Specifies a character string which is output after each NPSOBJ information message (empty by default).
  • preferEditedTemplates: Specifies whether the draft versions of layout files are to be preferred to the released versions. The default value corresponds to the user configuration setting of the same name, which is also used for the preview.
  • allowEditedContents: Specifies whether draft versions are to be used if released versions are not available. The default value corresponds to the state of the version for which this command is executed. The command does not refer to this version but to the versions it references.

Return value if successful: the formatted export report (string).

Necessary permissions: The user must have the permissionGlobalExport permission or the permissionRead permission for the file the version belongs to.

Example: (see below for a sample output)

CM>content withId 25687 debugExport detailed yes

Example for the usage as a subcommand of obj: (output strongly abridged)

CM>obj withId 2792 editedContent debugExport detailed yes
<HTML>
    <HEAD>
  ...
NPSOBJ insertvalue=var: title
The title
END NPSOBJ insertvalue=var
</TITLE>
    </HEAD>
NPSOBJ insertvalue=var: body
<a ...>Linked text</a>

*** ERROR [140008] The instruction attribute was missing from an NPSOBJ tag.
...