Tải bản đầy đủ (.pdf) (18 trang)

Preference Manifests and “Raw” Preferences

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (620.14 KB, 18 trang )


10
Chapter
Preference Manifests and
“Raw” Preferences
In Chapter 5, we introduced the use of Apple’s Workgroup Manager application for
creating managed preference .plist files. Workgroup Manager covers a lot of ground,
but at its heart it is a tool for working with directory service data. There are panes for
working with user accounts, user groups, computer accounts, and computer groups.
Since preferences can be managed for each of these types of directory objects,
Workgroup Manager also features a managed preferences editor.
The editors provided by Apple are very helpful for the preferences they cover. But what
if you want to manage additional preferences beyond those covered by the Workgroup
Manager Preferences overview? In this chapter, we’ll explore ways to use Workgroup
Manager to edit even more managed preferences. First, we’ll look at using ‘‘preference
manifests,’’ which provide a useful guide to manageable preferences. Finally, we’ll show
you how to manage preferences for any application that stores its preferences in Apple’s
.plist format. For this, we’ll import ‘‘raw’’ preference files.
First, let’s review the editors provided by Apple in the Workgroup Manager Preferences
Overview.
Preferences Overview
The Preferences Overview, shown in Figure 10-1, provides a friendly, easy-to-
understand user interface for managing various preferences.
CHAPTER 10: Preference Manifests and "Raw" Preferences
150

Figure 10-1. Workgroup Manager Preferences Overview
NOTE: You may not see every preference that is shown in Figure 10-1. If you are editing
managed preferences for a user object or group of users, Energy Saver and Time Machine will
not be displayed as they can be managed only for computers of computer groups.
Here, preferences are placed in logical groups. When you select a preference group,


such as Login, you’ll see a set of controls (i.e., editors) specifically designed for that
group of preferences, as in Figure 10-2.
CHAPTER 10: Preference Manifests and "Raw" Preferences
151

Figure 10-2. Login managed preferences editor
These Apple-provided managed preferences editors are a great convenience. The
options are specified in language similar to the language you see in the equivalent
System Preferences pane. For example, the preferences to display the login window
that contains a list of users is described with similar terminology as you’d see in the
Accounts pane of the System Preferences application (where the option appears as
‘‘Display login window as: List of users’’). Figure 10-3 shows the System Preferences
Accounts pane, so you can compare.
CHAPTER 10: Preference Manifests and "Raw" Preferences
152

Figure 10-3. System Preferences Accounts pane
Apple’s managed preferences editors contain pop-up menus, radio buttons, and check
boxes to guide you through the available options. Apple has also provided some hints
that help you understand which options are effective with which versions of Mac OS X.
This is important if you are managing Macs running different major releases of Mac OS
X. For example, you may have a mix of Tiger, Leopard, and Snow Leopard machines
that you must support, and not all preferences apply to all versions of Mac OS X.
However, the editors available in the Preferences Overview do not cover every single
preference that can be managed. You can manage additional preferences by using
Workgroup Manager’s Details tab in the Preferences pane, shown here in Figure 10-4.
CHAPTER 10: Preference Manifests and "Raw" Preferences
153

Figure 10-4. Workgroup Manager Preferences Details

If you look in Workgroup Manager on your Mac and don’t see a list of preference
domains in the Preferences Details as in Figure 10-4 (that is, the list of preference
domains is empty or nearly so), don’t worry. By default, this list is pretty empty. This list
gets populated in two ways:
 by importing preference manifests
 by importing raw preferences
Let’s explore each option in the following sections.

CHAPTER 10: Preference Manifests and "Raw" Preferences
154
Importing a Preference Manifest
Apple provides a number of interesting and useful preference manifests that you can
import from ManagedClient.app. A preference manifest is yet another type of .plist file,
distinct from preferences themselves, which are also stored in .plist files. A preference
manifest describes which manageable preference keys are available for a given
application, and what type of data they must contain. In other words, a preference
manifest is a sort of guide to what can be managed for a specific application.
Apple provides a nice set of manifests that you can import all in one fell swoop. In
Workgroup Manager, select an item (user, group, computer, or computer group) and
click the Preferences icon in the toolbar. Click the ‘‘Details’’ tab, and you should find
yourself in the Preferences Details pane (shown in Figure 10-4). To import a set of
preference manifests, click the plus button below the list, and navigate to
/System/Library/CoreServices. Select the ManagedClient application and click the
‘‘Add’’ button, as shown in Figure 10-5.

Figure 10-5. Importing preference manifests from ManagedClient.app
CHAPTER 10: Preference Manifests and "Raw" Preferences
155
Once you’ve imported the preference manifests from ManagedClient.app, your list
of preference domains should look a lot more like the ones shown previously in

Figure 10-4.
Working with Preference Manifests
As you can see, there are now several new interesting things available to manage. As an
example, let’s look at Desktop Picture. Let’s say we wanted to give all our users an initial
desktop picture that was specific to our organization. With Workgroup Manager and our
newly imported preference manifests, this is pretty easy.
Start by double-clicking the Desktop Picture entry in the list of preference names (again,
as shown in Figure 10-4). You’ll see a preferences details editor like the one in Figure
10-6. You may also notice that the title of the preferences details editor matches the
‘‘ p r e f e r e n c e d o m a i n ’’ y o u a r e e d i t i n g -----in this case, com.apple.desktop.

Figure 10-6. Desktop Picture preferences details editor
If this looks familiar, it may be because this editor greatly resembles Apple’s Property
List Editor application, introduced in Chapter 4. (See Figure 4-1 from that chapter for a
visual comparison.) Like Property List Editor, the preferences details editor provides an
outline-like structure for the preference keys you are managing. Figure 10-6 shows three
e m p t y d i c t i o n a r i e s t o s t a r t -----one each for ‘‘Once,’’ ‘‘Often,’’ and ‘‘Always.’’ These are
three of the four preference management frequencies discussed in Chapter 9.
NOTE: The fourth----‘‘Never’’----doesn’t get its own dictionary. If you want to manage a
preference ‘‘Never,’’ just don’t add it to the managed preferences!

×