Pages: 1
Print
Author Topic: Reuseable Component  (Read 6937 times)
linjinwei
Member

Posts: 65


« on: December 10, 2008, 08:53:47 AM »

Can anybody explain to me what is a reuseable component and how do I make use of it? Examples will be great.

Thanks
« Last Edit: December 10, 2008, 12:27:16 PM by Derek Read » Logged
mag3737
XMetaL Evangelist
Administrator
Member

Posts: 117

I even use XMetaL to write my business letters.


« Reply #1 on: December 10, 2008, 10:47:33 AM »

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.
Logged

Tom Magliery
JustSystems Canada, Inc.
Bill H
Member

Posts: 9

Principal Technical Writer


« Reply #2 on: December 10, 2008, 01:12:52 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!).
Logged
lorenma
Member

Posts: 2


« Reply #3 on: January 15, 2009, 11:05:51 AM »

Yes, the manual says the following:
<ol>
<li>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.</li>
<li>Click Reuse > Create Reusable Component .
</ol>
As "Reuse" is not a menu element, where would one find this element in the XMetaL Author DITA Edition structure?
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #4 on: January 15, 2009, 12:31:28 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.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
lorenma
Member

Posts: 2


« Reply #5 on: January 15, 2009, 12:42:57 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.

Best,

Loren MacGregor
Logged
Pages: 1
Print
Jump to: