File

platform-components-ng/projects/platform-components-lib/src/lib/components/content-types/service/content-types.service.ts

Description

Service to get Content Types and its and its info from PS.

Index

Methods

Constructor

constructor(http: HttpClient, userService: UserService)
Parameters :
Name Type Optional
http HttpClient No
userService UserService No

Methods

convertTreeToFlatList
convertTreeToFlatList(contentTypes: ContentType[])

Converting tree to flat list

Parameters :
Name Type Optional Description
contentTypes ContentType[] No

Content types

Returns : ContentType[]

Content types

createContentType
createContentType(parentContentTypeId: number, contentTypeName: string)

Create content type

Parameters :
Name Type Optional Description
parentContentTypeId number No

Parent content type Id

contentTypeName string No

Content type name

Returns : Observable<CreateContentTypeResponse>

Observable

deleteContentType
deleteContentType(contentTypeId: number)

Delete content type

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

Returns : Observable<any>

Observable

detectContentType
detectContentType(fileExt, file)

Delete content type

Parameters :
Name Optional Description
fileExt No

File Extension

file No

File

Returns : Promise<any>

Promise

duplicateContentType
duplicateContentType(sourceId: number, targetName: string, parentContentTypeId: number)

Duplicate content type

Parameters :
Name Type Optional Description
sourceId number No

Source Id

targetName string No
parentContentTypeId number No

Parent content type Id

Returns : Observable<CreateContentTypeResponse>

Observable

filterTree
filterTree(tree: (ContentType | null)[], idsToKeep: number[])
Parameters :
Name Type Optional
tree (ContentType | null)[] No
idsToKeep number[] No
Returns : ContentType[]
getAllDeliveryChannels
getAllDeliveryChannels()

Get all delivery channels

Returns : Observable<PublishingChannel[]>

Observable<PublishingChannel[]>

getAllPublishingChannels
getAllPublishingChannels()

Get all publishing channels

Returns : Observable<PublishingChannel[]>

Observable<PublishingChannel[]>

getAssetCount
getAssetCount(contentTypeIds: number[])

Get asset count

Parameters :
Name Type Optional Description
contentTypeIds number[] No

Content type Id list

Returns : any

Observable

getAttributeContentTypesMapping
getAttributeContentTypesMapping(attributeId: number)

Get Properties of an attribute

Parameters :
Name Type Optional Description
attributeId number No

Id of attribute

Returns : Observable<any>

Observable

getContentType
getContentType(contentTypeId: number)

Get content type info

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

Observable

getContentTypeByName
getContentTypeByName(contentTypeName: string)

Get content type info

Parameters :
Name Type Optional Description
contentTypeName string No

Content type name

Observable

getContentTypeDeliveryChannels
getContentTypeDeliveryChannels(contentTypeId: number)

Get content type delivery channels

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

Returns : Observable<any>

Observable

getContentTypeFromExtension
getContentTypeFromExtension(mimeType: string, fileExt: string)

Get content type from extension

Parameters :
Name Type Optional Description
mimeType string No

Mime type

fileExt string No

File Extension

Returns : Observable<any>

Observable

getContentTypeProperties
getContentTypeProperties(contentTypeId: number)

Get Properties of a content type

Parameters :
Name Type Optional Description
contentTypeId number No

Id of content type

Observable<Attribute[]>

getContentTypePublishingChannels
getContentTypePublishingChannels(contentTypeId: number, inherited)

Get Publishing channels of a content type

Parameters :
Name Type Optional Default value Description
contentTypeId number No

Id of content type

inherited No false

Inherited

Returns : Observable<PublishingChannel[]>

Observable<PublishingChannel[]>

getContentTypes
getContentTypes()

Get all content types

Promise<Observable>

getContentTypeWorkflows
getContentTypeWorkflows(contentTypeId: number, withContentTypes, withBlankStatuses)

Get Workflows of a content type

Parameters :
Name Type Optional Default value Description
contentTypeId number No

Id of content type

withContentTypes No true
withBlankStatuses No true

Observable<Workflow[]>

Async getDocumentTypes
getDocumentTypes(allContentTypes: any[])
Parameters :
Name Type Optional
allContentTypes any[] No
Returns : Promise<any[]>
getSelectionNodeHierarchy
getSelectionNodeHierarchy(selectedContentTypeNode: ContentType, contentTypeOptions: ContentType[])

Get selection node hierarchy

Parameters :
Name Type Optional Description
selectedContentTypeNode ContentType No

Selected contenttype node

contentTypeOptions ContentType[] No

Content type options

Returns : ContentType[]

ContentType[]

getSpecializationContentTypes
getSpecializationContentTypes(contentTypeId)

Get specialization content types

Parameters :
Name Optional Description
contentTypeId No

Content Type Id

Returns : ContentType[]

ContentType[]

isValidAncestor
isValidAncestor(contentTypeId, ancestorContentTypeId)

Is valid ancestor

Parameters :
Name Optional Description
contentTypeId No

Content Type Id

ancestorContentTypeId No

Ancestor content type Id

Returns : Observable<boolean>

Observable

loadDocumentTypes
loadDocumentTypes()
pruneNonDocParentsAboveFirstDocType
pruneNonDocParentsAboveFirstDocType(tree: (ContentType | null)[])
Parameters :
Name Type Optional
tree (ContentType | null)[] No
Returns : ContentType[]
pruneNonDocParentsBelowLastDocType
pruneNonDocParentsBelowLastDocType(tree: (ContentType)[])
Parameters :
Name Type Optional
tree (ContentType)[] No
Returns : ContentType[]
refreshContentType
refreshContentType(contentTypeId: number, updateIconGuid?: boolean)
Parameters :
Name Type Optional
contentTypeId number No
updateIconGuid boolean Yes
Returns : void
renameContentType
renameContentType(contentTypeId: number, newName: string)

Rename content type

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

newName string No

New Name

Returns : Observable<any>

Observable

setAttributeContentTypes
setAttributeContentTypes(attributeId: number, contentTypes: any)

Set attribute content types

Parameters :
Name Type Optional Description
attributeId number No

Attribute Id

contentTypes any No

Content Types

Observable

setContentTypeChannels
setContentTypeChannels(contentTypeId: number, channelIds: string)

Set content type channels

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

channelIds string No

Channel Id list

Observable

setContentTypeChannelsPreview
setContentTypeChannelsPreview(contentTypeId: number, channelIds: string, useForPreview: boolean)

Set content type channels preview

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

channelIds string No

Channel Id list

useForPreview boolean No

Use for preview

Returns : Observable<any>

Observable

setContentTypeProperties
setContentTypeProperties(contentTypeId: number, properties: any)

Set content type properties

Parameters :
Name Type Optional Description
contentTypeId number No

Content Type Id

properties any No

Properties

Observable

setContentTypesIntialized
setContentTypesIntialized(contentTypesIntialized)
Parameters :
Name Optional
contentTypesIntialized No
Returns : void
setContentTypeWorkflows
setContentTypeWorkflows(contentTypeId: number, workflowIds: number[])

Set content type workflows

Parameters :
Name Type Optional Description
contentTypeId number No

Content Id

workflowIds number[] No

Workflow Ids

Observable

updateContentTypeIcon
updateContentTypeIcon(_contentTypeIconInfo: any)

Update ContentType Icon

Parameters :
Name Type Optional Description
_contentTypeIconInfo any No

Icon Info (ContentType id and icon file)

Returns : Promise<string>

Promise

result-matching ""

    No results matching ""