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

Have non-page tables #37

Closed
splitbrain opened this issue Feb 25, 2016 · 1 comment
Closed

Have non-page tables #37

splitbrain opened this issue Feb 25, 2016 · 1 comment

Comments

@splitbrain
Copy link
Member

As a future feature it might be nice to be able to create data tables with data not bound to pages. For these editing would happen directly on a page where users can add new, browse, edit or delete existing entries.

Functionality like this has been asked for in the forum: https://forum.dokuwiki.org/thread/12820

It could also be used as a data source for the proposed dropdown type on #36

@splitbrain
Copy link
Member Author

splitbrain commented Aug 3, 2016

Concept

Some rough ideas on how to implement that

Basic Principles

Database Changes

  • the tables for lookups would have the exact same structure as our current data_ and multi_ tables
    • the exception is that the pid column would be an auto increment integer instead of a string
    • rev would always be 0 and latest would always be 1 (no revisions, the data is always current)
  • the schemas table would get an additiona islookup column

Keeping those tables so similar should make it possible to implement this new feature with minimal changes to existing classes

Code Changes

  • class Schema
    • a new isLookup() method is added
  • class SchemaBuilder
    • the $data passed in the constructor needs to be extended with the islookup property
    • schemas can not be converted between lookup and non lookup!
  • class Search
    • Aggregations should not be able to select more than one Lookup
    • It should not be possible to select Non-Lookups mixed with Lookups (we can't join on pid)
    • Types might join lookup tables via their select() and filter() methods
  • Inline Editor (action, JS)
    • needs to differentiate between lookups and non-lookups
    • lookups do not create page revisions, create page locks
    • needs to be extended to add new rows (lookups only)
    • needs to be extended to delete rows (lookups only)
  • new syntax/lookup
    • basically limited version of the aggregation table syntax
    • always shows all columns
    • accepts a single lookup table only
  • type Dropdown
    • extend to be able to use a lookup as values
    • should enable possibility to translate values (probably predefined column names)
  • new type Lookup
    • something like Dropdown, but with autocompletion
  • Failsafes
    • class Assignments make sure lookups aren't assigned to pages (throw exception)
    • action/entry should not handle lookups
    • class Search should not allow %lastupdate% and %title%

early brainstorm scribble

201608031436521000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant