Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Project from web resources #72

Open
cubap opened this issue Mar 19, 2024 · 1 comment
Open

Create Project from web resources #72

cubap opened this issue Mar 19, 2024 · 1 comment
Labels
core-functionality OSS An issue which is appropriate for OSS to work on.

Comments

@cubap
Copy link
Member

cubap commented Mar 19, 2024

/project/create

@cubap
Copy link
Member Author

cubap commented Mar 25, 2024

An action within the /project endpoint needs to be created that creates a new project. This may be divided into subissues if the scope is too big (specifially for an OSS task).

At GET /project/new?URL we will support clickable links from other applications. For this reason, it must be a GET and contain all the information needed in the querystring. Obvious note that the URL in the querystring will be URLencoded and may need to be decoded for use as a fetch.

First, the user must be known, so this GET will interact with a login.
The API will need to validate and fetch the link to create the project. If the link does not resolve to a known type (IIIF Manifest v2 or v3, or a supported Image format), the result should be a "Create Project from External Resource" page that is not yet ticketed.

  • Manifest: If the URL is a IIIF Manifest, it should be normalized to a Manifesto (See IIIF-Commons on GitHub) Manifest and fed to a ProjectFactory. The behavior of this factory is not clearly defined yet, but it will save a new Project record into the database and then redirect to the default transcription interface for that project.
  • Image: If the URL is an Image resource (jpg, tiff, png, webp, gif), a Project with a single page will be created, saved to the database, and then redirect to the default transcription interface.

After the GET resolves, the resulting page is the Project Management or Project Information page, unless there is an alternative in the querystring.

At POST /project/create we will be able to generate new projects by accepting a JSON body that describes most of the required parts of the new project. What follows are some examples that does not set the requirements for this call or the authoritative shape of a project.

Key Value Example
_id ObjectID() *assigned by db or reserved
creator URL "https://store.rerum.io/v1/id/agent-hex" *assigned by authenticator
name String "DisplayName for Project I want to read"
group ObjectID() or hex *generated or declared
layers Array [] *empty unless defined
viewer, license, tools, options various default if not defined
manifest or images URL or [URL] as with GET

The POST action should always respond RESTfully with a 201, Location header for the project info page, and have the _id value as the body.

Both of these will require some sort of ProjectFactory() and tips its hand towards other methods to apply metadata, create Layers, modify groups, etc. so remain aware of when to stop.

Out of Scope

  • There are plans for more types of resources, but not now. Code assuming there will be more, but it does not need to be included.
  • Parameters in the future may allow for more configuration, default metadata, prefer alternate interfaces, etc. but that is not necessary yet.
  • The default interfaces and configuration defaults will be generalized later but can be hardcoded for now.

@cubap cubap added OSS An issue which is appropriate for OSS to work on. core-functionality labels Mar 25, 2024
@cubap cubap changed the title Create Project from _n_ Create Project from *n* Mar 28, 2024
@cubap cubap changed the title Create Project from *n* Create Project from web resources Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-functionality OSS An issue which is appropriate for OSS to work on.
Projects
None yet
Development

No branches or pull requests

1 participant