Using Macromedia Flex in a Portal Environment
Integration Scenarios
The portlet specification defines three window states:
- Normal: A portlet in this state typically shares the page with other portlets. Therefore, a portlet should restrict the size of its rendered output in this window state.
- Maximized: A portlet in this state is typically the only portlet rendered in the portal page. A portlet may generate richer content when its window state is Maximized.
- Minimized: Only the title bar for the portlet is displayed.
Flex-based and HTML-based portlets in their Normal window state can co-exist on the same portal page. In addition, the same portlet can use a different rendering technology depending on the state it is in:
- For example, the UI of a portlet can be in HTML when the portlet is in normal state, and in Flex when the portlet is in maximized state.
- The opposite (normal state in Flex, and maximixed state in HTML) is possible too, although it probably makes less sense: it is typically when the portlet is in a maximized state that the user expects the most sophisticated user experience.
- Finally, the UI of a portlet can be in Flex in both its normal and maximized states. There can be significant benefits in using Flex even for a small portlet running in normal state. For example, imagine a stock quote portlet: In a traditional HTML implementation, the entire portal page refreshes every time the user request a quote. This is an expensive process for such a simple operation. Using a Flex-based portlet, you can obtain the data from the back-end system without refreshing the portal page. This paper discusses an example of a Flex-based Stock Quote portlet later.

Figure 2. Portfolio portlet in normal state

Figure 3. Portfolio portlet in Maximized state
You can use the maximized window state to execute complex and self-contained Flex applications. The following screen shot shows the FlexStore sample application packaged with Flex running as a portlet in the maximized state.

Figure 4. The FlexStore sample application packaged with Flex runs as a portlet in the Maximized state.
The portlet specification also defines three portlet modes: view (the only mode a portlet has to implement), edit, and help. Just as you can for window states, you can mix and match the technology used to render the user interface of the portlet in different modes: for example, using Flex for the View mode and HTML for the Help mode.