Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-236

Introduce content read criteria to find contents in Archive

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0-alpha-11
    • Fix Version/s: None
    • Component/s: api, impl-base
    • Labels:
      None
    • Affects:
      Documentation (Ref Guide, User Guide, etc.)
    • Estimated Difficulty:
      Medium

      Description

      The read capabilities on Archive are largely inadequate. You can get the content by an archive path or you can flip through all the content and filter the results by path name. However, there are much more logical structures inside the archive that ShrinkWrap does not expose an API to locate. For instance, I want to pull out one or more WebModules from an EnterpriseArchive.

      However, if we were to introduce a closed set of read methods, the user would eventual outgrow them and find themselves in the same position. My recommendation is to follow the lead of Weld Extensions and use an Archive criteria API. I believe it's a good choice because it feels familiar to Java EE developers with it's JPA-like syntax and it's completely extensible.

      For example:

      ArchiveContentQuery<EnterpriseArchive> query = ArchiveContentQueries.<EnterpriseArchive>createQuery(EnterpriseArchive.class)
      .addCriteria(new TypedAssetCriteria(WebArchive.class));
      List<WebArchive> wars = query.getResuiltList();

      This is so much simpler than using a filter on a tree walker. It's also crucial for manipulation of the Archive within Arquillian.

      see http://docs.jboss.org/weld/extensions/reference/latest/en-US/html/properties.html#d0e917

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            dan.j.allen Dan Allen added a comment -

            In the example above, a nested limit (or target nesting level) would be ideal for ensuring you aren't getting an archive within an archive within an archive (assuming that's an invalid result).

            Show
            dan.j.allen Dan Allen added a comment - In the example above, a nested limit (or target nesting level) would be ideal for ensuring you aren't getting an archive within an archive within an archive (assuming that's an invalid result).

              People

              • Assignee:
                Unassigned
                Reporter:
                dan.j.allen Dan Allen
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Development