Page 1 of 1

Converting *.framework to *.exf

Posted: Wed Aug 25, 2021 8:05 pm
by Johann
Hello,

I try to convert my *.framework files to *.exf files.

I do not find the corresponding tags in *.exf for these fields in *.framework :

Code: Select all

          <field name="useImposedInitialPage">
            <Boolean>true</Boolean>
          </field>
          <field name="imposedInitialPage">
            <String>Author</String>
          </field>
Thanks,

Johann

Re: Converting *.framework to *.exf

Posted: Thu Aug 26, 2021 7:58 am
by Radu
Hi Johann,

We kind of forgot about this setting but for Oxygen 24 (October this year) we added the support for it in the exf.
We will update this forum thread after the Oxygen 24 release.

Regards,
Radu

Re: Converting *.framework to *.exf

Posted: Thu Aug 26, 2021 6:12 pm
by Johann
Hi Radu,

Thanks for your response.

I have another question about framework extension.

Let's imagine that I have a folder with:
- base.framework file
- extension.exf file
- extension_externalAuthorActions

base.framework contains this action:

Code: Select all

<action>
	<field name="id">
		<String>test.action</String>
	</field>
	<field name="name">
		<String>action test</String>
	</field>
	<field name="description">
		<String/>
	</field>
	<field name="largeIconPath">
		<String/>
	</field>
	<field name="smallIconPath">
		<String/>
	</field>
	<field name="accessKey">
		<String/>
	</field>
	<field name="accelerator">
		<null/>
	</field>
	<field name="actionModes">
		<actionMode-array>
			<actionMode>
				<field name="xpathCondition">
					<String/>
				</field>
				<field name="argValues">
					<serializableOrderedMap>
						<entry>
							<String>fragment</String>
							<String>&lt;subScript>BASE &lt;/subScript></String>
						</entry>
					</serializableOrderedMap>
				</field>
				<field name="operationID">
					<String>ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation</String>
				</field>
			</actionMode>
		</actionMode-array>
	</field>
	<field name="enabledInReadOnlyContext">
		<Boolean>false</Boolean>
	</field>
</action>

extension.exf file is an extension of the base.framework so it has:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<script xmlns="http://www.oxygenxml.com/ns/framework/extend"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.oxygenxml.com/ns/framework/extend http://www.oxygenxml.com/ns/framework/extend/frameworkExtensionScript.xsd"
  base="BASE">

  <priority>Highest</priority>
  
</script>

At last, inside extension_externalAuthorActions, there is a test.action.xml file containing:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<a:authorAction xmlns:a="http://www.oxygenxml.com/ns/author/external-action"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.oxygenxml.com/ns/author/external-action http://www.oxygenxml.com/ns/author/external-action/authorAction.xsd"
  id="test.action">
  <a:name>action test</a:name>
  <a:operations>
    <a:operation id="InsertFragmentOperation">
      <a:arguments>
        <a:argument name="fragment"><superScript>EXTENSION</superScript></a:argument>
      </a:arguments>
    </a:operation>
  </a:operations>
  <a:enabledInReadOnlyContext>false</a:enabledInReadOnlyContext>
</a:authorAction>

Can I expect the final "test action" to be the one of my extension? Is there an action overload mechanism?
In general, according to the documentation, it is possible to delete or add items, but can these be overloaded?

Regards,

Johann

Re: Converting *.framework to *.exf

Posted: Fri Aug 27, 2021 7:33 am
by Radu
Hi Johann,

It would make sense to override actions like this, from what I tested (you can test too if you want) this does not seem to work right now, if you go to the Oxygen Preferences->"Document Type Associations" page and edit your custom framework, choose "Edit anyway" in the dialog which shows up you will see that in the Actions tab both actions (the base action and the action from the efx) were gathered, and they both have the same ID. But when I open a file and invoke the action on it, still the action from the base is preferred. So I added an internal issue to look more into trying to make this usecase work.

Regards,
Radu

Re: Converting *.framework to *.exf

Posted: Fri Aug 27, 2021 10:02 am
by Johann
Hi Radu,


Thank you for the quick response! I will wait for this new feature.


Regards,

Johann

Re: Converting *.framework to *.exf

Posted: Thu Sep 30, 2021 7:55 pm
by Johann
Hello Radu,

Several tests suggest to me that <xi:include> does not properly work in exf files.

In the exf file, if I put :

Code: Select all

    <contextualMenu>
      <submenu name="table" iconPath="/images/Table16.png">
        <addAction id="show.table.properties"/>
      </submenu>
    </contextualMenu>
It works, I can see the menu when I right click.

But if I put :

Code: Select all

    <contextualMenu>
      <xi:include href="contextualMenu.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
    </contextualMenu>
with contextualMenu.xml in the same folder as the exf file :

Code: Select all

  <submenu name="table" iconPath="/images/Table16.png">
    <addAction id="show.table.properties"/>
  </submenu>
It does not work.

Do I miss something ?

Thanks,


Johann

Re: Converting *.framework to *.exf

Posted: Mon Oct 04, 2021 4:12 pm
by alex_jitianu
Hello Johann,

I think its because you are missing the namespace. The fragment from contextualMenu.xml should be:

Code: Select all

  <submenu name="table" iconPath="/images/Table16.png" 
    xmlns="http://www.oxygenxml.com/ns/framework/extend">
    <addAction id="show.table.properties"/>
  </submenu>
For me it worked like that.

Best regards,
Alex

Re: Converting *.framework to *.exf

Posted: Wed Oct 20, 2021 10:07 am
by alex_jitianu
Hi Johann,

In the newly release Oxygen 24.0 you are able to specify the initial page in an *.exf script. I hope it helps!

Code: Select all

<initialPage>Author</initialPage>
Best regards,
Alex

Re: Converting *.framework to *.exf

Posted: Wed Oct 20, 2021 12:44 pm
by Johann
Thank you for the notification !

Regards,

Johann