Extract Images from DOORS Next with RPE
Looking at other posts the method to extract images with requirements seems to be using the DNG Text schema and the data source URL: https://server:port/rm/publish/text?resourceURI=[artefact UUID]&maximiseEmbeds=true
<o:p> </o:p>
2 answers
What you're seeing isn't really wrong, per se. For embedded or OLE objects, the information that DNG provides to RPE includes a link to the actual object inside DNG, and RPE includes that in the published output. If you want RPE to not do that, you'll need to use scripting to strip the link out of the XML that DNG returns for the image artifact.
sessionLogger.info("OLE Object:Requirement_Text = '" + div + "'");
var tmpDiv = div;
if (tmpDiv.match(/(<a href=\"(.?)Embedded Object<\/a>)/)) {
_sessionLogger.info(" FOUND Embedded Object");tmpDiv = tmpDiv.replace(/(<a href=\"(.?)Embedded Object<\/a>)/, "")tmpDiv = tmpDiv.replace("<br/>", "");tmpDiv = tmpDiv.replace("<div>", "");tmpDiv = tmpDiv.replace("<\/div>", "");_sessionLogger.info("tmpDiv = '" + tmpDiv + "'");
}else if (tmpDiv.match(/(<a id=\"[0-9]+\" href=\"(.?)Embedded Object<\/a>)/)) {
sessionLogger.info(" FOUND Embedded Object");tmpDiv = tmpDiv.replace(/(<a id=\"[0-9]+\" href=\"(.?)Embedded Object<\/a>)/g, "")tmpDiv = tmpDiv.replace("<br/>", "");tmpDiv = tmpDiv.replace("<div>", "");tmpDiv = tmpDiv.replace("<\/div>", "");sessionLogger.info("tmpDiv = '" + tmpDiv + "'");
}else if (tmpDiv.match(/(<a href=\"(.?)OLE Object<\/a>)/)) {
_sessionLogger.info(" FOUND OLE Object");tmpDiv = tmpDiv.replace(/(<a href=\"(.?)OLE Object<\/a>)/, "")tmpDiv = tmpDiv.replace("<br/>", "");tmpDiv = tmpDiv.replace("<div>", "");tmpDiv = tmpDiv.replace("<\/div>", "");_sessionLogger.info("tmpDiv = '" + tmpDiv + "'");
}else if (tmpDiv.match(/(<a id=\"[0-9]+\" href=\"(.?)OLE Object<\/a>)/)) {
sessionLogger.info(" FOUND OLE Object");tmpDiv = tmpDiv.replace(/(<a id=\"[0-9]+\" href=\"(.?)OLE Object<\/a>)/g, "")tmpDiv = tmpDiv.replace("<br/>", "");tmpDiv = tmpDiv.replace("<div>", "");tmpDiv = tmpDiv.replace("<\/div>", "");_sessionLogger.info("tmpDiv = '" + tmpDiv + "'");
}
tmpDiv;
Comments
Wow, that indentation formatting is ugly. Sorry about that.
Thanks John, I feel close to cracking it, my 'div' is coming out as:
It looks like the XML that you're getting from DNG for your artifact is different than what I get on my system, but it looks to me like you've got the important part: the <img src=" stuff.