Note from the Sprint held at the Chandler Techncal Update in April 2005
* It is hard to set the various environment variables (PARCELPATH or CHANDLERWEBSERVER) when using the double clickable Macintosh application.
If you do "export CHANDLERWEBSERVER=1", and then "open -a Chandler.app", then the Chandler web server will start, but we were unable to set PARCELPATH. This appears to be a problem with the Mac launcher
Also, you cannot run either RunChandler or python in Contents/MacOS from the terminal, and there is no RunPython script in the Mac build.
* There is a bug in the Windows builds where the RunChandler.bat file is throwing away its first argument
* Redirect to "shared" attributes doesn't really work - what would the syntax even be? i.e. an attribute that is pulled into two types, but brought in via <attributes>
* In the tutorial, you must create the event used by the menu item as well as the menu item before trying to test it. The tutorial's format seems to indicate that you can define the menuitem, then the event, then the controller, and test it each time.
* In fact, the skeleton needs some skin to go with the bones - add the menu items, maybe some python, the controller.
* where does the python go? Need to be explicit so people can find it, know where to put the controller, etc.
- common error: programmer gives the module name instead of the class name for the <classes> tag. The error message is something like 'item not in item 'list'' -- rather unhelpful. We exacerbate this problem with our conventions (block.Block.Block).
- common error: no _ _ init _ _.py in the module -- error msg is misleading here as well. Perhaps a common pattern where normal python msgs are obscured because of the way the code is loaded.
* If someone tries to commit an invalid value, the error message gives no indication of the attribute that caused the problem
* It should be possible to just create form based parcels without writing any Python code -- right now, we still need to create a controller that can construct an item of the new kind.
* The stack trace dialog doesn't include problems that the log files report. For example, the log file reports errors and line numbers in parcel.xml but that information is not reported to the stack trace.
* We had some troubles making the
blockName of blocks match the controller event - and you don't get any feedback - we should throw an exception or something if there are no controllers to handle an event.
* people are getting confused between PARCELPATH paths and repository paths.
* lots of problems running the weekly build on windows, because they run as full windows apps and don't have console output.
* Execptions from event handlers don't throw exceptions to the screen.
* Bug: when another chandler is running, --create doesn't tell us that - instead it complains
* Really need a way to display all errors to the user - otherwise its very hard to debug
* It is very hard to figure out which version/build of Chandler to use.
Chao's raw comments:
- Alec's tutorial is a good first step, but there are still many steps and areas that are undocumented. Only by asking an OSAF developer, or by really going through the source code line by line can you find many of these answers.
- in general, would like explanation about importing modules in Chandler, especially implicit paths Chandler uses for importing parcels, application, content mode, etc.
- need to have import line for AmazonController?
- importing ItemCollection? and Item
- import application.Globals as Globals
- which file to enter python Controller code. Had problems with blocks.py because that conflicted with the blocks folder. Finally settled on AmazonBlocks?.py
- Would like a better understanding menu and block event, and how they inter-relate e.g.
- confusion between Menu blockname and Event blockname. BlockEvent? cannot be named Event because the python handler automatically appends event
- too many filenames called parcel.xml
- binding python class to parcel.xml got me confused. RSSItem/RSSChannel got switched
- api for Collection and Item would be useful
- would be nice to use ZaoBao? code instead of skeleton. Or something simpler that has been tested to work before
- should mention need to set itemcollection displayName
- oops skipped section on need to set kindID and kindPath, but why does this need to be set? Don't we already specify it in the parcel.xml file in the other direction?
- should RSSChannel inherit from a Chandler class? how 'bout ItemCollection??
Heikki's comments:
- My parcel needed to load some data from parcel.xml, which was not explained in the tutorial. Apparently it had been there earlier, but removed when there did not seem to be a need for it. Well, I think several parcels will have some defaults, so it would make sense to include this IMO. I ended up finding out how Chandler was doing it with the 3 items we ship with.
- It was unclear what kind of hierarchy to place my data in the repository. The original thought was:
+ //parcels
+ certstore
+ root
- cert1
- cert2
- site
- user
-me
but it seems like the convention is to have everything in a "soup" on the top level. This meant moving the hierarchy "root, site, user, me" into an attribute on the certificate Kind.
- Actually, it seems that schemas and anything (including data) that is defined in parcel.xml ends up in a hierarchy.
- If you have data in parcel.xml, you need to somehow copy that into the soup? How? This difference between data in parcel.xml or not seems confusing. Come to think of it, why doesn't everything end up in the soup, including schemas? Or vice versa. Why is there a hierarchical side and soup side?
- If you have data in parcel.xml, copy it into soup, then delete from soup, the data will reappear if the repository recreated (since it will be loaded from parcel.xml, which was not affected by delete).
- I have some attributes that should only be computed once (since they will never change). How do you make this happen? John commented that this would be a bad idea...
- How do you make attributes who'se value is computed on first access? (This would mean that you can't search for uncomputed values?) I guess normal Python trickery...
- Can you have attributes on an item that are not saved in the repository? How? (I'd like to extract some information from a certificate to display it in detail view, but forget it as soon as the detail view is gone.) Solved this one by writing a custom attribute editor for my attribute, which only extracts the value for dispay, and does not store it into any of the item's properties...
- I can make a new sidebar entry easily enough, but how do I prevent a new entry if there already is an entry I created before?
- How do I make new columns in summary view and hide the existing columns?
- What attribute editors/viewers are available for detail view? What do they do? Samples? How can I show pictures, monospaced text? How do I mark things read only?
- How to use ref. collections to group items, search for them etc? Using queries it seems straight forward, but overkill.
- It wasn't mentioned anywhere that itsName must not contain forward slashes. Are there any other special characters that can not appear there?
- Stamping buttons show up (well, maybe I caused them to show up with MarkupBar), but they throw exceptions about my item not having StampKind attribute. Actually, I think I want to derive from ContentItem after all, so stamping buttons seem to work without raising exceptions, however nothing seems to happen - what gives?
- Dummy title elements needed(?) on StaticText elements.
- Items need to have displayName or random things break.
- Why does my detail why change when I stamp it as event, but not when I stamp it as mail?
- Why does my certificate stamped as event not show up in the All collection?
Chao's notes for moving parcels from one directory to another
The good news is that I did succeed in moving the parcel from the samples directory (set by PATHPATH ) to the parcels/osaf/examples/ directory that ships with Chandler with a little help from Alec.
Changes and mistakes I had to make can be grouped into 3 areas:
1) I needed to change all my python paths.
a) Python paths can be found in the python code itself, usually as the "import" statement. e.g. I had to change
import
AmazonKinds?
to
import osaf.examples.amazon.AmazonKinds as
AmazonKinds?
b) Python paths are also found in the parcel.xml files. e.g.
amazon.AmazonKinds.AmazonCollection
to
osaf.examples.amazon.AmazonKinds.AmazonCollection
2) For each new kind declared, I needed to change the kindPath to the kind definition in the repository
e.g.
myKindPath = "//parcels/amazon/schema/AmazonCollection"
to
myKindPath = "//parcels/osaf/examples/amazon/schema/AmazonCollection"
3) For every change I made, I found out the hard way that I needed to start from a clean repository. This stumped me for a while until Alec point me the way.
4) You don't have to change the path for any of the XML namspace URLs, although I have unanswered questions about how these namespaces can be made unique.