Does ISHRemote only see a Document Object if it has object, version and language layer present?

Hi,

I am still researching and trying to understand the workings of ISHRemote for manipulating objects in Tridion Docs.

While testing various calls to Get-IshDocumentObj it appears to sometimes remove only the language layer of a document object.

When I view the document object in Tridion Web Client I can still see the Object and Version layer. However, when I test further attempts to get or remove this object view ISHRemote, it doesn't find it.

Can anyone explain the visibility of a topic object in Tridion Web Client that cannot be seen via call to Get-IshDocumentObj using ISHRemote?

Any feedback appreciated,

Regards,

Ann

Parents Reply Children
  • Hi Dave,

    Thanks for your reply. I see the docs for the function says "Delete Will Fail...if the map is referenced by another map". How does this differ to calling ISHRemote cmdlet Remove-IshDocumentObj?

    When I test and call $ishSession.DocumentObj25.Delete it seems to only remove the language layer whereas Remove-IshDocumentObj removes both the language and version layer. Whatever way I try to delete a topic that is referenced from elsewhere, once the language layer is gone then the logical / object layer isn't seen by ISHRemote so I cannot do any further processing to something that is invisible. 

    Am I trying to do the impossible here or is there some way to achieve this?

    Also, I seem to be getting very few responses on my questions and wonder if there is another forum/site that community members use?

    Thanks in advance,

    Ann

  • Hi Dave,

    Sorry to bug you again but you do seem to be the only person in this community who can advise me.

    I see the API docs for the function says "Delete Will Fail...if the map is referenced by another map".

    How does this differ to calling ISHRemote cmdlet Remove-IshDocumentObj?

    When I test and call $ishSession.DocumentObj25.Delete it seems to only remove the language layer whereas Remove-IshDocumentObj removes both the language and version layer. Whatever way I try to delete a topic that is referenced from elsewhere, once the language layer is gone then the logical / object layer isn't seen by ISHRemote so I cannot do any further processing to something that is invisible :-|

    Can you provide me with any more guidance on this? Am I trying to do something that can't be done?

    Thanks,

    Ann

  • Hi Ann,

    It does not differ 'Remove-IshDocumentObj' eventually calls the Delete API function as you can see on https://github.com/sdl/ISHRemote/blob/master/Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/DocumentObj/RemoveIshDocumentObj.cs line 208. The main difference is that ISHRemote in total expects full logical-version-language, and only the delete tries to do cleanup for the last version (if all languages are gone) and also for the logical (if all versions and languages are gone).

    Now what you experience is that delete of that last logical level is blocked. And that will be the same for ISHRemote and the API call.

    So there are some best practices, as delete the pyramid of information in order

    1. Publications first as they reference (root) maps and resources (typically library topics)
    2. Then root maps, sub maps, etc as they reference topics
    3. Then Topics as they reference images and conrefs and variables (typically offered by library topics)
    4. Then Library Topics who could reference each other or images
    5. Then Images

    Another approach if you don't know or care about the information architecture is to brute-force loop. If you 10 objects referencing each other, probably one is top of the pyramid and the others will fail, so one delete will work. Enabling the next delete in the next loop.

    I understand - and experienced it multiple times myself - that referential integrity is part of the CMS and especially complicates negative/removal operations. Of course that is one of those things that set the CMS apart from a folder with files.

    Best wishes,
    Dave