Import Quick Templates

To import Quick Templates in KCM Repository, you can use the ImportQuickTemplates tool, which resides in <deploy root>\KCM\Programs\5.8\ITPMDKRepositoryServer. After import, they become visible in KCM Designer.

ImportQuickTemplates /file=<importxml> /user=<user> /password=<password> /token=<token>
                                            [/verbose] [/logfile=<logfile>] 

The command has these parameters:

  • file Required. Indicates an XML file containing the Quick Templates to import as well as a number of other settings.
  • user / password. Only required when the LDAP mode is disabled. A valid KCM Repository user and password.
  • token Only required when the LDAP mode is enabled. Logon token generated with KCM Designer. For more information, see KCM Designer Help.
  • verbose Optional. Shows more information on the ImportQuickTemplates tool while running the application.
  • logfile Optional. Name of the log file. If not given, it is importquicktemplates.log by default.

The following is an example of the XML structure.

<ImportQuicktemplates 
  xmlns	= " http://www.kofax.com/ccm/importQuicktemplates/1.0"
  version	=		required: {version}
  project 	= 		required: {project} 
  uri 		= 		required: {base URL to use for the restapi calls}
  promote 	= 		optional: {status to promote to}
  createDocumentTemplate =	optional: {"true" or "false"}. 
  If "true" document templates will be created for all imported quick templates. 
  If not present or "false" the document templates will not be created
  exist 	=		optional: {"fail", "newrevision", "overwrite"}  
  continueOnError	     = optional: {"true" or "false"} 
  If "true" Log the failure and continue importing}>
<Quicktemplate name={Quick Template name}>{document location}</Quicktemplate>
..
<Quicktemplate name={Quick Template name}>{document location}</Quicktemplate>
</ImportQuicktemplates> 

The attributes have the following meaning:

  • version={version} Indicates the version of the import XML. It can be used to differentiate between various versions of the import XML. Must be set to 1.
  • project={project} Name of the project where the Quick Templates are loaded.
  • uri={base url to use for the restapi calls}This is the URL to use to connect to KCM Repository for your instance.

    To retrieve the correct value for uri=, open the itpmdkapi.ini file that resides in the Config folder of the instance: [drive:]\KCM\Work\5.8\instance_<#>\designer\Config.

    Look for the line address= and copy the value. In this example, the value is http://localhost/cma_designer_01_5.8 .

    [Configuration]
    logfile=C:\KCM\Work\5.8\Instance_01\designer\Log\TESTCCM50S3\CMA [designer_01_5.8]\cmapi.log
    address=http://localhost/cma_designer_01_5.8
    MaxItemsInObjectGraph=500000
    

  • promote={status to promote to} Specifies the status to be assigned to the imported Quick Templates, either draft, accepted, or published. If this attribute is omitted, the imported Quick Templates are not imported. Depending on createDocumentTemplate, this also applies to the created Document Templates.
  • createDocumentTemplate={"true" or "false"} Default value is "false". If the value is "true", Document Templates will be generated for the imported Quick Templates if they did not exist before. If the Quick Template already existed, no Document Template is generated.
  • exist={"fail", "newrevision", "overwrite"} Default value is "fail". Indicates what action to take when the Quick Template to be imported already exists.

    "fail" indicates that the import fails when the Quick Template already exists. "newrevision" indicates that a new revision will be created. Quick Templates that where in development are unlocked prior to creating a new revision. Quick Templates that where locked by a user other than the importer fail. "overwrite" indicates a behavior similar to that of the new revision, except for the Quick Template that was in development and locked by the importer. In that case, the content of the Quick Template is overwritten.
  • continueOnError={"true" or "false"} Indicates what to do when a failure is encountered. If set to "true", the import continues but all failed imports are logged. If set to "false", the import stops at the first failure that is encountered.

We recommend that imported document has the same format as a project. For example, use .docx document format for a .docx project, or .doc document format for a .doc project respectively. Note, that .doc format has been deprecated in KCM 5.7.0.

In KCM Repository when importing HTML Quick Templates with ImportQuickTemplate.exe an error message appears. HTML Quick Templates must be imported via KCM Designer for Web.