Framework inheritance hierarchy?

Post here questions and problems related to oXygen frameworks/document types.
Krille
Posts: 26
Joined: Thu Nov 12, 2020 12:24 pm

Framework inheritance hierarchy?

Post by Krille »

Hi,

when developing author mode frameworks, what does extending a base framework mean?

Say, we have three frameworks A, B, C. The framework definitions declare, that A has no base framework, B's base framework is A, and C's base-framework is B.

Until today, I thought, that this would define a kind of framework inheritance hierarchy, where C inherits all actions, scenarios etc. of B AND A (because B inherits everything of A). Write: C>B>A

But today, I tried to declare that framework C, and I found, that this is not the case. My framework C does not know about the actions of B, but only A. Write: C>A

Is this a bug or an intended feature?

In my case:

A is "TEI P5" and uses a framework-file.
B is "oXbytei" (https://github.com/SCDH/oxbytei) and uses an exf-file.
C is "ALEA" (not online) and uses an exf-file.

Regards,
Christian
alex_jitianu
Posts: 910
Joined: Wed Nov 16, 2005 11:11 am

Re: Framework inheritance hierarchy?

Post by alex_jitianu »

Hi Christian,
It should work like you expected them to work, so it must be a bug. I am also having issues with the your scenario. I managed to make it work by using the {framework_file_name}_externalAuthorActions naming conventions. What if you renamed the oXbytei external actions folder from externalAuthorActions to oXbytei_externalAuthorActions , does it work?

I will record an issue to fix this behavior.

Best regards,
Alex
Krille
Posts: 26
Joined: Thu Nov 12, 2020 12:24 pm

Re: Framework inheritance hierarchy?

Post by Krille »

Hi Alex,

thanks for your answer! Good to know that C>B>A is intended!

When I rename externalAuthorActions to oXbytei_externalAuthorActions or to oxbytei_externalAuthorActions I get the actions of oXbytei in the menu, the toolbar, etc. But they are without icons. And the actions, that use XSLTOperations are all broken. So there still seems to be an issue of resolving paths.

Regards
Christian
alex_jitianu
Posts: 910
Joined: Wed Nov 16, 2005 11:11 am

Re: Framework inheritance hierarchy?

Post by alex_jitianu »

Hi Christian,
A current workaround would be to move all the images and XSLTS used by the oxbytei framework external actions into the oxbytei_externalAuthorActions folder. I willpost here again once we have released a fix.

Best regards,
Alex
Krille
Posts: 26
Joined: Thu Nov 12, 2020 12:24 pm

Re: Framework inheritance hierarchy?

Post by Krille »

Hi Alex,

after some experiments and some thinking I found two things:

1) Moving externalAuthorActions to oxbytei_externalAuthorActions as you suggested helps.

2) Replacing ${framework} with ${framework(oXbytei)} in the intermediate framework gets it done -- at least as far as I see it now.

After these two changes, framework inheritance works as expected. All entries in menus and toolbars and all scenarios are present. No copying of files needed.


Point 1) looks like a bug to me. It should be fixed, because having the folder externalAuthorActions not prefixed with a framework name is the precondition for sharing author actions within a bundle of frameworks.


Maybe, point 2) is not be a bug, but simply the way editor variables are expanded. If ${framework} always expands to the current framework and if this expansion does not depend on the source, where a strings originates from (whether the one or the other framework), it is not a bug. Then, it is rather something one has to understand when writing frameworks.

Well, I can't decide, if it's a bug. This is just my diagnosis to the issue and the way I solved it by thinking about what may happen in the internals. Interestingly it does not matter on the framework, which does not inherit from an other framework, aka, the base of base of base ... Even though TEIP5 uses ${framework} 46 times!


Here is a one-liner to fix things from the command line:

Code: Select all

find . -type f -exec sed -i "s/\${framework}/${framework(NAME)}/g" {} \;
Cheers,
Christian
alex_jitianu
Posts: 910
Joined: Wed Nov 16, 2005 11:11 am

Re: Framework inheritance hierarchy?

Post by alex_jitianu »

Hi Christian,

Thank you for the thorough analysis. Both 1) and 2) can and should be done by us automatically. I hope I'll be able to do it in time for the next release.

Best regards,
Alex
alex_jitianu
Posts: 910
Joined: Wed Nov 16, 2005 11:11 am

Re: Framework inheritance hierarchy?

Post by alex_jitianu »

Hello,
I just want to let you know that in the newly released Oxygen 24.1 we've fixed this issue. External author actions from the base framework's externalAuthorActions folder will be copied automatically to the new framework actions container. I hope it helps!
Best regards,
Alex
Post Reply