Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create no-embbed option for exporting issues #4799

Open
wants to merge 5 commits into
base: stable-3_3_0
Choose a base branch
from

Conversation

Godoy0722
Copy link
Contributor

Description: I added a --no-embbed option for the CLI and the system interface. It reduces the memory usage, as for faster responses and lighter XML files. It solves the issue #9769.

@jonasraoni jonasraoni linked an issue Apr 1, 2025 that may be closed by this pull request
Copy link
Contributor

@jonasraoni jonasraoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Godoy0722 I've left some comments.

One very important thing that's missing is the way back. I mean, it should be possible to import this new format.

Please, also take a look if there are no more <embed>s in the other applications (OPS and OMP).

{/fbvFormSection}

{fbvFormSection list="true" title="plugins.importexport.native.exportOptions"}
{fbvElement type="checkbox" id="no-embed" name="no-embed" label="plugins.importexport.native.noEmbedOption" checked=$noEmbed|default:false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that you've included the option on the UI, then it makes sense to include the other alternative, it should be a radio (embed | relative | URL).

@@ -135,7 +135,7 @@
<element name="original_file_name" type="string" minOccurs="1" maxOccurs="1" />
<element name="date_uploaded" type="date" minOccurs="1" maxOccurs="1" />
<element name="date_modified" type="date" minOccurs="1" maxOccurs="1" />
<element name="embed" type="pkp:embed" />
<element name="embed" type="pkp:embed" minOccurs="0" maxOccurs="1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Include the href element (min 0/max 1), with the attributes href and mime_type.
  • The schema should specify that there should be one <href> OR one <embed>

p.s.: There's another occurrence of this update.

$embedNode = $doc->createElementNS($deployment->getNamespace(), 'embed', base64_encode(file_get_contents($filePath)));
$embedNode->setAttribute('encoding', 'base64');
$issueFileNode->appendChild($embedNode);
if (empty($this->opts['no-embed'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wherever you added support for the no-embed, there should be also the URL (I didn't check, but I assume it's possible), just to keep the standard.

$request = Application::get()->getRequest();
$baseUrl = $request->getBaseUrl();
$context = $deployment->getContext();
$fileUrl = $baseUrl . '/' . $context->getPath() . '/public/' . $coverImage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This public path isn't standard, you need to use the class PublicFileManager.

@Godoy0722
Copy link
Contributor Author

@jonasraoni I just made the requested updates. I'll also take a look at OMP and OPS and will open PR forms for them if it's possible to change it there. I also see that my validation was not used anywhere - I forgot to implement the validation, but it's not required, so I removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native XML consumes too much memory
2 participants