The ReqIF model writer enables to write:
The RIF/ReqIF is stored in an XML file, as described by the related RIF/ReqIF specification. The XML document may be archived in a Zip file (recommended).
External files (e.g. images or spreadsheets) might be referenced by the RIF/ReqIF document. If the XML document is stored in an archive file, those external files are stored within the Zip archive. Otherwise files are written using relative paths in the folder of the XML document.
ReqIF models can be converted to RIF 1.1a or 1.2 files on writing, using respectively the "RIF 1.1a" or "RIF 1.2" model writers.
Note that ReqIF 1.0.1 XML format is exactly the same as ReqIF 1.1.
OLE objects can be inserted in a AttributeValueXHTML
instance.
In that case the AttributeValueXHTML.theValuet
attribute must contains XHTML tags that references the OLE objects, e.g.:
<xhtml:div><xhtml:object data="path_to_ole_object"/></xhtml:div>
When writing the model into a ReqIF file, an AttachmentResolver
is used to retrieve the physical location
of OLE objects files:
import com.sodius.mdw.metamodel.reqif.xhtml.AttachmentResolver; import com.sodius.mdw.metamodel.reqif.xhtml.XHTMLUtils; ... File myFolder = new File(<folder containing OLE object files>); AttachmentResolver resolver = XHTMLUtils.createAttachmentResolver(myFolder); Map<String, Object> options = new HashMap<String, Object>(); options.put(Options.OPTION_ATTACHMENT_RESOLVER, resolver); reqifModel.write("ReqIF 1.1", outputFile, options);
When the writer is launched from rules or Java code, you can set options to tweak the writer's behavior. Refer to the Javadoc of Options to list available settings.