wt.htmlutil
Class HtmlUtil

java.lang.Object
  extended bywt.htmlutil.HtmlUtil
All Implemented Interfaces:
TrailIdConstants

public class HtmlUtil
extends Object
implements TrailIdConstants

HtmlUtil contains those methods needed to generate HTML pages.


Field Summary
static String ACTION_SOURCE
           
static String AMPERSAND_CHAR
          Deprecated.  
static Object DISPLAY_IDENTIFIER_KEY
           
static String DOT_CHAR
          Deprecated.  
static String ESC_GT
           
static String ESC_LT
           
static char GT
           
protected static String HTML_LOCALE_CHARSET_PROPERTY
           
static char LT
           
private static int MAX_LINE_SIZE
           
static String[][] MULTI_CHAR_SPL_CHAR_REPLACEMENT_MAPPING
          Deprecated.  
static String PJL_ACTION_SOURCE
           
static String SCRIPT_START1
           
static String SCRIPT_START2
           
static String SCRIPT_START3
           
static String[][] SINGLE_CHAR_SPL_CHAR_REPLACEMENT_MAPPING
          Deprecated.  
static String SINGLE_CHAR_SPL_CHARS
          Deprecated.  
static String SPACE_CHAR
          Deprecated.  
private static boolean TRAIL_ENABLED
           
private static String TRL_COMMENT
          Deprecated.  
static String TRL_ID
          Deprecated.  
static char UNDERSCORE_CHAR
          Deprecated.  
static String UNIQUE_TAG_ID
          Deprecated.  
static String UNIQUE_TAG_ID_SEPARATOR
          Deprecated.  
static Locale US_ENGLISH_LOCALE
          Deprecated.  
private static boolean VERBOSE
           
 
Fields inherited from interface wt.htmlutil.TrailIdConstants
BUTTON_ICON_LINK, BUTTON_TEXT_LINK, ICON_LINK, ID_COMPONENT_SEPARATOR, ID_SPACE_CHAR, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_RADIO, INPUT_SUBMIT, INPUT_TEXT, LINK, NAV_LINK_BOTTOM, NAV_LINK_TOP, PDMLINK, SELECT, SELECT_OPTION, SUBNAV_LINK_BOTTOM, SUBNAV_LINK_TOP, TEXT_LINK, TEXTAREA, TRAIL_ID, WINDCHILL
 
Constructor Summary
HtmlUtil()
           
 
Method Summary
static String addFormInput(String params, String text)
          Deprecated.  
static String addFormSelect(String params, String text)
          Deprecated.  
static String addFormSelectOption(String params, String text)
          Deprecated.  
static String addFormTextArea(String params, String text)
          Deprecated.  
static String addListItem(String text)
          Deprecated.  
static String addListItem(String tag, String text)
          Deprecated.  
static String addTableEntry(String params, String text)
          Deprecated.  
static String addTableHeading(String params, String text)
          Deprecated.  
static String addTableRow(String params, String text)
          Deprecated.  
static String beginHtml(String title)
          Deprecated.  
static String beginHtml(String title, String resource)
          Deprecated.  
static String beginStructure(String tag, String params)
          Deprecated.  
static String createAttributeValuePair(String attributeName, String attributeValue)
          Deprecated.  
static String createBase()
          Deprecated.  
static void createBase(Properties p, Locale l, OutputStream os)
          Deprecated.  
static String createBase(String base)
          Deprecated.  
static void createBase(String base, OutputStream os)
          Deprecated.  
static String createBody(String resource)
          Deprecated.  
static String createBody(String base, String resource)
          Deprecated.  
static void createCodebase(Properties p, Locale l, OutputStream os)
          Deprecated.  
static String createFolderDropCBFuncs()
          Deprecated.  
static void createFolderDropCBFuncs(Properties p, Locale l, OutputStream os)
          Deprecated.  
static String createForm(String action, String method, String enctype, String name, String text)
          Deprecated.  
static String createFrameset(String params, String text)
          Deprecated.  
static String createImageLink(String href, String params, String label, String image)
          Deprecated.  
static StringBuffer createInlineLink(StringBuffer href, String params, String label)
          Creates an inline link (no carriage return) with the given information.
static String createInlineLink(String href, String params, String label)
          Deprecated.  
static String createLink(String href, String params, String label)
          Deprecated.  
static String createList(String tag, String params, String text)
          Deprecated.  
static void createLocale(Properties p, Locale l, OutputStream os)
          Deprecated.  
static String createMainFuncs()
          Deprecated.  
static String createPreformattedLink(String href, String params, String label, int wrap)
          Deprecated.  
static String createSelectHTML(String name, String selectParam, Vector values, Vector displayValues, boolean blank, int selected)
          Deprecated.  
static String createSelectHTML(String name, String selectParam, Vector values, Vector displayValues, Vector idValues, boolean blank, int selected)
          Deprecated.  
static String createSelectHTML(String name, String selectParam, Vector values, Vector displayValues, Vector idValues, boolean blank, Vector selected)
          Deprecated.  
static String createTable(String params, String text)
          Deprecated.  
static String createTagIDValuePair(String nameAttribute, Class processorClass)
          Deprecated.  
static String createTagIDValuePair(String nameAttribute, String subSystemName)
          Deprecated.  
static String createTrailId(String productPrefix, String featureName, String elementType, String uniqueId)
          Deprecated.  
static String createTrailId(String productPrefix, String featureName, String elementType, WTObject obj)
          Deprecated.  
static String createTrailObjId(WTObject obj)
          Deprecated.  
static String createTrlComment(String comment)
          Deprecated.  
static String createTrlIdAttribute(String productPrefix, String featureName, String elementType, String uniqueId)
          Deprecated.  
static String createTrlIdAttribute(String productPrefix, String featureName, String elementType, WTObject obj)
          Deprecated.  
static String createUniqueTagIDValue(String attributeName, Class processorClass)
          Deprecated.  
static String createUniqueTagIDValue(String attributeName, String subSystemName)
          Deprecated.  
static String defineFrame(String params, String text)
          Deprecated.  
static String encodeEscapeCharacters(String str)
          Deprecated.  
static String encodeSpaces(String str)
          Deprecated.  
static String endHtml()
          Deprecated.  
static String endStructure(String tag)
          Deprecated.  
static String fixString(String input)
          Fixes strings that contain illegal HTML charaters.
static String fixStringForJavaScript(String input)
          For removing special characters e.g &,",>,<,'(single quote) from String before adding string to javascript.
static String fixStringForJavaScriptInput(String input)
          Use this method to fix strings to populate input fields via JavaScript.
static String formatLayout(String tag, boolean endtag, String params, String text)
          Deprecated.  
static String formatText(String tag, String text)
          Deprecated.  
static String getDefaultEncoding()
          Deprecated.  
static String getEncoding(Locale locale)
          Deprecated.  
static String getEncoding(String locale_code)
          Deprecated.  
static String getHTMLDisplayIdentifier(WTObject obj, Locale locale)
          Deprecated.  
static String getHTMLDisplayIdentity(WTObject obj, Locale locale)
          Deprecated.  
private static int getScriptIndex(int index, String lowerValue)
           
static ArrayList getSelectedFromDCA(Properties formData)
           
static ArrayList getSelectedFromPartStructure(HTTPState state, Properties formData)
           
private static ArrayList getSelectedFromPJL(Properties formData)
           
static ArrayList getSelectedObjects(HTTPState state, Properties formData)
           
static String getSubSystemName(Class processorClass)
          Deprecated.  
private static ArrayList getValuesFrom(Properties formData, String keyString)
           
static String insertComment(String comment)
          Deprecated.  
static String insertHeading(String tag, String align, String text)
          Deprecated.  
static boolean isTrailEnabled()
           
static boolean isTrailEnabled(HTTPState state)
          Determines if trail is enabled from the given HTTPState.
static void printStackTrace(Throwable t)
          Use this method to print an exception stack trace in HTML.
static void printStackTrace(Throwable t, PrintStream ps)
          Use this method to print an exception stack trace in HTML.
static void printStackTrace(Throwable t, PrintWriter pw)
          Use this method to print an exception stack trace in HTML.
static String removeExtraNewLines(String str)
          Deprecated.  
static String removeScripts(String value)
          Escapes out the '<' and '>' characters of script calls in a String
private static String replace(String[] chars, String[] reps, String input)
          replaces chars found in input with corresponding reps.
static String replaceIllegalTrailIdChars(String idString)
          Deprecated.  
static String replaceMultiCharSplCharsInID(String uniqueId)
          Deprecated.  
static String replaceSingleCharSplCharsInID(String uniqueId)
          Deprecated.  
static String replaceSplCharsInID(String uniqueId)
          Deprecated.  
static String replaceSubString(String uniqueId, String oldToken, String newToken, int fromIndex)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIQUE_TAG_ID_SEPARATOR

public static final String UNIQUE_TAG_ID_SEPARATOR
Deprecated.  

See Also:
Constant Field Values

UNIQUE_TAG_ID

public static final String UNIQUE_TAG_ID
Deprecated.  

See Also:
Constant Field Values

DOT_CHAR

public static final String DOT_CHAR
Deprecated.  

See Also:
Constant Field Values

SPACE_CHAR

public static final String SPACE_CHAR
Deprecated.  

See Also:
Constant Field Values

AMPERSAND_CHAR

public static final String AMPERSAND_CHAR
Deprecated.  

See Also:
Constant Field Values

SINGLE_CHAR_SPL_CHAR_REPLACEMENT_MAPPING

public static final String[][] SINGLE_CHAR_SPL_CHAR_REPLACEMENT_MAPPING
Deprecated.  


SINGLE_CHAR_SPL_CHARS

public static final String SINGLE_CHAR_SPL_CHARS
Deprecated.  

See Also:
Constant Field Values

MULTI_CHAR_SPL_CHAR_REPLACEMENT_MAPPING

public static final String[][] MULTI_CHAR_SPL_CHAR_REPLACEMENT_MAPPING
Deprecated.  


UNDERSCORE_CHAR

public static final char UNDERSCORE_CHAR
Deprecated.  

See Also:
Constant Field Values

TRL_ID

public static final String TRL_ID
Deprecated.  

See Also:
Constant Field Values

TRL_COMMENT

private static final String TRL_COMMENT
Deprecated.  

See Also:
Constant Field Values

US_ENGLISH_LOCALE

public static final Locale US_ENGLISH_LOCALE
Deprecated.  


SCRIPT_START1

public static final String SCRIPT_START1
See Also:
Constant Field Values

SCRIPT_START2

public static final String SCRIPT_START2
See Also:
Constant Field Values

SCRIPT_START3

public static final String SCRIPT_START3
See Also:
Constant Field Values

GT

public static final char GT
See Also:
Constant Field Values

LT

public static final char LT
See Also:
Constant Field Values

ESC_GT

public static final String ESC_GT
See Also:
Constant Field Values

ESC_LT

public static final String ESC_LT
See Also:
Constant Field Values

MAX_LINE_SIZE

private static final int MAX_LINE_SIZE
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

TRAIL_ENABLED

private static final boolean TRAIL_ENABLED

ACTION_SOURCE

public static final String ACTION_SOURCE
See Also:
Constant Field Values

PJL_ACTION_SOURCE

public static final String PJL_ACTION_SOURCE
See Also:
Constant Field Values

DISPLAY_IDENTIFIER_KEY

public static final Object DISPLAY_IDENTIFIER_KEY

HTML_LOCALE_CHARSET_PROPERTY

protected static final String HTML_LOCALE_CHARSET_PROPERTY
See Also:
Constant Field Values
Constructor Detail

HtmlUtil

public HtmlUtil()
Method Detail

printStackTrace

public static void printStackTrace(Throwable t)
Use this method to print an exception stack trace in HTML.

Parameters:
t - Throwable to get stack trace from.

printStackTrace

public static void printStackTrace(Throwable t,
                                   PrintStream ps)
Use this method to print an exception stack trace in HTML.

Parameters:
t - Throwable to get stack trace from.
ps - Specified print stream

printStackTrace

public static void printStackTrace(Throwable t,
                                   PrintWriter pw)
Use this method to print an exception stack trace in HTML.

Parameters:
t - Throwable to get stack trace from.
pw - Specified print writer.

fixString

public static String fixString(String input)
Fixes strings that contain illegal HTML charaters.

Parameters:
input - String for HTML that needs to be checked and/or fixed
Returns:
The fixed string

fixStringForJavaScript

public static String fixStringForJavaScript(String input)
For removing special characters e.g &,",>,<,'(single quote) from String before adding string to javascript.


fixStringForJavaScriptInput

public static String fixStringForJavaScriptInput(String input)
Use this method to fix strings to populate input fields via JavaScript. The reason for using this is if you need to display a double-quote in an input field.


replace

private static String replace(String[] chars,
                              String[] reps,
                              String input)
replaces chars found in input with corresponding reps.

Parameters:
chars - Array of Strings to replace.
reps - Array of Strings that replace.
input - The input String to operate on.
Returns:
The input String with replacements.

beginStructure

public static String beginStructure(String tag,
                                    String params)
Deprecated.  

Generic routine to begin an HTML structure.

Supported API: true

Parameters:
tag - The HTML tag to use.
params - The optional parameters to use. Value may be null.
Returns:
The HTML string of the form: <tag> or <tag params>.

endStructure

public static String endStructure(String tag)
Deprecated.  

Generic routine to call to end a structure.

Supported API: true

Parameters:
tag - The tag to use.
Returns:
The HTML string of the form: </tag>

formatLayout

public static String formatLayout(String tag,
                                  boolean endtag,
                                  String params,
                                  String text)
Deprecated.  

Generic routine to format a layout.

Supported API: true

Parameters:
tag - The tag to use.
endtag - Indicates if an end tag should be generated.
params - Optional parameters to use. This value may be null.
text - The text being tagged.
Returns:
The HTML string of the form: <tag> text </tag> or <tag params>text</tag>

formatText

public static String formatText(String tag,
                                String text)
Deprecated.  

Generic routine to call when formating text.

Supported API: true

Parameters:
tag - The tag to use. Note that both the beginning and end tag will be generated. For example, given the value "P" for tag, the output will look like: <P>text</P>.
text - The text to format.
Returns:
The HTML string in the form: <tag>text</tag>.

insertHeading

public static String insertHeading(String tag,
                                   String align,
                                   String text)
Deprecated.  

Insert a heading line, with optional ALIGN option.

Supported API: true

Parameters:
tag - The heading tag to use. For example, "H1".
align - The ALIGN value to use. Value may be null.
text - The heading text.
Returns:
The HTML string of the form: <tag ALIGN=align>text</tag> (if align value is null, the ALIGN parameter will not be generated.)

beginHtml

public static String beginHtml(String title)
Deprecated.  

Begin an HTML page.

Supported API: true

Parameters:
title - The string to put in the title
Returns:
String containing beginning HTML tag, HEAD portion containing TITLE, and begin BODY tag.

beginHtml

public static String beginHtml(String title,
                               String resource)
Deprecated.  

Begin an HTML page.

Supported API: true

Parameters:
title - The string to put in the title
resource - String containing the resource to append to the URL base specified by the wt.server.codebase property.
Returns:
String containing beginning HTML tag, HEAD portion containing TITLE, and begin BODY tag.

createBody

public static String createBody(String base,
                                String resource)
Deprecated.  

Create a BODY tag entry with a BACKGROUND tag using the given base URL.

Supported API: true

Parameters:
base - The string containing the base URL
resource - The string containing the resource to append to the base.
Returns:
String containing the BODY tag

createBody

public static String createBody(String resource)
Deprecated.  

Create a BODY tag entry with a BACKGROUND tag using the value of the wt.server.codebase property.

Supported API: true

Parameters:
resource - String containing the resource to append to the URL base specified by the wt.server.codebase property.
Returns:
String containing the BODY tag

createBase

public static void createBase(String base,
                              OutputStream os)
                       throws WTRuntimeException
Deprecated.  

Create and output a BASE tag entry with the given base URL.

Supported API: true

Parameters:
base - The string containing the base URL
os - The outputStream to write to
Returns:
String containing the BASE tag
Throws:
WTRuntimeException

createLocale

public static void createLocale(Properties p,
                                Locale l,
                                OutputStream os)
Deprecated.  

Returns the locale string (ie en_US) for the current request. This is a static method which can be specified within an HTML template.

Supported API: true

Parameters:
p - Properties. Not used.
l - Locale.
os - The OutputStream to write to
Returns:
String containing the locale

createCodebase

public static void createCodebase(Properties p,
                                  Locale l,
                                  OutputStream os)
Deprecated.  

Returns the wt.server.codebase property value. This is a static method which can be specified within an HTML template.

Supported API: true

Parameters:
p - Properties. Not used.
l - Locale. Not used.
os - The OutputStream to write to
Returns:
String containing the codebase value

createBase

public static void createBase(Properties p,
                              Locale l,
                              OutputStream os)
Deprecated.  

Create a BASE tag entry with the wt.server.codebase property value as the base URL. This is a static method which can be specified within an HTML template.

Supported API: true

Parameters:
p - Properties. Not used.
l - Locale. Not used.
os - The OutputStream to write to
Returns:
String containing the BASE tag

createBase

public static String createBase(String base)
Deprecated.  

Create a BASE tag entry with the given base URL.

Supported API: true

Parameters:
base - The string containing the base URL
Returns:
String containing the BASE tag

createBase

public static String createBase()
Deprecated.  

Create a BASE tag entry with the wt.server.codebase property value as the base URL.

Supported API: true

Returns:
String containing the BASE tag

createFolderDropCBFuncs

public static void createFolderDropCBFuncs(Properties p,
                                           Locale l,
                                           OutputStream os)
Deprecated.  


createFolderDropCBFuncs

public static String createFolderDropCBFuncs()
                                      throws Exception
Deprecated.  

Throws:
Exception

createMainFuncs

public static String createMainFuncs()
                              throws Exception
Deprecated.  

Throws:
Exception

endHtml

public static String endHtml()
Deprecated.  

End the HTML page.

Supported API: true

Returns:
String containing end BODY tag and end HTML tag.

insertComment

public static String insertComment(String comment)
Deprecated.  

Insert the given input as an HTML comment.

Supported API: true

Parameters:
comment - String containing the comment to insert. Comment will be broken into maximum 80 character lines.
Returns:
The HTML string.

createForm

public static String createForm(String action,
                                String method,
                                String enctype,
                                String name,
                                String text)
Deprecated.  

Creates a form structure with the given contents.

Supported API: true

Parameters:
action - The URL to call when the form is submitted.
method - The method to associate with the FORM; e.g. GET or POST.
enctype - The value application.
name - The name associated with the form. Used by JavaScript scripts.
text - The string containing the form contents.
Returns:
The HTML string of the form: <FORM METHOD=method ACTION=action ENCTYPE=enctype NAME=name>text</FORM> (Note: any form parameter with a NULL value will not be generated in the parameter list.)

addFormInput

public static String addFormInput(String params,
                                  String text)
Deprecated.  

Generates a form INPUT line with the given row contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the INPUT contents.
Returns:
The HTML string of the form: <INPUT params>text

addFormTextArea

public static String addFormTextArea(String params,
                                     String text)
Deprecated.  

Generates a form TEXTAREA with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the TEXTAREA contents.
Returns:
The HTML string of the form: <TEXTAREA params>text</TEXTAREA>

addFormSelect

public static String addFormSelect(String params,
                                   String text)
Deprecated.  

Generates a form SELECT structure with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the SELECT contents.
Returns:
The HTML string of the form: <SELECT params>text</SELECT>

addFormSelectOption

public static String addFormSelectOption(String params,
                                         String text)
Deprecated.  

Generates a form select OPTION line with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the OPTION contents.
Returns:
The HTML string of the form: <OPTION params>text

createFrameset

public static String createFrameset(String params,
                                    String text)
Deprecated.  

Creates a frameset structure with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the frameset contents.
Returns:
The HTML string of the form: <FRAMESET params>text</FRAMESET>

defineFrame

public static String defineFrame(String params,
                                 String text)
Deprecated.  

Defines a frame with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the frame contents.
Returns:
The HTML string of the form: <FRAME params>text

createLink

public static String createLink(String href,
                                String params,
                                String label)
Deprecated.  

Create a link with the given information.

Supported API: true

Parameters:
href - The URL to call when link is selected.
params - Other parameters for the link; e.g. REL=xxx.
label - Label to associate with the link.
Returns:
The HTML string of the form: <A HREF="href" params>label</A>.

createImageLink

public static String createImageLink(String href,
                                     String params,
                                     String label,
                                     String image)
Deprecated.  

Create an image link with the given information.

Supported API: true

Parameters:
href - The URL to call when link is selected.
params - Other parameters for the link; e.g. REL=xxx.
label - Label to associate with the link.
image - Image to create a link for; e.g. Go to Team Administrator
Returns:
The HTML string of the form: <A HREF="href" params>label</A>.

createInlineLink

public static String createInlineLink(String href,
                                      String params,
                                      String label)
Deprecated.  

Creates an inline link (no carriage return) with the given information.

Supported API: true

Parameters:
href - The URL to call when link is selected.
params - Other parameters for the link; e.g. REL=xxx.
label - Label to associate with the link.
Returns:
The HTML string of the form: <A HREF="href" params>label</A>.

createInlineLink

public static StringBuffer createInlineLink(StringBuffer href,
                                            String params,
                                            String label)
Creates an inline link (no carriage return) with the given information.

Supported API: true

Parameters:
href - The URL to call when link is selected.
params - Other parameters for the link; e.g. REL=xxx.
label - Label to associate with the link.
Returns:
The HTML string of the form: <A HREF="href" params>label</A>.

createPreformattedLink

public static String createPreformattedLink(String href,
                                            String params,
                                            String label,
                                            int wrap)
Deprecated.  

Create a link with the given information.

Supported API: true

Parameters:
href - The URL to call when link is selected.
params - Other parameters for the link; e.g. REL=xxx.
label - Label to associate with the link.
wrap - The URL wrap length.
Returns:
The HTML string of the form: <A HREF="href" params>label</A>.

createList

public static String createList(String tag,
                                String params,
                                String text)
Deprecated.  

Creates a list structure containing the given contents.

Supported API: true

Parameters:
tag - The tag to use.
params - Optional parameters to use. Value may be null.
text - The contents of the list.
Returns:
The HTML string of the form: <tag> or <tag params>

addListItem

public static String addListItem(String text)
Deprecated.  

Add an item to a list.

Supported API: true

Parameters:
text - The text to add to the list.
Returns:
The HTML string of the form: <LI>text.

addListItem

public static String addListItem(String tag,
                                 String text)
Deprecated.  

Add an item to a list.

Parameters:
tag - The tag to use. If not specified, defaults to "LI".
text - The text to add to the list.
Returns:
The HTML string of the form: <tag>text

createTable

public static String createTable(String params,
                                 String text)
Deprecated.  

Creates a table structure with the given contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the table contents.
Returns:
The HTML string of the form: <TABLE params> text </TABLE>

addTableRow

public static String addTableRow(String params,
                                 String text)
Deprecated.  

Generates a table row with the given row contents.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the row contents.
Returns:
The HTML string of the form: <TR>text</TR>

addTableHeading

public static String addTableHeading(String params,
                                     String text)
Deprecated.  

Generates a table heading.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the heading.
Returns:
The HTML string of the form: <TH>text</TH>

addTableEntry

public static String addTableEntry(String params,
                                   String text)
Deprecated.  

Generates a table entry.

Supported API: true

Parameters:
params - Optional parameters to use. Value may be null.
text - The string containing the entry contents.
Returns:
The HTML string of the form: <TD>text</TD>

createSelectHTML

public static String createSelectHTML(String name,
                                      String selectParam,
                                      Vector values,
                                      Vector displayValues,
                                      boolean blank,
                                      int selected)
Deprecated.  

creates the complete select/option HTML from the opening select tag to the closed. This is the original version of this API and remains available for backward compatability. This is the API used throughout much of existing code however, it is not the API recommended for new development. Please use the reccommended API for new development instead of this one whenever possible. NOTE: Elements in all passed in vectors have the toString() method applied to them. If the displayValues are null the "values" vector will be used for display as well. The default count starts at zero and includes the blank if it is used.

Supported API: true

Parameters:
name - String name of the element in the HTML form.
selectParam - Additional SELECT parameters such as SIZE or onChange. ex: "SIZE=\"5\" onChange=javasript:method()"
values - Vector that contains the form values that correspond to the displayValue vector.
displayValues - Vector that contains the display values visible in the HTML drop down.
blank - Do you wish to have a blank prepended to the list of values? Note: Setting this to "true" will add one to the list's size. Remember this when setting the "default" param.
selected - int that corresponds to the default selected value in the drop-down.
Returns:
The HTML String that creates the select/option.

createSelectHTML

public static String createSelectHTML(String name,
                                      String selectParam,
                                      Vector values,
                                      Vector displayValues,
                                      Vector idValues,
                                      boolean blank,
                                      int selected)
Deprecated.  

creates the complete select/option HTML from the opening select tag to the closed. This version of the API was created in the 7.0 MOR timeframe and remains available for backward compatability. It is not the API recommended for new development. Please use the reccomended API for new development instead of this one whenever possible. NOTE: Elements in all passed in vectors have the toString() method applied to them. If the displayValues are null the "values" vector will be used for display as well. The default count starts at zero and includes the blank if it is used.

Supported API: true

Parameters:
name - String name of the element in the HTML form.
selectParam - Additional SELECT parameters such as SIZE or onChange. ex: "SIZE=\"5\" onChange=javasript:method()"
values - Vector that contains the form values that correspond to the displayValue vector.
displayValues - Vector that contains the display values visible in the HTML drop down.
idValues - Vector that contains the id values for the drop down entries. If null default ids are generated for the options.
blank - Do you wish to have a blank prepended to the list of values? Note: Setting this to "true" will add one to the list's size. Remember this when setting the "default" param.
selected - int that corresponds to the default selected value in the drop-down.
Returns:
The HTML String that creates the select/option.

createSelectHTML

public static String createSelectHTML(String name,
                                      String selectParam,
                                      Vector values,
                                      Vector displayValues,
                                      Vector idValues,
                                      boolean blank,
                                      Vector selected)
Deprecated.  

creates the complete select/option HTML from the opening select tag to the closed. This is the new API that is reccomended for use in new development. NOTE: Elements in all passed in vectors have the toString() method applied to them. If the displayValues are null the "values" vector will be used for display as well. The default count starts at zero and includes the blank if it is used.

Supported API: true

Parameters:
name - String name of the element in the HTML form.
selectParam - Additional SELECT parameters such as SIZE or onChange. ex: " SIZE=\"5\ " If you want the list to Allow Multiselect include the multiselect option here. ex. " SIZE=\"5\" multiple "
values - Vector that contains the form values that correspond to the displayValue vector.
displayValues - Vector that contains the display values visible in the HTML drop down.
idValues - Vector that contains the id values for the drop down entries. If null default ids are generated for the options.
blank - Do you wish to have a blank prepended to the list of values? Note: Setting this to "true" will add one to the list's size. Remember this when setting the "default" param.
selected - Vector that contains the indices or the value strings for the default selected value(s) in the drop-down.
Returns:
The HTML String that creates the select/option.

createAttributeValuePair

public static String createAttributeValuePair(String attributeName,
                                              String attributeValue)
Deprecated.  

For the specified attribute/value pair, return back the "attribute=value" kind of string. For example, if the attributeName is "id" and the attributeValue is "newcaddoc_CADDocType", the value returned would be " id="newcaddoc_CADDocType" "


createUniqueTagIDValue

public static String createUniqueTagIDValue(String attributeName,
                                            String subSystemName)
Deprecated.  

For the specified sub-system name, create an unique id value string using the attribute name in the following format: sub-system-name + "_" + attributeName For example, if the sub-system name is "newcaddoc" and the attributeName is "CADDocType", the uniqueId would be ""newcaddoc_CADDocType"


createUniqueTagIDValue

public static String createUniqueTagIDValue(String attributeName,
                                            Class processorClass)
Deprecated.  

For the specified processorClass determine the sub-system name, create an unique id value string using the attribute name in the following format: sub-system-name + "_" + attributeName For example, if the classname of the processorClass is "com.ptc.windchill.cadx.newcaddoc.NewCadDocTemplateProcessor" and the attributeName is "CADDocType", the uniqueId would be ""newcaddoc_CADDocType"


getSubSystemName

public static String getSubSystemName(Class processorClass)
Deprecated.  

From the specified class, derive the sub-system name. For example, if the classname is "com.ptc.windchill.cadx.newcaddoc.NewCadDocTemplateProcessor", the sub-system name would be "newcaddoc". Note that rose generated CLASSNAME static varible could be passed here as CLASSNAME.


createTagIDValuePair

public static String createTagIDValuePair(String nameAttribute,
                                          String subSystemName)
Deprecated.  

For the specified tag attribute & the specified sub-system name, create the unique tag id key/value pair for the tag.


createTagIDValuePair

public static String createTagIDValuePair(String nameAttribute,
                                          Class processorClass)
Deprecated.  

For the specified tag attribute & the specified class, create the unique tag id key/value pair for the tag.


replaceSplCharsInID

public static String replaceSplCharsInID(String uniqueId)
Deprecated.  

Replace any special characters in uniqueId with certain replacement values. If these characters are present, it causes issues in the trail processing.


replaceMultiCharSplCharsInID

public static String replaceMultiCharSplCharsInID(String uniqueId)
Deprecated.  

Replace special multi characters (such as "_ASC" ) with replacement value (such as "_ASC_")


replaceSubString

public static String replaceSubString(String uniqueId,
                                      String oldToken,
                                      String newToken,
                                      int fromIndex)
Deprecated.  

Replace the specified multi-char sub-string with the specified replacement string in the specified uniqueId


replaceSingleCharSplCharsInID

public static String replaceSingleCharSplCharsInID(String uniqueId)
Deprecated.  

Replace special single characters (such as '.', ' ') with replacement value


encodeSpaces

public static String encodeSpaces(String str)
Deprecated.  

Replaces space characters in the passed string with " " except for chars within tags ("<...>").

Parameters:
str - String to be processed
Returns:
the encoded string

encodeEscapeCharacters

public static final String encodeEscapeCharacters(String str)
Deprecated.  

This will HTML encode any Carriage Return,New Line characters in a String to <BR> tags as well as spaces, "<" and ">" for display in HTML. Only mulitple spaces and leading spaces will be encoded. It was discovered that if there are single spaces which are encoded as nbsp characters the browsers are not able to wrap text at all. Therefore only multiple spaces will be encoded. The resulting String is returned.

Supported API: false

Parameters:
str - The string to encode
Returns:
The encoded string.

getHTMLDisplayIdentifier

public static String getHTMLDisplayIdentifier(WTObject obj,
                                              Locale locale)
Deprecated.  

Returns the localized DisplayIdentifier string for the input object. Spaces in the output string will be encoded as " "

Parameters:
obj - object
locale - locale for localization of output string
Returns:
DisplayIdentifier string. For example, for WTPart this would be NUMBER (name) Version View

getHTMLDisplayIdentity

public static String getHTMLDisplayIdentity(WTObject obj,
                                            Locale locale)
Deprecated.  

Returns the localized DisplayIdentity string for the input object. Spaces in the output string will be encoded as " "

Parameters:
obj - object
locale - locale for localization of output string
Returns:
DisplayIdentity string. This includes the object type. For example, for WTPart this might be Separable Part MYPARTNUMBER (MyPartName) A Engineering

createTrailObjId

public static String createTrailObjId(WTObject obj)
Deprecated.  

Return a string that identifies the input object, is locale-independent, and does not reference the database oid of the object. This string is based on the English display identity of the object.

These strings are designed to be used in trail file ids so the only characters allowed are ['A'..'Z'], ['a'..'z'], ['0'..'9'],'-', '_', and ':'. All other characters, except spaces, will be replaced by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit unicode hex representation of the character. Space characters are replaced by a '_'.

Example id string: "Part_9553485454__u28_BRGSHAFT_u29__A_1"


createTrailId

public static String createTrailId(String productPrefix,
                                   String featureName,
                                   String elementType,
                                   String uniqueId)
Deprecated.  

Constructs an HTML tag ID suitable for Pro/E trail file instrumentation. All HTML tags with which the user can interact should have such an ID attribute. The ids returned will have the form:

<product prefix>:<feature name>:<element type>:<unique id>

where:

Any of the above four components may be missing from an id, although ids with all four are preferred wherever possible. Each of the four elements in the ID is input as a parameter to this method. Any that are missing will be excluded from the ID. If all are missing, an empty string will be returned.

We recommend that the total number of characters in all four components not exceed 65 characters (one trail file line) for trail file readability.

NOTE: We recommend that trail id components include only letter characters [A..Z,a..z], digit characters [0..9], and hyphens('-'). This will avoid usage of chars with special meanings and illegal id characters. Illegal characters will be escaped by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit hex representation of the character. See the method replaceIllegalTrailIdChars().

Sample ids:

   PDML:MoreSearchOptions:TextLink:r8h47

   PDML:Tools:DropDown:98735

   Tools:DropDown

   PDML:ProductStructureTable:Checkbox:Part_9553485454__u28_BRGSHAFT_29__A_1

Supported API: false


createTrailId

public static String createTrailId(String productPrefix,
                                   String featureName,
                                   String elementType,
                                   WTObject obj)
Deprecated.  

Constructs an HTML tag ID suitable for Pro/E trail file instrumentation. All HTML tags with which the user can interact should have such an ID attribute. The ids returned will have the form:

<product prefix>:<feature name>:<element type>:<object id>

where:

Any of the above four components may be missing from an id, although ids with all four are preferred wherever possible. Each of the four elements in the ID is input as a parameter to this method. Any that are missing will be excluded from the ID. If all are missing, an empty string will be returned.

We recommend that the total number of characters in all four components not exceed 65 characters (one trail file line) for trail file readability.

NOTE: We recommend that trail id components include only letter characters [A..Z,a..z], meanings and illegal id characters. Illegal characters will be escaped by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit hex representation of the character. See the method replaceIllegalTrailIdChars().

Example id: "PDML:ProductStructureTable:Checkbox:Part_9553485454__u28_BRGSHAFT_u29__A_1"


replaceIllegalTrailIdChars

public static String replaceIllegalTrailIdChars(String idString)
Deprecated.  

Replaces illegal characters in strngs to be used for HTML trail ids with their unicode numerical equivalent.

Legal id characters are ['A'..'Z'], ['a'..'z'], ['0'..'9'],'-', '_', and ':'. All others, except for spaces, will be replaced by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit unicode hex representation of the character. Spaces will be replaced by an underscore ('_').

Example:

input id string: "Part_9553485454_(BRGSHAFT)_A_1"

output id string: "Part_9553485454__u0028_BRGSHAFT_u0029__A_1"


createTrlIdAttribute

public static String createTrlIdAttribute(String productPrefix,
                                          String featureName,
                                          String elementType,
                                          String uniqueId)
Deprecated.  

Constructs a 'trlId' attribute suitable for Pro/E trail file instrumentation. All HTML elements with which the user can interact should have such a trlId attribute or at minimum an 'id' attribute. The trlId attributes returned will have the form:

trlId=<product prefix>:<feature name>:<element type>:<unique id>

where:

Any of the above four components may be missing from a trlId, although trlIds with all four are preferred wherever possible. Each of the four elements in the trlId is input as a parameter to this method. Any that are missing will be excluded from the trlId. If all are missing, an empty string will be returned.

We recommend that the total number of characters in all four components not exceed 65 characters (one trail file line) for trail file readability.

NOTE: We recommend that trlId attributes include only letter characters [A..Z,a..z], digit characters [0..9], and hyphens('-'). This will avoid usage of chars with special meanings and illegal id characters. Illegal characters will be escaped by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit hex representation of the character. See the method replaceIllegalTrailIdChars().

Sample trlId attributes:

   trlId=PDML:MoreSearchOptions:TextLink:r8h47

   trlId=PDML:Tools:DropDown:98735

   trlId=Tools:DropDown

   trlId=PDML:ProductStructureTable:Checkbox:Part_9553485454__u28_BRGSHAFT_29__A_1

Supported API: false


createTrlIdAttribute

public static String createTrlIdAttribute(String productPrefix,
                                          String featureName,
                                          String elementType,
                                          WTObject obj)
Deprecated.  

Constructs a 'trlId' attribute suitable for Pro/E trail file instrumentation. All HTML elements with which the user can interact should have such a trlId attribute or at minimum an 'id' attribute. The trlId attributes returned will have the form:

trlId=<product prefix>:<feature name>:<element type>:<unique id>

where:

Any of the above four components may be missing from a trlId, although trlIds with all four are preferred wherever possible. Each of the four elements in the trlId is input as a parameter to this method. Any that are missing will be excluded from the trlId. If all are missing, an empty string will be returned.

We recommend that the total number of characters in all four components not exceed 65 characters (one trail file line) for trail file readability.

NOTE: We recommend that trlId attributes include only letter characters [A..Z,a..z], digit characters [0..9], and hyphens('-'). This will avoid usage of chars with special meanings and illegal id characters. Illegal characters will be escaped by the sequence '_uD[DDD]_' where 'D[DDD]' is the 1- to 4-digit hex representation of the character. See the method replaceIllegalTrailIdChars().

Sample trlId attribute: "trlId=PDML:ProductStructureTable:Checkbox:Part_9553485454__u28_BRGSHAFT_29__A_1"

Supported API: false


createTrlComment

public static String createTrlComment(String comment)
Deprecated.  

Constructs a 'trlComment' attribute suitable for Pro/E trail file instrumentation. The trlComment is optional. It can be used to clarify what the HTML element is in cases where the trlId is obscure. (keeping the ids independent of language, machine, object identifiers etc. can lead to obscure trlIds) The trlComment is not a substitute for trlId. We recommend that the total number of characters in Comment not exceed 65 characters (one trail file line) for trail file readability.

Returns a trlComment attribute like: TRLCOMMENT="Set Local Time Zone" Will show up in the trail file as a comment like: !TrlCmnt: Clicked on element 'Set Local Time Zone' Note: This method always returns a trail comment string, regardless of whether or not trail is enabled. In some cases it may be more performant to check if trail is enabled before adding a trlComment/trlId. Use isTrailEnabled() to check if trail is enabled.

Supported API: false


isTrailEnabled

public static boolean isTrailEnabled(HTTPState state)
Determines if trail is enabled from the given HTTPState. Returns true if trail is enabled. Returns false if trail is not enabled or if any exceptions are thrown


isTrailEnabled

public static boolean isTrailEnabled()

getSelectedObjects

public static ArrayList getSelectedObjects(HTTPState state,
                                           Properties formData)
                                    throws WTException
Throws:
WTException

getSelectedFromPJL

private static ArrayList getSelectedFromPJL(Properties formData)
                                     throws WTException
Throws:
WTException

getSelectedFromDCA

public static ArrayList getSelectedFromDCA(Properties formData)
                                    throws WTException
Throws:
WTException

getSelectedFromPartStructure

public static ArrayList getSelectedFromPartStructure(HTTPState state,
                                                     Properties formData)
                                              throws WTException
Throws:
WTException

getValuesFrom

private static ArrayList getValuesFrom(Properties formData,
                                       String keyString)

removeExtraNewLines

public static String removeExtraNewLines(String str)
Deprecated.  

Replaces line feed-carriage return and carriage return-line feed character sequences with one line feed character. Designed for processing text input from HTML textarea input fields because browsers typically send a carriage return followed by a line feed to represent a new line entered by the user. Specifically, the following replacements will be done: "C CR LF C" will be replaced by "C LF C" "C LF CR C" will be replaced by "C LF C"
where C = any character but a carriage return or line feed CR = carriage return character LF = line feed character


getDefaultEncoding

public static String getDefaultEncoding()
Deprecated.  

Gets the default HTML encoding. This encoding is specified in wt.properties as HTML_LOCALE_CHARSET_PROPERTY. This method should be called to get the encoding value to set in an HTML file. To get the encoding of a file being read (e.g., .rbInfo or .ser file), use wt.util.LocaleUtilities.

Returns:
The encoding name for the locale.
See Also:
LocaleUtilities

getEncoding

public static String getEncoding(String locale_code)
Deprecated.  

Gets the localized HTML encoding for the locale code. This encoding is specified in wt.properties, with the default base property being defined by HTML_LOCALE_CHARSET_PROPERTY. This method should be called to get the encoding value to set in an HTML file. To get the encoding of a file being read (e.g., .rbInfo or .ser file), use wt.util.LocaleUtilities.

Parameters:
locale_code - - the locale code for which encoding is needed
Returns:
The encoding name for the locale.
See Also:
LocaleUtilities

getEncoding

public static String getEncoding(Locale locale)
Deprecated.  

Gets the localized HTML encoding for the locale. This encoding is specified in wt.properties, with the default base property being defined by HTML_LOCALE_CHARSET_PROPERTY. This method should be called to get the encoding value to set in an HTML file. To get the encoding of a file being read (e.g., .rbInfo or .ser file), use wt.util.LocaleUtilities.

Parameters:
locale - - the Locale for which encoding is needed
Returns:
The encoding name for the locale.
See Also:
LocaleUtilities

removeScripts

public static String removeScripts(String value)
Escapes out the '<' and '>' characters of script calls in a String


getScriptIndex

private static int getScriptIndex(int index,
                                  String lowerValue)