The liboaf Library | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
Defining servers is useful (that is what .goad files did light-years ago) but to use all the power of OAF (ie: queries ;-), you have to define oaf_attributes for each of those oaf_server entries. An example is worth all words.
<oaf_info> <oaf_server iid="OAFIID:demo_echo_factory:a7080731-d06c-42d2-852e-179c538f6ee5" type="exe" location="bonobo-echo"> <oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:GNOME/GenericFactory:1.0"/> </oaf_attribute> <oaf_attribute name="name" type="string" value="Echo component factory"/> <oaf_attribute name="description" type="string" value="Bonobo Echo server factory"/> </oaf_server> <oaf_server iid="OAFIID:demo_echo:fe45dab2-ae27-45e9-943d-34a49eefca96" type="factory" location="OAFIID:demo_echo_factory:a7080731-d06c-42d2-852e-179c538f6ee5"> <oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:Demo/Echo:1.0"/> </oaf_attribute> <oaf_attribute name="name" type="string" value="Echo component"/> <oaf_attribute name="description" type="string" value="Bonobo Echo server sample program"/> </oaf_server> </oaf_info> |
stringv types value is represented as follows:
<oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:GNOME/GenericFactory:1.0"/> </oaf_attribute> |
A certain number of attributes have been normalized for OAF. Some of them are mandatory. Their list follows.
Table 1. Normalized attributes
Attribute name | Type | Signification | Mandatory ? |
---|---|---|---|
repo_ids | stringv | the list of all IDL interfaces this component implements | yes |
description | string | a human readable string describing what the component can do | yes |
name | string | a short name for the component | yes |
bonobo:editable | boolean | if component allows editing of its content | no |
bonobo:supported_mime_types | stringv | a list of mime types this component understands as input. In addition to specific mime types, it is possible to include supertypes (e.g. "image/*" or "text/*") or "*/*" to indicate the component can display any mime type. Specifying "*/*" is only necessary if "supported_uri_schemes" is not specified, otherwise it is assumed. This only really makes sense if the component implements one of the following interfaces: Bonobo::PersistStream, Bonobo::ProgressiveDataSink, Nautilus::View. | no |
bonobo:supported_uri_schemes | stringv | a list of protocols this component knows how to handle. This only really makes sense if the component implements one of the following interfaces: Bonobo::PersistFile or Nautilus::View | no |
nautilus:view_as_name | string | a suitable name for use as a view as name (it will be displayed as "View as <foo>" where <foo> is the name). This must be implemented by any Bonobo Embeddables or Controls that can be used as Nautilus views (for the content in the main window, not in the sidebar). | no |
nautilus:required_directory_content_mime_types | stringv | if the component is to be activated on a URI with mime type special/directory, it is only really applicable if the directory contains one of these mime types. As before, supertypes like "audio/*" are allowed. If this attribute is omitted, "*/*" is assumed. | no |
nautilus:required_uri_tester | string | this specifies the OAFIID of a component that implements the Nautilus::URITester interface (see proposal below). If the criteria established by all the other attributes are satisfied, an object with that OAFIID should be activated and its is_applicable() method should be called on the URI to test if it this component _really_, _really_ applies to the given URI. This should be used as a last resort. (Not yet implemented.) | no |
nautilus:sidebar_panel_name | string | a suitable name for use as a sidebar panel label name. This must be implemented by any Bonobo Controls that can be used as a Nautilus sidebar view. | no |
nautilus:recommended_uri_schemes | string | the URI schemes this meta view is most recommended for. If "*" is included, this component is recommended for all schemes. If omitted or empty, it is not recommended for any. (Not yet implemented.) | no |
If bonobo:supported_uri_schemes is specified but bonobo:supported_mime_types is not, it is assumed the component can handle any type of data that might come via that protocol. Some schemes may not even have an associated mime type for any given URI, for instance irc: or news:
If bonobo:supported_mime_types is specified but bonobo:supported_uri_schemes is not, the component is assumed to be able to handle all common URI schemes (possible definition: anything gnome-vfs can handle).
If neither bonobo:supported_uri_schemes nor bonobo:supported_mime_types is specified, it is assumed the component cannot handle any data at all in a general way and should never be generically selected for such purposes.