Page 1 of 1

Add @scale attribute by default in Author mode

Posted: Wed Apr 27, 2016 4:18 pm
by Frank Ralf
Hi,

I want to add a @scale attribute by default to <table> (and <codeblock>) elements when creating them in Author mode. Can I modify the insert table dialog somehow like any other Author Action? Or do I have to program a custom Author Action or write my own Insert Table Action?

Kind regards,
Frank

Re: Add @scale attribute by default in Author mode

Posted: Wed Apr 27, 2016 4:54 pm
by alex_jitianu
Hi Frank,

Here is what I suggest:

1. create a new author action add.scale.on.table with this configuration:
Xpath expression: ancestor-or-self::table
operation: ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation
arguments:
elementLocation: ancestor-or-self::table
name: scale
value: whatever you want to set

2. create a new author action insert.table.with.scale that uses the ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation operation to invoke these too actions: insert.table (the default action that inserts a table) and add.scale.on.table (the new action that you have configured above)
3. replace in the toolbar, menu, etc., the old action that inserts a table with the newly create one: insert.table.with.scale

You'll have to do the same for <codeblock> (you might have to create an insert.codeblock action too because I don't think we have one to start with, its entry comes directly from the content completion support).

Best regards,
Alex

Re: Add @scale attribute by default in Author mode

Posted: Wed Jun 15, 2016 5:57 pm
by Frank Ralf
Hi Alex,

Sorry for the late reply. Many thanks for your suggestions. I will try them and report back.

Best regards,
Frank

Re: Add @status attribute by default in Author mode

Posted: Mon Jun 27, 2016 5:23 pm
by lief.erickson
alex_jitianu wrote:operation: ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation
I wanted to add @status="changed" to any topic that has a descendant with @status="new" or @status="deleted" or @status="changed, and this was exactly the operation I needed. I can confirm that it is working for me.