44 | | 1. '''Core''' --- a ''module'' that holds all the shared variables, admin, functions, permissions and other logic that will drive all widgets and facilitate the rest of the components. |
45 | | 1. '''Builder''' -- this is the UI ''module'' that will allow a user (with permission) to chose the type of widget, Context (see below) Purpose and style of a Widget and build an instance. The module will take these options and create a 'Widget Instance' (see below) before generating the themed, styled ''Widget Chrome'' (below) for a user to paste into their website. |
46 | | 1. '''Chrome''' (output, concept) -- the 'Widget Chrome' is this is the actual HTML and related CSS/JS, built by the ''Widget Builder'' (above), that a user cut/pastes into their site in order to display the widget. It's held on the client site and runs via whatever tech drives it (iFrames to start, web services & backbone maybe one day). The chrome used depends the user's choice of ''Type'' (Full screen, sidebar, button options etc), ''Style'' (css, colours etc - not planned to be editable initially), and ''Framework'' (iFrame for now, later other options might become available). |
| 48 | 1. '''Chrome''' (output, concept) -- the 'Widget Chrome' is this is the actual HTML and related CSS/JS, built by the ''Widget Builder'' (above), that a user cut/pastes into their site in order to display the widget. It's held on the client site and runs via whatever tech drives it (iFrames to start, web services & backbone maybe one day). The chrome used depends the user's choice of |
| 50 | a. '''Style''' -- How it will look when the Chrome is built; Options ''Type'' (Full screen, sidebar, button options etc), ''Style'' (css, colours etc - not planned to be editable initially), and ''Delivery Framework'' (iFrame for now, later other options might become available). |
| 51 | a. '''Purpose''' -- what the widget is for, e.g. National Directory (this is all we're building for the IIRS), Projects near Initiative, Single Node (e.g. for embedding a single page for an event, initiative or other content), Newsletter signup etc etc. The purpose wraps up a set of Displays (Views onto Services) inside Workflows (see below). |
51 | | 1. '''Display''' -- An actual single pane of UI within the widget, either stand-alone or as part of a Workflow. Each 'Display' (effectively a 'View' in MVC) uses the theme layer to render the data provided by a Service that is set by the Recipie's context, target and purpose. However, in Drupal 7 and for the purposes of the IIRS, the Display (UI) and the Service (data/logic) are often provided together by various modules -- e.g. Drupal core's login form... For example, the 'View list of Initiatives' display will provide show the output of a Drupal view that lists the recent initiatives added |
52 | | 1. '''Service''' -- are little chunks of functionality that deliver data to a View (see below). They are similar to the 'Controller' plus part of the 'Model' in MVC. Ideally the services map directly to real web services, though for now this is not likely to be needed/possible. Drupal 8/Symfony makes Services much more powerful however. Examples would be 'List nodes', 'Search nodes', 'View Node', 'Log in', 'Register', 'Add node', 'Edit node', 'Newsletter Signup' etc. In Drupal 7 these are effectively menu callbacks. |
| 54 | 1. '''Display''' -- An actual single pane of UI within the widget, either stand-alone or as part of a Workflow. Each 'Display' (effectively a 'View' in MVC) uses the theme layer to render the data provided by a Service that is set by the Recipe's context, target and purpose. However, in Drupal 7 and for the purposes of the IIRS, the Display (UI) and the Service (data/logic) are often provided together by various modules -- e.g. Drupal core's login form... For example, the 'View list of Initiatives' display will provide show the output of a Drupal view that lists the recent initiatives added |
| 55 | 1. [NOTE SURE ABOUT THESE with regards to ''Displays'' -- TBC] '''Service''' -- are little chunks of functionality that deliver data to a View (see below). Ideally the services map directly to real web services, though for now this is not likely to be needed/possible since Drupal provides services and displays together. Examples would be 'List nodes', 'Search nodes', 'View Node', 'Log in', 'Register', 'Add node', 'Edit node', 'Newsletter Signup' etc. In Drupal 7 these are effectively menu callbacks with extra theming. Drupal 8/Symfony makes Services much more powerful however |
| 56 | 1. '''Workflow''' -- A set of displays that go in sequence. E.g. Login/Register -> Add [Target] -> Thank you page. |
54 | | Hence most (all?) of the initial view |
| 58 | ==== Widget Builder example ==== |
| 59 | 1. National Hub user (from France, in French) has permission to create themselves a widget. |
| 60 | 1. They go to the Widget Builder and choose the ''Widget Recipe'' they want: |
| 61 | * Purpose: "National Hub Listings" |
| 62 | * Target: "Initiatives" |
| 63 | * Style: "Full page", "Standard theme", "iFrame" |
| 64 | * Title: (auto-generated but editable) t('Initiatives National Hub Listings, full page') = "Initiatives Listes nationales de Hub, complète la page". |
| 65 | 1. They click 'Save & Generate' and their ''Widget Recipe'' entity is saved, and the context is automatically added: |
| 66 | * Country: "France" (FR) |
| 67 | * Language: "Français" (fr) |
| 68 | * Owner: [current user] |
| 69 | * Status: "Active" |
| 70 | * Created/Edited: [date/time today] |
| 71 | 1. The page refreshes and their widget is shown in the example area, plus the Chrome (HTML code) in a box to copy/paste. |
56 | | ==== Complete widget example ==== |
57 | | 1. User (from France, in French) has permission to create themselves a |
| 73 | ==== Widget Plugins needed ==== |
| 74 | Leveraging CTools, the following plugins are needed for the IIRS: |
| 75 | * Style plugins: |
| 76 | * Types: "Full page", "Sidebar", "Button only" = Chrome styles we currently have. |
| 77 | * Style: "Default" = whatever we come up with based on very simple style. |
| 78 | * Delivery Framework: "IFrame" = shows displays and popups using HTML IFrames. |
| 79 | * Purpose plugin: "National Directory (recent)" which uses: |
| 80 | * Target plugin: "Initiatives" = Provides services for and entity handling for viewing/adding Initiative Nodes. |
| 81 | * Display plugins: |
| 82 | * "Tabbed National" = Large display with tabs for 'Recent', 'Map', and 'Search'). Uses following displays "Recent Content Listing", "Content Map" and "Content Search". Includes 'help' and 'about' links. |
| 83 | * "Simple National" = Small display with tabs for 'Recent' [target] nodes. Uses following displays only the "Recent Content Listing" displays. Includes 'help' and 'about' links. |
| 84 | * "Recent Content Listing" = A list of recently added [target] (initiatives in our case) in [country]. |
| 85 | * "Content Map" = A map of recently added [target] (initiatives in our case) in [country]. |
| 86 | * "Content Search" = A way of searching for [target] by name and location. |
| 87 | * "View Content" = A popup to display a single [target] Node. Can also show edit options if user has permission. Used for displaying both the Initiative details, and the 'About' and 'Help' pages. |
| 88 | * "Log in/Register" = A unified Login/Register form display with Social Media connect options. |
| 89 | * "Create Content" = A form to create [target] content, showing only core/required fields). |
| 90 | * Workflow plugin: "Registered User Create Content" which takes a user though the displays "Log in/Register" -> "Create Content" (for Initiative target) -> "View Content" ('About' page for Initiative target). |
59 | | |
60 | | 1. '''Workflow''' -- A pu |
61 | | |
| 92 | === To do (updated 25 Aug 2013) === |
| 93 | * Pin down relationships between views (both Drupal Views and View per MVC), Displays, Workflows and Services. It's ''almost'' clear but until development is started and the abilities of CTools are known, this is not easy to fully document at this stage. |
| 94 | * Work out how the 'Target' plugins will provide access to nodes, and what if anything they do to displays and services... Ideally they should extend such displays and make available certain fields that are important (e.g. location for initiatives/projects/events, date for events, type for resources etc). |