Add a JSP element to a template
We add a JSP element to an authoring template when we want the JSP element to be used by a set of items using the same authoring template.
- Open or create an authoring template.
- Click Manage Elements .
- Select JSP as the element type.
- Enter a name. Do not use double-byte and non-ASCII characters.
- Enter a display title to use as the title of the element displayed indexes and forms.
- If we have created a text provider plug-in for a multi-locale site, we can also select the text provider and enter a key to look up a string from the selected text provider. The text provider displays a different display title for each language it has been configured for. The text entered in the Display Title field is only used if an appropriate display title is not available from the selected text provider, or if the text provider is not available.
- Click OK. The JSP element is added to the form.
- Go to the Default Content tab.
- Go to the JSP element we added. Either specify the path to the JSP file, or do nothing if we want the content creators to enter this information.
- Enter the path to a JSP file if required, or leave blank if we want the content creators to specify the JSP. The path must begin with a forward slash. For example:
/wps/customapplication;/jsp/jspFilename.jsp
JSP files are stored within a web application that runs on the portal. To reference a JSP file in another web application, use the following path: contextPath;jspPath. For example: /wps/customapplication;/jsp/jspFilename.jsp.
A dynamic context path value can be defined by adding a token to the context path that corresponds to a key and value pair to the WCM configuration service environment provider. When this key is used as the token in the jsp value field, it is replaced dynamically at render time. For example: [my.custom.key];myfile where my.custom.key is a constant within the WCM configuration service.
- Enter an error message to display when an incorrect JSP path is entered. A Java exception stack trace is displayed if there is syntax error.
- Click
to open the display properties of the element. This is where we define how the element is displayed on the item form.
- To display the element as a required field select Identify this as a required field.
- To hide a field on the content form from all users select Hide field. Specify a default value if the field is a required field.
Administrators and managers can choose to display hidden fields and elements in an item by clicking Show hidden fields.
- Select the users or groups to grant edit access to a field or element by clicking Add Editors.
- Select the users or groups to grant view access to a field or element by clicking Add Viewers.
- Type field-specific help into Field help text. This displays with the element in the content form.
If we have created a text provider plug-in for a multi-locale site, we can also select the text provider and enter a key to look up a string from the selected text provider. The text provider displays a different help text for each language it has been configured for. The text entered in the Field help field is only used if an appropriate help text is not available from the selected text provider, or if the text provider is not available.
- Save the authoring template.
Parent Use a JSP element