Skip to main content

%iKnow.Queries.MetadataQAPI

Class %iKnow.Queries.MetadataQAPI Extends %iKnow.Queries.AbstractQAPI [ Deprecated, System = 4 ]

This is an automatically generated class, offering a functionally equivalent set of methods and queries as %iKnow.Queries.MetadataAPI, exposed as SqlProc methods.

See the classdocs for %iKnow.Queries.MetadataAPI for more information.

Methods

AddField

ClassMethod AddField(domainId As %Integer, fieldName As %String(MAXLEN=32767), supportedOperators As %String(MAXLEN=32767) = {$lb($$$MDOPEQUAL)}, dataType As %String(MAXLEN=32767) = {$$$MDDTSTRING}, storage As %Integer = {$$$MDSTNORMAL}, caseSensitive As %Boolean = 0, lovId As %Integer = -1, validateLov As %Boolean = 1, hidden As %Boolean = 0, Output scText As %String = "") As %Library.Integer [ SqlProc ]

Adds a field definition with the given name and properties.

  • The supportedOperators parameter specifies which operations (such as $$$MDOPEQUAL) will be available for filtering criteria
  • For dataType, choose either $$$MDDTSTRING, $$$MDDTNUMBER or $$$MDDTDATE ($horolog format)
  • Use storage to control how values are stored: $$$MDSTNORMAL for cases where you would use a normal index, $$$MDSTBITMAP where you would use a bitmap index (few different metadata values compared to total # of records)
  • If dataType is $$$MDDTSTRING, caseSensitive controls whether or not string values should be treated as case-sensitive.
  • The lovId and validateLov parameters define whether a List Of Values is available for this metadata field and whether input values should be verified against this list. See also AddListOfValues.
  • If hidden is set to true, the field will by default not appear in metadata field and value lists.

AddListOfValues

ClassMethod AddListOfValues(domainId As %Integer, lovName As %String(MAXLEN=32767), autoExtend As %Boolean = 1, Output scText As %String = "") As %Library.Integer [ SqlProc ]

Adds a List Of Values to the domain, which can then be used as a list of allowable values for one or more metadata fields.

AddLovValue

ClassMethod AddLovValue(domainId As %Integer, lovId As %Integer, value As %String(MAXLEN=32767), ByRef rank As %Integer = -1) As %Boolean [ SqlProc ]

Adds a new value to an existing List Of Values

CreateFilter

ClassMethod CreateFilter(pDomainId As %Integer, pFieldName As %String(MAXLEN=32767), pOperator As %String(MAXLEN=32767), pValue As %String(MAXLEN=32767), Output scText As %String = "") As %iKnow.Filters.Filter [ SqlProc ]

Create a %iKnow.Filters.Filter instance that filters sources according to the given criteria, using the filter class compatible with this %iKnow.Queries.MetadataI implementation.

For the default MetadataAPI, this is a %iKnow.Filters.SimpleMetadataFilter instance.

GetFieldId

ClassMethod GetFieldId(domainId As %Integer, fieldName As %String(MAXLEN=32767), Output scText As %String = "") As %Library.Integer [ SqlProc ]

Returns the metadata field ID corresponding to the supplied name, or "" if none exists in this domain.

GetFieldValuesExecute

ClassMethod GetFieldValuesExecute(ByRef qHandle As %Binary,  domainId As %Integer, fieldName As %String(MAXLEN=32767), page As %Integer = 1, pageSize As %Integer = 10) As %Status [ Internal ]

Returns all the distinct values currently in use for a given metadata field (by name). See also GetUniqueValues for a version returning the number of sources with this metadata value and sorting options.

GetFieldValuesFetch

ClassMethod GetFieldValuesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetFieldValuesExecute ]

GetFieldValuesClose

ClassMethod GetFieldValuesClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetFieldValuesExecute ]

GetFieldValuesByIdExecute

ClassMethod GetFieldValuesByIdExecute(ByRef qHandle As %Binary,  domainId As %Integer, mdFieldId As %Integer, page As %Integer = 1, pageSize As %Integer = 10) As %Status [ Internal ]

Returns all the distinct values currently in use for a given metadata field (by ID).

GetFieldValuesByIdFetch

ClassMethod GetFieldValuesByIdFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetFieldValuesByIdExecute ]

GetFieldValuesByIdClose

ClassMethod GetFieldValuesByIdClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetFieldValuesByIdExecute ]

GetFieldsExecute

ClassMethod GetFieldsExecute(ByRef qHandle As %Binary,  domainId As %Integer, includeHidden As %Boolean = 0) As %Status [ Internal ]

Returns all field definitions (including their properties) for the given domain.

Setting includeHidden to true will also return any metadata fields marked as 'hidden'.

GetFieldsFetch

ClassMethod GetFieldsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetFieldsExecute ]

GetFieldsClose

ClassMethod GetFieldsClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetFieldsExecute ]

GetLovValuesExecute

ClassMethod GetLovValuesExecute(ByRef qHandle As %Binary,  domainId As %Integer, lovId As %Integer) As %Status [ Internal ]

Returns all the allowed values for a given metadata LOV.

GetLovValuesFetch

ClassMethod GetLovValuesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetLovValuesExecute ]

GetLovValuesClose

ClassMethod GetLovValuesClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetLovValuesExecute ]

GetLovsExecute

ClassMethod GetLovsExecute(ByRef qHandle As %Binary,  domainId As %Integer, page As %Integer = 1, pageSize As %Integer = 10) As %Status [ Internal ]

Returns all LOVs (List of Values) registered for this domain.

GetLovsFetch

ClassMethod GetLovsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetLovsExecute ]

GetLovsClose

ClassMethod GetLovsClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetLovsExecute ]

GetMetaSpreadByEntities

ClassMethod GetMetaSpreadByEntities(pDomainId As %Integer, pFieldName As %String(MAXLEN=32767), pEntityList As %String(MAXLEN=32767), pFilter As %String(MAXLEN=32767) = "", pSetOp As %Integer = {$$$UNION}, Output scText As %String = "") As %Library.Integer [ SqlProc ]

Returns the "spread" of metadata values (number of distinct values) for field pFieldName for the entities in pEntityList, in the sources satisfying pFilter. When specifying multiple entities, sources (and their metadata values) are included based on the value of pSetOp: if pSetOp = $$$UNION, only one entity has to be present (default), if pSetOp = $$$INTERSECT, all of them need to be present.

GetMetaSpreadByEntityIds

ClassMethod GetMetaSpreadByEntityIds(pDomainId As %Integer, pFieldName As %String(MAXLEN=32767), pEntityIdList As %String(MAXLEN=32767), pFilter As %String(MAXLEN=32767) = "", pSetOp As %Integer = {$$$UNION}, Output scText As %String = "") As %Library.Integer [ SqlProc ]

Returns the "spread" of metadata values (number of distinct values) for field pFieldName for the entities in pEntityIdList, in the sources satisfying pFilter. When specifying multiple entities, sources (and their metadata values) are included based on the value of pSetOp: if pSetOp = $$$UNION, only one entity has to be present (default), if pSetOp = $$$INTERSECT, all of them need to be present.

GetMetaSpreadInternal

ClassMethod GetMetaSpreadInternal(pDomainId As %Integer, pFieldId As %Integer, pType As %String(MAXLEN=32767) = "ENTITY", pFilter As %String(MAXLEN=32767) = "", pSetOp As %Integer = {$$$UNION}, Output scText As %String = "") As %Library.Integer [ SqlProc ]

GetUniValue

ClassMethod GetUniValue(pDomainId As %Integer, pUniValueId As %Integer) As %Library.String [ SqlProc ]

Returns the unique metadata value corresponding to the supplied pUniValueId.

GetUniqueValueCount

ClassMethod GetUniqueValueCount(pDomainId As %Integer, pFieldName As %String(MAXLEN=32767), pFilter As %String(MAXLEN=32767) = "") As %Library.Integer [ SqlProc ]

Returns the number of unique metadata values for a given field pFieldName in the sources satisfying the supplied filter, after normalization based on the field specifications such as case sensitivity and data type.

GetUniqueValuesExecute

ClassMethod GetUniqueValuesExecute(ByRef qHandle As %Binary,  pDomainId As %Integer, pFieldName As %String(MAXLEN=32767), pPage As %Integer = 1, pPageSize As %Integer = 10, pFilter As %String(MAXLEN=32767) = "", pSortType As %String(MAXLEN=32767) = "") As %Status [ Internal ]

Returns all the unique metadata values for field pFieldName in sources satisfying the supplied filter, optionally sorted by value (pSortType = "VALUE") or frequency (pSortType = "FREQUENCY"). The returned frequency represents the number of sources with this metadata value (satisfying the filter).

NOTE: sorting by value is only precise up to the 150 first characters

GetUniqueValuesFetch

ClassMethod GetUniqueValuesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetUniqueValuesExecute ]

GetUniqueValuesClose

ClassMethod GetUniqueValuesClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetUniqueValuesExecute ]

GetUniqueValuesByIdExecute

ClassMethod GetUniqueValuesByIdExecute(ByRef qHandle As %Binary,  pDomainId As %Integer, pFieldId As %Integer, pPage As %Integer = 1, pPageSize As %Integer = 10, pFilter As %String(MAXLEN=32767) = "", pSortType As %String(MAXLEN=32767) = "") As %Status [ Internal ]

Returns all the unique metadata values for field pFieldId in sources satisfying the supplied filter, optionally sorted by value (pSortType = "VALUE") or frequency (pSortType = "FREQUENCY"). The returned frequency represents the number of sources with this metadata value (satisfying the filter).

NOTE: sorting by value is only precise up to the 150 first characters

GetUniqueValuesByIdFetch

ClassMethod GetUniqueValuesByIdFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetUniqueValuesByIdExecute ]

GetUniqueValuesByIdClose

ClassMethod GetUniqueValuesByIdClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetUniqueValuesByIdExecute ]

GetValue

ClassMethod GetValue(domainId As %Integer, fieldName As %String(MAXLEN=32767), externalId As %String(MAXLEN=32767), Output scText As %String = "") As %Library.String [ SqlProc ]

Returns the actual value for a given metadata field (by name) and source (by External ID).

GetValueById

ClassMethod GetValueById(domainId As %Integer, fieldId As %Integer, srcId As %Integer, Output scText As %String = "") As %Library.String [ SqlProc ]

Returns the actual value for a given metadata field (by ID) and source (by Source ID).

GetValuesExecute

ClassMethod GetValuesExecute(ByRef qHandle As %Binary,  domainId As %Integer, externalId As %String(MAXLEN=32767), includeHidden As %Boolean = 0) As %Status [ Internal ]

Returns the actual metadata values for the given source (by External ID).

Setting includeHidden to true will also return the values for hidden metadata fields.

GetValuesFetch

ClassMethod GetValuesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetValuesExecute ]

GetValuesClose

ClassMethod GetValuesClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetValuesExecute ]

GetValuesByIdExecute

ClassMethod GetValuesByIdExecute(ByRef qHandle As %Binary,  domainId As %Integer, srcId As %Integer, includeHidden As %Boolean = 0) As %Status [ Internal ]

Returns the actual metadata values for the given source (by Source ID).

Setting includeHidden to true will also return the values for hidden metadata fields.

GetValuesByIdFetch

ClassMethod GetValuesByIdFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal, PlaceAfter = GetValuesByIdExecute ]

GetValuesByIdClose

ClassMethod GetValuesByIdClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = GetValuesByIdExecute ]

RemoveField

ClassMethod RemoveField(domainId As %Integer, fieldName As %String(MAXLEN=32767)) As %Boolean [ SqlProc ]

Removes a metadata field (by name) from the domain, including all references by existing sources.

RemoveFieldById

ClassMethod RemoveFieldById(domainId As %Integer, fieldId As %Integer) As %Boolean [ SqlProc ]

Removes a metadata field (by ID) from the domain, including all references by existing sources.

SetValue

ClassMethod SetValue(domainId As %Integer, fieldName As %String(MAXLEN=32767), externalId As %String(MAXLEN=32767), value As %String(MAXLEN=32767)) As %Boolean [ SqlProc ]

Sets (or replaces if it exists) the value for a given metadata field (by name) for a given source (by External ID).

Values for fields of type $$$MDDTSTRING are normalized and stripped of whitespace and control characters at the beginning and end of the string.

SetValueById

ClassMethod SetValueById(domainId As %Integer, fieldId As %Integer, srcId As %Integer, value As %String(MAXLEN=32767)) As %Boolean [ SqlProc ]

Sets (or replaces if it exists) the value for a given metadata field (by ID) for a given source (by Source ID). Explicitly setting a value to "" (null/empty string) will erase the current value.

Values for fields of type $$$MDDTSTRING are normalized and stripped of whitespace and control characters at the beginning and end of the string.

UpdateField

ClassMethod UpdateField(domainId As %Integer, fieldName As %String(MAXLEN=32767), supportedOperators As %String(MAXLEN=32767) = "", storage As %Integer = -1, hidden As %Integer = -1, lovId As %Integer = -2, validateLov As %Integer = -1) As %Boolean [ SqlProc ]

Updates the properties for a given metadata field (by name). See also AddField.

Specifying a "" for the supportedOperators will leave the current value for that property. Similarly, specifying -1 for storage, hidden and validateLov or -2 for lovId will leave their respective values unmodified. Setting lovId to -1 will unset the LOV for this field.

UpdateFieldById

ClassMethod UpdateFieldById(domainId As %Integer, fieldId As %Integer, supportedOperators As %String(MAXLEN=32767) = "", storage As %Integer = -1, hidden As %Integer = -1, lovId As %Integer = -2, validateLov As %Integer = -1) As %Boolean [ SqlProc ]

Updates the properties for a given metadata field (by ID). See also AddField.

Specifying a "" for the supportedOperators will leave the current value for that property. Similarly, specifying -1 for storage, hidden and validateLov or -2 for lovId will leave their respective values unmodified. Setting lovId to -1 will unset the LOV for this field.