File

platform-components-ng/projects/platform-components-lib/src/lib/components/collection/service/asset.service.ts

Description

Asset service

Index

Properties
Methods

Constructor

constructor(http: HttpClient, notificationService: QppNotificationService)
Parameters :
Name Type Optional
http HttpClient No
notificationService QppNotificationService No

Methods

cancelAssetCheckout
cancelAssetCheckout(assetId: number, branchId: number)

Cancel Check out of a checked out asset

Parameters :
Name Type Optional Description
assetId number No

asset id of the asset whose check out is to be cancelled.

branchId number No

Branch id

Returns : Observable<any>

Observable

checkoutAsset
checkoutAsset(assetId: number, branchId: number)

Check out an asset

Parameters :
Name Type Optional Default value Description
assetId number No

asset id of the asset to be checked out.

branchId number No 0

branch id

Returns : Observable<any>

Observable

checkoutMultipleAsset
checkoutMultipleAsset(assets: literal type[])

Check out an asset

Parameters :
Name Type Optional
assets literal type[] No
Returns : Observable<any>

Observable

createAssetRelations
createAssetRelations(assetRelationData: AssetRelationData)

Creates asset relations based on the provided asset relation data.

Parameters :
Name Type Optional Description
assetRelationData AssetRelationData No

The data for creating asset relations.

Returns : Promise<number[]>

A promise that resolves to the number array.

createAssetVersion
createAssetVersion(assetId: number, branchId: number, attributeValues: any[], createMinorVersion)

Creates a new asset version with the specified attributes.

Parameters :
Name Type Optional Default value Description
assetId number No

The ID of the asset to create a version for.

branchId number No

The ID of the branch where the asset version will be created.

attributeValues any[] No

An array of attribute values to set for the new version.

createMinorVersion No true

Whether to create a minor version (default is true).

Returns : Observable<any>

An Observable that emits the response from the server.

deleteAsset
deleteAsset(assetId: number)

Deletes an asset and emits a behavior-subject

Parameters :
Name Type Optional Description
assetId number No

asset id of the asset to be deleted.

Returns : Observable<any>

Observable

duplicateAsset
duplicateAsset(assetId: number, createMinorVersion, branchId: number)

Duplicate asset

Parameters :
Name Type Optional Default value Description
assetId number No

Asset id of asset

createMinorVersion No false

Create minor version

branchId number No

Branch id

Returns : Observable<any>

Observable

endAssetWorkflow
endAssetWorkflow(assetId: number, branchId: number)

End asset workflow

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

branchId number No

Branch id

Returns : Observable<any>

Observable

getAllAssetAttributes
getAllAssetAttributes(assetId: number, versionInfo?: VersionInfo)

Get all the attributes for an asset.

Parameters :
Name Type Optional Description
assetId number No

Id of the asset whose attributes have to be fetched.

versionInfo VersionInfo Yes

VersionInfo object.

Returns : Observable<any>

Observable array of Attribute DTO containing all the defined attributes of the asset.

getApplicableAttributeConstraints
getApplicableAttributeConstraints(assetId: number, nextStatusId: number, collectionId: number, workflowId: number, branchId?: number)

Get applicable attribute constraints

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

nextStatusId number No

Next status Id

collectionId number No

Collection Id

workflowId number No

Workflow Id

branchId number Yes

Branch id

Returns : any

Observable

getApplicableStatusConstraints
getApplicableStatusConstraints(assetId: number, nextStatusId: number, workflowId?: number, roleId?: number, branchId?: number)

Get applicable status constraints

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

nextStatusId number No

Next status Id

workflowId number Yes

Workflow Id

roleId number Yes

Role id

branchId number Yes

Branch id

Returns : any

Observable

getAssetAnalytics
getAssetAnalytics(duration: number)

Get asset analytics

Parameters :
Name Type Optional Description
duration number No

Duration

Observable

getAssetDetails
getAssetDetails(assetId: number, versionInfo?: VersionInfo, additionalAttributes?: boolean)

Get asset meta for an asset specific to the asset detail component.

Parameters :
Name Type Optional Description
assetId number No

asset id of the asset.

versionInfo VersionInfo Yes

Version info

additionalAttributes boolean Yes

Additional attributes

Returns : Observable<any>

Observable an asset detail object.

getAssetFormInfo
getAssetFormInfo(assetId: number, versionInfo: VersionInfo, getAllAttributes?: boolean, workflowId?: number)

Get asset form info

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

versionInfo VersionInfo No

Version Info

getAllAttributes boolean Yes

Get all attributes

workflowId number Yes

Workflow Id

Returns : Observable<any>

Observable

getAssetFormInfoByContentTypeId
getAssetFormInfoByContentTypeId(contentTypeId: number, workflowId?: number)

Get asset form info by content type id

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

workflowId number Yes

Workflow Id

Returns : any

Observable

getAssetPreviewRenditionsInfo
getAssetPreviewRenditionsInfo(assetId: number, versionInfo: VersionInfo)

Get all preview and thumbnail renditions for an asset.

Parameters :
Name Type Optional Description
assetId number No

Id of the asset whose renditions have to be fetched.

versionInfo VersionInfo No

version info of the asset. This is an optional param.

Returns : Observable<any>

Observable array containing preview and thumbnail renditions of the asset.

getAssetPublicUrl
getAssetPublicUrl(assetId: number, versionInfo?: VersionInfo)

Get public downloadable asset url for configured period. Property to config period: asset.object.url.expiration.time

Parameters :
Name Type Optional Description
assetId number No

Id of an asset

versionInfo VersionInfo Yes
Returns : Observable<string>

Observable

getAssetRelations
getAssetRelations(assetId: number, versionInfo?: VersionInfo)

Get the asset relations for an asset.

Parameters :
Name Type Optional Description
assetId number No

Id of the asset whose relations have to be fetched.

versionInfo VersionInfo Yes

Version info

Observable<AssetRelation[]> array of AssetRelation DTO containing parent and child relations.

getAssetRenditions
getAssetRenditions(assetId: number, versionInfo: VersionInfo)

Get all preview and thumbnail renditions for an asset with BLOB based URL.

Parameters :
Name Type Optional Description
assetId number No

Id of the asset whose renditions have to be fetched.

versionInfo VersionInfo No

version info of the asset. This is an optional param.

Returns : Observable<any>

Observable array containing preview and thumbnail renditions of the asset.

getAssetsAttributes
getAssetsAttributes(assetIds: number[])

Get assets attributes

Parameters :
Name Type Optional Description
assetIds number[] No

Assets Id list

Returns : any

Observable

getAssetsCount
getAssetsCount()

Get assets count

Returns : Observable<literal type>

Observable

getAssetsDetails
getAssetsDetails(assets: AssetRequest[])

Get assets details

Parameters :
Name Type Optional Description
assets AssetRequest[] No

Assets of type AssetRequest[]

Returns : Observable<any>

Observable an asset detail object.

getAssetsFromInfo
getAssetsFromInfo(assetFormRequests: AssetFormRequest[])

Get assets from info

Parameters :
Name Type Optional Description
assetFormRequests AssetFormRequest[] No

Asset form request

Returns : any

Observable

getAssetsVersionAttributes
getAssetsVersionAttributes(assets: literal type[])

Get assets version attributes

Parameters :
Name Type Optional Description
assets literal type[] No

assets {id, majoVersion, minorVersion} list

Returns : Promise<Entity[]>

Promise<Entity[]>

getAssetUpdateStatus
getAssetUpdateStatus(contextId: string, includeIndexingStatus?: boolean)

Retrieves the update status of an asset based on the provided context ID.

Parameters :
Name Type Optional Description
contextId string No
  • The ID of the context for which the asset update status is being requested.
includeIndexingStatus boolean Yes
Returns : Observable<any>

An Observable that emits the update status of the asset.

getAssetVersionsInfo
getAssetVersionsInfo(assetId, versionInfo: VersionInfo)

Get asset version info

Parameters :
Name Type Optional Description
assetId No

Asset id of asset

versionInfo VersionInfo No

VersionInfo

Returns : Observable<any>

Observable

getChildAssetRelationsVersionOfType
getChildAssetRelationsVersionOfType(parentAssetId: number, version: VersionInfo, relationTypeIds: number[])

Get Child Asset Relations for Relationships ids

Parameters :
Name Type Optional Description
parentAssetId number No

Parent Asset id

version VersionInfo No

Version info

relationTypeIds number[] No

Array of relation Ids

Returns : Observable<any>

Promise

getCurrentVersionOnBranchTree
getCurrentVersionOnBranchTree(assetId: number)

Get current version of branch tree

Parameters :
Name Type Optional Description
assetId number No

Asset id

Observable

getLatestVersionsInfo
getLatestVersionsInfo(assetId: number, versionInfo?: VersionInfo, onlyLatest?: boolean)

Get latest versions info

Parameters :
Name Type Optional Description
assetId number No

Asset Id

versionInfo VersionInfo Yes

Version info

onlyLatest boolean Yes

Only latest

Returns : Observable<any>

Observable

getParentAssetRelations
getParentAssetRelations(assetId: number, versionInfo?: VersionInfo, excludeCrossReferenceRelations)

Get parent asset relations

Parameters :
Name Type Optional Default value Description
assetId number No

Asset id of asset

versionInfo VersionInfo Yes

VersionInfo

excludeCrossReferenceRelations No false

Observable<ParentRelationInfo[]>

getParentAssetRelationsVersionOfType
getParentAssetRelationsVersionOfType(childAssetId: number, version: VersionInfo, relationTypeIds: number[])

Get Parent Asset Relations for Relationships ids

Parameters :
Name Type Optional Description
childAssetId number No

Child Asset id

version VersionInfo No

Version info

relationTypeIds number[] No

Array of relation Ids

Returns : Observable<any>

Promise

isMinorVersionSupported
isMinorVersionSupported(assetId: number, branchId: number)

Checks if minor versioning is supported for the given asset and branch.

Parameters :
Name Type Optional Description
assetId number No

The ID of the asset.

branchId number No

The ID of the branch.

Returns : Observable<boolean>

An Observable that emits a boolean indicating whether minor versioning is supported.

reIndexAssets
reIndexAssets(assetInfo: AssetReIndexInfo[])

Reindex assets

Parameters :
Name Type Optional Description
assetInfo AssetReIndexInfo[] No

Asset info

Returns : Observable<any>

Observable

revertToVersion
revertToVersion(assetId: number, versionInfo: VersionInfo, createMinorVersion: boolean)

Revert to version

Parameters :
Name Type Optional Description
assetId number No

Asset Id

versionInfo VersionInfo No

Version info

createMinorVersion boolean No

Create minor version

Returns : any

Observable

setAssetAttributes
setAssetAttributes(assetId: number, versionInfo: VersionInfo, attributeValues: any[])

Set asset attributes

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

versionInfo VersionInfo No

Version info

attributeValues any[] No

An array of attribute values

Returns : Observable<any>

Observable

setAssetWorkflowAndFormAttributes
setAssetWorkflowAndFormAttributes(assetId: number, attributesObj: any, createAssetVersion: boolean)

Set asset workflow and form attributes

Parameters :
Name Type Optional Default value Description
assetId number No

Asset id of asset

attributesObj any No

Attributes object

createAssetVersion boolean No true

Create asset version

Returns : Observable<any>

Observable

setMultiAssetsAttributes
setMultiAssetsAttributes(multiFilesAttrSaveRequest: MultiFilesAttrSaveRequest, createAssetVersion: boolean)

Set multi assets attributes

Parameters :
Name Type Optional Default value Description
multiFilesAttrSaveRequest MultiFilesAttrSaveRequest No

Multifiles save request

createAssetVersion boolean No true

Create asset version

Returns : Promise<any>

Observable

updateAssetAttributes
updateAssetAttributes(assets: any[], attributeValues: any[], includeIndexingStatus?: boolean)

Updates the attributes of a list of assets.

Parameters :
Name Type Optional Description
assets any[] No
  • An array of assets to update. Each asset should have an id and versionInfo.
attributeValues any[] No
  • An array of new attribute values to be applied to the assets.
includeIndexingStatus boolean Yes
  • Optional parameter to include indexing status in the response.
Returns : Observable<any>

An Observable that emits the response from the update operation.

updateAssetsAttributes
updateAssetsAttributes(assetAttributesRequests: AssetAttributesRequest[])

Update attributes for multiple assets, with support for the createAssetVersion option.

Parameters :
Name Type Optional Description
assetAttributesRequests AssetAttributesRequest[] No

Requests containing assets attributes to set.

Observable<AssetAttributesResponse[]> Array of AssetAttributesResponse

updateDatadoc
updateDatadoc(assetId: number)

Update data doc

Parameters :
Name Type Optional Description
assetId number No

Asset id of asset

Returns : Observable<any>

Observable

Properties

assetDeletion
Default value : new Subject<number>()

result-matching ""

    No results matching ""