Add @scale attribute by default in Author mode

Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Add @scale attribute by default in Author mode

Post by Frank Ralf » Wed Apr 27, 2016 4:18 pm

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
Frank Ralf
parson AG
www.parson-europe.com

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

Re: Add @scale attribute by default in Author mode

Post by alex_jitianu » Wed Apr 27, 2016 4:54 pm

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

Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Add @scale attribute by default in Author mode

Post by Frank Ralf » Wed Jun 15, 2016 5:57 pm

Hi Alex,

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

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

lief.erickson
Posts: 17
Joined: Sun Mar 01, 2015 8:26 am

Re: Add @status attribute by default in Author mode

Post by lief.erickson » Mon Jun 27, 2016 5:23 pm

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.

Post Reply