Page 1 of 1
Issue with Actions Using an Individual XML File
Posted: Fri Sep 23, 2022 6:48 pm
by Isabelle
Hello,
With the version 24.1.0.0 of oxygen, we face an issue with actions using an individual XML file for each action.
We have define common framework extension script files and we have custom framework file for specific customers.
Exemple :
- proced.exf (common for all client)
- proced-custom.exf (can be added for specific client)
If a
{framework_file_name}-custom.exf file is added in our framework directory, then oxygen generate the
{framework_file_name}-custom_externalAuthorActions directory which contains
{framework_file_name}_externalAuthorActions directory which contains all actions files.
Exemple :
{framework_directory}/proced-custom_externalAuthorActions/proced_externalAuthorActions/add.template.xml
The issue is in the actions files placed in this directory.
Before, in version 24.0.0.2, when we had this kind of path, it worked fine :
Code: Select all
<a:argument name="fragment">${framework}/S1000D/resources/ftlTemplate/template.ftl</a:argument>
But now, with version 24.1.0.0, we have this :
Code: Select all
<a:argument name="fragment">${framework(S1000D - DM Procedure)}/S1000D/resources/ftlTemplate/template.ftl</a:argument>
For information
S1000D - DM Procedure seems to be the value of
base attribute in the
proced-custom.exf file :
Code: Select all
<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="S1000D - DM Procedure">
This unwanted modification causes issue in our application, because we are not able anymore to build the path correctly.
Are you aware of that behavior ?
How can we fix that ?
Thanks,
Regards,
Isabelle
Re: Issue with Actions Using an Individual XML File
Posted: Mon Sep 26, 2022 5:41 pm
by alex_jitianu
Hi Isabelle,
Yes, we are aware of this change. In version 24, the $framework variables from the base framework actions were left untouched when copied, but that was a problem when the base framework and the extension framework were not in the same directory. That's why we decided to rewrite ${framework} from the base with ${framework(BASE_FRAMEWORK_NAME)} which Oxygen will be able to expand no matter the location of the extension.
As an improvement, we could check and see if the base and the extension are in different directories and only perform the rewriting if the answer is yes.
How exactly does this rewriting affects you? Oxygen loads those external actions it will expand without any problem variables like ${framework(BASE_FRAMEWORK_NAME)} to their correct location
Best regards,
Alex
Re: Issue with Actions Using an Individual XML File
Posted: Mon Sep 26, 2022 7:14 pm
by Isabelle
Hello Alex,
Here is an exemple of an action we use :
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="drop.link.template">
<a:name>Drop Link Template</a:name>
<a:description>Drop Link Template</a:description>
<a:operations>
<a:operation id="com.framework.operations.InsertTemplateObject">
<a:arguments>
<a:argument name="fragment">${framework}/resources/ftlTemplate/templates/template.ftl</a:argument>
</a:arguments>
</a:operation>
</a:operations>
<a:enabledInReadOnlyContext>false</a:enabledInReadOnlyContext>
</a:authorAction>
As you can see, we use
${framework} to retrieve some resources for our action.
But now, with your changes,
${framework(BASE_FRAMEWORK_NAME)} is not expand anymore and we can not find our resource file.
Regards,
Isabelle
Re: Issue with Actions Using an Individual XML File
Posted: Tue Sep 27, 2022 4:53 pm
by alex_jitianu
Hi,
Inside the base framework (
S1000D - DM Procedure) you have:
Code: Select all
proced/resources/ftlTemplate/templates/template.ftl
proced/proced_externalAuthorActions/action.xml
proced/proced.exf
In the extension directory you have:
When
proced-custom.exf is compiled and
action.xml is copied inside
proced-custom/proced-custom_externalAuthorActions, it is a good thing that
${framework} is replaced with
${framework(S1000D - DM Procedure)}, because the template file is located inside its directory which is
proced in the above example.
So if you open a document that matches the extension you should be able to successfully invoke the action loaded from
action.xml.
I imagine that you didn't have any issues in version 24 because both
proced.exf and
proced-custom.exf were located in the the same directory, together with the
resources subfolder.
Perhaps I don't understand your setup and what doesn't work. Can you prepare some samples for me with instructions on how to reproduce the issue?
Best regards,
Alex
Re: Issue with Actions Using an Individual XML File
Posted: Tue Sep 27, 2022 4:57 pm
by alex_jitianu
Hi,
One more thing I've noticed with delay. You have a custom operation, com.framework.operations.InsertTemplateObject. Before we invoke an operation, the editor variables from its parameters are expanded, so it should receive an absolute URL, not ${framework(BASE_FRAMEWORK_NAME)}. Is this the issue? com.framework.operations.InsertTemplateObject receives the value for fragment with ${framework(BASE_FRAMEWORK_NAME)} still present in it?
Best regards,
Alex
Re: Issue with Actions Using an Individual XML File
Posted: Tue Sep 27, 2022 5:02 pm
by Isabelle
Hello,
This is exactly the problem.
The value of fragment still have ${framework(BASE_FRAMEWORK_NAME)} in it.
Regards,
Isabelle
Re: Issue with Actions Using an Individual XML File
Posted: Tue Sep 27, 2022 5:28 pm
by alex_jitianu
Hi,
I will try to reproduce this on some samples. Meanwhile, you should be able to expand it like this from within the operation:
Code: Select all
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args) throws AuthorOperationException {
String fragment = (String) args.getArgumentValue(ARGUMENT_FRAGMENT);
fragment = authorAccess.getUtilAccess().expandEditorVariables(fragment, null);
Let me know if it expands the path. If it doesn't, it might be a hint about the cause of the issue.
Best regards,
Alex
Re: Issue with Actions Using an Individual XML File
Posted: Tue Sep 27, 2022 7:33 pm
by Isabelle
Alex,
I have made the test and using authorAccess.getUtilAccess().expandEditorVariables expands the path.
Regards,
Isabelle
Re: Issue with Actions Using an Individual XML File
Posted: Wed Oct 05, 2022 12:12 pm
by alex_jitianu
Hello,
I've created some samples
in which ${framework(BASE_FRAMEWORK_NAME)} are resolved correctly. Here is how to test:
- unzip and open the xpr file inside Oxygen's
Project view
- open
sample.xml and switch it to Author mode
- invoke from the toolbar the action
Variables test
- some absolute paths are inserted, a sign that the variables were expanded
The action is defined in the base framework, inside
frameworks\proced\proced_externalAuthorActions\variables-test.xml
Perhaps you can notice something different between my setup and yours.
Best regards,
Alex