Pre-populate the URL field on xinclude dialog

steve.cuzner
Posts: 64

Pre-populate the URL field on xinclude dialog

Tue Mar 01, 2016 11:37 pm

I'd like to create a new button that launches the standard insert.xinclude action but sets the URL field to a specific file. There doesn't seem to be any available arguments available to the ro.sync.ecss.extensions.commons.operations.InsertXIncludeOperation operation. Is there any way to make this customization?
alex_jitianu
Posts: 600

Re: Pre-populate the URL field on xinclude dialog

Wed Mar 02, 2016 11:03 am

Hi,

Unfortunately there is no way of imposing a starting selected URL. I'll add an issue for this support on the next version. But just to make sure I've understood, you would like the same URL to be selected every time the dialog is being presented? Right now the dialog remembers the last selected URL. Wouldn't loosing the last URL and always imposing the same one bother the user? Should the user be able to select another URL or should we disable the URL selection?

Best regards,
Alex
steve.cuzner
Posts: 64

Re: Pre-populate the URL field on xinclude dialog

Thu Mar 03, 2016 12:06 am

Not exactly. I would want the standard insert.xinclude action to behave as it does, but I would like to add a new toolbar button that calls insert.xinclude with an argument that is the file to populate the URL field with. The reason is that we are using xinclude as a text entity replacement mechanism since schema doesn't allow entities and we can't use internal subsets to declare entities. So we end up with a file like:

Code: Select all

<section>
   <para><phrase xml:id="ph1">Phrase One</phrase></para>
   <para><phrase xml:id="ph2">Phrase Two</phrase></para>
</section>


If the writer wants to insert a phrase, they would click on the insert phrase button which would load the dialog with this file and they can quickly add the "entity"/xinclude with xpointer.
alex_jitianu
Posts: 600

Re: Pre-populate the URL field on xinclude dialog

Fri Mar 04, 2016 3:25 pm

Hi,

Right now, you could create a custom author operation that parses this file and presents the available entities. We have a topic that describes how to create a custom operation that presents a dialog. It requires Java development skills but if you have a Java developer in your team, then he can create this customization for you right now quite fast.

Best regards,
Alex

Return to “DocBook”

Who is online

Users browsing this forum: No registered users and 0 guests