Hi Shanmugham...

I can try to point you in the right direction .. but this isn't a simple 
task.

There are no DITA-specific FDK functions .. to FrameMaker, DITA files 
are just like any other structured document. It sounds like you're 
trying to replace the selected content (elements) with a conref of the 
same content, and generate that conref source file on the fly. Is that 
correct?

Note that you can't just create a new DITA file and stuff the selected 
content into it like you can with an unstructured document .. you'll 
have to create the proper structure to contain the selected elements. If 
you've selected a <li> element, you'll need to provide the <ul> and 
<body> to contain the <li>. You'll also need to assign an ID to the <li> 
as well as the newly created topic so you can use that to reference the 
conref.

There is no "new DITA file" FDK function. You have two options .. you 
can either create a new FrameMaker file, using F_ApiOpen (using the 
proper parameters to create a new document from a template), then build 
the necessary structure and add the selected content, then save that to 
XML .. or .. you can just write the raw DITA XML to disk using the 
necessary structure (I'd opt for the second method).

There is no "create conref" FDK function. To create the conref you'll 
need to delete the selected content, then create an API-defined text 
inset (an FO_TiApiClient). In this inset you'll paste the content from 
the conref source (which you've created and opened), then you'll need to 
lock the inset. You have to set some properties on the inset so that the 
DITA support in FrameMaker will recognize it. To do this, you need to 
create a conref in Frame (using the default method) and analyze it with 
the FDK (use F_ApiGetString to query the FP_TiClientData, 
FP_TiClientName, FP_TiClientSource, and FP_TiClientType properties, then 
use that information when creating your conref .. this data will vary 
depending on if you're trying to create conrefs for FM8, FM9 or 
DITA-FMx). Note that on disk (in the DITA XML file), the conrefs are all 
the same, standard DITA conrefs, but in Frame where you're building 
them, they are very different.

If you need help on using specific functions, you should probably post 
to the "frame_dev" Yahoo group where most of the FDK developers hang out.

Good luck!

...scott

Scott Prentice
Leximation, Inc.
www.leximation.com
+1.415.485.1892



Shanmugham Subbaiyan wrote:
> Hello,
>
>  
>
> I'm working on DITA file structure in FrameMaker. I wanted to create a 'New
> DITA File' out of the text that I'm selecting from a document that is opened
> in FM. And have to give the 'Conref' to this new file from the main
> document. Here are the steps that I would like to achieve with FDK
> programming.
>
>  
>
> 1.       Open a DITA document
>
> 2.       Select a section of text
>
> 3.       Make a new DITA file with the selected text
>
> 4.       Give the 'Conref' in the main file to the newly created file
>
>  
>
> It would be really helpful if anyone can advice me with the FDK APIs. Which
> API I should use for the followings.. (Or is there any other way to do this)
>
> 1.       To show "New DITA Topic" dialog
>
> 2.       To create (export) a new file with the selected text
>
> 3.       To insert a 'Conref' for this new file in the main file
>
>  
>
> Note: I'm referring "FDK Programmer's reference" and "FDK Programmer's
> guide". So far I could not find anything much useful for me.
>
> Pls help me out on this.
>
>  
>
> Thanks.
>
>  
>
> Rgs,
>
> Shanmugham
>
>  

Reply via email to