Repository navigation
Add PackageRead.Parts to enumerate package parts - #96
Merged
Merged
Conversation
Every read accessor so far needs a relationship or an already known URI, so a part that no relationship targets could not be discovered at all. Such parts are legal in an OPC package and occur in practice, e.g. the supplementary files of the IDTA-01005 example package, which has no aas-suppl relationships. Parts lists every part (excluding the OPC metadata entries) sorted by path, so importers can detect content they would otherwise drop. Fixes eclipse-aascw#79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #79
Problem
Every
PackageReadaccessor needs either a relationship or a URI the caller already knows, andPackageBase.partsis not accessible. So a part that no relationship targets can't be discovered.OPC (ISO/IEC 29500-2, which IDTA-01005 builds on) allows such parts, and they show up in practice. For example,
examples/IDTA-01005_Example.aasxin admin-shell-io/aas-specs-aasx holds three PDFs underaasx/suppl/.data.xmlrefers to them throughFileelements, but the package has noaas-supplrelationships. Strictly speaking, that example doesn't follow Part 5, which expects such files to be targeted byaas-supplfrom the spec. A reader still needs a way to notice them.Change
PackageRead.Parts(): Promise<Part[]>. It returns every part in the package sorted by path, including parts no relationship targets. OPC metadata ([Content_Types].xml,*.rels) is not included, same as everywhere else in the API.DeletePartafterwards.On the IDTA example,
Parts()now lists the origin,data.xml, all three supplementary PDFs andThumbnail.png.The same gap exists in aas-package3-golang. A matching PR is opened there.