How to add a new structure to Pier:
PRStructure subclass: #PRWorkoutLog instanceVariableNames: 'date exercies' classVariableNames: '' package: 'Pier-Workout'
class>>isAbstract
to return false (otherwise it won't be an option, and tests using the the class will fail to create an instance of it) class>>label
to return the name you want to display (an informal name for your class). Add accessors and initializing. viewComponentClass ^ PRWorkoutLogView
Define it as:
PRViewComponent subclass: #PRWorkoutLogView instanceVariableNames: '' classVariableNames: '' package: 'Pier-Workout'
PRWorkoutLogView>>renderContentOn: html html text: 'Test'
(PRPathLookup start: (PRKernel instanceNamed: 'Pier') root path: '/John Borden/Todo/Workout') addChild: ((PRWorkoutLog new) addWorkout: ( PRWorkout new addExerciseEntry: ( PRExerciseEntry newOf: ( PRExercise name: 'Bench Press' weightUnits: 'lb' details: 'Flat bench with bar') weight: 200.5 times: 12) ); name: 'test'; title: 'Test'; yourself).
isValidIn:
. If this is not present, it will be listed under Views:
There are common pitfalls related to Seaside and Pier, and several specific to new structures:
MessageNotUnderstood: receiver of "detect:ifNone:" is nil
- This can be caused by not calling super initialize
from the new classes initialize method.