Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 2.53 KB

File metadata and controls

69 lines (50 loc) · 2.53 KB

Wrangler collections

This package contains definitions for Wrangler-specific collections as well as file handler definitions. A file handler reads a file uploaded in Wrangler and either create WranglerDocuments for review or writes to the database.

Installation

In your Meteor app directory, enter:

$ meteor add medbook:wrangler-collections

WranglerDocuments

Wrangler documents are generated when Wrangler 'peeks' at the file. They describe and summarize various parts of the file.

The following code will create the panel below in the review step of Wrangler:

var submission_id = 'submission_id';
var user_id = 'user_id';
var submission_type = 'submission_type';
var wrangler_file_id = 'wrangler_file_id';

WranglerDocuments.insert({
  submission_id, user_id, submission_type, wrangler_file_id,
  document_type: 'panel_definition',
  contents: {
    name: 'panel_example',
    title: 'Panel heading',
    description: 'Some default panel content here. ...',
    css_class: 'panel-default',
    columns: [
      // NOTE: 'name' is an invalid attribute
      { heading: '#', attribute: 'number', header_of_row: true },
      { heading: 'First Name', attribute: 'first_name' },
      { heading: 'Last Name', attribute: 'last_name' },
      { heading: 'Username', attribute: 'username' },
    ],
  }
});

WranglerDocuments.insert({
  submission_id, user_id, submission_type, wrangler_file_id,
  document_type: 'panel_contents',
  contents: {
    name: 'panel_example',
    number: '1',
    first_name: 'Mark',
    last_name: 'Otto',
    username: '@mdo',
  }
});

// ...

panel_example

credit: http://getbootstrap.com/components/

Installation

File handlers must define this.submission_type before adding any WranglerDocuments.

Click to edit online