Extension:TableEdit2

From MediaWiki.org
Jump to: navigation, search

Extension in early development stages - page created as placeholder and container for any necessary discussion during development.

Introduction[edit | edit source]

This document is meant to be a software requirement specification for TableEdit v2.0.

Contact Info[edit | edit source]

TableEdit was originally written in 2006 by Jim Hu at Texas A&M University for use on EcoliWiki.net. Since then it has undergone quite a bit of change, and needs to be rewritten. Daniel Renfro worked on it over the years, and is undertaking a massive rewrite. (And is looking for help!)


Scope/Reasoning[edit | edit source]

Wiki markup can be challenging. Tables are one of the harder things for new users. TableEdit provides a simple table creation and editing system. TableEdit 2.0 should provide users of Mediawiki software a way to edit tables intuitively using the GUI instead of using markup. It should look and behave in a manner consistent with common applications and current web technologies; to use buzzwords, Web 2.0-ish. The benefits would be similar to those of the Usability Initiative extensions: ease of use for the common user, the power user, and to some extent, the admin. No-one shall ever need to type wiki-table syntax again! (Unless they want to, and that should be allowed by TableEdit, also.)

Definitions[edit | edit source]

TableEdit
The software extension to Mediawiki.
table
This could be one of a few things:
  1. wiki-markup table
  2. HTML table
  3. a MySQL relational-database table
box
the data representation of a table, either in a PHP object, DOM object, JavaScript object, JSON, XML, etc.
field
a cell in a table that is contained by only one row and one column
column-rule
behavior/functionality which defines what a field does under two circumstances:
  1. being edited
  2. being rendered

References[edit | edit source]

Overall Description[edit | edit source]

Current Functionality[edit | edit source]

TableEdit (v1.x) allows users to create and edit tables using HTML forms instead of editing the underlying (and sometimes quite esoteric and complex) wikitext. The user-interface is not intuitive and easy manipulation of existing rows and columns is lacking. The current version of TableEdit allows users to either create a single table, or define a table-template -- which can be transcluded from the Template namespace for multiple table instantiations.

Future Functionality[edit | edit source]

TableEdit2 should allow more spreadsheet-like behavior of tables, including:

  • Excel-like navigation based on keyboard input
  • in-line editing of rows
  • drag-and-drop manipulation of rows and columns
  • options for hiding the wiki-text from editors
    • based on permissions/groups
  • a defined API both on the server- and the client- side
    server side
    1. formal Mediawiki API for editing rows/columns/fields (with authentication)
    2. TableEdit API for automated editing/data mining
    client side
    1. TableEdit object

Constraints, Assumptions and Dependencies[edit | edit source]

  • depends on Mediawiki's ResourceLoader
  • depends on jQuery extension Datatables
    or Mediawiki Extension Datatables
    • KeyTable plugin
    • jEditable plugin


Specific Requirements[edit | edit source]

Client-Side[edit | edit source]

Interfaces/API[edit | edit source]

Classess/Methods[edit | edit source]

Performance/Tests[edit | edit source]

Server-Side[edit | edit source]

External interfaces/APIs[edit | edit source]

Globals (Variables/Functions/etc.)[edit | edit source]

Hooks Needed[edit | edit source]

Classess/Methods[edit | edit source]

Performance requirements[edit | edit source]

Tests[edit | edit source]

Logical database requirement[edit | edit source]

Database structure[edit | edit source]

TableEdit currently supports only MySQL databases, and does so badly. Version 2 needs to make use of the MW syntax for SQL files, to support custom table prefixes.

The database tables need to be renamed into something shorter:

old name                     new name

ext_TableEdit_box            tE_box
ext_TableEdit_row            tE_row
  N/A                        tE_field
ext_TableEdit_box_metadata   tE_meta_box
ext_TableEdit_row_metadata   tE_meta_row
ext_TableEdit_relations      tE_relation

Some necessary changes:

  • The page_name from tE_box should be removed because page_uid already handles this information.
  • tE_row gets a new field, rev_id, which is a foreign key to the revision table.
  • The entire table tE_field needs to be created to avoid having to split/join the row_data each time.
  • tE_relation needs to be simplified to only hold the necessary field_id; or redo this completely.


Design constraints[edit | edit source]

Key features[edit | edit source]

Deliverables[edit | edit source]

release projected date functionality notes
2.0 Jan. 1, 2011


Notes[edit | edit source]

Proposed Spec[edit | edit source]

  • Value types (can be combined):
    • text field
    • prefills
    • pulldowns
  • Data properties:
    • name
    • type
    • value
    • validation
    • relationship
    • sortable

links[edit | edit source]

don't forget about these:[edit | edit source]

  • documentation
  • api modules
ajax should call the api.php like in ExtendedCategoryPage
  • caption, attributes
    • new SQL file
    • integrate into view, model
  • finish tEio_IFALT
  • links/URLS should get made into absolute paths upon export
  • metadata SQL change:
    add a user_id field to the metadata...it makes sense to see which user made this save
  • TableEditLinks code
  • loading into tables -- tE should run the column_rules and handle exceptions intellegently to avoid data that doesn't conform to the column rule.
  • handle the case when a table gets copied to a new page.
  • styles for the messages/notes/etc
  • add a history stack
  • back/undo
    • add history-aware buttons like BACK and REVERT
  • optionally hide the table in the page
  • update the export/importers
  • change anything that relies on page_name, use page_uid
  • rewrite all of the tE templates
  • finish this documentation
  • hook into rebuildall.php or provide a script to update to tE2
    • or for internal conistency checkig
  • make it work in the extensions/ directory (patch for EW)
  • fix the class heirarchy use decorator and MVC
  • integrate the TableMarkerUpper script into tE
  • row deletion
  • hook into the preview (to show a preview of a new/existing box)
  • add the edit buttons to the top of the edit view
  • type=1, export, wikitext
  • add support for captions/cols/rowspans
  • add box_style, heading_style for non-templated tables
  • write an Install.php for tE2
  • fix the metadata loading/saving
  • deleting an entire table
  • when you copy a table from one page to another, tE should recognize the change in page_uid values and throw a question asking:
    • Did you mean to do this or was there an error?
  • conflict detection
  • relational foreign tables
  • add admin stuff
  • revert using wikitext
  • row-level history
  • install.php
    1. create database tables
    2. upgrade existing database tables
    3. create Mediawiki:TableEdit.js and Mediawiki:TableEdit.css
    4. run tests, check for global vars in LocalSettings that we need
    5. parse out captions, table/heading attributes

Example templates[edit | edit source]

Everything to the left of the light blue line below is included in the template page. It is broken up into pieces only for readability.

This is a TableEdit table template.

<template>
  <column>
    <heading>Qualifier</heading>
    <name>qualifier</name>
    <desc>Flags that modify the interpretation of an annotation.</desc>
    <format>select</format>
    <params>
      <option> </option>
      <option>NOT</option>
      <option>Contributes to</option>
      <option>Contributes to</option>
      <option>Colocalizes with</option>
      <option>Obsolete GO term</option>
      <option>Under review</option>
      <option>Deprecated</option>
    </params>
  </column>
  <column>
    <heading>GO ID</heading>
    <name>go_id</name>
    <desc>A unique number associated with each GO term.</desc>
    <format>text</format>
 </column>
 <column>
    <heading>GO term name</heading>
    <name>go_term</name>
    <desc>The name of the GO term.</desc>
    <format>go_term_lookup</format>
 </column>
 <column>
    <heading>Reference(s)</heading>
    <name>refs</name>
    <desc>One or more unique identifiers for a single source cited as an authority for the attribution of the GO ID to this gene product. This may be a literature reference or a database record. The syntax is DB:accession_number.</desc>
    <format>textarea</format>
 </column>
 <column>
    <heading>Evidence Code</heading>
    <name>evidence</name>
    <desc>see GO evidence code documentation.</desc>
    <format>select</format>
    <params>
      <option> </option>
      <option>IDA: Inferred from Direct Assay</option>
      <option>IPI: Inferred from Physical Interaction</option>
      <option>IMP: Inferred from Mutant Phenotype</option>
      <option>IGI: Inferred from Genetic Interaction</option>
      <option>IEP: Inferred from Expression Pattern</option>
      <option>ISS: Inferred from Sequence or Structural Similarity</option>
      <option>ISO: Inferred from Sequence Orthology</option>
      <option>ISA: Inferred from Sequence Alignment</option>
      <option>ISM: Inferred from Sequence Model</option>
      <option>IGC: Inferred from Genomic Context</option>
      <option>RCA: inferred from Reviewed Computational Analysis</option>
      <option>TAS: Traceable Author Statement</option>
      <option>NAS: Non-traceable Author Statement</option>
      <option>IC: Inferred by Curator</option>
      <option>ND: No biological Data available</option>
      <option>IEA: Inferred from Electronic Annotation</option> 
  </params>
 </column>
 <column>
    <heading>with/from</heading>
    <name>with</name>
    <desc>This field is used to hold an additional identifier for annotations using certain evidence codes (IC, IEA, IGI, IPI, ISS). For example, it can identify another gene product to which the annotated gene product is similar (ISS) or interacts with (IPI).</desc>
    <format>go_annotation_with</format>
 </column>
 <column>
    <heading>Aspect</heading>
    <name>aspect</name>
    <desc>Refers to the namespace or ontology to which the GO ID (column 5) belongs; one of P (biological process), F (molecular function) or C (cellular component)</desc>
    <format>display</format>
 </column>
 <column>
    <heading>Notes</heading>
    <name>notes</name>
    <desc>Free text area for user notes. (Not included in the monthly submital to GO.)</desc>
    <format>textarea</format>
 </column>
 <column>
    <heading>Status</heading>
    <name>status</name>
    <desc>Informs the user which is remaining of the three needed fields.</desc>
    <format>display</format>
 </column>
 <above>{{Product_GO_help}}</above>
 <help1>{{Product_GO_help}}</help1>
 <datatable>1</datatable>
</template>

Column-Rules[edit | edit source]

When a user edits a row in a table, it is nice to style the form that they fill out the way you want. Maybe you want them to select a single value from a list of values - the "select" format. The column rules in TableEdit-v2.0 do just this. In the table's template

<format> value description example definition
select Creates a select dropdown menu where the value would be. A default option can be shown.
 <column>
    <heading>Evidence Code</heading>
    <name>evidence</name>
    <desc>see GO evidence code documentation.</desc>
    <format>select</format>
    <params>
      <option> </option>
      <option>IDA: Inferred from Direct Assay</option>
      <option>IPI: Inferred from Physical Interaction</option>
      <option>IMP: Inferred from Mutant Phenotype</option>
      <option>IGI: Inferred from Genetic Interaction</option>
      <option>IEP: Inferred from Expression Pattern</option>
      <option>ISS: Inferred from Sequence or Structural Similarity</option>
      <option>ISO: Inferred from Sequence Orthology</option>
      <option>ISA: Inferred from Sequence Alignment</option>
      <option>ISM: Inferred from Sequence Model</option>
      <option>IGC: Inferred from Genomic Context</option>
      <option>RCA: inferred from Reviewed Computational Analysis</option>
      <option>TAS: Traceable Author Statement</option>
      <option>NAS: Non-traceable Author Statement</option>
      <option>IC: Inferred by Curator</option>
      <option>ND: No biological Data available</option>
      <option>IEA: Inferred from Electronic Annotation</option> 
  </params>
 </column>
text Creates an inline text input field.
  <column>
    <heading>GO ID</heading>
    <name>go_id</name>
    <desc>A unique number associated with each GO term.</desc>
    <format>text</format>
 </column>
textarea Creates a textarea. Params:
  • <rows> (optional)
  • <cols> (optional)
  • <readonly>(optional)
 <column>
    <heading>Notes</heading>
    <name>notes</name>
    <desc>Free text area for user notes. (Not included in the monthly submital to GO.)</desc>
    <format>textarea</format>
 </column>
checkbox
lookup
calculation
timestamp
foreign
coordinates
...