Skip to content

BundleManager

Helge Heß edited this page Sep 23, 2024 · 1 revision

The regular ObjC Foundation library has the concept of bundles (NSBundle), which are directories that contain resources and/or a shared library containing classes. Somewhat similar to a Java JAR file (which is a zipped directory structure).

SOPE extends the NSBundle concept w/ the NGBundleManager. This adds dependency management. A bundle can declare (in the bundle-info.plist) file what other bundles or features it needs and what features it provides.

OGo is using that functionality extensively, the server is mostly made of bundles of various kinds, e.g.

  • Command bundles (.lso), they contain "commands" which are operation classes that perform a specific thing. For example fetch the events of a week or create an account
  • DatasSource bundles (.ds), they contain a higher level NSFileManager/EODataSource abstractions. Easier to use in UI code.
  • WebUI components

The bundle manager is queried by code, e.g.:

bundle = [bm bundleProvidingResource:pageName ofType:@"DockablePages"];

And the e.g. the PersonsUI bundle declares it like this:

{
  bundleHandler = SkyPersonsModule;
...
  provides = {
    classes = (
...
      { name = LSWPersons;                   },
...
    DockablePages = (
      { 
        name      = "Persons";
        component = "LSWPersons";
        labelKey  = "Contacts";
        image     = "menu_persons_labeled.gif";
        listicon  = "icon_persons_26x21.gif";
      }
    );

Resource Types

  • DockablePages (UI components that can show up in the OGo UI dock)
  • OGoProjectBases (OGoFileManagerFactory)
  • EOModels (EOF database models, map SQL to objects)
  • LSCommands (OGo command operations, like `person::get``
  • PPConduits (Palm syncing things)
  • WOComponents (SOPE UI components, class plus html/wod/wox)
  • CTIDialers (CTI integration)
Clone this wiki locally