How to Freeze a Baseline via the SDL API?

Hi

The team I work on is currently tasked with freezing a baseline for all of the topics in our repository using the SDL API. These are the steps taken so far.

1) Get the baseline name from the publication object via GUID.

2) Use the baseline name to fetch the baseline id.

3) Use the baseline id to freeze the baseline.

The problem is when I try to freeze the baseline I get a false response. The resulting error report states, "No version selected for object". That makes sense, but we are unsure as how exactly select a version (latest version?) for each object attached to the baseline.

Anyone solved this problem, used the API to freeze a baseline?

Any help or pointers we could get would be most welcome.

Thanks,
Keith

Parents
  • Hi Keith,

    I'm always interested what the problem is we are trying to solve as inspiration for all of us :-)

    Let's go technical.

    First of all, you can get the baseline id in one go from the publication object by specifying the metadata to retrieve as "<ishfield level='version' name='FISHBASELINE' ishvaluetype='element'/>". The @ishvaluetype attribute defaults to 'value' which is the readable name, but the 'element' value is the real identifier that survives baseline renames.

    When freezing a baseline, the idea is that you will gather a 'super-set' of object versions so that all referenced objects truly have a version assigned. This means that for every starting point in your baseline all versions have to be set for all child branches (typically maps and topics) up to the leaves (typically topics, libraries and images). This including all permutations of condition contexts.
    When reusing that baseline in other publications with most likely a different condition context, any new root map selected from that 'super-set' will offer a complete set of information.

    To put it simple, I would do a Baseline25.CompleteBaselineByCandidateAndMode for the LogicalId of your root map. The latter you can pick up on the publication version level by field FISHMASTERREF. From the top of my head, in that call you can leave ExtendBaselineId empty and put AutoCompleteMode to ISHLatestAvailable - all other parameters can come from your publication version as well.
    The result is a report which you still have to persist into the baseline by a Baseline25.Update call... and then I think a server-side Baseline25.Freeze will work.

    -Dave

Reply
  • Hi Keith,

    I'm always interested what the problem is we are trying to solve as inspiration for all of us :-)

    Let's go technical.

    First of all, you can get the baseline id in one go from the publication object by specifying the metadata to retrieve as "<ishfield level='version' name='FISHBASELINE' ishvaluetype='element'/>". The @ishvaluetype attribute defaults to 'value' which is the readable name, but the 'element' value is the real identifier that survives baseline renames.

    When freezing a baseline, the idea is that you will gather a 'super-set' of object versions so that all referenced objects truly have a version assigned. This means that for every starting point in your baseline all versions have to be set for all child branches (typically maps and topics) up to the leaves (typically topics, libraries and images). This including all permutations of condition contexts.
    When reusing that baseline in other publications with most likely a different condition context, any new root map selected from that 'super-set' will offer a complete set of information.

    To put it simple, I would do a Baseline25.CompleteBaselineByCandidateAndMode for the LogicalId of your root map. The latter you can pick up on the publication version level by field FISHMASTERREF. From the top of my head, in that call you can leave ExtendBaselineId empty and put AutoCompleteMode to ISHLatestAvailable - all other parameters can come from your publication version as well.
    The result is a report which you still have to persist into the baseline by a Baseline25.Update call... and then I think a server-side Baseline25.Freeze will work.

    -Dave

Children