com.orchestranetworks.schema
Interface TableRefDisplay


public interface TableRefDisplay

Defines a custom renderer for presenting a foreign key constraint depending on the context of a node. For example:

 <xs:annotation> 
 		<xs:appinfo> 
			<osd:otherFacets> 
			 <osd:tableRef> 
				<tablePath>../catalog</tablePath> 
				<display osd:class="com.foo.CatalogRenderer"> 
					<param1>...</param1> 
					<param2>...</param2>
				</display>
			 </osd:tableRef>
			</osd:otherFacets>
		</xs:appinfo>
</xs:annotation>
where com.foo.CatalogRenderer is the fully qualified name of classes implementing this interface. The declaration may also use parameters:
 <display class="com.foo.CatalogFilter">
     <param1>...</param1>
     <param2>...</param2>
 </display>
where param1 and param2 are JavaBean properties of com.foo.CatalogRenderer class.

For more information, read JavaBeans specification.

Life cycle

  1. When the schema is loaded:
    1. the specified class is instantiated through its default constructor and the JavaBean properties' setters are called (in the example above, setParam1(...) and setParam2(...));
    2. the method setup(TableRefDisplayContext) is called on the new instance.
  2. In operational phase: the method displayOccurrence(Adaptation, Locale) is called each time an associated element has to be displayed.


Method Summary
 String displayOccurrence(Adaptation anOccurrence, Locale aLocale)
          Returns, for user display, a label representing the specified record.
 void setup(TableRefDisplayContext aContext)
          This method is called when the schema is loaded, for checking and preparing this instance.
 

Method Detail

setup

public void setup(TableRefDisplayContext aContext)
This method is called when the schema is loaded, for checking and preparing this instance.

This method can also declare a specific sort criteria.


displayOccurrence

public String displayOccurrence(Adaptation anOccurrence,
                                Locale aLocale)
                         throws InvalidSchemaException
Returns, for user display, a label representing the specified record.

Internationalization strategy

The method can return null if the specified locale is not handled by the current implementation. Indeed, the container is able to try several locales for handling a partial internationalization of this method's implementation and/or a mismatch between the locales declared by the associated module and the locales supported by EBX.Platform. In such cases, locales are tried in the following order:

  1. user's preferred locale for schema;
  2. session's current locale;
  3. default locale declared in file module.xml;

Multi-threading

For a single instance of this interface, this method may be called concurrently by several threads.

Parameters:
anOccurrence - The occurrence adaptation that must be displayed. It is never null.
aLocale - The current locale. It is never null, see "Internationalization strategy" above.
Throws:
InvalidSchemaException - if some schema's dynamic condition prevents the execution of this method.


(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.