Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Allow to to specify in the filter element to match the full path #1015

Closed
wants to merge 1 commit into from

Conversation

cofinoa
Copy link
Contributor

@cofinoa cofinoa commented Jan 25, 2018

New path attribute on filters to allow matching the full path instead only the name. See:
https://stackoverflow.com/questions/48445792/filtering-thredds-datasetscan-by-both-directory-and-file-pattern

Example of directory structure:

/GGG/alpha/a
          /b
          /c
/GGG/beta/a
         /b
         /c

the following <datasetScan>

<datasetScan name="Test Filtering" ID="testFiltering"
               path="testFiltering" location="/GGG">
    <filter>
      <include wildcard="*" atomic="true" collection="true"/>
      <exclude wildcard="*alpha/a" path="true" collection="true"/>
    </filter>
  </datasetScan>

will show all the directories except the alpha/a directory

@cwardgar
Copy link
Contributor

This is definitely a worthwhile addition, but I hesitate to merge it into master, because catalog handling is vastly different in 5.0.0. I think we should target 5.0.0 only.

We'll need to:

  • Add "path" attribute parsing to ConfigCatalogBuilder.readDatasetScan().
  • Add "path" attribute to InvCatalog.1.2.xsd.
  • Add unit test(s) to TestDatasetScanFilter.
  • Update documentation.

I'll try to get to it before the release of 5.0.0. I'll leave this PR open and un-merged until then. Thanks for getting this started, @cofinoa.

@cofinoa cofinoa changed the title Allow to to specify in the filter element to math the full path Allow to to specify in the filter element to match the full path Jan 26, 2018
@cofinoa
Copy link
Contributor Author

cofinoa commented Jan 26, 2018

Agree.

I was looking at the TDS4.6 source code to understand the datasetScan and it was too obvious to me how to implement that feature (which has been a long standing complain "among TDS admins").

@cofinoa
Copy link
Contributor Author

cofinoa commented Jan 26, 2018

@cwardgar I have migrate the master changes to the version 5.0.0 branch
https://github.com/cofinoa/thredds/tree/support_path_filter_v5

but I don't know how to add the unit tests to TestDatasetScanFilter, basically because of my lack of how to work with them.

If you provide me some basic instrucitions or guidance I can learn for future PR.

@cwardgar
Copy link
Contributor

I'm converting this to an issue (#1032), just to clear out our open pull requests a bit.

@cwardgar cwardgar closed this Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants