Converting *.framework to *.exf

Post here questions and problems related to oXygen frameworks/document types.
Johann
Posts: 126
Joined: Wed Jun 17, 2015 12:46 pm

Converting *.framework to *.exf

Post by Johann » Wed Aug 25, 2021 8:05 pm

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

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

Re: Converting *.framework to *.exf

Post by Radu » Thu Aug 26, 2021 7:58 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Johann
Posts: 126
Joined: Wed Jun 17, 2015 12:46 pm

Re: Converting *.framework to *.exf

Post by Johann » Thu Aug 26, 2021 6:12 pm

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

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

Re: Converting *.framework to *.exf

Post by Radu » Fri Aug 27, 2021 7:33 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Johann
Posts: 126
Joined: Wed Jun 17, 2015 12:46 pm

Re: Converting *.framework to *.exf

Post by Johann » Fri Aug 27, 2021 10:02 am

Hi Radu,


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


Regards,

Johann

Johann
Posts: 126
Joined: Wed Jun 17, 2015 12:46 pm

Re: Converting *.framework to *.exf

Post by Johann » Thu Sep 30, 2021 7:55 pm

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

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

Re: Converting *.framework to *.exf

Post by alex_jitianu » Mon Oct 04, 2021 4:12 pm

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

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

Re: Converting *.framework to *.exf

Post by alex_jitianu » Wed Oct 20, 2021 10:07 am

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

Johann
Posts: 126
Joined: Wed Jun 17, 2015 12:46 pm

Re: Converting *.framework to *.exf

Post by Johann » Wed Oct 20, 2021 12:44 pm

Thank you for the notification !

Regards,

Johann

Post Reply