14.12 Using Item Version Control

Item versioning makes it possible for multiple versions of an item to exist simultaneously in the Oracle database. This feature is useful for tracking document changes from one version to the next and allows for reverting to a previous version if necessary.

This section discusses using version control with items. It includes the following subsections:

Oracle Portal provides item version control settings for page groups and for individual pages. Additionally, item versioning is relevant to translations. For more information, see Section 5.5.2, "Setting the Item Versioning Level for a Page Group", Section 7.1, "Enabling Item Versioning for Page Groups, Pages, and Templates", and Section 19.3.2, "Translations and Item Versioning".

Note:

With custom item types, you can manually specify the numbering scheme to use for versioning with the Version Number attribute. If you plan to specify a default value for the Version Number attribute, do not use a constant value, such as 2. Because an item cannot have, for example, two version 2s on the same page, providing a static default value for the Version Number field results in an error. Instead, consider creating a default function that returns a unique value and calling the function with a procedure. For more information on adding a procedure call to an item type, see Section 5.2.2.2.3, "Adding a Procedure Call to an Item Type".

14.12.1 Changing Version Control Settings for an Item

When version control is enabled for items on a page, you can change the version control settings for most items. Exceptions to this include items with a status of either pending or draft. Such items do not have version control settings.

To change version control settings for an item:

  1. Log in to Oracle Portal.

  2. Go to the page that contains the items for which to set a versioning level.

    For information on locating a page through the Page Groups portlet, see Section 8.1, "Locating Pages in Oracle Portal".

  3. Click the Edit link at the top of the page.

    This opens the page in Edit mode.

  4. Click the Edit Item icon beside the relevant item (Figure 14-35).

    Figure 14-35 The Edit Item Icon

    Edit Item icon
  5. In the Item Version Control radio group, select the item version control option to apply to this item.

    • Simple

      • Add Item As New version, but not as Current Version

      • Add Item As New and Current Version

      • Overwrite Current Version

      For the first two options, Oracle Portal maintains a record of the item's previous versions.

    • Audit

      • Add Item As New version, but not as Current Version

      • Add Item As New and Current Version

      For both of these options, Oracle Portal maintains a record of the item's previous versions.

  6. Click OK.

Note:

The item version control options change when you are working in a language other than the default language view (a translated view) of the page group or page, Simple or Audit versioning is enabled, and the default-language view has a more-recent version of the item. For more information, see Section 19.3.3, "Copying Translatable Attributes".

14.12.2 Changing the Active Current Version of an Item

Once you have multiple versions of an item, you may want to change which version of the item is displayed to users.

To change the current version of an item:

  1. Log in to Oracle Portal.

  2. Go to the page where the item for which to set versioning is located.

    For information on locating a page through the Page Groups portlet, see Section 8.1, "Locating Pages in Oracle Portal".

  3. Click the Edit link at the top of the page.

    This opens the page in Edit mode.

  4. Click the Actions icon next to the relevant item (Figure 14-36).

    Figure 14-36 The Actions Icon

    Actions icon
  5. Click the Versions link.

  6. Select the version to use as the current active version, and click OK.

    The selected version of the item now displays to users. All other versions are maintained in the database and are available for selection as the current version.

14.12.3 Using Your Own Version Numbering Scheme

Using custom item types, you can establish your own version numbering scheme for versions of items that you add to your portal. Every time users update an item, they can manually enter the next version according to your company's version numbering scheme, then save the item as a new version.

If users do not provide a value for the Version Number attribute when they save the item as a new version, Oracle Portal automatically assigns a new value, using the algorithm ceil() + 1. (Ceil stands for ceiling, which is the next available whole number following a fraction.)

For example, if the last version was 3, then 4 is automatically assigned as the next version. However, if the last version was 3.1, then 5 is automatically assigned as the next version. This is because the ceiling for the number 3.1 is 4, and 4 + 1 = 5.

Keep in mind that you must use numerals and no other type of character. Additionally, you can use only one decimal point. You can establish a version series, such as 1, 2, 3 or 1.1, 1.2, 1.3, but not 1.1.1 or 1a.

To use your own version numbering scheme:

  1. Create a custom item type.

    For information on how to create a custom item type, see Chapter 5, "Preparing to Add Content".

  2. Add the Version Number attribute to the item type.

    Be sure to expose the Version Number attribute in the Add and Edit wizards.

  3. Configure the page group to allow the new item type.

    For information on how to make an item type available to a page group, see Section 5.2.2.3, "Making an Item Type Available to a Page Group".

  4. Turn on item versioning for the page.

    For information on enabling item versioning for a page, see Chapter 7, "Defining and Displaying Page Information".

  5. Add an item of the new custom type to the page.

    The Add Item wizard includes the Version Number attribute that you added to the custom item type on which this item is based.

    For information on adding an item to a page, see Section 14.2, "Adding Items to a Page".

  6. Provide a numeric value for the Version Number attribute.

    This value must be an arabic numeral (that is, 1, 2, 3, and so on) and can include one decimal point.

  7. Finish adding your item.

When users update the item, the Version Number attribute is exposed in the Edit Item wizard. Users can enter the appropriate incremental value according to your established numbering scheme and save the item as a new version.

14.12.4 Images and Item Versioning

If you are using item versioning and you always want to show the current version of an image—whether the image is the item itself or an attribute associated with the item—use the image's durable URL instead of the internal file name. The durable URL always picks up the latest version of the image. So, instead of entering the image's internal name, for example, 1645.GIF, enter:

/portal/page/<DAD>/<GUID>

This is the relative URL format of a durable URL. With values, it looks like the following:

/portal/page/mydad/A47D41ECA23648A9E030007F0100118A

Always use relative URLs to maintain the integrity of the reference should the host or domain name change, or should the content be exported to another site.

You can obtain the item's durable URL by displaying the Property Sheet attribute in the region hosting the item. Once the Property Sheet attribute is displayed in the region, click the Property Sheet icon (Figure 14-37) next to the item, and copy the portion of the durable URL you will be using. The durable URL is listed next to the heading Item Link. For more information about displaying region attributes, see Section 10.2.9, "Changing the Attributes Displayed in a Region".

Figure 14-37 The Item Property Sheet Icon

Item property sheet icon

The property sheet you view when you click the Property Sheet icon is different from the one you view when you right click the image and select Properties from the resulting pop-up menu. To get the image's durable URL, always click the Property Sheet icon.