Hi,
I'm living more and more inside Pharo, and as an experiment I would like to use plan board to plan an event. For that my idea is to build the event in plan board and export it in several formats: - Json exportation to import the plan info in our website (powered by web2py: http://web2py.com ), so this is the most important part - SVG (I think this is supported right now). I tried to create new instance of the plan board but I'm missing something from the syntax on how to proceed. So I started to modify exampleFour and create my own exampleDataweek (the event is called data week, look at [2] for details, about the previous version) and you now I can get something like this: [2] http://mutabit.com/dataweek/ So I would like to extend Stephan's example for Json exporting. Here are some questions: 1. How I create an instance of a plan board instead of a new class side example? 2. In the instance I would like to send the message "columns" and I imagine I will get all column data, including the "position" which is the start and end time of each session/event on each day. Am I right? 3. Once I have this, I imagine will be possible to use Ston to export this objects info to Json and teach my website how to read this information and show it properly in our activities calendar. Any pointer on how to start will be appreciated. Cheers, Offray |
On 13-09-15 22:59, Offray Vladimir Luna Cárdenas wrote:
> - Json exportation to import the plan info in our website (powered by web2py: > http://web2py.com ), so this is the most important part > - SVG (I think this is supported right now). The SVG output is not in the PlanBoard example but should be not a problem to retrofit. Generation of json is even simpler. > 1. How I create an instance of a plan board instead of a new class side example? In the PlanBoard example there is no separation between model and view. It is directly coded in the morphs. That is something that doesn't scale, and it is something we know how to fix once it becomes a problem. While prototyping, you probably don't want the separation between model and view yet, as that makes the prototype less direct. > 2. In the instance I would like to send the message "columns" and I imagine I > will get all column data, including the "position" which is the start and end > time of each session/event on each day. Am I right? Yes. Columns are morphs themselves and the submorphs are the sessions. Position in the column determines starting time, the event morphs contain the duration. You at least want an accessor for startingTime that calculates it from the position. In your application you probably want to revisit the timeline drawing code in the column to make it independent of column size. There are hardcoded values that should depend on column size and grid resolution. If you only have a few timeslots, you might want to add a mouseMove: handler in the column that checks on isDragging, and moves the dragged event to the closest slot. Also you probably want to be able to resize the planboard. In the mindmap example you'll find how to load and save to fuel Stephan |
Free forum by Nabble | Edit this page |