Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • name - the name of the HTML field
  • value - the value of the HTML field.  This field is either a static value or a value that an Interceptor will recognize as being overridden.
  • secured - whether the field should be sent as input type of "text" or "password".  If secured is true, it sends as a password field.  In addition, if the secured field is an overridden field that is editable, the editable field will be obscured when editable and will be encrypted when stored.

Interceptors

Interceptors examing examine FormFieldImpl objects before they are returned to the JSP and perform a substitution if the field should be substituted.  The interceptor itself is responsible for knowing whether the value should be overridden.  For example,

...

The FormFieldImpl entry for username shows a valud of "{prefs.myzimbra.uid}", which the UserPreferencePreInterceptor would recognize as a PortletPreference and would substitute the value found for this field, if UserPreferencePreInterceptor is configured for this HttpContentRequestImpl.

IPreInterceptor

IPreInterceptor is an interface that all Interceptors must implement.  Interceptors substitute values into FormFieldImpl objects.  Multiple interceptors can be associated with HttpContextRequestImpl objects.  It has two methods:

  • intercept() - substitutes the configured value for another, if necessary
  • validate() - returns true if all of the information needed to perform a substitution is avaialble, otherwise false

UserPreferencePreInterceptor

UserPreferencePreInterceptor overrides FormFieldImpl values with values that are stored in PortletPreferences.  When this interceptor runs, it looks for FormFieldImpl values that match the regex.  By default, your portlet will use the regex of "\\{prefs\\.[\\w.]+\\}", but this can be changed in configuration.properties of the portlet.  An example of a valid FormFieldImpl value would be "{prefs.myzimbra.uid}".  

UserInfoUrlParameterizingPreInterceptor

UserPreferencePreInterceptor overrides FormFieldImpl values with the values stored in UserInfo.  uPortal can be configured to store your uPortal login and password, making them available to userInfo.  If uPortal is configured this way, this interceptor will send the same uid and password that you used to authenticate to uPortal to the external system.  Since uPortal and the external system do not share an authentication system, it is still possible for the two systems to get out of sync.  An example of a valid FormFieldImpl value would be "{user.login.id}"

...

ExternalLogic

Custom Logic ExternalLogic can be embedded in your Gateway SSO to support more complicated scenarios.  The user can create their own Java Bean that implements the ExternalLogic interface and include it in the portlet definition.  When the controller gathers all of the information required by the JSP to render, in addition to any fields defined in the associated FormFieldImpl fields, it will add a new field for each CustomLogic bean.

For example, say you have an external system to which you wish to login.  However, before you actually login, you need to retrieve a token from another system and include it in the submitted form or on the form's action field.  You can write a custom logic bean that will retrieve that value and include it as a field in the submission.  If you wish to create a custom form action, you could return a field named "proxiedLocation" , which would override the proxied location stored with the HttpContentRequestImpl field.

This is how you might add ExternalLogic to your portlet definition file

Code Block
titleIncluding ExternalLogic in your portlet
          <bean class="org.jasig.portlet.proxy.mvc.portlet.gateway.GatewayEntry" p:name="MyZimbra"
              p:iconUrl="/ResourceServingWebapp/rs/tango/0.8.90/32x32/apps/internet-mail.png">

            <property name="externalLogic">
                <util:list>
                    <bean id="step1" class="org.jasig.portlet.proxy.service.web.MyCustomClass"  scope="session" p:fieldName="proxiedLocation"/>
                    <bean id="step2" class="org.jasig.portlet.proxy.service.web.MyCustomClass2" scope="singleton" p:fieldName="testField" />
                </util:list>
            </property>
			...
		</bean> 

 

ExternalLogic

ExternalLogic is an interface that must be implemented by any classes that wish to hook into the Custom Logic process.  The methods are:

...