It's all about the answers!

Ask a question

Extract Images from DOORS Next with RPE


J Hughes (111) | asked Feb 15 '22, 11:19 a.m.

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


though in my case I also need to add: &oslc_config.context=https://matrix-rm.almuk-prod.group.intra/rm/cm/stream/[streamUUID]

Unfortunately RPE outputs the requirement text with "Embedded image"

Has anyone an idea what may be going wrong?

thank you,

Jasper

<o:p> </o:p>

2 answers



permanent link
John Pawasauskas (511) | answered Feb 15 '22, 11:45 a.m.

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.


My template uses the following code to do this (I've seen two different formats, so I have code to support them both):

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;

Hope this helps.
-John P.


Comments
John Pawasauskas commented Feb 15 '22, 11:46 a.m.

 Wow, that indentation formatting is ugly.  Sorry about that.


J Hughes commented Feb 16 '22, 6:15 a.m.

Thanks John, I feel close to cracking it, my 'div' is coming out as:

<div><p id="_1644999280805" dir="ltr">[requirement text]<img src="https://[server:port]/rm/wrappedResources/_EEohUo74Eeyt9cXqQwoqDg?accept=none&amp;private" id="_1644999272458" alt="Embedded image"/></p><p id="_1644999280806" dir="ltr">&#160;</p><p id="_1644999280807" dir="ltr">&#160;</p></div> 

Do you have any advice on what needs to be edited there to output the image?


John Pawasauskas commented Feb 18 '22, 2:56 p.m.
I think I misunderstood the problem you're having.  I've never had an issue with getting RPE to publish the actual picture content, only with it also publishing a link back to the artifact in DNG.

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.


Does your template's "text" element where you're doing your scripting have both the XHTML Input and XHTML output boxes checked?

-John P.


permanent link
J Hughes (111) | answered Mar 22 '22, 10:57 a.m.

Turns out the issue lay within using Rational DOORS Next Generation v6.0.6.1 as this issue appears to be resolved in v7.0.2

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.