WebSphere Commerce EnterpriseWebSphere Commerce Professional

Adding a perspective

A perspective is a particular rendering of the IBM Sales Center that contains a predefined combination of views and editors. There are two perspectives in the IBM Sales Center, the Orders and Web Browser perspectives, that enable different sets of tasks. Both perspectives can be open and visible, but only one can be active at a time. You can add a perspective when required:

About this task

To add a perspective:

Procedure

  1. Define an extension to the base Eclipse extension point org.eclipse.ui.perspectives. This declaration contains the following basic elements: id, name, and class.
    
    <extension
             point="org.eclipse.ui.perspectives">
      <perspective
                    name="New"
                    
                    id="com.xyz.perspective.newPerspective">
      </perspective>
    </extension>
    
  2. Create a perspective class to define the initial layout of the perspective. You can write this class from scratch or subclass com.ibm.commerce.telesales.ui.impl.OrdersPerspective, see class API information (Javadoc) for more details. This class must implement org.eclipse.ui.IPerspectiveFactory and its one method, createInitialLayout. Implementers can add views, folders, actions, action sets, and other objects to the page layout. In this example, com.xyz.perspective.NewPerspective is the class that defines the initial layout of the perspective:
    
    package com.xyz.perspective;
    
    import org.eclipse.ui.IPageLayout;
    import org.eclipse.ui.IPerspectiveFactory;
    
    public class PerspectiveFactory implements IPerspectiveFactory {
    
            public void createInitialLayout(IPageLayout layout) {
    
               defineActions(layout);
            }
    }
    

    The method defineActions defines actions that are associated with this new perspective.

    Note: An alternative method is to supply an IPerspectiveFactory that does nothing. Then, you can use the perspective extension mechanism (see the Extending a perspective topic) to define its contents in XML instead of in code.

  3. Define an application to select the perspective. In the WebSphere Everyplace Deployment platform, perspectives are accessed by selecting an application. Applications are defined by using the WebSphere Everyplace Deployment com.ibm.eswe.workbench.WctApplication extension point.
    For example:
    
    <extension
    id="com.xyz.newApplication"
    point="com.ibm.eswe.workbench.WctApplication">
    <DisplayName>New application</DisplayName>
    <Icon>icons/full/eview16/new_perspective.gif</Icon>
    <PerspectiveId>
    com.xyz.perspective.NewPerspective
    </PerspectiveId>
    <Version>6.0.0</Version>
    <Description>This is a new application</Description>
    </extension>