Apple Newton Utilities Guía de usuario Pagina 803

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 942
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 802
CHAPTER 22
Transport Interface
Using the Transport Interface 22-15
e-mail address to the sender’s internet address. Here’s an example of code that sets
the appropriate e-mail address in the
fromRef object:
owner:=ResolveEntryAlias(GetUserConfig('currentPersona));
if owner and GetRoot().cardfile then begin
addrs := GetRoot().cardfile:BcEmailAddress(owner,
['|string.email.internet|]);
if addrs then
fromRef := clone(addrs[0]);
end
You can nd a description of BcEmailAddress and other similar functions that
extract information from Names soup entries in “Names Functions and Methods”
(page 16-5) in Newton Programmers Reference.
If, instead of extracting the address and sending it as a string, your transport sends
addressing information as a frame, like the beam transport, you must remove any
soup entry aliases from the name reference before it is transmitted. You can do
this by using the name reference data denition method
PrepareForRouting,
as follows:
// strip the aliases from a name ref
fromRef := datadef:PrepareForRouting(fromRef);
In general, however, you should not send all the information in a user’s persona
with a message, since it can include personal or condential information such as
credit card numbers.
For more information about name references and the methods of name reference
data denitions, see the section “Creating a Name Reference” beginning on
page 21-27, and “Name References” (page 5-1) in Newton Programmers
Reference.
The following is an example of how to override the
NewItem method during a
send operation to add a
fromRef slot:
// a sample overridden NewItem method
mytransport.NewItem := func(context) begin
// first call inherited method to get default frame
local item := inherited:NewItem(context);
// get sender info and insert fromRef slot
local persona:= GetUserConfig('currentPersona);
local dataDef := GetDataDefs(addressingClass);
Vista de pagina 802
1 2 ... 798 799 800 801 802 803 804 805 806 807 808 ... 941 942

Comentarios a estos manuales

Sin comentarios