Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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


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>

0 votes



2 answers

Permanent link

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.

0 votes

Comments

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

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?

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

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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Feb 15 '22, 11:19 a.m.

Question was seen: 2,128 times

Last updated: Mar 22 '22, 10:57 a.m.

Confirmation Cancel Confirm