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>
4 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.
If RPE can't give you the images directly, another option is to export or extract the document content first and then pull the embedded images from that output. I've seen people use different document-processing tools depending on their workflow. If your content ends up in Word format, WordImageExtractor (https://wordimageextractor.com/) can be handy for extracting the images separately. It won't replace RPE, but it can be a useful workaround in some cases.
You may want to verify that the publish/text endpoint is actually returning embedded images rather than image placeholders. Also check that your RPE template is using the DNG Text schema correctly and that the images are accessible in the selected configuration context. If the endpoint output already shows "Embedded image", the issue is likely with the published content rather than the RPE template .