ISHRemote - how to get baseline items

I get the baseline guid from the publication:

$publication = Get-IshPublicationOutput -LogicalId $PubGuid

$baselineguid = $publication[0].fishbaseline_version_element

Then I get the baseline like this:

$baseline = Get-IshBaseline -Id $baselineguid

At least I think I am getting a baseline with that.

I'm trying to get the baseline items after a certain modified date. But I can't find where in the baseline object these items are contained. Any ideas?

Thanks, Mark

The ISHBaseline object has these fields:

Name                             MemberType   Definition                                                      
----                             ----------   ----------                                                      
Equals                           Method       bool Equals(System.Object obj)                                  
GetHashCode                      Method       int GetHashCode()                                               
GetType                          Method       type GetType()                                                  
ToString                         Method       string ToString()                                               
fishbaselineactive               NoteProperty string fishbaselineactive=Yes                                   
fishbaselineactive_none_element  NoteProperty string fishbaselineactive_none_element=TRUE                     
fishdocumentrelease              NoteProperty string fishdocumentrelease=User Manual-v1-GUID-xxx...
fishdocumentrelease_none_element NoteProperty string fishdocumentrelease_none_element=GUID-xxx...
fishlabelreleased                NoteProperty string fishlabelreleased=No                                     
fishlabelreleased_none_element   NoteProperty string fishlabelreleased_none_element=FALSE                     
fusergroup                       NoteProperty string fusergroup=                                              
fusergroup_none_element          NoteProperty string fusergroup_none_element=                                 
readaccess                       NoteProperty string readaccess=                                              
readaccess_none_element          NoteProperty string readaccess_none_element=                                 
IshData                          Property     Trisoft.ISHRemote.Objects.Public.IshData IshData {get;set;}     
IshField                         Property     Trisoft.ISHRemote.Objects.Public.IshField[] IshField {get;}     
IshRef                           Property     string IshRef {get;}                                            
IshType                          Property     Trisoft.ISHRemote.Objects.Enumerations+ISHType IshType {get;}   
ObjectRef                        Property     string ObjectRef {get;}

emoji
  • Hi Mark,

    You are on the right path with "$baseline = Get-IshBaseline -Id $baselineguid" ... that results in an object (a card with fields) as you printed out above. What you probably want is actually the entries/items you also see in the baseline tab of Publication Manager. You can get those by a different cmdlet: "$baseline = Get-IshBaselineItems -Id $baselineguid". This cmdlet returns you the _saved_ baseline entries, anything with autocomplete (LatestReleased/LatestAvailable) which was not deliberately saved by a user in Publication Manager is not there.

    The second part of your question on modification date can become quite complicated depending on what you want to achieve. Theoretically this could be about

    • an item getting version-bumped in the baseline from v1 to v2 on or after a certain date
    • the same version selection of the content object could still be v2, but in the meanwhile it received more revisions in the repository (or edge cases like deleted, recreated, reimported).

    -Dave

    emoji
  • Thanks Dave, this helps. Now I can get a lot of the baseline that I can see in Publication Manager. But I am getting unexpected behavior in inspecting the baseline. I use a loop like this to get objects that were modified in 2022:

    foreach ($object in $baseline)
    {
        if ($object.ModifiedOn -like '*2022*') {
            Write-Output $object.ModifiedOn
        }
    }

    I get 4 dates back from this. But when I look at the same publication in Publication Manager there are at least 20 objects modified in 2022. Is this something you were trying to tell me above? I have this simple-minded idea that I can get the modified date on every object in the baseline.

    But I don't have to use the baseline. All I want to do is use a script to get all the modified topics and maps under the main DITA map in a publication. Should I go about this in a different way?

    Thanks,

    Mark

    emoji
  • Hi Mark - back from my holiday...

    Regarding your second question, I can tell you that an acurrate answer is a tough challenge. Something I tried to highlight with my earlier version-bump or version-selection samples and they are only tip of the ice berg. Now in a project - not product - you can take some short cuts because you have a certain way-of-working or information-architecture.

    So when you describe all modified topics under the map of a publication, it still implicitly means a certain map version (with the version set in the baseline) and in turn for the linked topics of that map (again decided by baseline) or would you be happy with latest available version.

    Regarding your first question, the Publication Manager baseline view is these days personalized (you add/remove columns) or via metadataconfig.xml (custom system-wide configuration). If you check that Add/Remove columns menu you'll notice various kind of dates, where we even do some heavy lifting on the back end as the product made a selection of the most interesting dates for the Publication Manager persona.

    Trados Studio Publication Manager baseline view with an AddRemove Columns menu open showing various date columns available for display.

    The $baseline[0].ModifiedOn is the date that your chosen topic LogicalId version was last changed in this $baseline. That most likely is not the modified-on date you see in your baseline list view - I think you are seeing the "Added on" column information.

    Hope this helps, and that I didn't scare you too much :)
    Dave

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:05 AM (GMT 0) on 5 Mar 2024]