IRISLIB database
CopyUtils Class Reference
Inheritance diagram for CopyUtils:
Collaboration diagram for CopyUtils:

Static Public Member Functions

_.Library.Status CopyDictionaries (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Boolean pVerbose, _.Library.Boolean pIgnoreDuplicates, _.Library.Boolean pCopyProfiles)
 
_.Library.Status CopyDictionary (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Integer pDictionaryId, _.Library.Boolean pVerbose, _.Library.Boolean pIgnoreDuplicates, pProfileMap)
 
_.Library.Status CopyDomain (_.Library.String pFromDomain, _.Library.String pToDomain, _.Library.Boolean pCopySources, _.Library.Boolean pCopySettings, _.Library.Boolean pCopyDictionaries, _.Library.Boolean pMatchCopy, _.Library.Boolean pVerbose, _.Library.String pUseConfiguration, _.Library.Integer pCopyMetrics)
 
_.Library.Status CopyMatchingProfile (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Integer pProfileId, _.Library.Boolean pVerbose, _.Library.Integer pNewProfileId)
 
_.Library.Status CopyMetadataFields (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Boolean pVerbose, _.Library.Boolean pIgnoreDuplicates)
 
_.Library.Status CopyMetric (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Integer pMetricId, _.Library.Boolean pPreserveOffsets, _.Library.Boolean pVerbose)
 Copies a Metric Definition from one domain to another. More...
 
_.Library.Status CopyMetrics (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Boolean pCopyValues, _.Library.Boolean pVerbose)
 
_.Library.Status CopySkipLists (_.Library.Integer pFromDomainId, _.Library.Integer pToDomainId, _.Library.Boolean pVerbose, _.Library.Boolean pIgnoreDuplicates)
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This utility class groups a few methods to easily copy the contents of a domain into another one (which doens't necessarily have to be empty).

Please note any domain elements copied will be created using the version of the target domain, regardless of the source domain's version number.

Member Function Documentation

◆ CopyDictionaries()

_.Library.Status CopyDictionaries ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pIgnoreDuplicates,
_.Library.Boolean  pCopyProfiles 
)
static

Copies any dictionaries and matching profiles (if pCopyProfiles is true)

from the domain identified by ID pFromDomainId into domain pToDomainId. If a dictionary, item or profile with the same name already exists, pIgnoreDuplicates=0 will cause an error to be thrown, whereas pIgnoreDuplicates=1 will mean the element in the target domain will be left as is, but extended with the items and terms of the element in the source domain.

◆ CopyDictionary()

_.Library.Status CopyDictionary ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Integer  pDictionaryId,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pIgnoreDuplicates,
  pProfileMap 
)
static

Copies a single dictionary (identified by pDictionaryId

from the domain identified by ID pFromDomainId into domain pToDomainId. If a dictionary or item with the same name already exists, pIgnoreDuplicates=0 will cause an error to be thrown, whereas pIgnoreDuplicates=1 will mean the element in the target domain will be left as is, but extended (in the case of a dictionary or item) with the items and terms of the element in the source domain.

An array of matching profile IDs can be passed in through pProfileMap to map any default matching profiles from the source domain to IDs of the corresponding profiles in the target domain.

◆ CopyDomain()

_.Library.Status CopyDomain ( _.Library.String  pFromDomain,
_.Library.String  pToDomain,
_.Library.Boolean  pCopySources,
_.Library.Boolean  pCopySettings,
_.Library.Boolean  pCopyDictionaries,
_.Library.Boolean  pMatchCopy,
_.Library.Boolean  pVerbose,
_.Library.String  pUseConfiguration,
_.Library.Integer  pCopyMetrics 
)
static

Copies all contents from the domain named pFromDomain into the domain

pToDomain. If pToDomain does not yet exist, it will be created automatically. The copy flags represent the following domain elements:

  • pCopySources includes regular source content as well as metadata (if the corresponding metadata fields exist in pToDomain or are created through pCopySettings. See also <class>iKnow.Source.Domain.Lister</class>
  • pCopySettings includes domain parameters, metadata, LOVs and SkipLists
  • pCopyDictionaries includes dictionaries, their items and terms and any domain-specific matching profiles. If pMatchCopy is 1 as well, all sources in the target domain will be matched against all dictionaries.
  • pCopySettings includes domain parameters, metadata and SkipLists
  • if pCopyMetrics>0, all metric definitions are copied and if pCopyMetrics>1, all metric values are copied along

This method relies on the other class methods in this class and uses a value of 1 for pIgnoreDuplciates when calling these methods.

If required, a specific iKnow Configuration name (cf <class>iKnow.Configuration</class>) can be supplied through pUseConfiguration to use while re-indexing the data. If this parameter is left blank (default), the default configuration of the original domain (configured using the $$$IKPDEFAULTCONFIG domain parameter) or $$$DEFAULTCONFIG will be used.

Note: if pCopySettings is true, only domain parameters a user is allowed to modify will be copied!!

◆ CopyMatchingProfile()

_.Library.Status CopyMatchingProfile ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Integer  pProfileId,
_.Library.Boolean  pVerbose,
_.Library.Integer  pNewProfileId 
)
static

Copies a single Matching Profile (identified by pProfileId) from the

domain identified by ID pFromDomainId into domain pToDomainId. If a profile with the same name already exists in the target domain, pIgnoreDuplicates=0 will cause an error to be thrown, whereas pIgnoreDuplicates=1 will mean the metadata field in the target domain will be left as is.

◆ CopyMetadataFields()

_.Library.Status CopyMetadataFields ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pIgnoreDuplicates 
)
static

Copies any metadata field definitions and List of Values from the domain identified by ID

pFromDomainId into domain pToDomainId. If a field with the same name already exists in the target domain, pIgnoreDuplicates=0 will cause an error to be thrown, whereas pIgnoreDuplicates=1 will mean the metadata field in the target domain will be left as is.

◆ CopyMetric()

_.Library.Status CopyMetric ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Integer  pMetricId,
_.Library.Boolean  pPreserveOffsets,
_.Library.Boolean  pVerbose 
)
static

Copies a Metric Definition from one domain to another.

No values are copied.

WARNING: only use pPreserveOffsets when copying metrics into a domain that didn't have any metric targets registered.

◆ CopyMetrics()

_.Library.Status CopyMetrics ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Boolean  pCopyValues,
_.Library.Boolean  pVerbose 
)
static

Copies all metric definitions from one domain to another, optionally including their

values.

WARNING: only Entity-, CRC-, CC- and source-based metric data can be copied from one domain to another. Use the metrics' builder class to (re-)generate metric values for path- or sentence-based metrics.

◆ CopySkipLists()

_.Library.Status CopySkipLists ( _.Library.Integer  pFromDomainId,
_.Library.Integer  pToDomainId,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pIgnoreDuplicates 
)
static

Copies any SkipList definitions and their contents from the domain identified by ID

pFromDomainId into domain pToDomainId. If a SkipList with the same name already exists in the target domain, pIgnoreDuplicates=0 will cause an error to be thrown, whereas pIgnoreDuplicates=1 will mean the SkipList in the target domain will be extended with the strings in the SkipList from the source domain.