7.5 Implementing the Sales Workplace example

 < Day Day Up > 



7.5 Implementing the Sales Workplace example

In this section we walk you through the five step Portlet creation process to build a Portlet with Portlet Factory. We highlight a few functionalities that we used to implement searching and Portlet cooperation for our Sales Workplace Portlet.

  1. Start the process by identifying your data source: the customer database.

    click to expand
    Figure 7-41: Database definition

    This is done by creating a database document that contains a reference to the database that you want to portalize. Portlet Factory allows us to specify either the path or the replica ID to a Domino database. In most cases the replica ID will be used.

  2. You need to select the information that is relevant from this database, so do a select statement. Portlet Factory allows you to build selections based on @formula statements or full-text selections. Remember: you are building a definition similar to a Notes view. If you have access to the design of the Domino database you can go ahead and copy and paste a view selection formula from a view.

    click to expand
    Figure 7-42: Selection definition

  3. This step is used to define a layout. As mentioned previously, the layout is a mixture of HTML and the @formula language. Portlet Factory layouts are made up of different layout components. You find layouts for the overall Portlet layout-this is called Definition Template-as well as layout components for the individual result set row. In this example you are going to focus on the layout of the individual result set row. Portlet Factory names this a Layout Template.

    click to expand
    Figure 7-43: Layout definition

    The layout also includes an option for sorting. As in a Domino view, you can specify multiple sorted columns. Columns in the Portlet context refer to columns of the table layout.

  4. In this step you summarize all the previous steps. You take your database, selection, and layout and put them into a query-the analogy of a Domino view.

    click to expand
    Figure 7-44: Query definition Basics tab

    On the Basic tab of the Query, select the database and selection definition for the Query. These are the elements defined in the previous steps.

    click to expand
    Figure 7-45: Query definition Layout tab

    On the layout tab, choose the template for the data display of the individual result set row as well as the Form template that is used to open the customer profile once the user clicks on a customer name inside of the Portlet.

  5. Finally, the query gets put into a Portlet definition. Portlet definitions can contain more than one query. This is relevant if you want to merge data from multiple Domino databases. In this example we just have one query.


    Figure 7-46: Portlet definition

  6. This was the final step in the definition process. The Portlet is now ready for creation. This is done by an automatic process that takes the Portlet definition and renders a portlet out of it.

    click to expand
    Figure 7-47: Automatic portlet creation

  7. Once this process is finished you can deploy the Portlet to your Portal and place it on the Sales Workplace. The result should look similar to Figure 7-48.


    Figure 7-48: The resulting Portlet

Search

In this section we highlight how we implemented the search and Portlet cooperation.

To enable the search in the customer Portlet we added the code in Example 7-2 to the Portlet Definition Template.

Example 7-2: Customer search

start example
 <form "Search" action="<@@PortletViewAction@>" method="post">    <input name="<@@ContentSearchName@>" size="40">    <input type="submit" name="Search" value="Search"> </form> 
end example

In the layout definition, we created a basic HTML form with a search field. The trick is to give the search field the special name <@@ContentSearchName@> and use the @formula <@@PortletViewAction@> to create an Action URI to submit the form to the Portlets action listener. In the query definition we can define what fields Portlet Factory should include in the search.

Portlet cooperation

Enabling Portlet cooperation is as straightforward as implementing searches. In our example we want to implement the following Portlet cooperation:

  • We search in the customer Portlet. Once we select a customer, the customer detail Portlet displays the customer details information.

  • The customer contacts show only the contact personnel of the selected customer.

  • The customer activity Portlet displays a view with the latest activities with that customer.

Example 7-3: Portlet cooperation

start example
 <a href="<@@sendmultiplemessage(PF_Customer_Detail;0;@DocumentUniqueID; PF_Contact-Person;1;<@CustomerNumber@>;PF_Customer_Activity;1;<@CustomerNumber@ >"><@CustomerName@></a> 
end example

These three actions are triggered with one line of @formula code. We build an HTML link that embeds the @sendmultiplemessage formula. This allows us to send multiple specific messages to other Portlets and have them respond to it.

After a user clicks on a customer name link, the other three Portlets will respond according to the defined behavior.

Summary

Building Portlets with CONET's Portlet Factory is easy for Domino developers who know the @formula language. The building process is straightforward and similar to building forms and views with the Domino designer. Results can be achieved fast and with minimum learning effort.

We were especially impressed by the good performance and scalable architecture of the tool.

However, we want to point out the following consideration with respect to the development environment: The use of the Notes client as the development environment makes coding difficult. We also found that a debugger would be a useful enhancement.



 < Day Day Up > 



Portalizing Domino Applications for Websphere Portal
Portalizing Domino Applications for Websphere Portal
ISBN: 0738499811
EAN: 2147483647
Year: 2003
Pages: 103
Authors: IBM Redbooks

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net