-
Notifications
You must be signed in to change notification settings - Fork 0
Component Activation
Helge Heß edited this page Sep 25, 2024
·
5 revisions
Component "content" pages in OGo are often activated using a Java Mail like activation system that works on top of the MIME type.
For example this DirectAction ("new appointment"):
/wa/newApt?year=2024&month=9&day=25&hour=11&tz=MST&c=...&wosid=...
Loads the page using this:
page = [sn instantiateComponentForCommand:@"new"
type:[NGMimeType mimeType:@"eo/date"]];
I.e. it tells the session to find a component that can create a new eo/date
object.
There are various command "verbs" (do not confuse them with "commands" in Logic), like:
new
edit
delete
print
move
proposal
mailview
htmlMail
textMail
link-inline-preview
The lookup is done using the BundleManager and declare like this in the bundle-info.plist
of an NSBundle:
{
provides = {
LSWCommands = (
{
verb = view;
type = "eo-gid/date";
component = LSWAppointmentViewer;
},
{ verb = view; type = "eo/date"; component = LSWAppointmentViewer; },
{ verb=print; type="eo-gid/date"; component=SkyAppointmentPrintViewer;},
{ verb=print; type="eo/date"; component=SkyAppointmentPrintViewer;},
{ verb = edit; type = "eo/date"; component = LSWAppointmentEditor; },
{ verb = new; type = "eo/date"; component = LSWAppointmentEditor; },
{ verb = proposal; type = "eo/date"; component = LSWAppointmentProposal; },
{ verb = move; type = "eo/date"; component = LSWAppointmentMove; },
...
Looks like the components get sent this:
- (BOOL)prepareForActivationCommand:(NSString *)_command
type:(NGMimeType *)_type
configuration:(NSDictionary *)_cfg
Which e.g. is implemented in OGoEditorPage
, and enhanced, e.g. it adds
- (BOOL)prepareForNewCommand:(NSString *)_command
type:(NGMimeType *)_type
configuration:(NSDictionary *)_cmdCfg
e.g. implemented in LSWAppointmentEditor
.