Configuring OJB Console

This section provides information about configuration options for the OJB Console.

Configuration Files

If you recall reading about the directory structure, you will remember the following structure. Below is some additional information about the specific configuration files read by the OJB Console. When building the ojbc.war, these files are bundled into the .war
objc-<version>
|---- + etc                           // the configuration directory
|        + ---- objc                  // the OBJ Console configuration files
|                - ui_repository.xml  // the primary configuration file (see sections below)
|                - OJBC.properties    // the console specific properties file 
|                - OJBC.xml           // the internal console configuration file

ui_repository.xml

This is the primary configuration file. The XSD can be found for the file in etc/castor/objectconsole.xsd
  1. Adding User Friendly Names

    You can specify an alternate name to be displayed when referring to a class or field. For instance, if you have a class org.scrashmeow.ojb.content.PhotoAlbum. You might rather the words "Photo Album" be used by the console rather than the actual class name. These user friendly names can be specified in the class-descriptor section of the ui_repository.xml. You can also configure field-descriptors using the same mechanism. See the widget examples below for an example related to field-descriptors. For example:
    
    <!-- localized text -->
    	
    <class-descriptor name="org.scrashmeow.ojb.content.PhotoAlbum">
          <!-- Specifies the message keys for the name and message key for the help text. --!>
          <!-- These keys must exist in the src/resources/org/scrashmeow/ojb/resources/ApplicationResources*.properties files --!>
          <ui-descriptor>
              <name-key>object.photo.name</name-key>
              <help-key>object.photo.help</help-key>
          </ui-descriptor>
    </class-descriptor>
    
    <!-- or non-localized version -->
    	
    <class-descriptor name="org.scrashmeow.ojb.content.PhotoAlbum">
          <ui-descriptor>
               <name>Photo Album</name>
               <help>A Collection of Photos</help>	
          </ui-descriptor>
    </class-descriptor>
    	
    
  2. Filtering Browseable Classes

    You can specify exactly which classes should be displayed from the available browseable classes This can be useful when you only want the user to see a specific set of classes. The following example demonstrates how this can be done
    
    <browseable-classes>
        <!-- includes the class Photo and Photo Album -->
        <include>org.scrashmeow.ojb.content.Photo</include>
        <include>org.scrashmeow.ojb.content.PhotoAlbum</include>
    		
              <!-- or -->
    		 
        <!-- excludes the class Photo Album-->
        <exclude>org.scrashmeow.ojb.content.PhotoAlbum</exclude>
            
    </browseable-classes>
    	
    
    
    If both are used, there is a attribute defaultExcludes="true|false" that configures what logic should be for
    the unmentioned classes.
    
    <browseable-classes defaultExcludes="true" > ... 
    
  3. Customize Field Descriptors

    You can specify user friendly names for field descriptors. In addition, you can specify the widget that should be used on the Insert/Edit form. The following example demonstrates both of these concepts. The field-descriptor elements go in between your class-descriptor elements. Note: The localized versions are available as well. See the section above for an example.
    	<class-descriptor name="org.scrashmeow.ojb.content.News">
    	
    	<!-- customize the ui label of the class -->
    	<ui-descriptor>
    		<name>News</name>
    		<help>Web Site News Article</help>
    	</ui-descriptor>
     
    	<!-- customize the field -->
    	<field-descriptor name="body">
    	
    		<!-- customize the ui label of the field -->
    		<ui-descriptor>
    		  <name>Body</name>
    		   <help>The Body of the Article</help>
    	    </ui-descriptor>
    	    
    	    <!-- customize the widget for the field -->
    		<widget-descriptor id="textarea">
    		
    		  <!-- configure properties on the widget -->
    			<widget-param>
    				<name>rows</name>
    				<value>10</value>
    			</widget-param>
    			<widget-param>
    				<name>cols</name>
    				<value>40</value>
    			</widget-param>
    				
    		</widget-descriptor>
    			
    	</field-descriptor>
    
    	<!-- customize the widget for the field -->
    	<field-descriptor name="createDate">
    		<widget-descriptor id="createDate" />
    	</field-descriptor>
    	
    	<!-- customize the widget for the field -->
    	<field-descriptor name="modifiedDate">
    		<widget-descriptor id="modifiedDate" />
    	</field-descriptor>
    
    	<!-- customize the widget for the field -->
    	<field-descriptor name="subject">
    		
    		<widget-descriptor id="textfield">
    			<widget-param>
    				<name>size</name>
    				<value>40</value>
    			</widget-param>
    		</widget-descriptor>
    
    	</field-descriptor>
    	
    	</class-descriptor>
    
    

OJBC.xml

The OJBC.xml is an internal configuration file. You should not modify this file unless you are extending the application or know what you are doing. This file contains data type mappings, widget definitions, and navigation definitions.

OJBC.properties

There are very few options allowed in this configuration file at the present time. Feel free to take a look.

Copyright © 2003 Alexander Bibighaus et al. All rights Reserved.