3D PLM Enterprise Architecture

Webtop

The Portal Registry

The declaration and the use of the registry of the Portal
Technical Article

Abstract

This article describes the Portal registry.


The Portal Registry MIMEtypes.xml File

The Portal registry is based on the MIMEtypes and Mailcap mechanism. All this is described in an xml file named MIMEtypes.xml. As most of the Portal configuration file, this file can also be prefixed by third party applications to have a custom MIMEtypes.xml file.
Here is an example of a MIMEtypes.xml file:

<MIME-Types>

<MIME>
  <Type>
    text/html
    <Command value="default">
      bean://com.dassault_systemes.catweb.browser.EBrowserCATlet?paramName=value
    </Command>
  </Type>
  <Desc> Hyper text </Desc>
  <Extension> html </Extension>
  <Extension> htm </Extension>
</MIME>

<MIME>
  <Type>
    application/java-bean
    <Command value="default"
      newInstance="ALWAYS"> com.dassault_systemes.catweb.bean.catlet.CATletBeanContainer
    </Command>
  </Type>
  <Desc> CATlet bean container </Desc>
  <Extension> class </Extension>
</MIME>

<MIME>
  <Type>
    application/catia
    <Command value="default">
      com.dassault_systemes.catweb.local3D.controller.LocalCATlet3D
    </Command>
    <Command value="Local3D">
      com.dassault_systemes.catweb.local3D.controller.LocalCATlet3D
    </Command>
    <Command value="Swing3D">
      com.dassault_systemes.catweb.basev4.catlet.Modeller3DCATlet
    </Command>
      <Command value="Local2D">
        com.dassault_systemes.catweb.local2D.controller.LocalCATlet2D
    </Command>
      <Command value="Remote2D" mode="CONNECTED">
        com.dassault_systemes.catweb.local2D.controller.RemoteCATlet2D
    </Command>
      <Command value="Remote3D" mode="CONNECTED">
        com.dassault_systemes.catweb.remote.controller.RemoteCATlet3D
    </Command>
    <Command
      value="Reporter">
      com.dassault_systemes.catweb.bommy.BOMCATlet </Command>
  </Type>

  <Desc>
    CATIA model
  </Desc>

  <Extension> model </Extension>
  </MIME>
</MIME-Types>

Each MIME type is declared with the MIME tag. Inside this tag, you will find the Desc tag that gives a short description of the type, a list of Extension tag that specifies all the file extensions that support this type and the Type tag that gives more information about the type.

Inside the Type tag you will find the MIMEtype (application/java-bean or text/html) as well as a list of commands that represent an application that can handle this type. Each command is described by its value (default for a default application, Local3D for an application that can visualize the data locally in 3D ...) and the class name or the URL (bean:// with arguments) of the bean application that will handle the type. A command can contain a parameter newInstance (not mandatory) which define if a new instance of the application must be created for each document (newInstance="always") or only one instance must be created and used by each document (newInstance="never"), or the creation of a new instance depends on the request (newInstance="default", the default value). For more details about these mechanisms, please refer to the URL mechanisms article [1].

The Command tag may also contains an attribute mode which describes in which mode this command is intended to be used: when connected to a server, when running as a nomade or simply in both mode. The right values for this attribute are CONNECTED, BOTH or NOMADE (all three in uppercases).

[Top]

How to Manipulate the Portal Registry in Java

The Portal registry can be accessed through the com.dassault_systemes.catweb.base.net.registry.PortalRegistry object. Its API as well as the API of classes related to this one are described inside the PortalURI paper [1].
Here is a list of how-to examples to manipulate the registry:

[Top]

How to Get the MIME Type from a File Extension

// --- get a PortalMIMETypes object
PortalMIMETypes type = PortalRegistry.getMIMETypesForExtension(".myExtension");

// --- get the mime type
String mimetype = type.getType();

[Top]

How to Get the List of Command Descriptions that Can Handle My Type

// --- get a PortalMIMETypes object
PortalMIMETypes type = PortalRegistry.getMIMETypesForExtension(".myExtension");

// --- get an array of commands
PortalMIMECommand[] commands = type.getCommandsList();

// --- get the description of each command (will get the result of the value attribute of the Command tag)
String descriptions = new String[commands.length];
for(int i=0;i<commands.length;i++)
  descriptions[i] = commands[i].getDescription();

[Top]

How to Get the Names of the Already Instantiated Applications that Can Handle My Type

// --- get a PortalMIMETypes object
PortalMIMETypes type = PortalRegistry.getMIMETypesForExtension(".myExtension");

// --- get the mime type
String mimetype = type.getType();

// --- get the list of instance names
String[] names = PortalRegistry.getInstancesNameForType(mimetype);

[Top]

How to Get My Data Handled by a CATlet of a Specific Type

First, you must get the command description of the application you want to handle your data. Then you must construct an url on your data and add the following argument inside your url : Command=commandDescription. Then construct an URLEvent object and fire it.

For example, if I want to visualize a CATIAV4 model inside a Local3D viewer, I will construct the following url:

file:/u/users/ddl/model/CUBES.model?Command=Local3D

[Top]

How to Get My Data Handled by an Already Instantiated CATlet

First, you must get the instance name of the application you want to handle your data. Then you must construct an url on your data and add the following argument inside your url : InstanceName=name. Then construct an URLEvent object and fire it.

For example, if I want to visualize a CATIAV4 model inside the Local3D-1 viewer, I will construct the following url:

file:/u/users/ddl/model/CUBES.model?InstanceName=Local3D-1

[Top]


References

[1] The URL Mechanism for the ENOVIA Portal
[Top]

History

Version: 1 [Feb 2000] Document created
[Top]

Copyright © 2000, Dassault Systèmes. All rights reserved.