Previous Topic

Book Contents

Book Index

Next Topic

Listing Contents of Containers

To find an API object within the respective container:

find(string)

Returns the first instance of an object by the specified name. The object will be returned in the same transaction as the container or in case of CATALOGS container, the objects will be created in a new internal transaction. The reason is that unlike the other containers, you don’t use transaction to create the CATALOGS container itself. The internal transaction can later be identified using the ApiCatalog.getTransaction method.

Note: This method is provided by most of the containers except Catalogs.

To find an API object within a catalog, you can also use:

find(ApiTransaction, string)

This modification of the find method is used exclusively with the CATALOGS container. It enables you to find an API object within the respective container and returns the first object by the specified name. The objects are created in a transaction that you pass as a parameter.

To get an item from a container by its order number:

item(integer)

Returns an object by the specified order number. The object will be returned in the same transaction as the container. However, there is an exception in case of CATALOGS container, where on calling of this method the catalogs are created in a brand new internal transaction. The reason is that unlike with the other containers, you don’t use transaction to create the CATALOGS container itself. This internal transaction can later be identified using the ApiCatalog.getTransaction method.

Note: This above mentioned method is provided by most of the containers, except Catalogs. Transactions are not used with containers containing only metadata (METAWORKFLOWS, FOLDERS, BOTYPES…)

With Catalogs, you can also use

item(ApiTransaction,integer)

This method is used exclusively with the CATALOGS container. Enables you to list through the objects in the container. Returns object by the specified order number, integer is the order number of the object you want to access. The objects are all created in a transaction that you pass as a parameter.

Note: the numbering of items in all containers begins with 0.

length(integer)

Returns the number of objects in the container. This method returns number of objects according to the current user’s rights – in other words, the objects the current user is not allowed to access (the appropriate right is set to “no read”) are not included.

See Also

Containers

Getting Main Objects from the Database

Catalogs