Skip to content

Instantly share code, notes, and snippets.

@joewiz
Created February 5, 2019 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewiz/82733bd89388fdaef447d82fe9823a1a to your computer and use it in GitHub Desktop.
Save joewiz/82733bd89388fdaef447d82fe9823a1a to your computer and use it in GitHub Desktop.
Thoughts on a "package library" to replace eXist's "public repo"

package-library

API

  1. add package
    • receive uploaded xar(s)
    • store upload(s) in "temp" folder
    • for each new package:
      • extract package metadata
      • validate package metadata
      • move package to "library" (deleting previous version if present)
      • update package metadata listing
  2. delete package - @param package URI @param version
    • remove package from library
    • delete package metadata
    • delete package
    • update package metadata listing
  3. list packages
    • list all packages in "library"
    • list all packages matching eXist version constraints
    • list all versions of a package - @param package URI @param abbrev
    • list all versions of a package matching its own version constraints @param version
    • list all versions of a package matching processor version constraints @param processor @param version

app code

  • /db/apps/package-library contains minimal code

    • controller.xql handles app templating
    • collection.xconf is installed for /db/data/package-library
    • templates cause uploads to go to restxq endpoint
    • templates load contents from restxq / ajax
    • downloads also are triggered via restxq endpoint
  • /db/system/repo/package-library

    • package-library.xqm

data

  • /db/data/package-library
    • catalog.xml
    • /packages
      • /functx
        • catalog.xml (new file containing consolidated metadata)
        • /1.0
          • /package
            • functx-1.0.xar
          • /metadata
            • expath-pkg.xml
            • repo.xml
            • icon.png
      • /tei-publisher-app
        • catalog.xml
        • /4.0.0
        • /4.0.0-RC1
      • /exist-documentation
        • /3.0.0
          • package
            • doc-3.0.0.xar
        • /3.6.0
          • package
            • exist-documentation-3.6.0.xar
    • /temp
      • /packages
        • functx-1.0.xar
        • /functx-1.0
          • expath-pkg.xml
          • repo.xml
          • icon.png
      • /extracts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment