Skip to main content

Dynamic loading

4 replies [Last post]
rmcintosh
Offline
Joined: 2006-02-17

Is there a way to dynamically load and display components via the XML configuration? For example, say my main app is just a shell with a login screen. Based on that login, I want it to load one of several different jdnc files.

Is that possible?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rameshgupta
Offline
Joined: 2004-06-04

> Is there a way to dynamically load and display
> components via the XML configuration? For example,
> say my main app is just a shell with a login screen.
> Based on that login, I want it to load one of several
> different jdnc files.
>
> Is that possible?

JDNC does not have any intrinsic support for access control based on user identity. The JDNC Application class in the runner package only knows about a single JDNC document that is specified in the application's JNLP document, and uses that for all users under all circumstances.

To accomplish what you are after, you must implement your own authentication mechanism to handle your login screen, and serve different jdnc files as appropriate to your shell. You can also look at the code for the JDNC Application class to see how your shell might invoke the object realizer to process the file served by your web application.

Ramesh

rmcintosh
Offline
Joined: 2006-02-17

my question had nothing to do with user access. That was just a scenario for what I was really asking, which is can an application 'manually' load components via a descriptor, instead of it being automatic by the runtime.

Lets say that I have an app that starts up but it is just a shell, or a minimal framework (think Eclipse), and because it is say oh Wednesday it loads a different set of components (call them plugins, portlets perhaps, etc) and displays them.

rameshgupta
Offline
Joined: 2004-06-04

> my question had nothing to do with user access. That
> was just a scenario for what I was really asking,
> which is can an application 'manually' load
> components via a descriptor, instead of it being
> automatic by the runtime.
>
> Lets say that I have an app that starts up but it is
> just a shell, or a minimal framework (think Eclipse),
> and because it is say oh Wednesday it loads a
> different set of components (call them plugins,
> portlets perhaps, etc) and displays them.

Yes, sure.

Your shell could do something like:
ObjectRealizer realizer = Application.getObjectRealizer();
Object object = realizer.getObject(myResourceURL);
where, myResourceURL points to any arbitrary JDNC document you've defined.

Ramesh

rmcintosh
Offline
Joined: 2006-02-17

Thanks Ramesh, that is precisely what I was looking for.