DITA and XMetaL Discussion
linjinwei December 10, 2008 at 2:53 pm
Reuseable ComponentDecember 10, 2008 at 2:53 pmParticipants 4Replies 5Last Activity 13 years, 6 months ago
Can anybody explain to me what is a reuseable component and how do I make use of it? Examples will be great.
Thanksmag3737 December 10, 2008 at 4:47 pm
Reply to: Reuseable ComponentDecember 10, 2008 at 4:47 pm
XMetaL's Reusable Components are a special case of the DITA “conref” mechanism for reusing content.
A conref is an attribute that forms a particular kind of link in a DITA document. This link is essentially like a URL that points to another element in a DITA document (usually another one, but doesn't have to be). More importantly, the meaning of this link is when this document is published to an output format, go get that other thing and put it in here. The thing being referenced must be of a compatible type for the location where the link is made. For your convenience, XMetaL also displays the referenced content in place while you are editing.
Conrefs can point to things anywhere in any DITA documents, but many users prefer to save one's reusable components (the targets of the links) one-per-document. This has certain advantages with regards to storing content in a CMS, for example.
XMetaL's Reusable Components gives you some special-purpose commands that let you do just that: “Create Reusable Component” will take a bit of content that you have selected in your current document, and save it out into a separate file (which is a standard, specialized DITA topic) for later reuse. “Insert Reusable Component” allows you to select one of these saved components and form a link to it.Bill H December 10, 2008 at 7:12 pm
Reply to: Reuseable ComponentDecember 10, 2008 at 7:12 pm
Here's a simplistic explanation: You define some text in one file. Then you point to that one file anywhere else you want to use that text. So if that file says YUCK, anywhere you point to it (via a conref) you'll see YUCK. If suddenly every YUCK needs to be YUM instead, you just make the change in the “definition” file. Then the new definition will be “read” wherever it's referred to.
The XMetaL User Guide explains how you Create a reusable component (the “definition” file) and then Insert reusable component–i.e., point to the definition file.
Two examples of how we use reusable components:
1. Product names. If our company decided to change HN9000 to HN9999, we'd only have to make the change in a single file.
2. Document titles. We store the names and document numbers of other documents we refer to in reusable component files. This makes it easy to refer to a document, always get the document title and number right, and easily make a correction globally if necessary (if we don't get it right!).lorenma January 15, 2009 at 5:05 pm
Reply to: Reuseable ComponentJanuary 15, 2009 at 5:05 pm
Yes, the manual says the following:
- Select the content you want to make into the re-usable component. If the content spans more than one paragraph-level element, repeat these steps for each of the elements.
- Click Reuse > Create Reusable Component .
As “Reuse” is not a menu element, where would one find this element in the XMetaL Author DITA Edition structure?Su-Laine Yeo January 15, 2009 at 6:31 pm
Reply to: Reuseable ComponentJanuary 15, 2009 at 6:31 pm
Hi Lorenma. What version of XMetaL are you using?
If you have a DITA topic open, there is a “Reuse” menu in XMetaL Author Enterprise 5.1 and 5.5. It wasn't there in previous versions.lorenma January 15, 2009 at 6:42 pm
Reply to: Reuseable ComponentJanuary 15, 2009 at 6:42 pm
Thank you, Su-Laine.
I am using 5.0; we have 5.1 but because of an incompatability with one of our tools, we needed to drop back a version. I will discuss this with our internal engineers to see what steps we can take to resolve.
- You must be logged in to reply to this topic.