Automating on Tridion Docs - ISHRemote v8.1 holding performance boost is now available

Automating on Tridion Docs - ISHRemote v8.1 holding performance boost is now available

What happened

Full release notes are on https://github.com/sdl/ISHRemote/blob/master/Doc/ReleaseNotes-ISHRemote-8.1.md and https://github.com/RWS/ISHRemote/releases/tag/v8.1

Before I forget, all people with a Github account, could you spare a moment to STAR this repository - see top-right Star icon on https://github.com/RWS/ISHRemote/ Appreciated!

General

This release inherits the v0.1 to v0.14 up to v8.0 development branch and features. All cmdlets and business logic are fully compatible even around authentication. In short, we expect it all to work still :)

Remember

  • All C# source code of the ISHRemote library is online at master, including handling of the different Connection protocols in a NET 4.8 and NET 6.0+ style.

  • All PowerShell-based Pester integration tests are located per cmdlet complying with the *.tests.ps1 file naming convention. See for example AddIshDocumentObj.Tests.ps1 or TestIshValidXml.Tests.ps1

The below text describes the delta compared to fielded release ISHRemote v8.0.

Boosting performance for protocol WcfSoapWithWsTrust

In ISHRemote v8.0 we refactored the proxies to introduce Modern Authentication next to existing legacy authentication now known as -protocol WcfSoapWithWsTrust. Performance was boosted and memory handling was optimized by making the token expiration less overzealous. #196

All customers on ISHRemote v8.0 are advised to upgrade, especially when using ISHRemote to Tridion Docs 14SP4/14.0.4 and earlier or when using the New-IShSession -IShUserName ... -IShPassword ... parameter set.

Extending cmdlet Add-IshBackgroundTask with parameter InputDataTemplate to enable Metrics feature

The Add-IshBackgroundTask cmdlet, introduced in #112, offered a shorthand way of enabling the Semantic AI feature (SMARTTAG) plus it offered a raw InputData pass through option.

The contract of what you put on the BackgroundTask message queue under InputData and how the BackgroundTask handler interprets it is up to the implementer. For the standard product however there are only a handful of InputData contracts. An overview where you'll notice that the client triggering the message prefers a minimal contract, so providing the least amount of information as possible as the matching BackgroundTask handler (EventTypes) can retrieve more data if desired. #193

EventTypes

InputDataTemplate

incoming IShObjects

InputData sample

SMARTTAG, CREATETRANSLATIONFROMLIST

IshObjectsWithLngRef

IShDocumentObj

<ishobjects><ishobject ishtype='ISHMasterDoc' ishref='GUID-X' ishlogicalref='45677' ishversionref='45678' ishlngref='45679'><ishobject ishtype='ISHIllustration' ishref='GUID-Y' ishlogicalref='345677' ishversionref='435678' ishlngref='345679'></ishobjects>

CLEANUPMETRICS, DITADELIVERYUPDATEPUBLICATIONMETADATA,... everything that goes over IWrite plugin OnMultiFieldChangeSendEvent

IshObjectWithLngRef

IShPublicationOutput, IShDocumentObj or IShBaseline

<ishobject ishtype='ISHBaseline' ishref='GUID-X' ishbaselineref='45798'> or <ishobject ishtype='ISHMasterDoc' ishref='GUID-X' ishlogicalref='45677' ishversionref='45678' ishlngref='45679'>

SYNCHRONIZEMETRICS

IshObjectsWithIshRef

IShDocumentObj

<ishobjects><ishobject ishtype='ISHMasterDoc' ishref='GUID-X'><ishobject ishtype='ISHIllustration' ishref='GUID-Y'></ishobjects>

INBOXEXPORT, REPORTEXPORT, SEARCHEXPORT, PUBLICATIONEXPORT, FOLDEREXPORT

EventDataWithIshLngRefs

IShDocumentObj

<eventdata><lngcardids>13043819, 13058357, 14246721, 13058260</lngcardids></eventdata>

custom

when not specified you have to pass -RawInputData

custom

value of -RawInputData should match your BackgroundTask handler implementation

Example using SMARTTAG

Add BackgroundTask with event type SMARTTAG for the objects located under the General\MyFolder\Topics path. One BackgroundTask message will appear per folder containing a list of all latest version English (en) content objects in the InputData of the message. Note that there is no devide on $ishSession.MetadataBatchSize (default was 999) anymore since this v8.1 version of ISHRemote.

Get-IshFolder -FolderPath "General\Myfolder\Topics" -FolderTypeFilter @("ISHModule", "ISHMasterDoc", "ISHLibrary") -Recurse |
ForEach-Object -Process {
    Get-IshFolderContent -IshFolder $_ -VersionFilter Latest -LanguagesFilter en |
    Add-IshBackgroundTask -EventType "SMARTTAG" -InputDataTemplate IshObjectsWithLngRef  # plural content objects...
}

Example using SYNCHRONIZEMETRICS

Rebuilding the Metrics subsystem, introduced in Tridion Docs 15.1 Update 1 (15.1.1), is optimally done in the order of Images, Topics and Publications. Add BackgroundTask with event type SYNCHRONIZEMETRICS for the objects located under the General path (Data folder). One BackgroundTask message will appear per folder containing a list of LogicalIds in the InputData of the message, hence the content of one folder is passed in one message.

Note that a more complex script will be offered in the product (IShCD installation media) that covers error handling, logging transcript and more. The below illustrates that ISHRemote cmdlets are an enabler for the feature and offering variations like partial rebuilds and more.

# First Images
Get-IshFolder -BaseFolder Data -FolderTypeFilter @("ISHIllustration") -Recurse |
ForEach-Object -Process {
    Get-IshFolderContent -IshFolder $_ -VersionFilter Latest |
    Add-IshBackgroundTask -EventType "SYNCHRONIZEMETRICS" -EventDescription "SYNCHRONIZEMETRICS Images" -InputDataTemplate IshObjectsWithIshRef  # plural LogicalIds
}
# Then Topics
Get-IshFolder -BaseFolder Data -FolderTypeFilter @("ISHModule") -Recurse |
ForEach-Object -Process {
    Get-IshFolderContent -IshFolder $_ -VersionFilter Latest |
    Add-IshBackgroundTask -EventType "SYNCHRONIZEMETRICS" -EventDescription "SYNCHRONIZEMETRICS Topics" -InputDataTemplate IshObjectsWithIshRef  # plural LogicalIds
}
# Then Publications
Get-IshFolder -BaseFolder Data -FolderTypeFilter @("ISHPublication") -Recurse |
ForEach-Object -Process {
    Get-IshFolderContent -IshFolder $_ -VersionFilter Latest |
    Add-IshBackgroundTask -EventType "SYNCHRONIZEMETRICS" -EventDescription "SYNCHRONIZEMETRICS Publications" -InputDataTemplate IshObjectsWithIshRef  # plural LogicalIds
}

Example using FOLDEREXPORT

Add BackgroundTask with event type FOLDEREXPORT for the objects located under the General\MyFolder\Images path. Note that the BackgroundTask handler behind all ...EXPORT events like SEARCHEXPORT or INBOXEXPORT on Tridion Docs 15.1 and earlier is identical. One BackgroundTask message will appear per folder containing a list of all latest version English (en) content objects in the InputData of the message.

Get-IshFolder -FolderPath "General\MyFolder\Images" -Recurse |
ForEach-Object -Process {
    Get-IshFolderContent -IshFolder $_ -VersionFilter Latest -LanguagesFilter en |
    Add-IshBackgroundTask -EventType "FOLDEREXPORT" -InputDataTemplate EventDataWithIshLngRefs
}

Note that without the ForEach-Object construction, all recursively found content objects would all be passed in one BackgroundTask message.

Get-IshFolder -BaseFolder EditorTemplate -Recurse |
Get-IshFolderContent -VersionFilter Latest -LanguagesFilter en |
Add-IshBackgroundTask -EventType "FOLDEREXPORT" -EventDescription "Folder Export of General\MyFolder\Images" -InputDataTemplate EventDataWithIshLngRefs -WhatIf

Get-IshBackgroundTask -MetadataFilter (Set-IshMetadataFilterField -Level Task -Name EVENTTYPE -FilterOperator Equal -Value 'FOLDEREXPORT')

References

If you don't know what PowerShell or ISHRemote are about. Or don't know how to install it, then have a look at the videos and supporting blogposts on https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-docs/b/weblog/posts/automating-tasks-in-sdl-tridion-docs-using-powershell