Package com.dassault_systemes.catweb.base.net.url

   
Class PortalURL

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catweb.base.net.url.PortalURL
Class Location

Framework : PortalBase

Module : PLBbase

Class Description

public class PortalURL

the PortalURL includes the class java.net.URL . It exports the same mecanism provided by Java and will be able to integrate dynamically new protocols without API modification. This imply the creation of specific classes to support each protocol. These classes must inherits from URLStreamHandler. See @see java.net.URL.URL() comments in the JDK API documentation for more details. PortalURL scheme : protocol://username:password@server_name:portNumber/data_origin.data_extension?arg1=value1&arg2=value2 sample : remotefile://my_server:1570/u/users/my_user/my_file.ext?my_arg=my_value

   All Implemented Interfaces:
Transferable
Field Summary
String COMMAND_INSTANCE_NAME
String NEW_INSTANCE_NAME
String COMMAND_NAME
String MIME_TYPE
String NO_ACTIVATION
String ARG_WITH_NULL_VALUE
String ARG_WITH_MULTI_VALUE
String EPL_NO_MIME_TYPE
int dot
int questionMark
String ampersand

Constructor Summary
PortalURL(String portalURL)
PortalURL(String protocol, String hostname, int portNumber, String dataOrigin, String dataExtension, String username, String password, Hashtable argumentsTable)
PortalURL(PortalURL contextUrl, String subURL)
PortalURL(URL contextUrl, String subURL)

Method Summary
void initPortaURLWithString(String portalURL)
String getProtocol()
String getUsername()
String getPassword()
int getPort()
String getHost()
String getDataOrigin()
String getDataExtension()
String getFile()
String[] getArgumentList()
String getValueOfArgument(String argument)
Vector getValuesOfArgument(String argument)
String getQuery()
String getCommandName()
String getCommandInstanceName()
String getMIMEType()
String getContentType()
InputStream openStream()
String getPostData()
void setPostData(String PostData)
String toStringWithoutSpecifiedArguments(boolean portalArgumentsFlag, String[] arguments)
String toString()
boolean equals(Object obj)
URL getURL()
URLConnection openConnection()


Field Detail

COMMAND_INSTANCE_NAME

    String COMMAND_INSTANCE_NAME
Reserved argument name for command instance name: "InstanceName"


NEW_INSTANCE_NAME

    String NEW_INSTANCE_NAME
Reserved InstanceName in order to specify the creation of a new instance


COMMAND_NAME

    String COMMAND_NAME
Reserved argument name for command class name: "Command"


MIME_TYPE

    String MIME_TYPE
Reserved argument name for MIME Type name: "MIMEType"


NO_ACTIVATION

    String NO_ACTIVATION
Reserved argument name in order to specify to not activate the CATlet


ARG_WITH_NULL_VALUE

    String ARG_WITH_NULL_VALUE


ARG_WITH_MULTI_VALUE

    String ARG_WITH_MULTI_VALUE
See IR 366397 : arg=value1&arg=value2


EPL_NO_MIME_TYPE

    String EPL_NO_MIME_TYPE
Reserved argument name in order to specify to not get MIMETypes from URLConnection Usefull for http script URLs like CGIs which should not be executed several times.


dot

    int dot


questionMark

    int questionMark


ampersand

    String ampersand


Constructor Detail

PortalURL

    PortalURL(String portalURL)

PortalURL constructor. The url is given as a String. Throws a MalformedURLException if the given String is not a PortalURL.

Parameters:
portalURL
- the string representation of the url.

PortalURL

    PortalURL(String protocol, String hostname, int portNumber, String dataOrigin, String dataExtension, String username, String password, Hashtable argumentsTable)

PortalURL constructor. The url is given element by element. In some cases, some elements mais be null or -1 (for port number : default port taken) The password, if specified, is given encrypted.

Parameters:
protocol
- the name of the protocol
hostname
- the name of the host
portNumber
- the port number (-1 for default port)
dataOrigin
- the data origin of data specified by the url
dataExtension
- the extension of the data specified by the url
username
- the user name for protocol with authentication
password
- the encrypted password protocol with authentication
argumentsTable
- the arguments of the query of the url

PortalURL

    PortalURL(PortalURL contextUrl, String subURL)

PortalURL constructor. Creates a URL by parsing the specification subURL within a specified context. If the contextUrl argument is not null and the subURL argument is a partial URL specification, then any of the strings missing components are inherited from the contextUrl argument.

Parameters:
contextUrl
- the PortalURL use for missing argument of the subURL
subURL
- the string representation of the PortalURL to create

PortalURL

    PortalURL(URL contextUrl, String subURL)

PortalURL constructor. Creates a URL by parsing the specification subURL within a specified context. If the contextUrl argument is not null and the subURL argument is a partial URL specification, then any of the strings missing components are inherited from the contextUrl argument.

Parameters:
contextUrl
- the PURL use for missing argument of the subURL
subURL
- the string representation of the PortalURL to create

Method Detail

initPortaURLWithString

    void initPortaURLWithString(String portalURL)


getProtocol

    String getProtocol()

Returns the protocol used to retreive the data (http, enovia, cdm, remotefile ...) Mapped to @see java.net.URL#getProtocol()


getUsername

    String getUsername()

Returns the username used for authentication. May be null.


getPassword

    String getPassword()

Returns the password used for authentication. The password is not encrypted


getPort

    int getPort()

Returns the port number used for the connection. Mapped to @see java.net.URL#getPort()


getHost

    String getHost()

Returns the hostname of the server on which reside the data Mapped to @see java.net.URL#.getHost()


getDataOrigin

    String getDataOrigin()

Returns the data origin. In some cases, the data origin may also contains the data extension.


getDataExtension

    String getDataExtension()

Returns the data extension.


getFile

    String getFile()

Returns the file. (DataOrigin.DataExtension) Same method as @see java.net.URL#getFile()


getArgumentList

    String[] getArgumentList()

Returns the list of all arguments contained in the URL


getValueOfArgument

    String getValueOfArgument(String argument)

Returns the value associated with an argument. Returns null if the argument is not present inside the URL.

Parameters:
argument
- the argument name.

getValuesOfArgument

    Vector getValuesOfArgument(String argument)

Returns the values associated with an argument. Returns null if the argument is not present inside the URL.

Parameters:
argument
- the argument name.

getQuery

    String getQuery()

Returns the arguments as a query String "arg1=val1&arg2=val2"


getCommandName

    String getCommandName()

Returns the command name associated with this URL. the reserved argument name is : "CommandName"


getCommandInstanceName

    String getCommandInstanceName()

Returns the instance name of the command associated with this URL the reserved argument name is : "CommandInstanceName"


getMIMEType

    String getMIMEType()

Returns the application type associated with the data. If possible, it is based on the URL content type normally returned by the server. If this content type is not available, the mime type is resolved from the data extension. If the MIME type is specified in the query, it is returned.


getContentType

    String getContentType()

Returns the content of the pointed file Same method as @see java.net.URLConnection#getContentType()


openStream

    InputStream openStream()

Opens a connection to this URL. For some protocol, always throws an IOException as there are no meaning or no way to retreive the data on the client (enovia protocol essentially) Mapped to @see java.net.URL#openStream()


getPostData

    String getPostData()

Returns the data that is sent to the webserver through post method, is called from EBrowserCATlet only, do not call from anywhere else It is used in the "other method" of VPM context only.


setPostData

    void setPostData(String PostData)

Sets the data , that is sent to the webserver through post method, intended for MenuItemWizard usage only, Do not use it from anywhere else.

Parameters:
PostData
- post data that portal url should carry to the handler.

toStringWithoutSpecifiedArguments

    String toStringWithoutSpecifiedArguments(boolean portalArgumentsFlag, String[] arguments)

Returns the string representation of the PortalURL whithout specific Portal arguments if portalArguments = true, and without the specified list of argument

Parameters:
portalArgumentsFlag
- boolean flag in order to remove specific Portal arguments
arguments
- the list of argument to remove from the url string

toString

    String toString()

Constructs a string representation of this PortalURL.


equals

    boolean equals(Object obj)

Compares the equality of an object with this instance

Parameters:
obj
- the PortalURL to compare with this instance

getURL

    URL getURL()

Returns the url @link java.net.URL instance encapsulated by this PortalURL. This url may be null especially when running inside a browser and using other protocols than "file" or "http".


openConnection

    URLConnection openConnection()

Returns a URLConnection object that represents a connection to the remote object referred to by the PortalURL.

If there is not already an open connection, the connection is opened by calling the openConnection method of the protocol handler for this PortalURL.

Returns:
a URLConnection to the PortalURL.


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