Java Custom Web layout - java

Currently i am developing a CRM web applications using J2EE . For this application i need to support the localization for the layout such as menu names.
At the same time i need to allow admin to customize the layout such as adding new menu or deleting the menu and changing themes. I am planned to use XML for the layout specifications
Anyother methods to achieve this one?
Please help me .
Thanks in advance
Dilip

I think that If you use an XML you have to write your Parsers to read/write the settings updated by the users which will be time consuming and may be complicated.
I would suggest to use Database and put these Menus in master tables. Then you can create a table (for many to many relationship with menus and users) which contains the settings updated by the user. At the login or before generating the menus, you can get the menus specific to that user and display it as per your requirement. You can do the same for Themes.
I think, this would be bit easier and readable too.

What you want is Customization / Personalization, not Localization. Customization / Personalization involves a lot of work. There are special frameworks such as Oracle's WebCenter Framework that are proficient at this. If you get into writing this customization framework yourself, you will be developing and maintaining a lot of plumbing which will take time away from implementing real business functionality. I suggest that you do not re-invent the wheel and try to re-use an out of the box framework.

Related

What is the most efficient way to render a dynamic menu

What is the most efficient way to make a dynamic menu, in my database I have different user roles and each role has different permissions to access pages, what would be the best way to create a menu that is generated every time you access. What would be the best way to avoid slow loading of the page?
I'm using the technologies: Primefaces, JSF, java..
Your question directly not connected with JSF. You should develop your application logic yourself, JSF/Primefaces just can help you render menu in fron tend.

caption composite

Is there any header composite availabe in swt? What my requirement is I should have one user login form available in SWT. That form should be able to show inside the view. And that form should have one caption also. First I thought to use some kind of dialogs. But I dont want to
use any dialogs. Is there any way which I can implement the same?
There is an API called Eclipse Forms which was only introduced in Eclipse 3.3, so many books don't mention it. It lets you organize forms in a somewhat web-like way, with headers and sections and boxed groups and such. I think this would probably meet your needs.
Try to look at LoginDialog in Opal SWT Widget Library. It provide a ready-to-use and configurable login dialog. Maybe it will be suitable for you.

Dynamic GUI Framework Designing

There is a Scenario to be developed for a 3-tier Application .We need to design a Framework or a utility sort of thing .
In tradional aspect of GUI Designing , either we tend to create a static gui page and code the elements on it along with other properties of the elements such as (disabled/enabled,image source,name ,id ,which function to be called under onclick event.) or we tend to drag and drop the elements from the control pallete provided by variety of gui frameworks.
Certain things i need to design a POC so that we can develop this concept.
There must a utility ,such that during creation of screen layout , that screen should be saved in the database(RDBMS) with a screen number.
All the Events related to that control should be saved in some other table which will be dynamically mapped during the calling of screen number by the user.
When the user call that screen ,a generic function should be invoked which'll call the screen file from the database and apply all the properties ,events,etc at runtime and the final output will be displayed to the user.
This POC will help the us to customised the screens according to our usage.also all the code will seperated which can easily be used for some other development process.
Thanks
Amit Kalra
-- Migrated from Answer --
Iam not getting it with GUI framework supporting serialization .
The Concept should be like this .
The Developer has a utility like a Screen Painter in which developer can drag drop controls ,now this file will get saved in 2 formats ,first one is a source file and another on is the compiled one (say compiled in a .cpp format or any other format).
now on a client side ,when the user enters any transaction number ,there should be a utility which can load the file from the database ,also apply all the functions applicable to each event .
This Concept is similar to wat is there in SAP R/3.
please help me in undergoing this POC.
Thanks
If I understand your question, you are asking for a GUI framework supporting serialization. There are several ones supporting this. Two I have been using are the FOX Toolkit (C++, cross-platform) and the Windows Presentation Foundation (.NET), which is using the XAML format for serialization.
You can achieve the purpose by using the Serialization support of many popular languages. Even if there is no support for that it shouldn't not be very difficult, storing essential data in some configuration files (or as such in your case storing in a DB) will do the expected like controls details, their position etc. But standard frameworks will make your life easy in long running.

Achieving multipage GWT website

I have a question on managing a multipage GWT website. For now I only have one html page in which I embed lots of divs to store the widgets that I use. Then, according to the user's actions I add or remove the necessary divs using GWTs DOM class. Therefore, I use only one html page to simulate multiple pages. Is there a better way to do this?
Thanks.
I disagree with cletus. In my experience, gwt is just as good at enhancing multipage apps as it is at one-page applications like gmail. It just depends on what you're requirements are for your web app.
I'd agree that writing one-page applications is definitely the place to start, but once you get the concept of gwt modules, they can easily be used to add custom javascript to multiple pages.
To answer your question; I think your design of using one page and swapping out widgets is perfectly acceptable.
These talks might help to give you ideas about when multi page apps might make sense:
Effective GWT: Developing a complex,
high-performance app with Google Web
Toolkit
Progressively Enhance AJAX
Applications with Google Web Toolkit
and GQuery
GWT is designed primarily for one-page applications. There is good reason for this. You take a hit every time you do a page transition with so much Javascript. The page load times are so noticeable. Think of goign to GMail. You have a period of 1-5 seconds where it loads. Now how would your user experience be if that happened whenever the user went to a new page and that happened a lot?
Neither do you need to put every widget on the page. You can dynamically create and add (or remove) widgets as you see fit. It's a somewhat different approach to how you'd normally do a traditional multi-page HTML-centric Website.
Something I have found useful is using the GWT DeckPanel. A deck panel is like a deck of cards where each "card" is a GWT Panel. You can treat these "card" panels like pages and initialise and populate them with widgets at startup. You can then respond to user navigation actions by bringing a "card" panel to the front of the deck so that the user can see it.
The sort of approach works best as part of either the MVC (model-view-controller) or MVP (model-view-presenter) design pattern.
In order to achieve such a thing, you should have history management - like Gmail, which can use back/forward. It is achieved by anchors, and this class
In addition to the good DeckPanel and History suggestions, I'd also add that you can get GWT to split your app into multiple JS files that are dynamically loaded as needed with runAsync. This let's you have a very fast initial page load and load the new "pages" as the user needs them.
LazyPanel.createWidget() is a convenient place to stick a runAsync call that can be combined with DeckPanel or TabPanel to dynamically load content and UI code. A controller/presenter for navigation is even better (though a little more work on the programmer sometimes).

ADF Custom Components

Where is the best place to find custom compnonents? Ideally a repository, as opposed to finding a few here and there. We are currently about to re-design our look and feel UI for about 200 forms and we were hoping to find a lot of custom components... We were told they were everywhere by the pre-sales architect but even a simple google search returns nothing.
If you use Oracle ADF 11i Faces, you have over 100 Components out of the box (According to the Oracle site even over a 150 Ajax-enabled JSF components). Try using these first (could be better than custom components).

Categories