Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.