I see a couple of use cases depending on the actor:
- Map Maker would likely want a list of past Bike Trains and a way to select multiple of these for copying into a new quarter.
- User may want to make their own copy of the latest. This could be as simple as a "Repeat <bike train> for <Quarter>" button.
Basic Course of Events
''Some interesting questions about whether to filter based on current quarter or not.''
- Map Maker requests list of recent bike trains, preferably those that are not part of the current quarter.
- App provides the list with an opportunity to select one or more to be copied to the current quarter.
- Map Maker requests that the list be copied.
- App makes the copy and presents the bike trains for the current quarter in a list, optionally allowing the Map Maker to view the current map.
These are the manual steps performed in the database until this UC is implemented in code. Assuming we have already created the Group record, we will be inserting new records into three tables (in this order) for each Bike Train:
- Use phpMyAdmin DB Browser to browse the BikeTrain table of the 'routes' database (I like to sort by Primary key descending so most recent are at the top). This will show records that you want to copy from.
- Open a second window that we can use to insert new records.
- Type in the values for each of the fields (except the ID which will be autopopulated).
- Save the new record for the BikeTrain and by browsing in the first window, note the ID that was assigned. We use this in the next table: DisplayElement.
- In the second window, insert a record for DisplayElement and populate as follows (Element_ID is autopopulated as before):
- className: BikeTrain
- sourceId: <ID from the new BikeTrain record>
- type: ROUTE
- In the first window, browse the DisplayElement table to find the new record and note its new ELEMENT_ID.
- Back in the second window, insert a record for MAP_ELEMENT_GROUP and populate as follows:
- GROUP_ID: <looked up for the new Group (7 = btSummer2011, for example, enter the '7')>
- ELEMENT_ID: <from the new DisplayElement record>
You can now refresh the showRoutes and view the new Bike Train.