wt.util.version
Class WindchillVersion

java.lang.Object
  extended bywt.util.version.WindchillVersion

public class WindchillVersion
extends Object

Provides APIs for querying the release identifiers and display labels for all installed assemblies.

Supported API: true

Extendable: false


Field Summary
private static InstallationRegistry installedAssemblyRegistry__
           
private static String RESOURCE
           
 
Constructor Summary
WindchillVersion()
           
 
Method Summary
private static void displayTable(String[][] data)
           
static String getDisplayLabelFor(ReleaseId release_identifier)
          Query the display label associated with an assembly's release id.
static String getDisplayLabelFor(String assembly_identifier)
          Query the display label associated with a particular assembly id.
private static InstallationRegistry getInstallationRegistry()
           
static String getInstalledAssemblyDisplayLabelsAsString()
          Returns the display labels of all installed assemblies in a comma-delimited list.
static ReleaseId getInstalledAssemblyReleaseIdFor(String assembly_id)
          Query the release id for the assembly with the specified assembly id.
static ReleaseId[] getInstalledAssemblyReleaseIds()
          Query the release ids of all installed assemblies.
static String getInstalledAssemblyReleaseIdsAsString()
          Returns the release ids of all installed assemblies in a comma-delimited list.
static String getInstallerSequenceFor(ReleaseId release_id)
          Query the installer sequence associated with a particular assembly id.
static String getSupportDateCodeFor(ReleaseId release_identifier)
          Query the date code associated with an assembly's release id.
static String getSupportDateCodeFor(String assembly_id)
          Query the date code associated with a particular assembly id.
static String getSupportReleaseNumberFor(ReleaseId release_identifier)
          Query the release number associated with an assembly's release id.
static String getSupportReleaseNumberFor(String assembly_id)
          Query the release number associated with a particular assembly id
static boolean isAssemblyInstalled(String assembly_id)
          Determine if the assembly with the specified id is installed.
static boolean isComplete(ReleaseId release_id)
          Whether or not the assembly with the release id's assembly id was sucessfully installed

Supported API: false

Extendable: false
static boolean isRegressed(ReleaseId release_id)
          Whether or not the assembly with the release id's assembly id has regressed from its highest version.
private static String leftJustify(int size, String str)
           
static void main(String[] args)
          When invoked, displays to System.out information for each assembly, temp patch and locale installed.
static void reportOnInstall()
          When invoked, displays to System.out information for each assembly, temp patch and locale installed.
private static void reportOnInstalledAssemblies()
           
private static void reportOnLocales()
           
private static void reportOnTemporaryPatches()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

installedAssemblyRegistry__

private static InstallationRegistry installedAssemblyRegistry__
Constructor Detail

WindchillVersion

public WindchillVersion()
Method Detail

getInstallationRegistry

private static InstallationRegistry getInstallationRegistry()
                                                     throws IAException
Throws:
IAException

getInstalledAssemblyReleaseIds

public static final ReleaseId[] getInstalledAssemblyReleaseIds()
                                                        throws ReleaseIdException
Query the release ids of all installed assemblies.

These release ids are queries from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null collection of versions in no particular order
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

isAssemblyInstalled

public static final boolean isAssemblyInstalled(String assembly_id)
                                         throws ReleaseIdException
Determine if the assembly with the specified id is installed.

These ids is queries from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
true if the assembly with the specified id is installed
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource or if the named assembly is not installed

getInstalledAssemblyReleaseIdFor

public static final ReleaseId getInstalledAssemblyReleaseIdFor(String assembly_id)
                                                        throws ReleaseIdException
Query the release id for the assembly with the specified assembly id.

These ids is queries from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
POSSIBLY-NULL ReleaseId corresponding to the provided assembly id (i.e. null when isAssemblyInstalled = false)
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource or if the named assembly is not installed
See Also:
isAssemblyInstalled(java.lang.String)

getDisplayLabelFor

public static final String getDisplayLabelFor(ReleaseId release_identifier)
                                       throws ReleaseIdException
Query the display label associated with an assembly's release id.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null string that may be empty of the assembly with the release identifier was never installed
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource
See Also:
isAssemblyInstalled(java.lang.String)

getDisplayLabelFor

public static final String getDisplayLabelFor(String assembly_identifier)
                                       throws ReleaseIdException
Query the display label associated with a particular assembly id.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null string that may be empty of the assembly with the release identifier was never installed
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource
See Also:
isAssemblyInstalled(java.lang.String)

getSupportDateCodeFor

public static final String getSupportDateCodeFor(ReleaseId release_identifier)
                                          throws ReleaseIdException
Query the date code associated with an assembly's release id.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null, possibly-empty string
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

getSupportDateCodeFor

public static final String getSupportDateCodeFor(String assembly_id)
                                          throws ReleaseIdException
Query the date code associated with a particular assembly id.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null, possibly-empty string
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

getSupportReleaseNumberFor

public static final String getSupportReleaseNumberFor(ReleaseId release_identifier)
                                               throws ReleaseIdException
Query the release number associated with an assembly's release id.

This is not the formal release identifier (ReleaseId), but rather the truncated version number to display in a product's about page allong with the date code to clearly identify the product when requesting techinical support.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null, possibly-empty string
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

getSupportReleaseNumberFor

public static final String getSupportReleaseNumberFor(String assembly_id)
                                               throws ReleaseIdException
Query the release number associated with a particular assembly id

This is not the formal release identifier (ReleaseId), but rather the truncated version number to display in a product's about page allong with the date code to clearly identify the product when requesting techinical support.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: true

Extendable: false

Returns:
non-null, possibly-empty string
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

getInstallerSequenceFor

public static final String getInstallerSequenceFor(ReleaseId release_id)
                                            throws ReleaseIdException
Query the installer sequence associated with a particular assembly id.

This information is queried from the $(wt.home)/codebase/instreg/registry resource located on the server. This .iar resource is queries through the WTContext. So if invoking from a Windchill client, the HTTP server must be running.

Supported API: false

Extendable: false

Returns:
non-null, possibly-empty string
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

isComplete

public static final boolean isComplete(ReleaseId release_id)
                                throws ReleaseIdException
Whether or not the assembly with the release id's assembly id was sucessfully installed

Supported API: false

Extendable: false

Returns:
false if the assembly is not installed or if it was not successfully installed
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

isRegressed

public static final boolean isRegressed(ReleaseId release_id)
                                 throws ReleaseIdException
Whether or not the assembly with the release id's assembly id has regressed from its highest version. That is, has a new component been installed at a lower version than the highest version this assembly has ever attained?

Supported API: false

Extendable: false

Returns:
false if the assembly is not regressed or if it was not successfully installed
Throws:
ReleaseIdException - if there is a problem reading the InstallationRegistry resource

getInstalledAssemblyReleaseIdsAsString

public static final String getInstalledAssemblyReleaseIdsAsString()
                                                           throws ReleaseIdException
Returns the release ids of all installed assemblies in a comma-delimited list. The release ids are return in no specific order

Supported API: false

Extendable: false

Throws:
ReleaseIdException

getInstalledAssemblyDisplayLabelsAsString

public static final String getInstalledAssemblyDisplayLabelsAsString()
                                                              throws ReleaseIdException
Returns the display labels of all installed assemblies in a comma-delimited list. The release ids are return in no specific order

Supported API: false

Extendable: false

Throws:
ReleaseIdException

main

public static void main(String[] args)
When invoked, displays to System.out information for each assembly, temp patch and locale installed.

Supported API: false

Extendable: false


reportOnInstall

public static void reportOnInstall()
                            throws Exception
When invoked, displays to System.out information for each assembly, temp patch and locale installed.

Supported API: false

Extendable: false

Throws:
Exception

reportOnInstalledAssemblies

private static void reportOnInstalledAssemblies()
                                         throws IAException,
                                                ReleaseIdException
Throws:
IAException
ReleaseIdException

reportOnTemporaryPatches

private static void reportOnTemporaryPatches()
                                      throws IAException
Throws:
IAException

reportOnLocales

private static void reportOnLocales()
                             throws IAException
Throws:
IAException

displayTable

private static void displayTable(String[][] data)

leftJustify

private static String leftJustify(int size,
                                  String str)