When developing a container, you can do the following:
Define a <Container> element in the display profile that references an existing <Provider> element. For example, to create a custom Container definition that uses the JSPTabContainerProvider:
<Container name="MyTabContainer" provider="JSPTabContainerProvider"> <Properties/> <Available/> <Selected/> <Channels/> </Container>
Define a <Provider> element in the display profile that references an existing container provider class. You must also define the container. For example, create the custom Provider definition that uses the JSPTabContainerProvider container provider class:
<Provider name="MyTabContainerProvider" class="com.sun.portal.providers.containers.jsp.tab.JSPTabContainerProvider"> <Properties/> </Provider> <Container name="MyTabContainer" provider="MyTabContainerProvider"> <Properties/> <Available/> <Selected/> <Channels/> </Container>
Define a container provider class that extends an existing container provider such as JSPTabContainerProvider. You must also define the container in the display profile. For example:
public class MyTabContainerProvider extends JSPTabContainerProvider { } <Container name="MyTabContainer" provider="MyTabContainerProvider"> <Properties/> <Available/> <Selected/> <Channels/> </Container>
Define a container provider class from scratch that extends ContainerProviderAdapter. You must also define the container in the display profile. If you create a container by extending the container provider class, then it also needs to implement the ContainerProvider interface:
public class MyTabContainerProvider extends ContainerProviderAdapter implements ContainerProvider { } <Provider name="MyTabContainerProvider" class="package.MyContainerProvider"> <Properties/> </Provider> <Container name="MyTabContainer" provider="MyTabContainerProvider"> <Properties/> <Available/> <Selected/> <Channels/> </Container>
You cannot create a container provider by just extending the Provider class. By definition, a container must implement the ContainerProvider interface. ContainerProviderAdapter does this. See the Sun Java System Portal Server 7.1 Developer’s Guide for more information on creating custom container providers.
If you write a new class file, it must reside in the PortalServer-DataDir/portals/portal-ID/desktop/classes directory. You can change this location by editing the PortalServer-DataDir/portals/portal-ID/config/desktopconfig.properties file. The providerClassBaseDir setting in the desktopconfig.properties file determines the directory where the classes will be picked up.