04.12.2012 Views

Windchill System Administrator's Guide

Windchill System Administrator's Guide

Windchill System Administrator's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The fully qualified preference key is combined with a context to form a unique<br />

row in the database table. This makes it possible for users and other divisions to<br />

have separate preferences.<br />

Preference Macros<br />

The wt.prefs.WTPreferences class defines the following types of preference<br />

context macros:<br />

• USER_CONTEXT - the context for individual users.<br />

• DEFAULT_CONTEXT - the context for the system default (shipping) values.<br />

• CONTAINER_CONTEXT - a context used in the container hierarchy.<br />

• CONTAINER_POLICY_CONTEXT - a container context that is enforced as<br />

a policy.<br />

• DIVISION_CONTEXT - the context used for any scopes defined in addition<br />

to the default, container, and user scopes.<br />

• DIVISION_POLICY_CONTEXT - a division context that is enforced as a<br />

policy.<br />

Creating a Preference Hierarchy<br />

A familiar example of a hierarchy is a modern corporation, which is composed of<br />

divisions. The divisions are composed of departments, which are composed of<br />

teams consisting of users.<br />

This hierarchical structure could be managed by preference delegates for defining<br />

user preferences, as in the following structure:<br />

• The bottom level in the hierarchy (users) would be managed by the<br />

wt.prefs.delegates.UserDelegate, which implements the Macro<br />

USER_CONTEXT.<br />

• The top level (above the corporation) would be the DEFAULT_CONTEXT,<br />

managed by the wt.prefs.delegates.Default<strong>System</strong>Delegate.<br />

These delegates can be replaced by customized delegates; however, the<br />

customized delegate must implement the DEFAULT_CONTEXT and<br />

USER_CONTEXT macros for the preferences framework to operate properly.<br />

See the <strong>Windchill</strong> Javadoc for details on the implementation of these delegates.<br />

For the rest of the hierarchy, delegates must be written to extend<br />

PreferenceDelegate and implement the abstract methods. The number of delegates<br />

that perform this task can be variable, each level may have its own delegate, or a<br />

single delegate can be used to handle the body of the tree.<br />

Use the following procedure to add a delegate to the preference hierarchy:<br />

1. Add the delegate in the appropriate place in the delegates.properties file,<br />

located in codebase/wt/prefs/delegates.<br />

1-30 <strong>Windchill</strong> <strong>System</strong> Administrator’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!