develop-20 9412 December 1994
From the originals
13 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
PowerPC Branch Prediction • Text Tracks in Movies • A Space-Saving PICT Trick develop The Apple Technical Journal Issue 20 December 1994 Getting the Most out of AOCE Catalog Records Exploring Advanced AOCE Templates Make Your Own Sound Components Scripting the Finder From Your Application NetWare on PowerPC Improving QuickDraw GX Printer Driver Performance $10.00
A cover with a white left column of green and black cover lines beside a vivid red, green and blue collage of three stacked open books with pixelated blobs and eye and ear-like shapes on a textured background.
Reading notes: The magazine name is set in widely spaced lowercase letters and the tagline is small and spaced, so exact letter spacing is approximate. The bottom-left price line is small and was read as $10.00. Reading order of the cover lines follows the visual top-to-bottom order in the left column.
- Printed product names
- develop
- Printed prices
- $10.00
- Printed dates
- December 1994 · 1994
- Languages
- English
PDF page 1
PowerPC Branch Prediction • Text Tracks in Movies • A Space-Saving PICT Trick develop The Apple Technical Journal Issue 20 December 1994 Getting the Most out of AOCE Catalog Records Exploring Advanced AOCE Templates Make Your Own Sound Components Scripting the Finder From Your Application NetWare on PowerPC Improving QuickDraw GX Printer Driver Performance $10.00
A colorful cover with a white left column of green and black cover lines and a right-side psychedelic illustration of open books, eyes, and pixelated shapes over red, green, and blue textured backgrounds, with a purple banner across the top and the Apple logo at upper right.
Reading notes: The small text along the top banner and the 'The Apple Technical Journal' tagline are small but legible; no spans were illegible. Reading order of cover lines is top to bottom in the left column, and the issue line is placed under the masthead at right.
- Printed product names
- develop: The Apple Technical Journal
- Printed prices
- $10.00
- Printed dates
- December 1994 · Issue 20
- Languages
- English
PDF page 2
E D I T O R I A L S T A F F Editor-in-Cheek Caroline Rose Managing Editor Toni Moccia Technical Buckstopper Dave Johnson Bookmark CD Leader Alex Dosher Able Assistants Meredith Best, Liz Hujsak Our Boss Greg Joswiak His Boss Dennis Matthews Review Board Pete “Luke” Alexander, Ray Chiang, Dave Hersey, Dave Radcliffe, Jim Reekes, Bryan K. “Beaker” Ressler, Larry Rosenstein, Andy Shebanow, Gregg Williams Contributing Editors Lorraine Anderson, Steve Chernicoff, Toni Haskell, Judy Helfand, Jody Larson, Joe Williams Indexer Marc Savage A R T & P R O D U C T I O N Production/Art Director Diane Wilcox Technical Illustration Sandee Karr Formatting Forbes Mill Press Photography Sharon Beals, Jean-Eric Garnier, Marcie Griffin, Mark Maxham On-line Production Cassi Carpenter ISSN #1047-0735. © 1994 Apple Computer, Inc. All rights reserved. Apple, the Apple logo, APDA, AppleLink, AppleTalk, HyperCard, LaserWriter, MacApp, Macintosh, MacTCP, MPW, Newton, QuickTime, SANE, and TrueType are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. AOCE, AppleScript, A/ROSE, Balloon Help, ColorSync, develop, Finder, NewtonMail, NewtonScript, OpenDoc, Power Macintosh, PowerShare, PowerTalk, QuickDraw, and Sound Manager are trademarks of Apple Computer, Inc. PostScript is a trademark of Adobe Systems Incorporated, which may be registered in certain jurisdictions. PowerPC is a trademark of International Business Machines Corporation, used under license therefrom. UNIX is a registered trademark of UNIX System Laboratories, Inc. All other trademarks are the property of their respective owners. T H I N G S T O K N O W develop, The Apple Technical Journal, a quarterly publication of Apple Computer’s Developer Press group, is published in March, June, September, and December. develop articles and code have been reviewed for robustness by Apple engineers. This issue’s CD. Subscription issues of develop are accompanied by the develop Bookmark CD. The Bookmark CD contains a subset of the materials on the monthly Developer CD Series , which is available from APDA. Included on the CD are this issue and all back issues of develop along with the code that the articles describe. The develop code is updated when necessary, so always use the most recent CD. The CD also contains Technical Notes, sample code, and other useful documentation and tools (these contents are subject to change). Software and documentation referred to as being on this issue’s CD are located on either the Bookmark CD or the Reference Library or Tool Chest edition of the Developer CD Series . The develop issues and code are also available on AppleLink and via anonymous ftp at ftp.apple.com. Macintosh Technical Notes. Where references to Macintosh Technical Notes in develop are followed by something like “(QT 4),” this indicates the category and number of the Note on this issue’s CD. (QT is the QuickTime category.) E-mail addresses. Most e-mail addresses mentioned in develop are AppleLink addresses; to convert one of these to an Internet address, append “@applelink.apple.com” to it. For example, DEVELOP on AppleLink becomes develop@applelink.apple.com on the Internet. To convert a NewtonMail address to an Internet address, append “@online.apple.com” to it. C O N T A C T I N G U S Feedback. Send editorial suggestions or comments to Caroline Rose at AppleLink CROSE, Internet crose@applelink.apple.com, or fax (408)974-6395. Send technical questions about develop to Dave Johnson at AppleLink JOHNSON.DK, Internet dkj@apple.com, CompuServe 75300,715, or fax (408)974-6395. Or write to Caroline or Dave at Apple Computer, Inc., One Infinite Loop, M/S 303-4DP, Cupertino, CA 95014. Article submissions. Ask for our Author’s Guidelines and a submission form at AppleLink DEVELOP, Internet develop@applelink.apple.com, or fax (408)974-6395. Or write to Caroline Rose at the above address. Subscriptions. Subscribe to develop through APDA (see below) or use the subscription card in this issue. For subscription changes or queries, call 1-800-877-5548 in the U.S. or (815)734-1116 outside the U.S., or write to AppleLink DEV.SUBS, Internet dev.subs@applelink.apple.com, or develop , P.O. Box 531, Mount Morris, IL 61054-7858. Back issues. Printed back issues are available for $13 each in the U.S. or $20 outside the U.S. To order, call 1-800-877-5548 in the U.S. or (815)734-1116 outside the U.S., or write to AppleLink DEV.SUBS, Internet dev.subs@applelink.apple.com, or develop , P.O. Box 531, Mount Morris, IL 61054-7858. APDA. To order products from APDA or receive a catalog, call 1-800-282- 2732 in the U.S., 1-800-637-0029 in Canada, (716)871-6555 internationally, or (716)871-6511 for fax. Order electronically at AppleLink APDA, Internet apda@applelink.apple.com, CompuServe 76666,2405, or America Online APDAorder. Or write APDA, Apple Computer, Inc., P.O. Box 319, Buffalo, NY 14207-0319. Printed on recycled paper d e v e l o p
Reading notes: Transcript is intentionally empty because the exact extracted text is preserved separately. No headline or advertised products are identifiable in the supplied copy, so headline is null and productNames is empty. Prices $13 and $20 are back-issue prices from the subscription and ordering copy, not advertising. Column reading order for the multi-column staff and contact sections was inferred from the supplied text and may not match the physical layout. Printed names such as 'Editor-in-Cheek' and 'Technical Buckstopper' are kept as supplied, and the stray 'd e v e l o p' logo line appears at the end of the copy.
- Printed prices
- $13 · $20
- Printed dates
- 1994
- Languages
- English
PDF page 3
A R T I C L E S 5 Getting the Most out of AOCE Catalog Records by Christine Buttin AOCE templates let you extend AOCE catalogs to store new kinds of data. This article introduces you to writing AOCE templates by providing an example template that extends the built-in User record. 26 Exploring Advanced AOCE Templates Through Celestial Mechanics by Harry R. Chesley AOCE templates allow you to specify how the Finder displays your data and how the user interacts with it. This article shows how to use some of the more advanced features of the template mechanism. 50 Make Your Own Sound Components by Kip Olson Sound Manager 3.0 supports plug-in components for compression, decompression, custom hardware support, and more. This introduction to Sound Manager components will get you started. 65 Scripting the Finder From Your Application by Greg Anderson The System 7.5 Finder is OSL-compliant, opening the door to full scriptability and to direct manipulation through Apple events. Here’s how to talk to the Scriptable Finder from your application. 84 NetWare Development on PowerPC by Jamie Osborne With NetWare now on the Power Macintosh, you may want to write your network products to use it. This introduction to the NetWare environment includes a simple sample module. C O L U M N S 44 SOMEWHERE IN QUICKTIME Supporting Text Tracks in Your Application by Nick Thompson How to support text tracks in your application, allowing both searching and editing. 63 GRAPHICAL TRUFFLES A Space-Saving PICT Trick by Guillermo A. Ortiz and Dave Johnson If you’re storing a large set of pictures with the same colors, here’s a neat trick to reduce its size. 79 PRINT HINTS Improving QuickDraw GX Printer Driver Performance by Dave Hersey Understanding QuickDraw GX buffering will help you fine-tune the performance of your printer driver. 96 BALANCE OF POWER PowerPC Branch Prediction by Dave Evans Is it science or is it hokum? Only your branch prediction unit knows for sure. 99 Macintosh Q & A Apple’s Developer Support Center answers questions about Macintosh product development. 109 THE VETERAN NEOPHYTE Nothing Comes From Nothing by Dave Johnson Creation-shmeation, nothing’s really new; it’s just a rearrangement of what’s already there. Then again, maybe not. 112 Newton Q & A: Ask the Llama Answers to Newton-related development questions; you can send in your own. 117 KON AND BAL’S PUZZLE PAGE Processed Cheese by Cary Clark Process is everything. Or is it? 2 EDITOR’S NOTE 3 LETTERS 122 INDEX Issue 20 December 1994 CONTENTS 1
- Printed product names
- AOCE · Sound Manager 3.0 · System 7.5 · Scriptable Finder · NetWare · Power Macintosh · QuickTime · QuickDraw GX · PowerPC · Macintosh · Newton
- Printed dates
- December 1994
- Languages
- English
PDF page 4
EDITOR'S NOTE
At the Worldwide Developers Conference in May, hundreds of developers volunteered comments on develop , the Developer CD, and related products, writing them either on a big board we set up for that purpose or in a comments box in our electronic survey. The remarks were collated and handed out to the people in Apple’s Developer Press group who are responsible for those products. (Our Able Assistant Meredith Best, whom you can see hard at work with other develop team members on page 111, typed up all those comments that were scrawled on the big board — even the complaints about the conference food and the unique “At what elevation do deer turn into elk?”) So what results come out of this, if any? That’s harder to answer. Of course it depends on the nature of the comment. The result of all the great feedback on develop is that I’ll have the pleasure of doing this job for a while longer. (Thanks especially to the person who wrote “ develop is brilliant! Give Caroline a raise now!”; it was hard convincing my boss I didn’t enter that one myself.) The answers to some questions are really easy. For example, “How about a guest developer column?” is a no-brainer; we’ve always accepted columns from developers (and articles too!) and would be happy to send our author’s guidelines to anyone who’s interested. Most of the comments from the conference are in the process of being assimilated, and what they’ll yield is uncertain, but we do want to thank you for sharing, as we say in California. In turn we’ll share with you some feedback that was among the strongest and that applies to many of you out there as well as to us at Apple: documentation should not be electronic-only. (OK, a couple of developers disagreed, and one said “Ehh, who cares,” but we’re talking overwhelming majority here.) Paper was praised. But it’s clear from other feedback that developers also hold up THINK Reference as a model for viewing documentation on-line. Does this contradict their praise of paper? I think not. They’re recognizing the difference between reference and other types of documentation. They want paper for conceptual information but would like good (fast!) on-line access for reference materials. I for one am happy to see this distinction being made. Not only are the different types of materials too often lumped together when the big question of on-line versus off-line presentation arises, but this separation isn’t being realized enough in printed books either. The first thing I polled developers on when planning NeXT’s technical documentation (in a past life) was this very question, and as a result, the reference-type descriptions were placed in an entirely separate book. Read-once versus read-many — simple. What I’d like to know is, if so many hundreds of you took the time to give us feedback at the conference, why don’t more of you write to develop ? You know where to find us . . . CAROLINE ROSE d e v e l o p Issue 20 December 1994 2 EDITOR’S NOTE CAROLINE ROSE (AppleLink CROSE) has been writing about software ever since the Internet was the ARPAnet. She was originally hired because they wanted the fresh approach of someone new to the industry, which in those days wasn’t hard to find. Now she has to leave town to find someone new to the industry. Caroline loves her job but seems to enjoy leaving town most of all. Her big trip this year was to England, where she especially enjoyed the green rolling hills and quaint old towns of the Cotswolds. She was also crazy about British desserts, particularly the banoffi pie (she lacked the courage, however, to try the Spotted Dick).• Caroline Rose Editor
Reading notes: Headline is ambiguous: the primary heading may be the 'EDITOR'S NOTE' sidebar label rather than the article title. Some product names contain stylized spacing (e.g., 'develop' with decorative markers) that may not reflect exact print spelling.
- Printed product names
- develop · Developer CD · THINK Reference · NeXT
- Printed dates
- May · December 1994 · Issue 20
- Languages
- English
PDF page 5
PENMODE NOT FOR TEXT In the Macintosh Q & A section of develop Issue 18, I noticed the suggestion to use PenMode(srcBic) for drawing white text on a black background. This is wrong; the desired result will be achieved by TextMode(srcBic). Hope this helps. — David Surovell Thanks for the correction. Say, don’t I recognize your name from an article in Issue 19? — Caroline Rose SLIME: IS IT SAFE? As I was reading develop Issue 18, I came across the green slime question in Macintosh Q & A. A friend of mine has been looking for just this recipe, to help keep her preschool-aged daughter amused. However, after reading the recipe, I’m not going to forward it to my friend, because one of the ingredients, borax, is poisonous. Now, I’m not a toxicologist, nor do I play one on TV, so I don’t know exactly how toxic borax is. But I don’t want to find out by letting anyone’s children play with it (not even the nasty little feral children down the street). And what about people who screw up the recipe? Or decide to experiment with it? You didn’t even tell them that straight borax is poisonous. And it’s not like there’s a big “Mr. Yuk” sticker on the box of Twenty-Mule Team, just those friendly-looking equines. You and your staff do a fine job of technical presentation, and you have a process for technical review. You might consider a “toxicity review” before you publish any more recipes for nifty stuff that’s not inherently edible. Ya never know. — Greg Guerin I volunteer at the Exploratorium, a science museum in San Francisco, and we’ve been handing out this slime for months to any kid who wants it. The recipe was acquired from a grade-school teacher and is used in schools all over the country. A chemist at the Exploratorium told me that borax is toxic to about the same degree as soap: if you eat enough of it, you’ll probably get a belly ache. Any kid who’s old enough to have figured out that soap is yucky to eat is plenty old enough, in my opinion. It’s my sincere hope and belief that most develop readers have already reached that stage of maturity. To be absolutely sure, I called the Poison Control center, and they said that to have any toxic effect at all someone would have to eat an awful lot of it. They even told me I didn’t need to bother to wash my hands after handling it. I asked if the soap analogy was a good one, and they said it was accurate. You might recommend corn starch and cold water to your friend. In the right proportions (just enough water to get it all wet) it makes a very satisfying goop (usually called “oobleck” by teachers, after Dr. Seuss) that’s probably more appropriate for very young children. — Dave Johnson DOGCOW IN THINK REFERENCE I really enjoyed reading Mark Harlan’s history of the dogcow in Issues 17 and LETTERS LETTERS 3 IT PAINS US WHEN YOU DON’T WRITE We welcome timely letters to the editors, especially from readers reacting to articles that we publish in develop. Letters should be addressed to Caroline Rose (or, if technical develop-related questions, to Dave Johnson) at Apple Computer, Inc., One Infinite Loop, M/S 303-4DP, Cupertino, CA 95014 (AppleLink CROSE or JOHNSON.DK). All letters should include your name and company name as well as your address and phone number. Letters may be excerpted or edited for clarity (or to make them say what we wish they did).•
Reading notes: Headline and column titles rendered in capitals; reading order of letters and sidebars may be uncertain.
- Printed product names
- Twenty-Mule Team · Macintosh · PenMode · TextMode · Mr. Yuk
- Languages
- English
PDF page 6
18 of develop . He states that Technical Note #31 has not been available for quite a while. That may be so, but something like this Tech Note is hiding inside the THINK Reference databases. Just do a search for “DogCow” and you’ll find it. — Robert Grimm Thanks for pointing out the dogcow lore in THINK Reference; I didn’t know about that. I especially like the part about how, since the dogcow is two-dimensional, she can face a predator head-on to avoid being seen. Although that defensive maneuver sounds likely enough, keep in mind that the dogcow information in THINK Reference is unauthorized and has nothing to do with the Tech Note. The Tech Note gives lots more information, and we’re glad it remains as mysterious as ever. — Caroline Rose PUZZLING OVER THE PUZZLE PAGE After reading Issue 17 of develop , I have a question. I’m not sure what the purpose is in calling KON & BAL’s page a Puzzle Page if it requires that you have access to certain obscure beta ROMs in order to solve the puzzle. Perhaps this is just sour grapes because I’ve never scored above 5? Sure, it still demonstrates various debugging techniques (although I’m not sure that iterative debugging with a reboot after each test is a very useful technique, and this seems quite common in the puzzle pages). But is it really a puzzle? — Peter Lewis KON & BAL chose the Puzzle Page format because they thought it was a fun way to give people debugging tips. They don’t expect readers to take the puzzle aspect of it seriously; in fact, you’re the first one we’ve ever heard from who has scored anything besides 0. None of us were thrilled with Issue 17’s puzzle, but, in KON’s words, “There was a lot of great stuff about how the Resource Manager works, locking down handles, and other really useful advice. We try to demonstrate efficient and good debugging techniques.” Want a better Puzzle Page? Why not write one yourself? We now accept “guest puzzlers,” as you may have noticed. If you’ve got a good idea for a Puzzle Page, please send it to us at AppleLink DEVELOP. — Caroline Rose SAVED BY THE PUZZLE PAGE I’ve enjoyed reading develop since the first issue was published. I find that the articles contain a lot of useful technical information. Normally I try to read each issue when it arrives, but when Issue 16 arrived, it sat for two months while I was finishing a product. About two weeks after the application shipped, a bug was reported where the application would randomly crash with a trashed stack on the PowerBook 180c. We spent a very frustrating Friday trying to reproduce and isolate the bug, but the behavior was inconsistent. Over the weekend, in an effort to catch up on my reading, I picked up develop Issue 16 and read through it. About an hour after I finished, I thought back on KON & BAL’s Puzzle Page, picked the magazine up again, and reread it. Something struck me about the problem they were puzzling over. Their result sounded similar to the problem we were encountering. On Monday, we ran a series of tests in which we were able to prove that the bug was in Sound Manager 2.0 and disappeared under Sound Manager 3.0. If it hadn’t been for the timely coincidence of reading develop and seeing a different manifestation of our bug described, we might have spent a lot longer tracking down the problem. develop saved us a lot of time and frustration. Thanks for the magazine. — Bruce D. Rosenblum d e v e l o p Issue 20 December 1994 4
Reading notes: Reader letters are headed by section titles such as 'PUZZLING OVER THE PUZZLE PAGE' and 'SAVED BY THE PUZZLE PAGE'; the primary heading is uncertain. The issue number appears as 'Issue 20' in the footer while the text references Issue 16 and 17, which is a reading-order caveat.
- Printed product names
- THINK Reference · Sound Manager 2.0 · Sound Manager 3.0 · PowerBook 180c · AppleLink
- Printed dates
- December 1994
- Languages
- English
PDF page 7
Getting the Most out of AOCE Catalog Records
Apple Open Collaboration Environment (AOCE) catalogs can contain any kind of data, which users can browse and edit using the Finder. Developers and knowledgeable end users can write AOCE templates, which add new record types to catalogs and tell the Finder how to display the data. This article describes AOCE templates and provides an example of using templates to extend PowerTalk’s built-in User records to contain your own data. Personal computers are great for storing large amounts of related data. Databases make it possible to organize data and to find individual items quickly, but it takes a long time to set up a database and enter data into it. If you’re a system administrator or in-house developer and you want to provide a database for use by others, you also have to worry about providing and maintaining the database software for everyone involved. If you’re using PowerTalk, however, you already have a way to store information: AOCE catalogs. What’s more, the related Catalogs Extension (CE) to the Finder allows users to browse and edit catalog records with the Finder. The Human Resources group at Apple Computer France wanted to create a directory of Apple personnel that included each person’s name, title, department, address, and a list of keywords to identify areas of expertise. Furthermore, the group wanted to be able to list everyone with a particular area of expertise. Since Human Resources uses a PowerShare collaboration server, there was already a catalog with a User record containing all of the information for everyone with an account on the server, except for areas of expertise. What better way to create the directory than to add the new keyword data to the User records? To list people related to a specific keyword, the group could create keyword records by adding a new record type to the AOCE catalog in which the data was stored. The User records that are defined as part of the PowerTalk system software store information such as a person’s name, title, phone number, and electronic address. PowerTalk uses AOCE templates — resource files that go in the Extensions folder in the System Folder — to tell the CE how to store and display the data. This article shows you how to write AOCE templates that extend User records to hold additional CHRISTINE BUTTIN Getting the Most out of AOCE Catalog Records GETTING THE MOST OUT OF AOCE CATALOG RECORDS 5 CHRISTINE BUTTIN has worked in Developer Technical Support for Apple since 1989, first for Apple Computer Europe and now for Apple France. At the office, they call her the talkative woman, not only because she enjoys chatting, but also because she mainly supports technologies that enable communication (such as AppleTalk, AppleScript, AOCE). When not talking, she spends most of her time practicing Aikido or traveling (she has a special love for the Sahara Desert, where she’s sure to be far away from computers). An extra benefit of her job is that she can regularly visit the U.S., where she has made many good friends. Visiting her American friends might not be as restful as a trip to the Sahara Desert, but it certainly is a lot of fun.•
Reading notes: Reading order of the page number and author biography block is uncertain
- Printed product names
- Apple Open Collaboration Environment (AOCE) · Finder · PowerTalk · PowerShare · AppleTalk · AppleScript · Catalogs Extension (CE)
- Printed dates
- 1989
- Languages
- English
PDF page 8
information (keywords identifying areas of expertise) and templates that define a new record type (keyword records). Although writing templates doesn’t necessarily require writing any code resources at all, you can do more by adding code resources to your templates. This article goes on to demonstrate how to use a code resource to keep records synchronized that refer to each other’s data. You’ll find all the example code on this issue’s CD. Even if you’re not using a PowerShare server, you can use the approach described in this article to store data in a personal catalog on your own Macintosh. A BIT ABOUT AOCE CATALOGS To get the most out of this article, you should have PowerTalk installed on your computer and have spent a little time playing with catalogs. A catalog is a hierarchically arranged store of data. The bottom level of the catalog hierarchy is the record , which is analogous to a file in the Macintosh hierarchical file system (HFS). Unlike files, however, when the user double-clicks a record, the application that opens the record is the Finder itself. How the contents of the record are stored in the catalog and displayed to the user is determined by sets of resources in files known as AOCE templates . For the complete story on AOCE, see Inside Macintosh: AOCE Application Interfaces.• A PowerShare collaboration server stores the name and account information of each entity (person, gateway, or whatever) that has an account on the AOCE server in a server-based catalog. It uses User records for this purpose. A personal catalog looks much like a server-based catalog but is, in fact, an HFS file on the local disk. There’s practically no difference between a record in a server-based catalog and one in a personal catalog; AOCE templates work identically in both cases. The data in records is organized into attributes . Each attribute has a type (for example, address or area of expertise) and any number of attribute values, which can contain any sort of data. Each attribute type is defined by a template that specifies the format for the data. You can write new templates to expand the types of attributes that existing record types can contain — that’s precisely what this article does, in fact. FROM RECORDS TO INFORMATION PAGES When the user double-clicks an AOCE catalog record in the Finder, a window called an information page window opens. An information page window can contain a single information page, or several information pages, each with a pop-up menu listing the other pages. Each information page displays data stored in the record. The window in Figure 1 shows an information page that displays data stored in a User record. The CE uses a two-step process to get from a record to an information page. Because there’s not necessarily a one-to-one correspondence between attribute values and the data you want to display on an information page, the first step consists of parsing the data in the attribute values into discrete units of data known as properties . For example, an address attribute value may contain street, city, and zip code properties. The second step is to specify exactly where and how each property is displayed on the information page. Two types of AOCE templates specify how the CE performs each of these steps: • An aspect template describes how the attribute values are to be parsed into properties. d e v e l o p Issue 20 December 1994 6
Reading notes: Source begins mid-sentence, so the opening reading order is uncertain.
- Languages
- English
PDF page 9
• An information page template specifies how the properties are to be displayed on the information page. These aspect and information page templates share a data structure in memory that contains the properties. This data structure is called an aspect . The relationships among records, aspect templates, aspects, information page templates, and information pages are illustrated in Figure 2. There are a few important things to note about these relationships: • An aspect template does not have to deal with every attribute type in a record. There can be any number of aspect templates that apply to a given record type, and each can describe the parsing of some subset of attribute types. • An information page template does not have to use every property stored in an aspect. • More than one information page template can use properties from the same aspect, but each information page template can use properties from only one aspect. GETTING THE MOST OUT OF AOCE CATALOG RECORDS 7 Figure 1. An information page window User record User data Company data Birthday Attributes Icon resources Aspect template Aspect Name Title Department Company name Location Properties Information page template Information page Figure 2. Getting from a record to an information page
Reading notes: Figure captions and diagram labels are fragmentary and their reading order is uncertain.
- Languages
- English
PDF page 10
• The process works in reverse as well. When the user enters data into an information page, the information page template defines which property that data belongs to and the aspect template describes how the data should be stored in an attribute value. WHAT’S IN A TEMPLATE Every template contains a signature resource that indicates the type of the template and specifies some other template characteristics. In addition, there are other resources that are required for every template (such as the template name resource), resources that are required for specific template types, and a variety of optional resources that you can include if needed. The CE identifies each resource by its resource type and by the offset of its resource ID from the resource ID of the signature resource. For example, the template name resource and the record type resource (which specifies what type of record the template applies to) are both 'rstr' resources; the CE can distinguish between them because the template name resource’s ID is equal to the signature resource’s ID plus the constant value kDETTemplateName, while the record type resource has an ID offset of kDETRecordType. Aspect templates contain a resource called a lookup table . The lookup table contains the instructions to the CE for parsing attribute values into properties and properties into attribute values. If the CE needs a property that has a property number in the range 0 to 249, and it doesn’t find a value for that property that the lookup table constructed from an attribute value, it looks for a resource with an ID offset equal to the property number. This means that in the aspect template itself you can provide property values to be used as default values, initial values, or constant values for properties. Information page templates contain one or more resources called view lists , which specify the views that appear on the information page. A view is an item or a field on an information page displaying one or more property values (for example, a text field or a radio button). Unlike the ID of other template resources, a view list’s resource ID isn’t related to the signature resource’s ID. Instead, the information page template’s signature resource includes references to all the view lists for that template. For each view list, the signature resource includes two property numbers that identify properties associated with that view list. The view list is active only if the values of its two associated properties are equal. You can use this feature to implement conditional views , that is, information-page features that the CE displays only under certain circumstances. MAIN VIEWS, SUBLISTS, AND MAIN ASPECTS Figure 3 shows another common feature of information pages — a sublist . A sublist is a portion of the information page that contains a list of attribute values or records. In Figure 3, the sublist holds two records (actually, it holds aliases to the records). Typically, when the user double-clicks an item in a sublist, the same two-step process as described earlier in the section “From Records to Information Pages” occurs; as a result, another information page opens and displays the information associated with the attribute or record represented by the selected item. For example, double-clicking the AOCE item in Figure 3 opens an information page displaying all people with that expertise (as shown in Figure 4 later in this article). d e v e l o p Issue 20 December 1994 8
Reading notes: Mentions of 'Figure 3' and 'Figure 4' refer to images not included in the supplied copy.
- Printed dates
- December 1994
- Languages
- English
PDF page 11
All the property values displayed on an information page outside the sublist come from a single aspect, called the main view aspect . This aspect also provides the list of items to be included in the sublist (if any). Each item in a sublist has its own aspect, called a main aspect , which provides the property values necessary to display the item in the sublist (such as the name of a record or the kind of attribute value). A main aspect can contain other property values as well; in fact, a main aspect can also serve as the main view aspect for an information page. If you want to create a new information page for an existing record, you must provide a main view aspect template for that information page. If you’re defining a new record type to be displayed in a sublist, you need to provide a main aspect template for that record type. The example in this article demonstrates how to create a main view aspect template and an information page template that extend the User record to hold keywords. It then shows how to create the main aspect template needed in order to list keyword records in the new User record information page sublist. DEFINING THE ASPECT TEMPLATE Now we’re ready to define the aspect template for the new information page, which is a main view aspect template. The main view aspect template serves as the aspect template for everything on the new User record information page except for the content of the sublist items. Aspect templates contain a signature resource, a name resource, a record type resource, resources that specify how to handle objects dropped on the information page, resources for handling the View menu and Balloon Help, and the all-important lookup table. SIGNATURE, NAME, AND RECORD TYPE RESOURCES The ID of the aspect template signature resource, of type 'deta', provides the base resource ID for the other aspect template resources. The signature resource also makes some settings related to drag and drop operations, as discussed in the next section, and specifies whether this template is a main aspect template. resource 'deta' (kEInfoPageAspect, purgeable) { 0, // Drop-operation order dropCheckAlways, // Drop-check flag notMainAspect // Not the main aspect template }; GETTING THE MOST OUT OF AOCE CATALOG RECORDS 9 Figure 3. Information page with a sublist
- Languages
- English