digirati-co-uk / iiif-manifest-editor

Create new IIIF Manifests. Modify existing manifests. Tell stories with IIIF.
https://manifest-editor.digirati.services/
MIT License
29 stars 3 forks source link

Configurable publishing #236

Open stephenwf opened 1 year ago

stephenwf commented 1 year ago

Aspects of publishing

One idea for this is to use iframes and postMessage. This would allow both internal and external UI and scripts to run as part of a pipeline. This documents a scenario for composing these steps together (but could easily just be a single URL).

Configuring a publishing process

const config = {
  publishing: [
    {
      label: 'Publish to Github'
      type: 'pipeline',
      steps: [
        {
          label: 'Login with Github',
          url: 'https://mygithubloginproxy.com/',
          type: 'frame-login',
        },
        { 
          label: 'Select repository',
          url: 'https://mygithubloginproxy.com/select-repo',
          type: 'frame',
        },
        { 
          label: 'ID Generation options',
          url: 'https://mygithubloginproxy.com/id-generation',
          type: 'frame',
        },
        {
          label: 'Save',
          type: 'frame',
          url: 'https://mygithubloginproxy.com/save',
        },
        {
          label: 'Slack notification',
          type: 'frame',
          url: 'https://mygithubloginproxy.com/slack',
        }
      ]
    }
  ]
}

This mock example shows what a configuration may look like for publishing:

When each step runs, a set of postMessage() will be sent to each frame (to be defined) sending the IIIF + a context object that is shared by the steps. For example, the Login step may ensure a cookie is present OR present the user with a login screen. Once the login has happened it would perhaps add the Github username to the context.

As you can see, steps can use the "context" from previous steps (and may require it!).

With this mechanism we can have "keywords" in the context that might be used by the Manifest Editor. For example, a me_published_url field could for example be used in the ME to link back to the published manifest.

Each step is an iframe, and it can optionally show a UI to the user when they are going through the publishing UI.