ADF Custom Components - java

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).

Related

Vaadin ComboBox text color extension

I am working with Vaadin for a long period of time, but one thing really annoys me: The colorless ComboBox. As I found out, it is not possible to set the items via HTML or to add a color style attribute via ItemStyleGenerators. The last option to do this is implementing extensions as mentioned here: Question-link
But I have really no idea how to do this. Implementing extensions is really not as clear as possible and there are not that many easy tutorials on how to do this.
Has anyone an idea for how to do this or a good link to any detailed tutorial site?
To realize what extensions are, you must to read about client side Vaadin development. I suggest to start with: Client-Side Development
After that you can start to think about extensions.

Adding content to Liferay via API

I am starting using Liferay Portal and I have two basic needs which I would like to achieve with Liferay.
Is there a posibility to add content to CMS through API level? I would like to insert some data "from code".
More important. How to achieve such situation that for every created user there will be its own homepage generated with some predefined template elements on it?
I have tried to Google something so far, but I did not find it helpful. Maybe some keywords?
After some analysis of documentation devoted to services and ServiceBuilder I realized that it is not what I want.
Let me show an example based on Websphere.
In Websphere we have bunch of EJB components available to perform some actions, exchange information with portal, easy to use. Isn't there any similar mechanism in Liferay not involving web services?
My recommendation for this kind of question is to take a look at the sevencogs-hook sourcecode. The structure of this hook is basically just a long script that runs once, setting up a complete demo site with users, sites, pages, content etc. The code runs once (after the first deployment) and then never again. There are no (obvious) conditionals, no context to understand etc.
You can basically just step through everything and - in that process - understand how content (and pages, images, blog posts, etc.) are created and positioned on pages in Liferay.
This hook accesses the Java API, a very similar API is available through Webservices. Basically all of Liferay's portlets also use the same API to do their business.
Edit: Additional information to keep this answer valuable/current: Sevencogs is discontinued, but still available in old releases (source & binary). The API has slightly changed, so compiling/running it will need a bit of work. James Falkner has blogged about the leftovers and lessons learnt - those snippets are extracted from sevencogs and contain the relevant code pieces to work with the API.
Looking at this page from the documentation: It smells like a SOAP interface (they mention some sort of document uploader service and I've read axis).
You'll find some url examples that should give a list of available webservices.
For number 1, you can use the one of the:
JournalArticleLocalServiceUtil.addArticle()
methods to programmatically add Liferay Web Content from a portlet. If you download the Liferay Portal Source you can see the structure of these methods.
For number 2, can create page templates with preconfigured portlets on them (through the Plugins-SDK), and then use the API to programmatically create the pages using one of the:
LayoutLocalServiceUtil.addLayout()
methods.
If you have any more speific questions about these comment back, and I hope this helps!

Java Custom Web layout

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.

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).

Tree component in JSF

What is a good tree component in JSF. I also want the user to be able to select one (using radiobutton) or more than one node (using checkboxes) from that tree component. Is there any existing component that meets my need?
thanks
Vikas
I've used many of the rich faces components and they all work very well. Easy to implement as well. Have a look at http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf
Just search for your component from the component based frameworks available here. I have seen tree components developed by ICEFaces. Not sure whether it specifically addresses your needs of using radio/checkbox with tree. Neverthless the demo url available in the above link will help you decide.
Note: I havent used these frameowrks to write production code. So you also need to check for performace issues related to each of these frameworks before choosing one.
Look to my blog http://blog.jvsystem.pl - richfaces tree component - there is simple tutorial how to create tree in richfaces.
You can try myFaces Tree component if you are using this library in your application.
Other option is rich faces tree.
There might be more if you google for better and suitable option for your need.

Categories