Class RedirectObject

java.lang.Object
wt.templateutil.processor.RedirectObject

public class RedirectObject 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 is a convenience class that is used to allow the redirection of a response page. This class in conjunction with the RedirectPageProcessor allows the response of processing an action that was kicked off be a URL or HTTP POST to go through an intermediate page and then finally to the true response page. The purpose of this service is to allow the correct URL to be displayed in the Browser when the "true" response page appears. For example, the URL that results in a document being checked in

...?Action=CheckIn&Class=&Location=&Form=CheckInDocument&Method=processForm&oid=VR%3Awt.doc.WTDocument%3A281101

currently has a response page that presents the Properties page for that document. The problem is that if the "Reload" or "Refresh" button on the browser is clicked, an error message is returned as the object is already checked in.

With this service, the intermediate page will forward the browser to the "true" response page and the correct URL for that response page will be in the browser.

The correct usage of this service relies on the following :

  • You have the following entry in service.properties
wt.services/svc/default/wt.enterprise.TemplateProcessor/redirectAction/windmill.RedirectObject/0=windmill.RedirectPageProcessor/duplicate
  • You have the following entry in htmltemplate.properties
wt.services/rsc/default/wt.templateutil.DefaultHTMLTemplate/redirectAction/windmill.RedirectObject/0=templates.util.ReDirectTemplate

You will use this service, visibly,in FormTaskDelegate. You will perform the desired action in FormTaskDelegate and set the response page information in the usual way

  • Set the context on the HTTPState object, i.e. the contextAction, the contextObj, the contextClassName
  • Use the addToResponseHeaders and addToResponseFooters
The you will add the followings lines of code before leaving FormTaskDelegate
RedirectObject redirectObject = new RedirectObject();
redirectObject.setRedirection( getState() );

The URL that is generated for the redirect page is is based on the settings for the context. The URL will be one of the following

  • ../URLTemplateAction?action="contextAction"&oid="reference String to current contextObj" - if contextObj != null
  • ../URLTemplateAction?action="contextAction"&class="contextClassName" - if contextClassName != null
  • ../URLTemplateAction?action="contextAction" - otherwise
If there are additional information that you need to pass that does not need to appear on the queryString of the URL, then you can do the following

RedirectObject redirectObject = new RedirectObject();
Properties hiddenProperties = new Properties();
// add name/values pairs to hiddenProperties
...
//
setContextProperties( hiddenProperties );
redirectObject.setRedirection( getState() );

Should you need a different format for the queryString or if you need to go through a different gateway method other than URLTemplateProcessor, you will need to use the other setRedirection methods.

Supported API: true

Extendable: false

  • Field Details

    • REDIRECT_SERVICE_ACTION

      public static final String REDIRECT_SERVICE_ACTION
      Deprecated.


      Supported API: true
      See Also:
  • Method Details

    • getRedirectUrl

      protected String getRedirectUrl()
      Deprecated.
      Gets the value of the attribute: redirectUrl.

      Supported API: true
      Returns:
      String
    • setRedirectUrl

      protected void setRedirectUrl(String a_RedirectUrl)
      Deprecated.
      Sets the value of the attribute: redirectUrl.

      Supported API: true
      Parameters:
      a_RedirectUrl -
    • getQueryString

      protected String getQueryString()
      Deprecated.
      Gets the value of the attribute: queryString.

      Supported API: true
      Returns:
      String
    • setQueryString

      protected void setQueryString(String a_QueryString)
      Deprecated.
      Sets the value of the attribute: queryString.

      Supported API: true
      Parameters:
      a_QueryString -
    • getFormData

      protected Properties getFormData()
      Deprecated.
      Gets the value of the attribute: formData.

      Supported API: true
      Returns:
      Properties
    • setFormData

      protected void setFormData(Properties a_FormData)
      Deprecated.
      Sets the value of the attribute: formData.

      Supported API: true
      Parameters:
      a_FormData -
    • setRedirection

      public HTTPState setRedirection(String urlString, Properties hiddenFields)
      Deprecated.


      Supported API: true
      Parameters:
      urlString -
      hiddenFields -
      Returns:
      HTTPState
    • setRedirection

      public HTTPState setRedirection(String urlString, Properties hiddenFields, HTTPState theState)
      Deprecated.


      Supported API: true
      Parameters:
      urlString -
      hiddenFields -
      theState -
      Returns:
      HTTPState
    • setRedirection

      public HTTPState setRedirection(String method, Properties queryString, Properties hiddenFields)
      Deprecated.


      Supported API: true
      Parameters:
      method -
      queryString -
      hiddenFields -
      Returns:
      HTTPState
    • setRedirection

      public HTTPState setRedirection(String method, Properties queryString, Properties hiddenFields, HTTPState theState)
      Deprecated.


      Supported API: true
      Parameters:
      method -
      queryString -
      hiddenFields -
      theState -
      Returns:
      HTTPState
    • setRedirection

      public HTTPState setRedirection(HTTPState currentState)
      Deprecated.


      Supported API: true
      Parameters:
      currentState -
      Returns:
      HTTPState