DNG Changeset in RM Client Extension
Hello,
I am trying to develop the DNG client extension.This widget needs to be executed in changeset context.
So, could you please provide us some leads how to check whether the user in changeset context or not.
I tried using RM.Client.getCurrentConfigurationContext which is unsuccessful.
I am hinting should i use rest api or oslc api (private apis) to check whether the user in changeset context or not ?
If so, sample uri would be helpful
Regards,
Chandan
One answer
A sample Javascript code to get the local configuration context and test if a Changeset exists or not :
function get_ChangeSetConfig (replaceFunction, artifactList, searchString, replaceString) {
RM.Client.getCurrentConfigurationContext (function (result) {
$("#" + GUI_ITEM_MSGERROR).hide();
if (result.code === RM.OperationResult.OPERATION_OK) {
const COMPONENT_CONTEXT = result.data;
if (COMPONENT_CONTEXT.changeSetUri === undefined || COMPONENT_CONTEXT.changeSetUri === null) { // ---- ChangetSet is mandatory to use this widget !
$("#" + GUI_ITEM_MSGERROR).text(MSG_ERR_0004);
$("#" + GUI_ITEM_MSGERROR).show();
} else { // ---- Launch replace operation
replaceFunction (artifactList, searchString, replaceString);
}
} else { // ---- Other error
$("#" + GUI_ITEM_MSGERROR).text(MSG_ERR_0005);
$("#" + GUI_ITEM_MSGERROR).show();
}
});
}
Enjoy