comet.idtype

The comet.idtype module provides factory functions for creating CIDType objects aswell as helper functions for processing unbound ID values.

See also

Class CIDType

Instances of IDType objects

Methods

comet.idtype.create(ID1, ID2=0, ID3=0, stringID='')

Create a new CIDType object from the provided values

Parameters:
  • ID1 (int) – The first int ID

  • ID2 (int) – The second int ID

  • ID3 (int) – The third int ID

  • stringID (str) – The str ID

Returns:

The new ID object

Return type:

CIDType

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf® Illustrator®

CScript:

idtype::alloc

Examples:

Create an IDType

myID = comet.idtype.create(1, 0, 0, '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#')
comet.idtype.getRecordID(stringID)

Get the RecordID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getRecordID()

CScript:

idtype::record_id

Examples:

Get the recordID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getRecordID(stringID)
comet.wlog(value)   #logs '1234'
comet.idtype.getGroupID(stringID)

Get the GroupID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getGroupID()

CScript:

idtype::group_id

Examples:

Get the group ID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getGroupID(stringID)
comet.wlog(value)   #logs 'myGroupID'
comet.idtype.getEntityID(stringID)

Get the EntityID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getEntityID()

CScript:

idtype::entity_id

Examples:

Get the entity ID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getEntityID(stringID)
comet.wlog(value)   #logs 'product'
comet.idtype.getEntityClass(stringID)

Get the EntityClass part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getEntityClass()

CScript:

idtype::entity_class

Examples:

Get the entity class part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getEntityClass(stringID)
comet.wlog(value)   #logs 'Bucket'
comet.idtype.getParentRecordID(stringID)

Get the Parent RecordID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getParentRecordID()

CScript:

idtype::parent_record_id

Examples:

Get the parent record ID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getParentRecordID(stringID)
comet.wlog(value)   #logs '5678'
comet.idtype.getParentGroupID(stringID)

Get the Parent GroupID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getParentGroupID()

CScript:

idtype::parent_group_id

Examples:

Get the parent group ID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getParentGroupID(stringID)
comet.wlog(value)   #logs '5678'
comet.idtype.getParentEntityID(stringID)

Get the Parent EntityID part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getParentEntityID()

CScript:

idtype::parent_entity_id

Examples:

Get the parent entity ID part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getParentEntityID(stringID)
comet.wlog(value)   #logs 'category'
comet.idtype.getParentEntityClass(stringID)

Get the Parent EntityClass part of a StringID.

Returns:

StringID in the PublishingServer schema

Return type:

str

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter stringID is empty

Available:

InDesign® comet_pdf® Illustrator®

See also:

CIDType.getParentEntityClass()

CScript:

idtype::parent_entity_class

Examples:

Get the parent entity class part of a string ID.

stringID = '1234#myGroupID#product#Bucket#5678#myParentGroupID#category#Bucket#'
value = comet.idtype.getParentEntityClass(stringID)
comet.wlog(value)   #logs 'Bucket'