Changing default values for table creation

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Changing default values for table creation

Post by gwhite » Thu Nov 14, 2013 11:51 pm

I want to change the default values used for creating a table in a DITA topic so my most commonly needed table (for field definitions) is the default and I don't have to enter the values by hand every time. Specifically, I want these attributes preset:

# Columns = 2
# Rows = 3
Column widths = Fixed
Frame = <unspecified>
Column 1 colwidth=150px
Column 2 colwidth=400px

Is there a way to preset those values?

Gary

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Thu Nov 14, 2013 11:55 pm

BTW, I'm familiar with the concepts of customization of my DITA framework. I've made other changes to table setup, namely forcing cell borders by default and changing the background color of header cells.

Thanks.

alex_jitianu
Posts: 742
Joined: Wed Nov 16, 2005 11:11 am

Re: Changing default values for table creation

Post by alex_jitianu » Fri Nov 15, 2013 11:44 am

Hi,

You can't change the default values in the table wizard but what you can do is change the insert table action to always insert a table fragment with the specification you want.

You should go to Preferences-> Document Type Associations and edit the DITA framework. On the Author/Actions tab identify and edit the insert.table action. On the invoke the operation text field click choose and select InsertFragmentOperation. Next go to the with the arguments section, double click on fragment and give the table fragment you want to be inserted.

If you still want to keep the table wizard then instead of changing the insert.table action you could create a new one named default.table (by following the previous steps) and add it in the toolbar. This way you will have both the default table and the table wizard.

Best regards,
Alex

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Fri Nov 15, 2013 7:57 pm

I think creating a new insert table action is what I want to do. However, how do I insert a table fragment like the following while adding a unique automatically created table ID?

Code: Select all

<table id="table_jyr_tbc_2m">
<title/>
<tgroup cols="2">
<colspec colname="c1" colnum="1" colwidth="150px"/>
<colspec colname="c2" colnum="2" colwidth="400px"/>
<thead>
<row>
<entry>Field Name</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
</tbody>
</tgroup>
</table>

alex_jitianu
Posts: 742
Joined: Wed Nov 16, 2005 11:11 am

Re: Changing default values for table creation

Post by alex_jitianu » Mon Nov 18, 2013 11:36 am

Hi,

When inserting a table element Oxygen automatically generates an ID for it. So just remove the id attribute from the inserted fragment. This behavior is controlled by the ID Options... from the DITA menu. But if you want to be sure an ID is inserted no matter those options, you should explicitly request the ID generation by using the ${id} editor variable:

Code: Select all


<table id="${id}">
....
</table>
Best regards,
Alex

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Wed Jul 02, 2014 7:45 pm

After a long interlude, I've finally implemented this customization in my own copy of Author and it works great. Now how do I disseminate it, as well as other changes made in Options > Preferences > Document Type Associations, to other users?

Gary

Radu
Posts: 6808
Joined: Fri Jul 09, 2004 5:18 pm

Re: Changing default values for table creation

Post by Radu » Thu Jul 03, 2014 8:43 am

Hi Gary,

I'm happy it works for you.
Now for the sharing of the customization:

I do not have many details about what you did until know. In the Oxygen "Document Type Association" page did you edit the DITA document type and make changes to it? Did you also add a Java library containing Java extensions for the framework? Or were all your changes limited to editing the DITA document type and making changes in the Document type edit dialog?
When you make changes to a document type configuration like DITA in your case, those changes are saved in a configuration options file. For DITA the configuration file is stored in:

OXYGEN_INSTALL_DIR\frameworks\dita\dita.framework

The idea is that the folder OXYGEN_INSTALL_DIR\frameworks\dita\ should contain all resources necessary for DITA editing + the configuration file which references to them. So you can for example share that "dita" folder with others.
In the Oxygen Preferences->"Document Type Association / Locations" page each user can specify a list of additional frameworks directories from which Oxygen should load frameworks. The frameworks specified here have greater importance than the ones from the Oxygen installation.

You could also try to bundle and distribute the customized "dita" folder as an add-on:

http://www.oxygenxml.com/addons.html

In Oxygen 16.0 we added in the Preferences->"Document Type Association" page support to "extend" a framework. Basically with this support you could create your own framework folder called "dita_custom" for example in which your framework extension would reside. All resources would be used from the base "dita" folder and when a new Oxygen release appears with improvements to the DITA support, your extension would automatically benefit of those changes.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Thu Jul 03, 2014 6:15 pm

Thanks very much for the thorough explanation, Radu. I really appreciate it.

Gary

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Sat Nov 22, 2014 2:13 am

Hi,

Recently I've implemented your solution above for specifying a custom table fragment and adding it to the Author toolbar by utilizing the new Extension tab on the Oxygen Author 16.0 Document Type Associations dialog (under Options > Preferences). I've created a new document type called DITA - Extension [extension of: DITA]. However, now I want to distribute that extension to other authors on my team. How do I do that?

Gary

alex_jitianu
Posts: 742
Joined: Wed Nov 16, 2005 11:11 am

Re: Changing default values for table creation

Post by alex_jitianu » Mon Nov 24, 2014 10:41 am

Hello Gary,

First of all, you should make sure that you've saved the extension as external, for example in:
OXYGEN_INSTALL_DIR\frameworks\ext_dita\ext_dita.framework

This new ext_dita folder should contain all additional resources that your framework requires. All of your authors already have the built-in DITA framework so you need to pack and distribute only this new ext_dita folder. You can distribute it just like my colleague Radu mentioned above:
- zip it and deliver it to the authors. They can unzip it in OXYGEN_INSTALL_DIR\frameworks\. They can also define an additional frameworks directory in Oxygen Preferences->"Document Type Association / Locations" and unzip the framework in that location.
- pack it as an add-on, publish it on an HTTP server and give the users the URL to install it.

Best regards,
Alex

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Fri Dec 19, 2014 9:00 pm

This solution worked brilliantly, BTW. Oxygen, and you support guys, are truly amazing!

Gary

gwhite
Posts: 70
Joined: Fri Jul 27, 2012 1:46 am

Re: Changing default values for table creation

Post by gwhite » Thu Jun 25, 2015 10:46 pm

alex_jitianu wrote:Hello Gary,

First of all, you should make sure that you've saved the extension as external, for example in:
OXYGEN_INSTALL_DIR\frameworks\ext_dita\ext_dita.framework

This new ext_dita folder should contain all additional resources that your framework requires. All of your authors already have the built-in DITA framework so you need to pack and distribute only this new ext_dita folder. You can distribute it just like my colleague Radu mentioned above:
- zip it and deliver it to the authors. They can unzip it in OXYGEN_INSTALL_DIR\frameworks\. They can also define an additional frameworks directory in Oxygen Preferences->"Document Type Association / Locations" and unzip the framework in that location.
- pack it as an add-on, publish it on an HTTP server and give the users the URL to install it.

Best regards,
Alex
Hi,

This DITA framework extension I implemented in Author 16.1 does not continue to work in version 17.0. I dropped the framework extension folder into the frameworks folder of the 17.0 installation folder, but the insert table fragment action it is supposed to add to my DITA toolbar is not available.

The only difference between my ver. 16.1 installation and ver. 17.0 involves a change due to the following problem I reported recently. For that I changed the Priority of the DITA Document Type Association from Low to High. I also just now changed the Priority of the DITA extension to High thinking that might fix the problem but it did not.

http://www.oxygenxml.com/forum/topic11591.html

Any help would be appreciated.

Gary

alex_jitianu
Posts: 742
Joined: Wed Nov 16, 2005 11:11 am

Re: Changing default values for table creation

Post by alex_jitianu » Fri Jun 26, 2015 10:47 am

Hello Gary,

From what I remember you created an extension and defined an author action in it. I did the same and the extension was loaded correctly in version 17.0. Can you send us the extension on support@oxygenxml.com so that we can take a look at it? I can assure you we will only use it to search for the problem and we will remove it afterwards.

Best regards,
Alex

Post Reply