[oXygen-user] Inserting child elements automatically

Cody Steele csteele at minitab.com
Thu Feb 16 10:30:28 CST 2023


Thank you, Alex and Radu. I was able to get a version of both of these solutions working in short-order and will demo to my team.

With respect to the solution based on the actions, I wasn't able to get the processing instruction to go in as a fragment. I was able to get non-placeholder text to enter just fine. Perhaps it's a css issue because the link target is shown as placeholder text by default?

It was really helpful to see both of these. I can envision several other cases where I can use both approaches to perform other tasks that I've been working on.
________________________________
From: oXygen-user <oxygen-user-bounces at oxygenxml.com> on behalf of Alex Jitianu <alex_jitianu at sync.ro>
Sent: Thursday, February 16, 2023 2:54 AM
To: oxygen-user at oxygenxml.com <oxygen-user at oxygenxml.com>
Subject: Re: [oXygen-user] Inserting child elements automatically


Hi,


Another option would be to cascade [1] the existing action with a a new one that inserts a comment or a placeholder that is removed once the user types text [2]:


<?oxy-placeholder content="Enter a title"?>


To summarize it you will have to:

- create one action that inserts this comment

- create one action based on ExecuteMultipleActionsOperation [2] that cascades the xref and the previous action

- you replace the xref action from the toolbar with this new action based on ExecuteMultipleActionsOperation


[1] https://www.oxygenxml.com/doc/versions/25.0/ug-editor/topics/dg-default-author-operations.html#dg-default-author-operations__executemultipleactionsoperation<https://www.oxygenxml.com/doc/versions/25.0/ug-editor/topics/dg-default-author-operations.html#dg-default-author-operations__executemultipleactionsoperation>

[2] https://www.oxygenxml.com/doc/versions/25.0/ug-editor/topics/dg-placeholder-css-extension.html<https://www.oxygenxml.com/doc/versions/25.0/ug-editor/topics/dg-placeholder-css-extension.html>

Best regards,
Alex
--
Alex Jitianu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com<http://www.oxygenxml.com>

On 2/16/2023 8:00 AM, Oxygen XML Editor Support (Radu Coravu) wrote:

Hello Cody,


Indeed the "InsertXrefOperation" Java operation does not have a parameter to specify some fixed text to insert inside the link, I added an internal issue based on your feedback. I do not have an easy workaround for you, it's possible that what you want would be possible with a Java based extension which would somehow listen for inserted links and add that text inside the inserted link.


But coming back to your use case which seems to be to always add custom text inside a link to a web page, I would rather suggest using a custom Schematron schema to signal as a validation error to the end user that the link is empty:


https://blog.oxygenxml.com/topics/sharing_schematron_validation_rules.html<https://blog.oxygenxml.com/topics/sharing_schematron_validation_rules.html>


So a Schematron schema like this would report a user friendly warning if there is an empty link:

<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"<http://purl.oclc.org/dsdl/schematron> queryBinding="xslt2"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process"<http://www.schematron-quickfix.com/validator/process>>
    <sch:pattern>
        <sch:rule context="xref[@format='html'][@scope='external']">
            <sch:assert test="node()">An external link should have custom link text set inside.</sch:assert>
        </sch:rule>
    </sch:pattern>
</sch:schema>


Regards,

Radu

Radu Coravu
Oxygen XML Editor

On 2/15/23 18:17, Cody Steele wrote:
I was following along with Frank's questions.

My interest was in editing the author action insert.url.reference for a web link by adding something like <!--Insert link text here--> inside of the XREF element. It doesn't look like any of the arguments for ro.sync.ecss.extensions.dita.link.InsertXrefOperation lets you insert a fragment. Is it correct that I should proceed to the involving the DITA extension framework or is there another method that makes more sense to you?

Thanks,

Cody
________________________________
From: oXygen-user <oxygen-user-bounces at oxygenxml.com><mailto:oxygen-user-bounces at oxygenxml.com> on behalf of Oxygen XML Editor Support (Radu Coravu) <support at oxygenxml.com><mailto:support at oxygenxml.com>
Sent: Wednesday, January 25, 2023 1:06 AM
To: oxygen-user at oxygenxml.com<mailto:oxygen-user at oxygenxml.com> <oxygen-user at oxygenxml.com><mailto:oxygen-user at oxygenxml.com>
Subject: Re: [oXygen-user] Inserting child elements automatically


*Warning* This email originates from outside of Minitab. Do not open attachments or click links unless you are sure this email comes from a known sender and you know the content is safe.

Hi Frank,


Let's split your use cases in two:

1) Inserting elements using Oxygen's actions (toolbars, menus)

2) Inserting elements using the content completion window.


1)


Let's take table insertion for example:


If you edit your DITA framework extension that is defined in the Preferences->"Document Type Association" page, it has an "Author=>Actions" tab.

If you edit the action "insert.table", it calls an operation named "ro.sync.ecss.extensions.dita.topic.table.InsertTableOperation" with certain parameters. One of the parameters is named "cellFragment", you can set its value to "<p/>".

There are other ways to change a table, for example insert a new column, insert a new row. So actions like "insert.table.row.below" or "insert.table.column.after" which also need to be changed accordingly.


2) Inserting elements like <info> using the content completion window.

Your DITA extension framework customization can contain a "cc_config.xml" file which defines that for certain elements, if they are inserted, another element should be inserted inside them as well:

https://www.oxygenxml.com/doc/ug-editor/topics/configure-elements-attr-cc-individually.html#configure-elements-attr-cc-individually__examples_configuring_elements<https://www.oxygenxml.com/doc/ug-editor/topics/configure-elements-attr-cc-individually.html#configure-elements-attr-cc-individually__examples_configuring_elements>


Hope this helps.


Regards,

Radu


Radu Coravu
Oxygen XML Editor

On 1/24/23 11:49, Frank Dissinger wrote:

Hi list,


Whenever this is valid, I wrap text in a <p> element. I would like oXygen to automatically insert <p> as a child element when inserting <table>, <simpletable> (for the table cells of course), <info>, <stepresult>, <stepxmp>... and many more. How do I do this?


Regards,

Frank

--

Frank Dissinger

Documentation Manager

....................................................................

CGS Publishing Technologies International GmbH

Email frank.dissinger at cgs-oris.com<mailto:frank.dissinger at cgs-oris.com> | Web www.cgs-oris.com<http://www.cgs-oris.com/>

Address Kettelerstr. 24 | D-63512 Hainburg | Germany

Phone +49 6182 9626-27 | Fax +49 6182 9626-99

Commercial register Offenbach, HRB no. 21495

Managing directors Bernd Rückert, Christoph Thommessen


[https://www.cgs-oris.com/Signatur.png]<https://www.cgs-oris.com/signatur>



_______________________________________________
oXygen-user mailing list
oXygen-user at oxygenxml.com<mailto:oXygen-user at oxygenxml.com>
https://www.oxygenxml.com/mailman/listinfo/oxygen-user<https://www.oxygenxml.com/mailman/listinfo/oxygen-user>




Minitab, LLC, Quality Plaza, 1829 Pine Hall Rd, State College PA 16801-3210, USA
Minitab Limited, England and Wales, Company No. 3061730, Unit E1-2 Brandon Court, Progress Way, Coventry, CV3 2TE, United Kingdom
Minitab Sarl, 17-21 rue Saint-Fiacre, 75002 Paris, 419 061 361 R.C.S Paris, France
Minitab Pty Ltd, Level 10, 20 Martin Place, Sydney NSW 2000, Australia
Minitab GmbH, Theatinerstraße 11, 80333 München, Germany, Geschäftsführer: Bruce Pincus, Handelsregister: Amtsgericht München; HRB 225635
Minitab HK Limited, Room 3703, 37th Floor, Lee Garden One, 33 Hysan Avenue, Causeway Bay, Hong Kong

Confidentiality Notice: This email and any attachment(s) may contain confidential and proprietary information, some or all of which may be legally privileged. It is for the intended use of the individual(s) or entity named on the email. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient(s), you must not use, disclose, distribute, copy, print or rely on this email. If you have received this email in error, please immediately return it to the sender and delete it and any attachments from your system. Thank you.

Privacy Notice: All incoming email communications are monitored. Please refer to our Privacy Policy<https://www.minitab.com/legal/privacy-policy/> for information on how Minitab collects, manages, and uses personal data.

Update your email preferences<https://it.minitab.com/my-account/manage-account.aspx> to choose the types of emails you receive or Unsubscribe<mailto:unsubscribe at minitab.com?subject=Unsubscribe%20from%20Minitab%20Marketing%20Communications&body=Please%20unsubscribe%20this%20email%20address%20from%20Minitab%20marketing%20communications.%20%0A%0AThank%20you.>.



_______________________________________________
oXygen-user mailing list
oXygen-user at oxygenxml.com<mailto:oXygen-user at oxygenxml.com>
https://www.oxygenxml.com/mailman/listinfo/oxygen-user<https://www.oxygenxml.com/mailman/listinfo/oxygen-user>




_______________________________________________
oXygen-user mailing list
oXygen-user at oxygenxml.com<mailto:oXygen-user at oxygenxml.com>
https://www.oxygenxml.com/mailman/listinfo/oxygen-user<https://www.oxygenxml.com/mailman/listinfo/oxygen-user>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20230216/2ad938e9/attachment.htm>


More information about the oXygen-user mailing list