Joe,
> i assume i put this code in the awake methode of my AWApplication
> subclass right?
That's one option. You'll want to make sure that your web app doesn't
include the metaui-jpa jar -- if it does that will try to assign its
provider instead of yours.
Since you'll probably build multiple apps with this support, you might
want to put it all in a separate JAR. If you look the source
directory for metaui-jpa you'll notice an "aribaweb.properties" file.
packaged-resource-extensions=awl,oss
depends-on=ariba.metaui
initializer=ariba.ui.meta.jpa.Initialization.initialize
use-namespace-from-package=ariba.ui.meta
This line "initializer" points at a static class method, "initialize",
in ariba.ui.meta.jpa.Initialization, that does the registration. This
happens because on startup AW scans for jars with aribaweb.properties
files and automatically calls their initializers (in dependency order).
> does the framework pick my application subclass automatically or there
> is some configuration to direct it ?
If it's in a package called "app" and is named "Application" we'll use
yours.
> Oh... slowly please....
> let's divide it into simple questions
> first : does the metaUI depend on the JPA annotation to know about
> object->object relationship (yes or no)?
NO.
> second : if so and if i use other technology(by providing my
> ObjectContext) can i use these annotation to just make the framework
> happy (this will b a temporary work around)
YES
> third: what r annotation listeners ? like what in the framework? class
> name please...
There's a lot behind the answer to your questions -- I'm not sure that
writing a design overview
on metaui on question at a time in an email thread is going to be
best. At this stage if you want to
write support for a whole other persistence layer you're ultimately
going to have to trace through the
code. I'm not sure that I'd want to make that my first project...
There are two types of "annotation listeners":
1) AWJarWalker.AnnotationListener
- Must be registered *early* (by the initializer in
aribaweb.properties)
- Called for all appearances of annotations on all classes appearing
in jars (that themselves have an aribaweb.properties file).
- Handler should do minimal work at this stage -- you don't want to
bog down app startup by eagerly doing processing on all of your domain
classes
- See use in ariba.ui.meta.jpa.Initialization for an example
2) ObjectMeta.AnnotationProcessor
- Called the first time an annotation is seen on a class that is
about to be used for the first time in MetaUI
- Code here can do more work, since this is only performed (lazily)
when classes are first *used*
- See use in ariba.ui.meta.jpa.Initialization for an example
> and what is Meta.ValueQueriedObservers and how it is used? the api
> docs says nothing and no pointers in the api docs to any implemention
Don't expect to find doc for these kind of internals any time soon
(i.e. load up the source in IDEA and start looking for usages).
You'll find examples like this (in ObjectMeta):
registerKeyInitObserver(KeyClass, new
IntrospectionMetaProvider());
This will cause IntrospectionMetaProvider() to have its method
void notify(Meta meta, String key, Object value)
called the first time and class name is used for the first time in a
rule. In this case, ObjectMeta uses this as a trigger to introspect
the class and register rules based on fields and actions it finds.
(This is also where it notices annotations and calls any registered
ObjectMeta.AnnotationProcessor handlers).
Again, I'd really say that unless you're really adventurous and really
willing to trace through a pretty intricate rule engine, you may want
to get a few simpler AribaWeb projects under your belt before
proceeding down this path.
Hope this helps...
- craig