View Full Version : how can i configure an application page with vldocking?
geronimo013
May 2nd, 2007, 12:03 AM
Hello,
currently I use a VLDockingApplicationPageFactory and each view is configured via VLDockingViewDescriptor.
As far as I understand things behind the curtain, at creation of the first view, the desktop and the application-page where created implicitly.
Now I found out, that the application page already has the ability to save and restore a layout - if it has a valid property "initialLayout".
Is that property configurable from the application-context and/or how can I setup such property?
Any hint is appreciated!
rdawes
May 2nd, 2007, 07:54 AM
The InitialLayout is configured in the VLDockingPageDescriptor, and is then transferred into the VLDockingApplicationPage when it is constructed.
Here's an example from my application:
<bean id="proxyPage" class="org.springframework.richclient.application.vldocki ng.VLDockingPageDescriptor">
<property name="viewDescriptors">
<list>
<value>siteMapView</value>
<value>conversationListView</value>
<value>conversationView</value>
</list>
</property>
<property name="initialLayout">
<bean class="org.springframework.core.io.ClassPathResource">
<constructor-arg type="java.lang.String">
<value>/layouts/proxyPage.xml</value>
</constructor-arg>
</bean>
</property>
</bean>
This is not a 100% solution, since if you distribute the initial layout as part of your jar, is is not writable, and will never be updated. If the layout file is in the filesystem and is writable, it will be updated when the page is closed.
I think I need to change it to something like:
public void setLayout(Resource userLayout, Resource defaultLayout);
Where defaultLayout would typically be a resource provided by the app developer, and distributed in the jar, and userResource would be a reference to a location in the filesystem that the user can write his updated layout to.
geronimo013
May 2nd, 2007, 11:21 AM
Thank you very much for your attention and your fast reply!
Yes, I guess, that proxy page is the missing link, I was looking for.
I followed the sample and there is no such definition.
I former missed also any definition for the desktop.
From the code I saw, that the desktop is quite standard, so ...
- Do I understand it right, that the proxypage has no java view-class and the viewDescriptors are the Views wrapped in a VLDockingViewDescriptor?
- Will all defined views get opened on application start?
I consider the readonly context from the jarfile not as a shortcoming, but beeing the same as system- and user-preferences. I'm experimenting with those preferences, which i.e. I setup being root and in the application I use the system preferences as default. All save-operation will always happen to the user-preferences.
I also thought about putting the preferences into the database - but that has the shortcoming, that no userpreferences are available before successful database connection.
For the moment I try many similar things (i.e. flexdoc and vldocking), just to learn and understand the framework. I'm not tied to any design decision yet.
May be, it makes sense, putting the layout-definition in a bean-layer, wich could be populated from any kind of source, i.e. database, application-context, preferences, whatever ...
... by the way:
sometimes I have the effect, that the whole application freezes, when I open a new view. It does not depend on the view, cause when I kill the app and start again it works as it should.
Do you know this effekt? - Am I doing something wrong?
kind regards
Geronimo
rdawes
May 2nd, 2007, 11:35 AM
Note that "proxyPage" is a definition from my own application. If you want to define your own pageDescriptor, you would likely call it something different.
As you can see in the above example, the VLDockingPageDescriptor includes methods to specify which Views should be added by default. However, if you supply an InitialLayout, the default Views will NOT be used.
You may want to try using the VLDocking Layout designer (accessible from the VLSolutions website) to create your initial layout (in my case "/layouts/proxyPage.xml").
To answer your questions:
* The VLDockingPageDescriptor is used to configure the VLDockingApplicationPage. The VLDockingApplicationPage has a "view-class", in that it presents a JPanel with a VLDocking Desktop contained in it.
* The defined views will only be opened if no "initialLayout" is defined.
Sorry, I have not experienced lockups as you describe.
geronimo013
May 2nd, 2007, 12:48 PM
Note that "proxyPage" is a definition from my own application. If you want to define your own pageDescriptor, you would likely call it something different.
So if the name matters, is it the "startingPageId" from LifeCycleAdvisor?
The VLDockingPageDescriptor is used to configure the VLDockingApplicationPage. The VLDockingApplicationPage has a "view-class", in that it presents a JPanel with a VLDocking Desktop contained in it.
Sorry, my question was not precise enuf.
Is the view-class of your proxyPage the internal/default view from the framework, or did you create a view-class in your application-layer?
In my context-definition, each VLDockingViewDescriptor has a property viewClass, which refers to a class from my application layer.
... or in other words: do I have to create a view-class for the proxyPage?
Sorry, I have not experienced lockups as you describe.
No prob - I considered it worth to ask about.
I'm a very beginner, so there's stil a lot to learn.
geronimo013
May 2nd, 2007, 01:30 PM
Ok, seems to work. Many thanks for your support!
I put "proxyPage" as startingPageId and the layout-loading/-saving also works as expected. I gave the app an empty file as initial layout. Then I arranged the Views as I like it and after closing the app, I got a valid layout description. Fine!
Also I got a bit closer to the freezing effect.
I was astonished as it seemed that I could reproduce (?) the effect.
I start the app from eclipse with lots of debugging enabled, so the app "runs" quite slowly. Now I have the suspicion, that the freezing happens, when I open a view, before the splashscreen has been closed.
Don't know, wether this could be related - it's not easy to track down the situation, cause the logging stops also.
rdawes
May 2nd, 2007, 01:58 PM
Glad you got it sorted out.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.