5.2 Working with Attributes, Item Types, and Page Types

Oracle Portal provides an assortment of base attributes, page types, and item types that you can expose to the user community. Each page and item type includes attributes that are used to store information about the page or item. If the base page and item types do not quite meet your requirements, you can create your own page and item types. This means that you can control what information is stored by specifying which attributes to include in page or item types. Furthermore, if the base attributes do not cover the kind of information you want to store about your pages or items, you can create your own attributes and add those to your page and item types. You can also control exactly which page and item types are made available to the users of your page groups.

Note:

One way to control the display of attributes in item regions is through the use of HTML content layout substitution tags. For more information, see Section 12.3.2, "Using HTML to Define the Layout and Appearance of Region Content".

Oracle Portal also includes a selection of built-in extensible item types. If you do not want to create your own item types, you can edit these built-in item types to meet your requirements.

This section contains the following sub-sections:

Note:

Any user with at least the Manage Classifications privilege on a page group can create and manage attributes and types. To edit the built-in page and item types, you must have at least the Manage Classifications privilege on the Shared Objects page group.

5.2.1 Working with Attributes

There are two types of attributes:

Content Attributes

Content attributes are associated with item types and page types, and store information about an item or page, such as the associated category, description, or perspectives. These attributes are included in the add and edit pages where users can provide information about the item or page they are adding or editing. Page group administrators can create their own item types and page types and specify exactly what information they want users to supply by choosing which attributes to include. In addition, page group administrators can create their own attributes for containing extra information.

For a list of the content attributes provided by default, see Section A.2.1, "Base Content Attributes".

Display Attributes

Display attributes are associated with regions, and display information about an item or portlet, such as the author, display name, and creation date. Page designers can choose which attributes to display in a region. Some content attributes can also be used as display attributes. See Section 10.2.9, "Changing the Attributes Displayed in a Region".

For a list of the display attributes provided by default, see Section A.2.2, "Base Display Attributes".

5.2.1.1 Creating an Attribute

To create an attribute:

  1. In the Navigator, click the link for the page group in which you want to create the attribute.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

  2. Click the Attributes link.

    Tip:

    If you create an attribute in a particular page group, that attribute is available only in that page group. If you want the attribute to be available in multiple page groups, either create it in the Shared Objects page group, or (if the attribute already exists) promote it to the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups".

  3. Next to Create New, click the Attribute link.

  4. In the Display Name field, enter a descriptive name for the attribute. The display name is displayed as a label for the attribute whenever the attribute is used.

    Use up to 256 characters of any kind, except commas. When the Display Name contains one or more commas, it does not display properly in search-related attribute selection boxes.

    Although the attribute display name has no enforced uniqueness requirement, consider keeping it unique across your page groups. If you do not, users see duplicate names on attribute pick-lists, and are unable to determine which attribute belongs to which page group. For example, attributes display on a pick-list when a user creates a custom item type or selects custom search criteria.

  5. From the Datatype list, choose the type of data that the attribute will store.

    • Boolean stores a value of 1 (for TRUE) or 0 (for FALSE).

    • Date stores a date in the format DD-MON-YYYY HH12:MI PM, for example, 20-SEP-2004 10:57 AM.

    • File stores a file, such as a Microsoft Excel spreadsheet or an HTML document.

    • Number stores a numeric value, for example, 8479.

    • PL/SQL stores PL/SQL code, for example, htp.print('Hello World');

    • Text stores a text string.

    • URL stores the URL of a Web site or Web page, for example, http://www.oracle.com.

  6. Click Create.

  7. Click Close.

5.2.1.2 Editing an Attribute

You can specify how an attribute is displayed when users add or edit an item or page of a type that includes the attribute. For example, you can change the label for the attribute by editing the attribute's display name.

To edit an attribute:

  1. Use the Navigator to browse to the attribute that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the attribute is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the attribute, click the Edit link.

    This opens the Edit Attribute page. The options available on this page vary a little from those options available when you first create the attribute. Notably, the page includes a Name attribute.

  3. In the Name field, edit the name of the attribute. The name is used internally only.

    The default value in the Name field is taken from the Display Name provided when the attribute was created. Spaces and special characters are discarded.

    For example, if the Display Name is R & D Team Lead, the Name is RDTeamLead.

    The Name is not case sensitive. It must be unique within its page group and the Shared Objects page group. Use up to 256 alphanumeric characters (A to Z, a to z, 0 to 9) and the underscore character (_); spaces and other special characters are not allowed.

  4. In the Display Name field, edit the descriptive name of the attribute. The Display Name identifies the attribute to other users. It is used in the Portal Navigator and as the label for the attribute value wherever the attribute is used.

    Use up to 256 characters of any kind, except commas. When the Display Name contains one or more commas, it does not display properly in search-related attribute selection boxes.

    Any change you make here does not affect the value in the Name field. Changes to the attribute Display Name are not reflected immediately on cached pages. To make the change display immediately, you must clear the page group's cache. Go to the Access tab of the page group that owns the attribute, and click the Clear Cache link.

    Although the attribute display name has no enforced uniqueness requirement, we recommend that you try to keep it unique across your page groups. If you do not, users will see duplicate names on attribute pick-lists, and will be unable to determine which attribute belongs to which page group. For example, attributes display on a pick-list when a user creates a custom item type or selects custom search criteria.

  5. Select Enable Translations if you want users to be able to translate the values stored in the attribute into different languages.

    If you clear this check box, the values stored in the attribute will be the same in all languages.

  6. For Date, Number, and URL attributes:

    In the List Of Values field, enter the name of a list of values from which users can choose a value for the attribute. If you are not sure of the name of the list of values, click the List icon and select from the list provided.

    Note:

    The list of values must already exist. Multi-valued attributes are not supported for lists of values. That is, users are able to choose only one value from an attribute list of values. This means that attribute values can be displayed in combo boxes and pop-ups, but not as check boxes, drop-down lists, or radio buttons.

  7. For PL/SQL attributes:

    In the PL/SQL Execute Options radio group, select which privileges to use when executing the PL/SQL stored in the attribute:

    • Public executes the PL/SQL with the privileges of the Oracle Portal PUBLIC schema.

    • Creator executes the PL/SQL with the privileges of the schema associated with the user who created the item or page that includes the PL/SQL attribute.

    • Schema executes the PL/SQL with the privileges of a specific schema. If you select this radio button, enter the name of the schema in the field provided. If you are not sure of the name of the schema, click the Browse Database Schemas icon and select from the list provided.

  8. For Text attributes:

    1. In the Length field, enter the number of characters the attribute can store.

      Values can be provided only when the Display Option is Single-line Field. If you specify a length and then select a Display Option of Multi-line Field or List Of Values, the Length field is cleared and becomes display only.

    2. In the Display Option radio group, select how to display the attribute when users add or edit an item or page of a type that includes the attribute:

      • Single-line Field displays the attribute as a field that contains a single line of text.

      • Multi-line Field displays the attribute as a field that contains multiple lines of text.

      • List Of Values displays the attribute as a list from which users can choose a value.

        If you select this radio button, enter the name of the list of values in the field provided. If you are not sure of the name of the list of values, click the List icon and select from the list provided.

        Note:

        The list of values must already exist. Multi-valued attributes are not supported for lists of values. That is, users are able to choose only one value from an attribute list of values. This means that attribute values can be displayed in combo boxes and pop-ups, but not as check boxes, drop-down lists, or radio buttons.

  9. Click OK.

5.2.1.3 Deleting an Attribute

When you delete an attribute, you also remove the attribute and its values from any items and pages that include it.

Take care when deleting an attribute from the Shared Objects page group. Attributes in the Shared Objects page group may be used across page groups. Deleting an attribute from Shared Objects removes it from all page groups that use it.

To delete an attribute:

  1. Use the Navigator to browse to the attribute that you want to delete.

  2. In the row for the attribute, click the Delete link.

  3. In the confirmation page, click Yes.

5.2.2 Working With Item Types

Item types define the contents of an item and the information that is stored about an item. The information stored about an item is determined by the attributes of the item type.

By default, Oracle Portal includes several base item types to cover the most common content that contributors will want to add. Oracle Portal also includes several built-in custom item types so that content contributors can get started adding content right out of the box. For a complete list of base and built-in item types, see Section A.4, "Base Item Types".

However, you may find that you want to store more information about your items than the built-in item types allow. If this is the case, you can extend the built-in item types to meet your requirements. You can add different attributes to the built-in item types to store exactly the information that you want. You can also add calls to PL/SQL and HTTP procedures and even pass attributes to the parameters of those procedures. For example, if the Review item type includes a Search attribute to store a search string, you could add a procedure call to a search engine and pass the search string to that search engine. When users run the search engine, the search results for the search string are displayed.

If you prefer, you can create your own item types. You can base an item type on one of the base item types. Basing your item type on a base item type means that your item type will inherit certain attributes. You can then extend your item type to include other attributes and procedure calls. You can also choose to base your item type on none of the base item types (choose <None> from the Base Item Type list), which gives you complete control over the attributes included in the item type.

5.2.2.1 Creating an Item Type

To create an item type:

  1. In the Navigator, click the link for the page group in which you want to create the item type.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If you create an item type in a particular page group, that item type is available only in that page group. If you want the item type to be available in multiple page groups, either create it in the Shared Objects page group, or (if the item type already exists) promote it to the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups".

  2. Click the Item Types link.

  3. Next to Create New, click the Item Type link.

  4. In the Display Name field, enter a descriptive name for the item type. The display name is used in the Portal Navigator and the Add Item Item Type list, so shorter display names are better.

    Use up to 256 characters of any kind, including spaces.

  5. From the Base Item Type list, choose the base item type from which you want your item type to inherit attributes. You can choose from None, Base File, Base Image Map, Base Image, Base PL/SQL, Base Page Link, Base Text, and Base URL.

  6. Click Create.

  7. Click Close.

5.2.2.2 Editing an Item Type

When you first create an item type, it includes exactly the same attributes as the base item type on which you based it. If you chose <None> as the base item type, your new item type includes only the Display Name attribute. To truly customize the item type, you need to edit it to add more attributes, and possibly procedure calls.

Note:

You cannot edit the base item types. However you can extend the built-in item types.

5.2.2.2.1 Editing the Basic Properties of an Item Type

To edit the basic properties of an item type:

  1. Use the Navigator to browse to the item type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Note:

    If the item type is shared (or is one of the built-in item types), it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the item type, click the Edit link.

    This opens the Edit Item Type page. The options available on this page vary a little from those options available when you first create the item type. Notably, the page includes a Name attribute.

  3. In the Name field, edit the name of the item type. The name is used internally only.

    The default value in the Name field is created from the Display Name provided for the item type when it was created. The Name is truncated to 30 characters and all spaces and special characters are discarded. For example, if the Display Name is Science & Math Images, the Name is ScienceMathImages.

    The Name is not case sensitive. It must be unique within its page group and the Shared Objects page group. Use up to 30 alphanumeric characters (A to Z, a to z, 0 to 9) and the underscore character (_); spaces and other special characters are not allowed.

  4. In the Display Name field, edit the descriptive name of the item type. The Display Name identifies the item type to other users. It is used in the Portal Navigator and Add Item Item Type list, so shorter display names are better.

    Use up to 256 characters of any kind, including spaces. Changes to the item type Display Name are not reflected immediately on cached pages. To make the change display immediately, you must clear the page group's cache. Go to the Access tab of the page group that owns the item type, and click the Clear Cache link.

    Any change you make here does not affect the value in the Name field.

  5. In the Description field, enter information about the item type that may be useful to others, such as its arguments, functionality, or usage. The description is displayed only when editing the item type.

  6. In the Icon field, enter the path and file name of an image to associate with the item type. Click Browse to locate the image if you are not sure of its path or file name. When you click Apply or OK, the file is uploaded to the Oracle Metadata Repository.

    Note:

    This icon is not currently used within Oracle Portal. The icon may be used in future releases.

  7. You can create your own help to display when users click the context sensitive help icon while adding an item of this type. To associate your custom help with the item type, enter the URL of the help in the Help URL For Add Item Wizard field

  8. You can also create your own help to display when users click the context sensitive help icon while editing an item of this type. To associated your custom help with the item type, enter the URL of the help in the Help URL For Edit Item Wizard field.

  9. Click OK.

5.2.2.2.2 Adding Attributes to an Item Type

To add attributes to an item type:

  1. Use the Navigator to browse to the item type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the item type is shared (or is one of the built-in item types), it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the item type, click the Edit link.

  3. Click the Attributes tab.

  4. In the Available Attributes list, select the attributes that you want to add to the item type.

  5. Click the Move icon to move the selected attributes to the Selected Attributes list.

    The order of attributes in the Selected Attributes list determines the order in which the attributes are displayed when users add or edit an item of this type. Use the icons to the right of the list to change the order.

  6. Click Apply to add the attributes to the item type.

  7. When you have added the attributes, you can change their display properties if necessary:

    1. In the Default Value field, enter the value to use by default for the attribute. If content contributors do not specify a value for the attribute, the default value is used. If you provide a default value, contributors will not be able to set the attribute to a null value, they can only replace the default value with another non-null value. You can leave this field blank if you prefer.

      Multi-valued attributes are not supported for lists of values. That is, users are able to choose only one value from an attribute list of values. This means that attribute values can be displayed in combo boxes and pop-ups, but not as check boxes, drop-down lists, or radio buttons.

      If you are suppling a default value for the base item link item type, you must enter the target item's globally unique identifier (GUID), which you can determine through the item's property sheet. The GUID is the alpha-numeric value at the end of the item's Item Link, for example F43069B7A66E553AE030B98B6C883291. Using the GUID is also a way to provide a default value for an item that belongs to another page group--a normally prohibited action. Using any other type of item identifier for the default value, such as the item's internal name, results in an error when users try to add the custom item to a page.

      You can use PL/SQL expressions and function calls to determine the default value for an attribute. You must precede the expression or function call with a # character. The function being called must already exist in the database and must be prefixed with its owning schema.

      For example:

      - To set the default value of the Author attribute to the current user, you would set the default value of the attribute to #USER#.

      - To set the default value of the Publish Date attribute to the first day of the month, you would set the default value of the attribute to #TO_CHAR(LAST_DAY(SYSDATE)+1, 'DD-MON-YYYY HH12:MI PM').

      - To set the default value of a custom Project ID attribute to the current project to which the current user is assigned, you would first need a function that returns the ID of the project. The function might be something like the following (assuming that a user is assigned to only one project on any specified date):

      create function GET_CURRENT_PROJECT return VARCHAR2 as  project_id VARCHAR2 (30);begin  select pa.id   into project_id  from project_asignments pa  where SYSDATE between pa.start and pa.end --selects current assignment   and pa.assignee = WWCTX_API.GET_USER; --gets name of current user  return project_id;end;
      
      

      If the GET_CURRENT_PROJECT function was created in the PROJECTS schema, you would set the default value of the Project ID attribute to #PROJECTS.GET_CURRENT_PROJECT.

      Note:

      You cannot pass attribute values as parameters to a function when it is called from an attribute default value. You can however pass PL/SQL expressions as parameters. You can use expressions and function calls only for the default values of attributes, not for the actual values of attributes. If you are using an expression to determine the default value of a date attribute, you must make sure that the date value is converted to the DD-MON-YYYY HH12:MI PM date format as shown in the second example described earlier.

    2. Select the Required check box if you want it to be mandatory for content contributors to provide a value for the attribute. The Required icon will be displayed next to the attribute when contributors add or edit an item of this type.

      If you do not select this check box, content contributors do not need to provide a value for the attribute.

    3. Clear the Add Wizard check box if you do not want to display the attribute on the Add Item Wizard.

      For example, to make it easier for content contributors to add an item of this type, you might want to limit the number of attributes displayed on the Add Item Wizard. Contributors can provide values for the extra attributes when they edit the item.

    4. Clear the Edit Wizard check box if you do not want to display the attribute on the Edit Item pages.

      For example, if you want to supply a default value for an attribute, and do not want content contributors to be able to change that value, clear both the Add Wizard and Edit Wizard check boxes so that the attribute does not display in the wizards.

      You could create an item type called Performance Review and add the Expiration Period attribute to it. You set a default value for the attribute, 01-JAN-2003, so that every Performance Review item added by users expires on this date. Since users do not need to know about or edit this date, you clear the Add Wizard and Edit Wizard check boxes for the attribute. When users add and edit their performance review items, they will not see the Expiration Period attribute even though it is stored for each item.

  8. Click OK.

To remove attributes from the item type, select the attributes in the Selected Attributes list, and click the Remove icon.

Tip:

If you intend any of the attributes that you add to include important information that you want users to see immediately, you should instruct page designers to display those attributes in the regions on their pages. See Section 10.2.9, "Changing the Attributes Displayed in a Region"

5.2.2.2.3 Adding a Procedure Call to an Item Type

For an example of how you might use a procedure call in an item type, see:

Note:

The total length of the procedure call (including any parameters) must not exceed 2000 bytes. If the item procedure has too many parameters or parameter values with a large number of characters, some of the parameters or parameter values will be excluded to ensure that the limit is not reached.

To add a procedure call to an item type:

  1. Use the Navigator to browse to the item type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the item type is shared (or is one of the built-in item types), it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the item type, click the Edit link.

  3. Click the Procedures tab.

  4. From the Type list, choose whether the call is to an HTTP or PL/SQL procedure.

  5. In the Procedure Call field, enter one of the following:

    • The URL of the HTTP procedure, including the protocol used to access it, for example:

      http://www.mycompany.com/search/index.html
      
    • The name of the PL/SQL procedure. The procedure must already exist in the database and must be prefixed with its owning schema, for example:

      SCOTT.MY_PROC
      

      The PUBLIC user must be granted execute privileges on the procedure.

  6. In the Link Text field, enter the text to display as a hypertext link that users can click to execute the procedure call.

    This link is displayed only if the region containing the item displays the Associated Function attribute and you do not select Display Procedure Results With Item, or you have not specified an icon. For information about adding the Associated Function attribute to a region, see Section 5.2.2.2.4, "Including an Item Type's Procedure Call on a Page".

  7. In the Icon field, enter the path and file name of an image to associate with this procedure call. If you specify an icon, it is used instead of the Link Text, however you must still enter a value in the Link Text field to serve as the image's rollover text.

    Click Browse to locate the image if you are not sure of its path or file name.

  8. Select Display Procedure Results With Item to display the results of the procedure call directly in the page instead of displaying a link for users to click. This makes the results immediately visible to users, rather than requiring them to click a link to execute the procedure call themselves.

  9. If the procedure you are calling has parameters, you can pass values to those parameters using the attributes you attached to the item type in Section 5.2.2.2.2, "Adding Attributes to an Item Type".

    1. In the Attribute list, choose the attribute whose values you want to pass to a parameter in the procedure.

    2. In the Pass As field, enter the parameter name if it is different from the attribute name.

  10. Click Apply to add the procedure call to the item type.

  11. Click OK.

To remove a procedure call from the item type, click the Delete Procedure icon next to the procedure call in the Existing Procedure Calls section.

To edit an existing procedure call, for example, to add more parameter/attribute mappings, click the Edit Procedure icon next to the procedure call in the Existing Procedure Calls section. Remember to click Apply to save your changes.

Example 5-1 Adding an HTTP Procedure Call to an Item Type

Imagine that your portal provides movie reviews to subscribers. To customize the hundreds of movie reviews you plan to upload, you create a Movie Review item type to use for each review. Knowing that users will want to find additional information about each movie, you decide to include a link to a search engine within the review.

To include this link, you choose HTTP as the procedure type, and add the following to the Procedure Call field (Figure 5-1):

http://www.google.com/search

You include the Link Text Click here for more..., and you specify an icon to associate with the procedure. You choose not to display the procedure results with the item because you want users to click the icon to access the search.

For the search engine to return information about the appropriate movie, you need to pass it the movie title. Say your Movie Review item type includes an attribute called Movie Title. To pass the value in this attribute to the search engine, you select it in the Attribute list (you could also use the Display Name attribute if it is used to store the title of the movie).

Finally, you need to make sure that the attribute value is sent to the correct search engine parameter. In the case of Google, the search parameter name is q, so you enter this name in the Pass As field (Figure 5-2).

This information is appended to the Procedure Call as follows:

http://www.google.com/search?q=<MovieTitle>

Each movie review will now include a link to a customized search based on the movie title (Figure 5-3).

When users click the specified icon, the customized search content (based on the movie title) displays (Figure 5-4). The movie title, which is the search criteria, displays at the top of the search results page.

Figure 5-1 Adding an HTTP Procedure Call to an Item Type

Description of Figure 5-1 follows
Description of "Figure 5-1 Adding an HTTP Procedure Call to an Item Type"

Figure 5-2 Passing Attribute Values to HTTP Procedure Parameters

Description of Figure 5-2 follows
Description of "Figure 5-2 Passing Attribute Values to HTTP Procedure Parameters"

Figure 5-3 Example Movie Review Item

Description of Figure 5-3 follows
Description of "Figure 5-3 Example Movie Review Item"

Figure 5-4 Example Movie Review Procedure Call Results

Description of Figure 5-4 follows
Description of "Figure 5-4 Example Movie Review Procedure Call Results"

Example 5-2 Adding a PL/SQL Procedure Call to an Item Type

Imagine that you have written the following procedure that displays the creator and create date of an object in an HTML table:

--
-- procedure display_attributes
-- created Monday 17-JUN-2002 10:35
--
create or replace
procedure display_attributes (
  p_creator in varchar2,
  p_create_date in varchar2)
as
begin
  htp.p('<table><tr><td><b>Creator:</b></td>'
  || '<td>' || p_creator || '</td></tr>'
  || '<tr><td><b>Create Date:</b></td>'
  || '<td>' || p_create_date || '</td></tr>'
  || '</table>');
exception
when others then
  htp.p(sqlerrm);
end;

You can add a call to this procedure to an item type (My Item Type) so that this information is displayed for items of that type.

First you choose PL/SQL as the Procedure Type, and then add the following to the Procedure Call field (Figure 5-5):

<schema>.DISPLAY_ATTRIBUTES

You include the link text Display Attributes, and you specify an icon to associate with the procedure.

For the procedure to return the appropriate attribute values, you need to pass it the attribute names. Your procedure includes two parameters: p_creator and p_create_date. You need to pass these two parameters information from the Creator and Create Date attributes (Figure 5-6).

Each item of type My Item Type will now include a link to run the procedure (Figure 5-7).

When users click the specified icon, the additional attributes are displayed as an HTML table (Figure 5-8).

Figure 5-5 Adding a PL/SQL Procedure Call to an Item Type

Description of Figure 5-5 follows
Description of "Figure 5-5 Adding a PL/SQL Procedure Call to an Item Type"

Figure 5-6 Passing Attribute Values to PL/SQL Procedure Parameters

Description of Figure 5-6 follows
Description of "Figure 5-6 Passing Attribute Values to PL/SQL Procedure Parameters"

Figure 5-7 Example My Item Type Item

Description of Figure 5-7 follows
Description of "Figure 5-7 Example My Item Type Item"

Figure 5-8 Example My Item Procedure Call Results

Description of Figure 5-8 follows
Description of "Figure 5-8 Example My Item Procedure Call Results"

5.2.2.2.4 Including an Item Type's Procedure Call on a Page

If an item type includes a procedure call, the link to execute the procedure call will be displayed with an item of that type only if the Associated Functions attribute is displayed in the region that contains the item.

To include an item type's procedure call on a page:

  1. Go to the page to which you want to add the link.

    For information on locating a page, see Section 8.1, "Locating Pages in Oracle Portal".

  2. Switch to Edit mode.

  3. In the region to which you want to add the link, click the Edit Region icon.

  4. Click the Attributes/Style tab.

  5. In the Available Attributes list, select Associated Function.

  6. Click the Move arrow.

  7. Click Apply.

  8. Click Close.

5.2.2.3 Making an Item Type Available to a Page Group

When you create an item type, it is not immediately available for use by content contributors. This is because you will probably want to edit the item type first to add attributes and procedure calls. When you are happy with the item type, and are ready for content contributors to start adding items of that type, you must make the item type available in the page group.

To make an item type available to a page group:

  1. From the Page Groups portlet's Work In drop-down list, choose the page group to be edited.

    By default, the Page Groups portlet is located on the Build tab of the Builder page.

  2. Click the Configure tab.

  3. In the Types and Classification section, click the Edit link.

    Note:

    You can also reach the Configure Types and Classification page by clicking the configure the list of available item types link on the first page of the Add Item Wizard.

  4. From the Hidden Item Types list, select the item type that you want to make available.

    The Hidden and Visible Item Type lists include all the item types owned by this page group and the Shared Objects page group.

  5. Click the Move icon to move the selected item type into the Visible Item Types list.

    The order of item types in the Visible Item Types list determines the order when items in a region are grouped by item type. For information about how to group items by item type, see Section 10.2.10, "Grouping Items in a Region".

  6. Click OK to return to the Configure tab.

  7. Click Close.

You can also exclude an item type from a page group, meaning that content contributors cannot add items of that type to pages in the page group. For example, if you have created your own item types, you might want to exclude some of the built-in item types from the page group. To do this, select the item type in the Visible Item Type list and click the Remove icon.

5.2.2.4 Deleting an Item Type

When you delete an item type, all items of that type are also deleted. You cannot undo this action.

Take care when deleting an item type from the Shared Objects page group. Item types in the Shared Objects page group may be used across page groups. Deleting an item type from Shared Objects removes it from all page groups that use it.

Note:

If you delete an item type that is one of the selected Default WebDAV Types (on the Items tab of page properties), the option that used that type (either Default Regular Files, Default Zip Files, or Default Image Files) is reset to Inherit from Parent Page - [File/Zip File/File].

To delete an item type:

  1. Use the Navigator to browse to the item type that you want to delete.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the item type is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the item type, click the Delete link.

  3. In the confirmation page, click Yes.

5.2.3 Working with Page Types

Page types define the contents of a page and the information that is stored about a page. The information stored about a page is determined by the attributes of the page type.

By default, Oracle Portal includes several base page types so that page managers can get started creating pages right out of the box. Base page types include:

  • Standard—These contain and manage items, portlets, tabs, and sub-page links.

  • URL—These provide a route to another Web page, identified by its URL. When a user clicks the page link, the Web page referenced by the link is displayed.

  • PL/SQL—These consist of PL/SQL code that executes when the pages are rendered.

  • JavaServer Pages (JSPs)—These are an extension to servlet functionality that provides a simple programmatic interface to Web pages. JSPs are HTML pages with special tags and embedded Java code that is executed on the Web or application server. JSPs provide dynamic functionality to HTML pages. They are compiled into servlets when first requested, and they run in the servlet container.

For a complete list of base page types, see Section A.3, "Base Page Types".

You may find that you want to store more information about your pages than the base page types allow. If this is the case, you can create your own page types. You base your page type on one of the base page types. The page type automatically inherits all of the base page type's attributes. But, after you create your page type, you can edit it to add other attributes that are specific to your requirements. These attributes can be other default Oracle Portal attributes, or attributes that you have created yourself.

In addition to adding attributes to page types, you can also add calls to PL/SQL or HTTP procedures. You can pass attributes as parameters to those procedures if required.

5.2.3.1 Creating a Page Type

To create a page type:

  1. In the Navigator, click the link for the page group in which you want to create the page type.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If you create a page type in a particular page group, that page type is available only in that page group. If you want the page type to be available in multiple page groups, either create it in the Shared Objects page group, or (if the page type already exists) promote it to the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. Click the Page Types link.

  3. Next to Create New, click the Page Type link.

  4. In the Display Name field, enter a descriptive name for the page type. The Display Name identifies the page type to other users. It is used in the Portal Navigator and Create Page Page Type list, so shorter display names are better.

    Use up to 256 characters of any kind, including spaces.

  5. From the Base Page Type list, choose the base page type from which you want your page type to inherit attributes. You can choose from Standard, PL/SQL, or URL.

  6. Click Create.

  7. Click Close.

5.2.3.2 Editing a Page Type

When you first create a page type, it is exactly the same as the base page type from which you chose to inherit attributes. To truly customize the page type, you need to edit it to add more attributes, and possibly procedure calls.

Note:

You cannot edit the base page types.

5.2.3.2.1 Editing the Basic Properties of a Page Type

To edit the basic properties of a page type:

  1. Use the Navigator to browse to the page type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the page type is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the page type, click the Edit link.

    This opens the Edit Page Type page, displaying the Main tab. The attributes available on the Main tab vary a little from the attributes available when you first create the page type. Notably, the Main tab includes a Name attribute.

  3. In the Name field, edit the name of the page type. The name is used internally only.

    The default value in the Name field is created from the Display Name provided for the page type when it was created. The Name is truncated to 30 characters and all spaces and special characters are discarded. For example, if the Display Name is Research & Development, the Name is ResearchDevelopment.

    The Name is not case sensitive. It must be unique within its page group and the Shared Objects page group. Use up to 30 alphanumeric characters (A to Z, a to z, 0 to 9) and the underscore character (_); spaces and other special characters are not allowed.

  4. In the Display Name field, edit the descriptive name of the page type. The Display Name identifies the page type to other users. It is used in the Portal Navigator and Create Page Page Type list, so shorter display names are better.

    Use up to 256 characters of any kind, including spaces. Changes to the page type Display Name are not reflected immediately on cached pages. To make the change display immediately, you must clear the page group's cache. Go to the Access tab of the page group that owns the page type, and click the Clear Cache link.

    Any change you make here does not affect the value in the Name field.

  5. In the Description field, enter information about the page type that may be useful to others, such as its arguments, functionality, or usage. The description is displayed only when editing the page type.

  6. In the Icon field, enter the path and file name of an image to associate with the page type. Click Browse to locate the image if you are not sure of its path or file name. When you click Apply or OK, the file is uploaded to the Oracle Metadata Repository.

    Note:

    This icon is not currently used within Oracle Portal. The icon may be used in future releases.

  7. Click OK.

5.2.3.2.2 Adding Attributes to a Page Type

To add attributes to a page type:

  1. Use the Navigator to browse to the page type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the page type is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the page type, click the Edit link.

  3. Click the Attributes tab.

  4. In the Available Attributes list, select the attributes that you want to add to the page type.

  5. Click the Move icon to move the selected attributes to the Selected Attributes list.

    The order of attributes in the Selected Attributes list determines the order in which the attributes are displayed when users create or edit a page of this type. Use the icons to the right of the list to change the order.

  6. Click Apply to add the attributes to the page type.

  7. When you have added the attributes, you can change their display properties if necessary:

    1. In the Default Value field, enter the value to use by default for the attribute. If page managers do not specify a value for the attribute, the default value is used. You can leave this field blank if you prefer.

      Multi-valued attributes are not supported for lists of values. That is, users are able to choose only one value from an attribute list of values. This means that attribute values can be displayed in combo boxes and pop-ups, but not as check boxes, drop-down lists, or radio buttons.

    2. Select the Required check box if you want it to be mandatory for page managers to provide a value for the attribute. The attribute will be displayed on the first page of the Create Page Wizard, and the Main tab of the Edit Page page.

      If you do not select this check box, page managers do not need to provide a value for the attribute and the attribute will be displayed on the Optional tab of the Edit Page page.

  8. Click OK.

To remove attributes from the page type, select the attributes in the Selected Attributes list, and click the Remove icon.

5.2.3.2.3 Add a Procedure Call to a Page Type

For an example of how you might use a procedure call in a page or item type, see Example 5-1, "Adding an HTTP Procedure Call to an Item Type" or Example 5-2, "Adding a PL/SQL Procedure Call to an Item Type".

To add a procedure call to a page type:

  1. Use the Navigator to browse to the page type that you want to edit.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the page type is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the page type, click the Edit link.

  3. Click the Procedures tab.

  4. From the Type list, choose whether the call is to an HTTP or PL/SQL procedure.

  5. In the Procedure Call field, enter one of the following:

    • The URL of the HTTP procedure, including the protocol used to access it, for example:

      http://www.oracle.com/search/index.html
      
    • The name of the PL/SQL procedure. The procedure must already exist in the database and must be prefixed with its owning schema, for example:

      SCOTT.MY_PROC
      

      The PUBLIC user must be granted execute privileges on the procedure.

  6. In the Link Text field, enter the text to display as a hypertext link that users can click to execute the procedure call.

    This link is displayed only if the page includes a Page Function item and you do not select Display Procedure Results With Page, or you have not specified an icon. For information about adding a Page Function item to a page, see Section 5.2.3.2.4, "Including a Page Type's Procedure Call on a Page".

  7. In the Icon field, enter the path and file name of an image to associate with this procedure call. If you specify an icon, it is used instead of the Link Text, however you must still enter a value in the Link Text field to serve as the image's rollover text.

    Click Browse to locate the image if you are not sure of its path or file name.

  8. Select Display Procedure Results With Page to display the results of the procedure call directly in the page instead of displaying a link for users to click. This makes the results immediately visible to users, rather than requiring them to click a link to execute the procedure call themselves.

  9. If the procedure you are calling has parameters, you can pass values to those parameters using the attributes you attached to the page type in Section 5.2.3.2.2, "Adding Attributes to a Page Type".

    1. In the Attribute list, choose the attribute whose values you want to pass to a parameter in the procedure.

    2. In the Pass As field, enter the parameter name if it is different from the attribute name.

  10. Click Apply to add the procedure call to the page type.

  11. Click OK.

To remove a procedure call from the page type, click the Delete Procedure icon next to the procedure call in the Existing Procedure Calls section.

To edit an existing procedure call, for example, to add more parameter/attribute mappings, click the Edit Procedure icon next to the procedure call in the Existing Procedure Calls section. Remember to click Apply to save your changes.

5.2.3.2.4 Including a Page Type's Procedure Call on a Page

If a page type includes a procedure call, the link to execute the procedure call will be displayed in a page of that type only if a Page Function item is added to the page.

To include a page type's procedure call on a page:

  1. Go to the page where you want to add the Page Function item.

    For information on locating a page, see Section 8.1, "Locating Pages in Oracle Portal".

  2. Switch to Edit mode.

  3. In the region where you want to add the Page Function item, click the Add Item icon.

    If you do not see the Add Item icon, the region may be a portlet region, in which case, you cannot add items to this region.

  4. From the Built-In Navigation Item Types list, choose Page Function.

    If there are no page functions associated with the current page, this item type is not displayed. If you know there are page functions, but this item type does not appear in the list, contact your page group administrator. Your administrator selects which item types to display here.

    If you do not see Page Function in the list, the page may not have any page functions associated with it or the Page Function item type may not have been included in the page group. For information about how to include this item type, see Section 5.2.2.3, "Making an Item Type Available to a Page Group".

  5. Click Next.

  6. From the Page Function list, choose the page function that you want to include in the page.

  7. Click Finish.

5.2.3.3 Making a Page Type Available to a Page Group

When you create a page type, it is not immediately available for use by page creators. This is because you will probably want to edit the page type first to add attributes and procedure calls. When you are happy with the page type, and are ready for page creators to start creating pages of that type, you must make the page type available in the page group.

To make a page type available to a page group:

  1. From the Page Groups portlet's Work In drop-down list, choose the page group to be edited.

    By default, the Page Groups portlet is located on the Build tab of the Builder page.

  2. Click the Configure tab.

  3. In the Page Defaults section, click the Edit link.

    Note:

    You can also reach the Configure Types and Classification page by clicking the Configure link on the first page of the Create Page Wizard.

  4. From the Hidden Page Types list, select the page type that you want to make available.

    The Hidden and Visible Page Type lists include all the base page types, and the page types owned by this page group and the Shared Objects page group.

  5. Click the Move icon to move the selected page type into the Visible Page Types list.

    The order of page types in the Visible Page Types list determines the order in which the page types are displayed in the Page Type list when creating a page.

  6. Click OK to return to the Configure tab.

  7. Click Close.

You can also exclude a page type from a page group, meaning that page creators cannot create pages of that type in the page group. For example, if you have created your own page types, you might want to exclude some of the base page types from the page group. To do this, select the page type in the Visible Page Type list and click the Remove icon.

5.2.3.4 Deleting a Page Type

When you delete a page type, all pages of that type and all the items in those pages are also deleted. You cannot undo this action.

Take care when deleting a page type from the Shared Objects page group. Page types in the Shared Objects page group may be used across page groups. Deleting a page type from Shared Objects removes it from all page groups that use it.

Note:

You cannot delete the base page types.

To delete a page type:

  1. Use the Navigator to browse to the page type that you want to delete.

    To get to the Navigator click the Navigator link on any page. By default you can find a Navigator link on the Portal Builder page.

    Tip:

    If the page type is shared, it will be in the Shared Objects page group. See Section 4.6, "Sharing Objects Across Page Groups"

  2. In the row for the page type, click the Delete link.

  3. In the confirmation page, click Yes.