Package wt.enterprise

Class URLProcessor

java.lang.Object
wt.enterprise.URLProcessor

public class URLProcessor extends Object
Deprecated.
Deprecation Notice: This class is still valid for this release, however this serves as advance notice that it will be removed in the future. All user interfaces built using the Windchill HTML Template Processing client architecture will be rewritten using a different framework in an upcoming release. This class is a "Gateway" for the HTML client; by "Gateway", it is meant that there are methods in this class that can be referenced directly by URLs pointing to the Windchill method server, independent of whether CGI or Servlets are being used. Any method that would like to be available directly via a URL needs to implement the following signature :

public static void Method Name( wt.httpgw.HTTPRequest req, wt.httpgw.HTTPResponse resp )
throws List of exceptions {

The method will be available via URL using a URL that looks like:
http://Windchill Method Server Address/Class Name/Method Name

In the case that the Windchill home page is at http://smith.ptc.com/WindchillGW, the URL that would reference the method processForm of this class would look like:
http://smith.ptc.com/WindchillGW/URLProcessor/processForm

This class defines several methods that receive the HTTP request, process the request if necessary, and generate a response page. These "Gateway" methods below each perform this general functionality, but each has a specific purpose that is described in the method JavaDoc.

Supported API: true

Extendable: false

  • Method Details

    • URLTemplateAction

      public static void URLTemplateAction(HTTPRequest req, HTTPResponse resp) throws WTException
      Deprecated.
      This gateway method should be used to generate HTML pages that present views of data. This gateway method should not be used to process HTML Forms or generate HTML Forms. There are a few existing exceptions, but they should remain exceptions.

      This method will accept a the standard HTTP Get that has a query String attached to the URL. This method will also accept an HTTP Post request. This method WILL NOT accept an HTTP Post with enc-type set for a multipart post. An exception will be thrown in this case.

      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      The template processor that is used to process this request is retrieved using the wt.enterprise.TemplateProcessorFactory. This factory will locate the TemplateProcessor subclass to use based on value of the action parameter and either the class of the oid passed in or the class of the class parameter passed in.

      Supported API: true
      Parameters:
      req -
      resp -
      Throws:
      WTException
    • handleIncludeRequest

      public static void handleIncludeRequest(Properties params, Locale locale, OutputStream os, Object contextObject) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      params -
      locale -
      os -
      contextObject -
      Throws:
      WTException
    • handleException

      public static void handleException(HTTPRequest req, HTTPResponse resp, Exception e) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      req -
      resp -
      e -
      Throws:
      WTException
    • getLocale

      public static Locale getLocale(HTTPRequest request)
      Deprecated.


      Supported API: true
      Parameters:
      request -
      Returns:
      Locale
    • parameterValue

      public static String parameterValue(Properties params, String paramName) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      params -
      paramName -
      Returns:
      String
      Throws:
      WTException
    • hanldleHTMLError

      public static void hanldleHTMLError(PrintWriter out, String title, String text, Exception e)
      Deprecated.


      Supported API: true
      Parameters:
      out -
      title -
      text -
      e -
    • processForm

      public static void processForm(HTTPRequest request, HTTPResponse response, InputStream is) throws WTException
      Deprecated.
      This "Gateway" method is the first method in a two stage process that is used to process an HTML form from an HTTP GET/POST request. Multi-part POSTs are accepted and there is support for uploading content from the HTML form using the service methods in the wt.content package.

      The first stage of the processing the HTML Form, as performed in this method, consists of the following actions
      • Find an ActionDelegate and see if the current user has permission to submit the current form. If no ActionDelegate is located for the current action, then it is assumed to be permission/state independent
      • Locate a subclass of wt.templateutil.processor.FormTaskDelegate using the FormTaskDelegateFactory and use that subclass of FormTaskDelegate to process this request.
      In the FormTaskDelegate, the HTTPState object should be updated based on the result of processing the HTML Form. The updated HTTPState object will be used in the second stage of the Form processing to select and process the response page.

      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      Supported API: true
      Parameters:
      request -
      response -
      is -
      Throws:
      WTException
    • processForm

      public static void processForm(HTTPRequest request, HTTPResponse response) throws WTException
      Deprecated.
      This "Gateway" method is the second method in a two stage process that is used to process an HTML form from an HTTP GET/POST request. Multi-part POSTs are accepted.

      The second stage of the processing the HTML Form, as performed in this method, consists of the checking the settings in the HTTPState object, that should have been updated in FormTaskDelegate, and using these settings to select an appropriate TemplateProcessor subclass to generate the Response page. The TemplateProcessorFactory is used to select the desired subclass of TemplateProcessor.

      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      Supported API: true
      Parameters:
      request -
      response -
      Throws:
      WTException
    • generateForm

      public static void generateForm(HTTPRequest request, HTTPResponse response) throws WTException
      Deprecated.
      This "Gateway" method is used to generate HTML pages with HTML Forms in them. This "Gateway" method can be called using either an HTTP GET or an HTTP POST. Calling this "Gateway" method with a multi-part POST will result in an exception being thrown and the page not being generated.

      The generation of the HTML page with the HTML Form in it consists of the following actions
      • Find an ActionDelegate and see if the current user has permission to submit the Form that is to be generated. If no ActionDelegate is located for the current action, then it is assumed to be permission/state independent
      • Locate a subclass of wt.enterprise.TemplateProcessor using the TemplateProcessorFactory and use that subclass of TemplateProcessor to process generate the HTML page with the HTML Form in it.


      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      The template processor that is used to process this request is retrieved using the wt.enterprise.TemplateProcessorFactory. This factory will locate the TemplateProcessor subclass to use based on value of the action parameter and either the class of the oid passed in or the class of the class parameter passed in.

      Supported API: true
      Parameters:
      request -
      response -
      Throws:
      WTException
    • invokeAction

      public static void invokeAction(HTTPRequest request, HTTPResponse response) throws WTException
      Deprecated.
      This "Gateway" method is used to process an HTML form from an HTTP GET/POST request. Multi-part POSTs are NOT accepted and there is NOT support for uploading content from the HTML form.
      This method is generally used to process actions that are invoked by clicking on a URL that has a Query String (i.e. an HTTP GET request). HTTP POST requests that result from submitting an HTML Form are processed by this "Gateway" method. However, you should really the processForm "Gateway" method for such a purpose.

      The processing the Action/HTML Form, as performed in this method, consists of the following actions
      • Find an ActionDelegate and see if the current user has permission to submit the current form. If no ActionDelegate is located for the current action, then it is assumed to be permission/state independent
      • Locate a subclass of wt.templateutil.processor.FormTaskDelegate using the FormTaskDelegateFactory and use that subclass of FormTaskDelegate to process this request.
      • Using the updated state of the HTTPState object, locate a subclass of TemplateProcessor using the TemplateProcessorFactory. This instance of a subclass of TemplateProcessor will be used to generate the response page.


      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      Supported API: true
      Parameters:
      request -
      response -
      Throws:
      WTException
    • readContextStatic

      public static void readContextStatic(HTTPState httpState) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      httpState -
      Throws:
      WTException
    • validatePostStringStatic

      public static void validatePostStringStatic(Properties parameters) throws WTException
      Deprecated.
      This "Gateway" method is used to process an HTML form from an HTTP GET/POST request. Multi-part POSTs are NOT accepted and there is NOT support for uploading content from the HTML form.
      This method is generally used to process actions that are invoked by clicking on a URL that has a Query String (i.e. an HTTP GET request). HTTP POST requests that result from submitting an HTML Form are processed by this "Gateway" method. However, you should really the processForm "Gateway" method for such a purpose.

      The processing the Action/HTML Form, as performed in this method, consists of the following actions
      • Find an ActionDelegate and see if the current user has permission to submit the current form. If no ActionDelegate is located for the current action, then it is assumed to be permission/state independent
      • Locate a subclass of wt.templateutil.processor.FormTaskDelegate using the FormTaskDelegateFactory and use that subclass of FormTaskDelegate to process this request.
      • Using the updated state of the HTTPState object, locate a subclass of TemplateProcessor using the TemplateProcessorFactory. This instance of a subclass of TemplateProcessor will be used to generate the response page.


      This gateway method, as with all gateway methods in this class, require that a parameter with the name action be passed in either the query string or the Form data of the HTTP Post. If no value for an action parameter is sent, an exception is thrown.

      Supported API: true
      Parameters:
      parameters -
      Throws:
      WTException
    • presentFormProcessorException

      public static void presentFormProcessorException(HTTPRequest request, HTTPResponse response, Exception e) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      request -
      response -
      e -
      Throws:
      WTException