Pre-populate the URL field on xinclude dialog

steve.cuzner
Posts: 72
Joined: Thu Mar 26, 2015 4:57 pm

Pre-populate the URL field on xinclude dialog

Post 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?
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Pre-populate the URL field on xinclude dialog

Post 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
steve.cuzner
Posts: 72
Joined: Thu Mar 26, 2015 4:57 pm

Re: Pre-populate the URL field on xinclude dialog

Post 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.
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Pre-populate the URL field on xinclude dialog

Post 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
Post Reply