Page 1 of 1

Pre-populate the URL field on xinclude dialog

Posted: Tue Mar 01, 2016 11:37 pm
by steve.cuzner
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?

Re: Pre-populate the URL field on xinclude dialog

Posted: Wed Mar 02, 2016 11:03 am
by alex_jitianu
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

Re: Pre-populate the URL field on xinclude dialog

Posted: Thu Mar 03, 2016 12:06 am
by steve.cuzner
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.

Re: Pre-populate the URL field on xinclude dialog

Posted: Fri Mar 04, 2016 3:25 pm
by alex_jitianu
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