Developing iScript-Based Pagelets

Use an iScript only for pagelets that reference non-PeopleSoft data or if a PeopleSoft page does not provide the necessary functionality. When you develop pagelets that are based on iScripts, you should be aware of the advantages and disadvantages.

Advantages

These are some advantages of iScripts:

  • You may be familiar with the technique because it's similar to creating Active Server Pages (ASP) or Java Server Pages (JSP). Basically, you are using a script to produce HTML and JavaScript.

  • Greater flexibility is available in pagelet appearance because you have direct control of the HTML or JavaScript.

  • Greater flexibility is available in pagelet sizing. PeopleSoft Internet Architecture pages tend to be fairly static in their object placement and sizing.

  • Many PeopleSoft Application Designer definitions and their attributes are available for you to take advantage of programmatically. For example, almost all PeopleSoft pages share a consistent appearance through the use of style sheets. Your pagelet, too, can use these styles and thus maintain uniformity of appearance with your PeopleSoft application because iScript-based pagelets can access the same style sheet definitions and their properties,

Disadvantages

These are some disadvantages of iScripts:

  • You must manually program all aspects of the transaction. You must handle and account for support for multiple browsers and international considerations, such as language, date and currency formatting, and so on. PeopleTools handles these details automatically on transaction pages and component-based pagelets.

  • You must be extremely meticulous and thoughtful. The poor design and implementation of many complex and interrelated programs can lead to loss of functionality and degradation of performance.

  • When you develop a template pagelet based on an iScript, some of the functions provided by PeopleSoft Application Designer, such as currency codes, language support, and multiple browser support, are not automatically available in your iScript. Therefore, if you want any such functionality, you must develop it.

Template Pagelets

To create an iScript-based template pagelet:

Note: Use steps 1 and 2 when you are getting HTML from another website or if you want to create some relatively static HTML that is used by the iScript to render a pagelet. If you are creating a pagelet iScript that is going to render highly dynamic HTML, then begin with step 3 and create any necessary or complex PeopleCode to conditionally render the HTML or JavaScript.

  1. Create the HTML code for the pagelet.

    In many cases you can navigate to a Uniform Resource Locator (URL) that you want to turn into a pagelet and copy the HTML associated with that web page. For form-based web pages, copy all of the HTML code located between the Form tags of an existing HTML document.

  2. Store the new HTML code in PeopleSoft Application Designer as an HTML definition.

  3. Create an iScript that calls the new HTML definition in a web library.

    A web library is a derived record that is created in PeopleTools for storing iScripts. The name of all web library records begin with WEBLIB_.

    Note: All iScripts should be coded in the FieldFormula PeopleCode event of a derived record called WEBLIB_XX, where XX is the product code. Only functions that start with IScript_, such as IScript_iTracker, can be invoked from a URL.

  4. Find to the appropriate field name and edit the FieldFormula PeopleCode that is associated with the field.

    This is where you create an iScript that calls the HTML definition that you created.

  5. Create a new iScript and give it a meaningful name.

    An easy way to create a new iScript is to copy and paste an existing iScript that is located in the web library and then make the desired changes. All iScript names must begin with IScript_.

  6. Save the web library.

  7. Register the iScript as a pagelet in the portal registry. This step also involves setting up security access to the iScript.

    See Administering Pagelets in the Portal Registry.

Modifying Security for the Web Library

Security for the web library can be set up initially by means of the Registration Wizard. You can use the following steps to modify the security settings created by the wizard.

To modify security:

  1. Select PeopleTools > Security > Permissions & Roles > Permission Lists.

  2. Open the desired permission list, such as ALLPAGES or PAPP9000.

  3. Go to the Web Libraries tab.

  4. Select the Edit link next to the appropriate web library.

  5. Modify the web library permissions as desired by changing the Access Permissions drop-down option. The choices are Full Access and No Access. Click OK to return to the main Permission List page.

  6. Click Save to save your changes to the permission list.