Oracle
  Home arrow Oracle arrow Page 2 - Working with Themes and Templates
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Working with Themes and Templates
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-03-29

    Table of Contents:
  • Working with Themes and Templates
  • Switching an Application’s Theme
  • Templates
  • Editing an Existing Template

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with Themes and Templates - Switching an Application’s Theme


    (Page 2 of 4 )

    Clicking the Switch Theme button on the Themes page shown in Figure 6-1 takes you into a wizard that walks you through the steps necessary to change an application’s current theme. The Switch Theme button is not available if there is only one theme; you must create another before this button will appear.

    The first page of the Switch Theme Wizard allows you to select a new theme. The second page verifies the compatibility of the selected theme with the application’s existing pages and objects. The last page asks for confirmation of the switch.

    When switching templates, HTML DB accomplishes mappings from one theme to another through template class identifiers. Each template is assigned to a template class in the first section of the template edit page. For instance, a specific button template might be associate with the “Button” or “Button – Alternate 1” class identifier, among others. By checking the compatibility of themes, HTML DB ensures the new theme contains a template of the same class for every class of template being used. For example, if the application has a button that uses a button template with a “Button – Alternate 1” class identifier, HTML DB ensures that the new theme contains a Button template also associated with the “Button – Alternate 1” class.

    If the new theme has two or more templates of the same class, you will see “Warning” in the Status column and a pick list in the To Template column on the Verify Theme Compatibility pages, as shown in Figure 6-2. The pick list allows you to select which template you want to map to in the new theme. Note that the columns are actually mislabeled; they are in fact To and From Template, not To and From Template Class. The To and From templates are matched by their corresponding template classes.

    If one of the mappings fails, you will see “Error” in the Status column and you will not be allowed to proceed to the next page of the wizard. An error occurs if either a From template is not associated with a template class or a To theme does not have a template of the same class.

    To resolve these errors, note the template name, listed under the From Template column, for each one that has an “Error” status. Cancel out of the switch process. This returns you back to the main Themes page. Click on the small Theme Reports tab, just below the breadcrumb menu, and view the Application Templates report for the existing theme. The report lists each template in the theme by theme type along with its name and associated template class. Observe the template classes for the template name noted earlier. If there is no template class listed, that is part of the


    Figure 6-2.  Theme compatibility

    problem. You must edit your existing template and assign a template class to each template and then try the switch again. If a template class is listed for the template, you must have a template with a corresponding template class in your To theme. In the theme you wish to switch to, create a new (or edit an existing) template of the proper type and associate it with the same template class.

    NOTE

    When an application is converted from version 1.5 to 1.6 or 2.0, an initial theme will be created from the application’s templates. The templates will not be assigned a template class. If you want to switch templates, you will have to edit each template and assign it a template class.

    Creating New Themes

    Like the theme-switching process, the process to create a new theme is also accomplished through a wizard. Start the wizard by clicking on the Create Theme button on the Themes page, as shown earlier in Figure 6-1. The first screen of the wizard presents the three options for creating themes: From the HTML DB Repository, From Scratch, and From Export.

    HTML DB comes with a repository of a dozen different themes. If you decide to create a theme based on one from the repository, you will be taken to a screen to select from one of the canned themes. After you have created the new theme, you can alter it in any way you would like. If you select the option to create a theme from an export, the wizard will take you through the process of importing an export file from another application. Exporting and importing of applications and their components is covered in Chapter 7. This is the method you would use to copy a theme from one application to another.

    If you select to create a theme from scratch, you will be taken to a screen to name your new theme and then an empty theme will be created. This is the method you use if you want to create all your own templates or copy templates from other different themes. When you create new templates, you can copy them from templates in themes in other applications within your workspace. Before version 1.6, it was not possible to copy templates between applications. When you copy a template, you can subscribe to the original template. If changes are made to the original template, you can update the subscribed template. However, if you do update the subscribed template, any modifications you made will be lost. For more information, refer to the upcoming section, “Creating and Copying Templates.”

    NOTE

    Versions 1.6 and above allow you to share templates between applications in the same workspace.

    Specifying a Theme’s Default Template

    Within a theme you can specify a default template for each type of template. When an application uses a theme and a specific template is not specified for an object, that object will use the theme’s corresponding default template. Clicking the name of a theme listed on the Themes page, as shown earlier in Figure 6-1, will navigate you to the Create/Edit Theme page, shown in Figure 6-3. Here, you can select a default template for each type of template. For page- and region-type templates, you may specify several defaults based on the type of page or type of region. Notice there is no place to set a default template for Popup LOVs; this is because only one Popup LOV template is allowed per theme.


    Figure 6-3.  Create/Edit Theme page

    More Oracle Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "Oracle HTML DB Handbook," published by...
     

    Buy this book now. This article is excerpted from chapter 6 of the Oracle HTML DB Handbook, written by Lawrence Linnemeyer and Bradley Brown (McGraw-Hill, 2006; ISBN: 0072257687). Check it out today at your favorite bookstore. Buy this book now.

       

    ORACLE ARTICLES

    - Implementing and Using Oracle`s Restore Poin...
    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway