tcladdressbook-commits Mailing List for TclAddressBook (Page 5)
Status: Alpha
Brought to you by:
bdesgraupes
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(114) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(37) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(70) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
(2) |
Apr
(9) |
May
|
Jun
(8) |
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:35:24
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29676/Source Modified Files: TclAddressBookUtils.c Log Message: More informative result in TclAB_RecordFromUID() Index: TclAddressBookUtils.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- TclAddressBookUtils.c 30 Jul 2004 21:29:17 -0000 1.18 +++ TclAddressBookUtils.c 1 Aug 2004 06:35:15 -0000 1.19 @@ -627,7 +627,11 @@ { *outRecordRef = ABCopyRecordForUniqueId(ab, inUID); if (!*outRecordRef) { - Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL); + char theStr[256]; + Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID ", (char *) NULL); + if (CFStringGetCString(inUID, theStr, sizeof(theStr), NULL)) { + Tcl_AppendStringsToObj(resultPtr, theStr, (char *) NULL); + } return false; } return true; |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:35:00
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29607/Source Modified Files: TclAddressBook.c Log Message: [add] and [remove] take multiple args Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- TclAddressBook.c 30 Jul 2004 21:29:05 -0000 1.31 +++ TclAddressBook.c 1 Aug 2004 06:34:50 -0000 1.32 @@ -272,7 +272,7 @@ * See the user documentation for details on what it does. * * Syntax: - * addressbook add recordID groupID + * addressbook add groupID recordID ?recordID ...? * * Results: * A standard Tcl result. @@ -291,62 +291,72 @@ Tcl_Obj *CONST objv[], /* Argument values. */ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { - int kind, length, result = TCL_OK, success; - CONST84 char * groupID; + int i, kind, length, result = TCL_OK, success; + CONST84 char * objID, * groupID; CFStringRef strRef; ABAddressBookRef ab; ABRecordRef objRecord, groupRecord; - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "recordID groupID"); + if (objc < 4) { + Tcl_WrongNumArgs(interp, 2, objv, "groupID recordID ?recordID ...?"); return TCL_ERROR; } // Get the address book ab = ABGetSharedAddressBook(); - // Second argument is a person or a group ID - strRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[2], &length), NULL); - // Find the record corresponding to the UID - success = TclAB_RecordFromUID(ab, strRef, resultPtr, &objRecord); - CFRelease(strRef); - if (!success) {return TCL_ERROR;} - - // Third argument is a group ID - groupID = Tcl_GetStringFromObj(objv[3], &length); + // Second argument is a group ID + groupID = Tcl_GetStringFromObj(objv[2], &length); // Check if it is a group and get the corresponding record - if ( !TclAB_CheckItem(interp, ab, groupID, "third", &groupRecord, rec_group) ) { - result = TCL_ERROR; - goto DONE; + if ( !TclAB_CheckItem(interp, ab, groupID, "second", &groupRecord, rec_group) ) { + return TCL_ERROR; } - // Is objRecord a person or a group? - kind = TclAB_TypeFromRecord(ab, objRecord); - switch (kind) { - case rec_person: - if (!ABGroupAddMember(groupRecord, objRecord)) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't add member to group", (char *) NULL); + for ( i = 3; i < objc; i++) { + + Tcl_IncrRefCount(objv[i]); + // Next argument should be a person or a group ID + objID = Tcl_GetStringFromObj(objv[i], &length); + strRef = CFStringCreateWithCString(NULL, objID, NULL); + // Find the record corresponding to the UID + success = TclAB_RecordFromUID(ab, strRef, resultPtr, &objRecord); + CFRelease(strRef); + if (!success) { + Tcl_DecrRefCount(objv[i]); result = TCL_ERROR; + break; } - break; - case rec_group: - if (!ABGroupAddGroup(groupRecord, objRecord)) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't add subgroup to group", (char *) NULL); + // Is objRecord a person or a group? + kind = TclAB_TypeFromRecord(ab, objRecord); + switch (kind) { + case rec_person: + if (!ABGroupAddMember(groupRecord, objRecord)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't add member ", objID, " to group", (char *) NULL); + result = TCL_ERROR; + } + break; + + case rec_group: + if (!ABGroupAddGroup(groupRecord, objRecord)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't add subgroup ", objID, " to group", (char *) NULL); + result = TCL_ERROR; + } + break; + + default: + Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID ", objID, (char *) NULL); result = TCL_ERROR; + break; + } + Tcl_DecrRefCount(objv[i]); + CFRelease(objRecord); + if (result == TCL_ERROR) { + break; } - break; - - default: - Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID argument", (char *) NULL); - result = TCL_ERROR; - break; } CFRelease(groupRecord); - -DONE: - CFRelease(objRecord); return result; } @@ -1350,7 +1360,7 @@ * See the user documentation for details on what it does. * * Syntax: - * addressbook remove personID groupID + * addressbook remove groupID recordID ?recordID ...? * * Results: * A standard Tcl result. @@ -1369,62 +1379,72 @@ Tcl_Obj *CONST objv[], /* Argument values. */ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { - int kind, length, result = TCL_OK, success; - CONST84 char * groupID; + int i, kind, length, result = TCL_OK, success; + CONST84 char * objID, * groupID; CFStringRef strRef; ABAddressBookRef ab; ABRecordRef objRecord, groupRecord; - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "recordID groupID"); + if (objc < 4) { + Tcl_WrongNumArgs(interp, 2, objv, "groupID recordID ?recordID ...?"); return TCL_ERROR; } // Get the address book ab = ABGetSharedAddressBook(); - // Second argument is a person or a group ID - strRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[2], &length), NULL); - // Find the record corresponding to the UID - success = TclAB_RecordFromUID(ab, strRef, resultPtr, &objRecord); - CFRelease(strRef); - if (!success) {return TCL_ERROR;} - - // Third argument is a group ID - groupID = Tcl_GetStringFromObj(objv[3], &length); + // Second argument is a group ID + groupID = Tcl_GetStringFromObj(objv[2], &length); // Check if it is a group and get the corresponding record - if ( !TclAB_CheckItem(interp, ab, groupID, "third", &groupRecord, rec_group) ) { - result = TCL_ERROR; - goto DONE; + if ( !TclAB_CheckItem(interp, ab, groupID, "second", &groupRecord, rec_group) ) { + return TCL_ERROR; } - // Is objRecord a person or a group? - kind = TclAB_TypeFromRecord(ab, objRecord); - switch (kind) { - case rec_person: - if (!ABGroupRemoveMember(groupRecord, objRecord)) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't remove member from group", (char *) NULL); + for ( i = 3; i < objc; i++) { + + Tcl_IncrRefCount(objv[i]); + // Next argument should be a person or a group ID + objID = Tcl_GetStringFromObj(objv[i], &length); + strRef = CFStringCreateWithCString(NULL, objID, NULL); + // Find the record corresponding to the UID + success = TclAB_RecordFromUID(ab, strRef, resultPtr, &objRecord); + CFRelease(strRef); + if (!success) { + Tcl_DecrRefCount(objv[i]); result = TCL_ERROR; + break; } - break; - case rec_group: - if (!ABGroupRemoveGroup(groupRecord, objRecord)) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't remove subgroup from group", (char *) NULL); + // Is objRecord a person or a group? + kind = TclAB_TypeFromRecord(ab, objRecord); + switch (kind) { + case rec_person: + if (!ABGroupRemoveMember(groupRecord, objRecord)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't remove member ", objID, " from group", (char *) NULL); + result = TCL_ERROR; + } + break; + + case rec_group: + if (!ABGroupRemoveGroup(groupRecord, objRecord)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't remove subgroup ", objID, " from group", (char *) NULL); + result = TCL_ERROR; + } + break; + + default: + Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID ", objID, (char *) NULL); result = TCL_ERROR; + break; + } + Tcl_DecrRefCount(objv[i]); + CFRelease(objRecord); + if (result == TCL_ERROR) { + break; } - break; - - default: - Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID argument", (char *) NULL); - result = TCL_ERROR; - break; } CFRelease(groupRecord); - -DONE: - CFRelease(objRecord); return result; } |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:34:47
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29577/Source Modified Files: Changes.Log Log Message: [add] and [remove] take multiple args Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Changes.Log 30 Jul 2004 21:28:54 -0000 1.17 +++ Changes.Log 1 Aug 2004 06:34:38 -0000 1.18 @@ -31,12 +31,21 @@ Last modification: $Date$ ================================================================================ -= 1.1b4 last update: += 1.1b5 last update: +================================================================================ + + +================================================================================ += 1.1b4 last update: 2004-08-01 07:58:05 ================================================================================ Added a new [addressbook identifier index] command to return the index corresponding to a particular identifier in a multi-value list. Extended the [addressbook identifier primary] command to set, and - not only get, the primary identifier for a multi-value list. + not only get, the primary identifier for a multi-value list. + Note: it does not seem to work as expected, so it is temporarily + disabled. + Extended the [add] and [remove] commands to accept any number of + arguments in order to add or remove several items at a time. ================================================================================ = 1.1b3 last update: 2004-07-30 23:15:35 |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:32:29
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29377/Help Modified Files: TclAddressBookHelp.html Log Message: [add] and [remove] take multiple args Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- TclAddressBookHelp.html 30 Jul 2004 21:31:13 -0000 1.21 +++ TclAddressBookHelp.html 1 Aug 2004 06:32:19 -0000 1.22 @@ -15,7 +15,7 @@ <LI><A HREF="#M2">SYNOPSIS</A> <LI><A HREF="#M3">INTRODUCTION</A> <LI><A HREF="#M4">SUBCOMMANDS</A> -<UL><UL><LI><A HREF="#M5">addressbook add <I>recordID</I> <I>groupID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M5">addressbook add <I>groupID</I> <I>recordID ?recordID ...?</I></A></UL></UL> <UL><UL><LI><A HREF="#M6">addressbook changed</A></UL></UL> <UL><UL><LI><A HREF="#M7">addressbook count (-groups | -persons) ?-ingroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M8">addressbook create (group | person) <I>name</I> ?-ingroup <I>groupID</I>?</A></UL></UL> @@ -37,7 +37,7 @@ <UL><UL><LI><A HREF="#M24">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> <UL><UL><LI><A HREF="#M25">addressbook property remove (-groups | -persons | recordID) <I>propName</I></A></UL></UL> <UL><UL><LI><A HREF="#M26">addressbook record <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M27">addressbook remove <I>recordID</I> <I>groupID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M27">addressbook remove <I>groupID</I> <I>recordID ?recordID ...?</I></A></UL></UL> <UL><UL><LI><A HREF="#M28">addressbook save</A></UL></UL> <UL><UL><LI><A HREF="#M29">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> <UL><UL><LI><A HREF="#M30">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> @@ -59,9 +59,9 @@ <B>package require addressbook</B> <P> <B>addressbook subcommand</B> ?<I>arg arg</I>...?<P><H2><A NAME="M3"></A>INTRODUCTION</H2><P>The argument <I>subcommand</I> indicates what operation to perform. Any unique abbreviation for each subcommand is acceptable. The valid -subcommands are explained in the next sections.<P><H2><A NAME="M4"></A>SUBCOMMANDS</H2><P><H4><A NAME="M5"></A>addressbook add <I>recordID</I> <I>groupID</I></H4> -This command lets you add an already existing item (person or group) -designated by its unique ID <I>recordID</I> to the group with ID +subcommands are explained in the next sections.<P><H2><A NAME="M4"></A>SUBCOMMANDS</H2><P><H4><A NAME="M5"></A>addressbook add <I>groupID</I> <I>recordID ?recordID ...?</I></H4> +This command lets you add one or more already existing items (persons or +groups) designated by their unique ID <I>recordID</I> to the group with ID <I>groupID</I>.<P><H4><A NAME="M6"></A>addressbook changed</H4> This command returns 1 if there has been changes made to the database, 0 otherwise. Changes are made in memory with commands such as <B>addressbook @@ -118,13 +118,15 @@ which will be used by default if no <I>distribution identifier</I> has been specified using the <B>addressbook identifier set</B> command. Property <I>propName</I> must be a multi-value list property (such as -<I>Phone, Email</I>). ((nl Used without the <I>ident</I> argument, the -command will return the <I>primary identifier</I> concerning property -<I>propName</I> for the person <I>personID</I>. +<I>Phone, Email</I>). +<P> Used without the <I>ident</I> argument, the command will return the +<I>primary identifier</I> concerning property <I>propName</I> for the +person <I>personID</I>. <P> If the <I>ident</I> argument is specified, the command will set the primary value to be the value for the given identifier <I>ident</I>. This value must be a valid identifier used by the multi-value list: one can get -the identifiers of any element of a multi-value list using the <B>addressbook identifier get</B> command.<P><H4><A NAME="M17"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> +the identifiers of any element of a multi-value list using the +<B>addressbook identifier get</B> command.<P><H4><A NAME="M17"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> This command lets you get or set the <I>distribution identifier</I> for a multi-value list property of a person in a group. See the section <A HREF="#dist"> Distribution lists and identifiers</A> below for @@ -194,19 +196,19 @@ takes the form of a keyed list. <P> The format used for a particular property's value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have -a multiple type: MultiString for fields like Email, Phone etc., MultiDate -for fields like ABDate, MultiDictionary for the Address field. In case of a +a multiple type: <I>MultiString</I> for fields like Email, Phone etc., <I>MultiDate</I> +for fields like ABDate, <I>MultiDictionary</I> for the Address field. In case of a multivalue, the returned value is a keyed list itself. Each element of the list corresponds to a single property. For instance: <UL> - <LI> the elements of a MultiString or MultiDate value list are two-elements + <LI> the elements of a <I>MultiString</I> or <I>MultiDate</I> value list are two-elements sublists: the first element is the label of the corresponding -property (like Home, Work etc.) and the second is the value itself. - <LI> the elements of a MultiDictionary value list are lists themselves, +property (like <I>Home, Work</I> etc.) and the second is the value itself. + <LI> the elements of a <I>MultiDictionary</I> value list are lists themselves, representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of this list has two elements: the first one is the label describing the -address (like Home, Work etc.) and the second one is a list representing +address (like <I>Home, Work</I> etc.) and the second one is a list representing the dictionary. The lists representing dictionaries contain two-elements sublists: the first item is the key in the dictionary and the second one is the value associated with this key. For instance a person could have two @@ -218,9 +220,9 @@ 00:00:00 CET 1970". <P> Note that keyed lists can be easily manipulated using the <B>keylget</B> and <B>keylset</B> commands defined in the TclX -extension.<P><H4><A NAME="M27"></A>addressbook remove <I>recordID</I> <I>groupID</I></H4> -This command lets you remove an already existing item (person or group) -designated by its unique ID <I>recordID</I> from the group with ID +extension.<P><H4><A NAME="M27"></A>addressbook remove <I>groupID</I> <I>recordID ?recordID ...?</I></H4> +This command lets you remove one or more already existing items (persons or +groups) designated by their unique ID <I>recordID</I> from the group with ID <I>groupID</I>.<P><H4><A NAME="M28"></A>addressbook save</H4> This command lets you save the changes made in the database. Commands such as <B>addressbook set</B>, <B>addressbook create</B> or <B>addressbook @@ -325,7 +327,8 @@ command. <LI> 1.1b2 -- 2004/07/29 -- New command [setme]. <LI> 1.1b3 -- 2004/07/30 -- New command [identifier] to handle -distribution lists. +distribution lists. Subcommands: count, get, primary, set. + <LI> 1.1b4 -- 2004/07/31 -- New command [identifier index]. </UL><P><H2><A NAME="M36"></A>REQUIREMENTS AND PORTABILITY</H2> This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced @@ -352,6 +355,6 @@ See the TclX extension for keyed lists: TclX(n). See the Mk4Tcl extension for commands to open directly the database file.<P><H2><A NAME="M42"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-07-30 23:21:29<P> +<P> Last updated 2004-08-01 08:09:45<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:32:19
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29354/Help Modified Files: TclAddressBookHelp.aida Log Message: [add] and [remove] take multiple args Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- TclAddressBookHelp.aida 30 Jul 2004 21:30:51 -0000 1.18 +++ TclAddressBookHelp.aida 1 Aug 2004 06:32:10 -0000 1.19 @@ -5,7 +5,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-11-26 14:30:03 -:Modified: 2004-07-30 23:21:07 +:Modified: 2004-08-01 08:09:34 :Keywords: Address book, data base ((if $aida_params(target) eq "Pdf" @@ -45,9 +45,9 @@ ((s1 SUBCOMMANDS -((s3 addressbook add ((i recordID i)) ((i groupID i)) -This command lets you add an already existing item (person or group) -designated by its unique ID ((i recordID i)) to the group with ID +((s3 addressbook add ((i groupID i)) ((i recordID ?recordID ...? i)) +This command lets you add one or more already existing items (persons or +groups) designated by their unique ID ((i recordID i)) to the group with ID ((i groupID i)). ((s3 addressbook changed @@ -126,14 +126,15 @@ which will be used by default if no ((i distribution identifier i)) has been specified using the ((b addressbook identifier set b)) command. Property ((i propName i)) must be a multi-value list property (such as -((i Phone, Email i))). ((nl Used without the ((i ident i)) argument, the -command will return the ((i primary identifier i)) concerning property -((i propName i)) for the person ((i personID i)). +((i Phone, Email i))). +((nl Used without the ((i ident i)) argument, the command will return the +((i primary identifier i)) concerning property ((i propName i)) for the +person ((i personID i)). ((nl If the ((i ident i)) argument is specified, the command will set the primary value to be the value for the given identifier ((i ident i)). This value must be a valid identifier used by the multi-value list: one can get -the identifiers of any element of a multi-value list using the ((b -addressbook identifier get b)) command. +the identifiers of any element of a multi-value list using the +((b addressbook identifier get b)) command. ((s3 addressbook identifier set ((i groupID i)) ((i personID i)) ((i propName i)) ?((i ident i))? This command lets you get or set the ((i distribution identifier i)) for a @@ -223,19 +224,19 @@ takes the form of a keyed list. ((nl The format used for a particular property's value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have -a multiple type: MultiString for fields like Email, Phone etc., MultiDate -for fields like ABDate, MultiDictionary for the Address field. In case of a +a multiple type: ((i MultiString i)) for fields like Email, Phone etc., ((i MultiDate i)) +for fields like ABDate, ((i MultiDictionary i)) for the Address field. In case of a multivalue, the returned value is a keyed list itself. Each element of the list corresponds to a single property. For instance: ((lu -((li the elements of a MultiString or MultiDate value list are two-elements +((li the elements of a ((i MultiString i)) or ((i MultiDate i)) value list are two-elements sublists: the first element is the label of the corresponding -property (like Home, Work etc.) and the second is the value itself. -((li the elements of a MultiDictionary value list are lists themselves, +property (like ((i Home, Work i)) etc.) and the second is the value itself. +((li the elements of a ((i MultiDictionary i)) value list are lists themselves, representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of this list has two elements: the first one is the label describing the -address (like Home, Work etc.) and the second one is a list representing +address (like ((i Home, Work i)) etc.) and the second one is a list representing the dictionary. The lists representing dictionaries contain two-elements sublists: the first item is the key in the dictionary and the second one is the value associated with this key. For instance a person could have two @@ -249,9 +250,9 @@ using the ((b keylget b)) and ((b keylset b)) commands defined in the TclX extension. -((s3 addressbook remove ((i recordID i)) ((i groupID i)) -This command lets you remove an already existing item (person or group) -designated by its unique ID ((i recordID i)) from the group with ID +((s3 addressbook remove ((i groupID i)) ((i recordID ?recordID ...? i)) +This command lets you remove one or more already existing items (persons or +groups) designated by their unique ID ((i recordID i)) from the group with ID ((i groupID i)). ((s3 addressbook save @@ -381,7 +382,8 @@ command. ((li 1.1b2 -- 2004/07/29 -- New command [setme]. ((li 1.1b3 -- 2004/07/30 -- New command [identifier] to handle -distribution lists. +distribution lists. Subcommands: count, get, primary, set. +((li 1.1b4 -- 2004/07/31 -- New command [identifier index]. lu)) |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:32:09
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29289/Help Modified Files: TclAddressBookHelp Log Message: [add] and [remove] take multiple args Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- TclAddressBookHelp 30 Jul 2004 21:30:42 -0000 1.18 +++ TclAddressBookHelp 1 Aug 2004 06:32:00 -0000 1.19 @@ -12,7 +12,7 @@ 2. SYNOPSIS 3. INTRODUCTION 4. SUBCOMMANDS - addressbook add recordID groupID + addressbook add groupID recordID ?recordID ...? addressbook changed addressbook count (-groups | -persons) ?-ingroup groupID? addressbook create (group | person) name ?-ingroup groupID? @@ -34,7 +34,7 @@ addressbook property add (-groups | -persons) propName propType addressbook property remove (-groups | -persons | recordID) propName addressbook record recordID - addressbook remove recordID groupID + addressbook remove groupID recordID ?recordID ...? addressbook save addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value addressbook set recordID propertyName ?value? @@ -70,9 +70,9 @@ 4. SUBCOMMANDS - addressbook add recordID groupID -This command lets you add an already existing item (person or group) -designated by its unique ID recordID to the group with ID + addressbook add groupID recordID ?recordID ...? +This command lets you add one or more already existing items (persons or +groups) designated by their unique ID recordID to the group with ID groupID. addressbook changed @@ -151,13 +151,15 @@ which will be used by default if no distribution identifier has been specified using the addressbook identifier set command. Property propName must be a multi-value list property (such as -Phone, Email). ((nl Used without the ident argument, the -command will return the primary identifier concerning property -propName for the person personID. +Phone, Email). + Used without the ident argument, the command will return the +primary identifier concerning property propName for the +person personID. If the ident argument is specified, the command will set the primary value to be the value for the given identifier ident. This value must be a valid identifier used by the multi-value list: one can get -the identifiers of any element of a multi-value list using the addressbook identifier get command. +the identifiers of any element of a multi-value list using the +addressbook identifier get command. addressbook identifier set groupID personID propName ?ident? This command lets you get or set the distribution identifier for a @@ -272,9 +274,9 @@ using the keylget and keylset commands defined in the TclX extension. - addressbook remove recordID groupID -This command lets you remove an already existing item (person or group) -designated by its unique ID recordID from the group with ID + addressbook remove groupID recordID ?recordID ...? +This command lets you remove one or more already existing items (persons or +groups) designated by their unique ID recordID from the group with ID groupID. addressbook save @@ -400,7 +402,8 @@ command. 1.1b2 -- 2004/07/29 -- New command [setme]. 1.1b3 -- 2004/07/30 -- New command [identifier] to handle -distribution lists. +distribution lists. Subcommands: count, get, primary, set. + 1.1b4 -- 2004/07/31 -- New command [identifier index]. @@ -455,7 +458,7 @@ ---------------------------------------------------------------------- - Last updated 2004-07-30 23:22:23 + Last updated 2004-08-01 08:09:58 |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:32:01
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29254/Help Modified Files: tcladdressbook.n Log Message: [add] and [remove] take multiple args Index: tcladdressbook.n =================================================================== RCS file: /cvsroot/tcladdressbook/Help/tcladdressbook.n,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tcladdressbook.n 30 Jul 2004 21:30:32 -0000 1.8 +++ tcladdressbook.n 1 Aug 2004 06:31:51 -0000 1.9 @@ -1,7 +1,7 @@ .de uline \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m' .. -.TH tcladdressbook n "" "2004-07-30" "addressbook extension for Tcl" +.TH tcladdressbook n "" "2004-08-01" "addressbook extension for Tcl" .SH NAME .PP addressbook - manipulate the Macintosh OSX Address Book database @@ -17,10 +17,10 @@ subcommands are explained in the next sections. .SH SUBCOMMANDS .PP -.SS addressbook add \fI recordID\fP \fI groupID\fP +.SS addressbook add \fI groupID\fP \fI recordID ?recordID ...?\fP .PP -This command lets you add an already existing item (person or group) -designated by its unique ID \fI recordID\fP to the group with ID +This command lets you add one or more already existing items (persons or +groups) designated by their unique ID \fI recordID\fP to the group with ID \fI groupID\fP. .SS addressbook changed .PP @@ -100,14 +100,17 @@ which will be used by default if no \fI distribution identifier\fP has been specified using the \fBaddressbook identifier set\fP command. Property \fI propName\fP must be a multi-value list property (such as -\fI Phone, Email\fP). ((nl Used without the \fI ident\fP argument, the -command will return the \fI primary identifier\fP concerning property -\fI propName\fP for the person \fI personID\fP. +\fI Phone, Email\fP). +.PP + Used without the \fI ident\fP argument, the command will return the +\fI primary identifier\fP concerning property \fI propName\fP for the +person \fI personID\fP. .PP If the \fI ident\fP argument is specified, the command will set the primary value to be the value for the given identifier \fI ident\fP. This value must be a valid identifier used by the multi-value list: one can get -the identifiers of any element of a multi-value list using the \fBaddressbook identifier get\fP command. +the identifiers of any element of a multi-value list using the +\fBaddressbook identifier get\fP command. .SS addressbook identifier set \fI groupID\fP \fI personID\fP \fI propName\fP ?\fI ident\fP? .PP This command lets you get or set the \fI distribution identifier\fP for a @@ -201,21 +204,21 @@ .PP The format used for a particular property's value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have -a multiple type: MultiString for fields like Email, Phone etc., MultiDate -for fields like ABDate, MultiDictionary for the Address field. In case of a +a multiple type: \fI MultiString\fP for fields like Email, Phone etc., \fI MultiDate\fP +for fields like ABDate, \fI MultiDictionary\fP for the Address field. In case of a multivalue, the returned value is a keyed list itself. Each element of the list corresponds to a single property. For instance: .RS .IP * 4 -the elements of a MultiString or MultiDate value list are two-elements +the elements of a \fI MultiString\fP or \fI MultiDate\fP value list are two-elements sublists: the first element is the label of the corresponding -property (like Home, Work etc.) and the second is the value itself. +property (like \fI Home, Work\fP etc.) and the second is the value itself. .IP * 4 -the elements of a MultiDictionary value list are lists themselves, +the elements of a \fI MultiDictionary\fP value list are lists themselves, representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of this list has two elements: the first one is the label describing the -address (like Home, Work etc.) and the second one is a list representing +address (like \fI Home, Work\fP etc.) and the second one is a list representing the dictionary. The lists representing dictionaries contain two-elements sublists: the first item is the key in the dictionary and the second one is the value associated with this key. For instance a person could have two @@ -230,10 +233,10 @@ Note that keyed lists can be easily manipulated using the \fBkeylget\fP and \fBkeylset\fP commands defined in the TclX extension. -.SS addressbook remove \fI recordID\fP \fI groupID\fP +.SS addressbook remove \fI groupID\fP \fI recordID ?recordID ...?\fP .PP -This command lets you remove an already existing item (person or group) -designated by its unique ID \fI recordID\fP from the group with ID +This command lets you remove one or more already existing items (persons or +groups) designated by their unique ID \fI recordID\fP from the group with ID \fI groupID\fP. .SS addressbook save .PP @@ -385,7 +388,9 @@ 1.1b2 -- 2004/07/29 -- New command [setme]. .IP * 4 1.1b3 -- 2004/07/30 -- New command [identifier] to handle -distribution lists. +distribution lists. Subcommands: count, get, primary, set. +.IP * 4 +1.1b4 -- 2004/07/31 -- New command [identifier index]. .RE .SH REQUIREMENTS AND PORTABILITY .PP |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:31:45
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29220/Help Modified Files: TclAB_QuickStart.html Log Message: [add] and [remove] take multiple args Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TclAB_QuickStart.html 30 Jul 2004 21:30:11 -0000 1.9 +++ TclAB_QuickStart.html 1 Aug 2004 06:31:36 -0000 1.10 @@ -136,14 +136,22 @@ <PRE> set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] - addressbook add $theid $groupid + addressbook add $groupid $theid +</PRE> +One can add several items at a time with this command: +<PRE> + addressbook add $groupid $theid1 $theid2 $theid3 </PRE><P><H3><A NAME="M11"></A>The [remove] subcommand</H3> Remove from a specific group the record corresponding to the ID <I>$theid</I>: this can be a person as well as a group. <PRE> set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] - addressbook remove $theid $groupid + addressbook remove $groupid $theid +</PRE> +One can remove several items at a time with this command: +<PRE> + addressbook remove $groupid $theid1 $theid2 $theid3 </PRE><P><H3><A NAME="M12"></A>The [parents] subcommand</H3> List the parents of a person record (the various groups it belongs to). <PRE> @@ -363,6 +371,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-07-30 23:25:49<P> +<P> Last updated 2004-08-01 08:10:55<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:31:36
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29192/Help Modified Files: TclAB_QuickStart.aida Log Message: [add] and [remove] take multiple args Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TclAB_QuickStart.aida 30 Jul 2004 21:30:01 -0000 1.9 +++ TclAB_QuickStart.aida 1 Aug 2004 06:31:28 -0000 1.10 @@ -6,7 +6,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-12-14 18:26:47 -:Modified: 2004-07-30 23:25:47 +:Modified: 2004-08-01 08:09:16 :Keywords: Address book, data base @@ -153,7 +153,11 @@ ((| set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] - addressbook add $theid $groupid + addressbook add $groupid $theid +|)) +One can add several items at a time with this command: +((| + addressbook add $groupid $theid1 $theid2 $theid3 |)) @@ -163,7 +167,11 @@ ((| set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] - addressbook remove $theid $groupid + addressbook remove $groupid $theid +|)) +One can remove several items at a time with this command: +((| + addressbook remove $groupid $theid1 $theid2 $theid3 |)) |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:31:24
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31667/Help Modified Files: TclAddressBookHelp.html Log Message: Doc and examples for the [identifier index] command Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- TclAddressBookHelp.html 30 Jul 2004 13:08:26 -0000 1.20 +++ TclAddressBookHelp.html 30 Jul 2004 21:31:13 -0000 1.21 @@ -8,7 +8,7 @@ <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> <P> <A HREF="TclAB.html"> Home Page</A> | <A HREF="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1b3. +documents version 1.1b4. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">NAME</A> @@ -25,33 +25,34 @@ <UL><UL><LI><A HREF="#M12">addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M13">addressbook identifier count <I>personID</I> <I>propName</I></A></UL></UL> <UL><UL><LI><A HREF="#M14">addressbook identifier get <I>personID</I> <I>propName</I> <I>index</I></A></UL></UL> -<UL><UL><LI><A HREF="#M15">addressbook identifier primary <I>personID</I> <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M16">addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M17">addressbook image <I>personID</I> ?<I>imageData</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M18">addressbook import <I>vCardData</I></A></UL></UL> -<UL><UL><LI><A HREF="#M19">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M20">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M21">addressbook property names (-groups | -persons)</A></UL></UL> -<UL><UL><LI><A HREF="#M22">addressbook property type (-groups | -persons) <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M23">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> -<UL><UL><LI><A HREF="#M24">addressbook property remove (-groups | -persons | recordID) <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M25">addressbook record <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M26">addressbook remove <I>recordID</I> <I>groupID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M27">addressbook save</A></UL></UL> -<UL><UL><LI><A HREF="#M28">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> -<UL><UL><LI><A HREF="#M29">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M30">addressbook setme <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M31">addressbook type <I>recordID</I></A></UL></UL> -<LI><A HREF="#M32">DISTRIBUTION LIST AND IDENTIFIERS</A> -<LI><A HREF="#M33">INSTALLATION</A> -<LI><A HREF="#M34">VERSION HISTORY</A> -<LI><A HREF="#M35">REQUIREMENTS AND PORTABILITY</A> -<LI><A HREF="#M36">KNOW ISSUES</A> -<LI><A HREF="#M37">SOURCE CODE</A> -<LI><A HREF="#M38">CONTRIBUTIONS</A> -<LI><A HREF="#M39">LICENSE AND DISCLAIMER</A> -<LI><A HREF="#M40">SEE ALSO</A> -<LI><A HREF="#M41">KEYWORDS</A> +<UL><UL><LI><A HREF="#M15">addressbook identifier index <I>personID</I> <I>propName</I> <I>ident</I></A></UL></UL> +<UL><UL><LI><A HREF="#M16">addressbook identifier primary <I>personID</I> <I>propName</I> ?<I>ident</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M17">addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M18">addressbook image <I>personID</I> ?<I>imageData</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M19">addressbook import <I>vCardData</I></A></UL></UL> +<UL><UL><LI><A HREF="#M20">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M21">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M22">addressbook property names (-groups | -persons)</A></UL></UL> +<UL><UL><LI><A HREF="#M23">addressbook property type (-groups | -persons) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M24">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> +<UL><UL><LI><A HREF="#M25">addressbook property remove (-groups | -persons | recordID) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M26">addressbook record <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M27">addressbook remove <I>recordID</I> <I>groupID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M28">addressbook save</A></UL></UL> +<UL><UL><LI><A HREF="#M29">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> +<UL><UL><LI><A HREF="#M30">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M31">addressbook setme <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M32">addressbook type <I>recordID</I></A></UL></UL> +<LI><A HREF="#M33">DISTRIBUTION LISTS AND IDENTIFIERS</A> +<LI><A HREF="#M34">INSTALLATION</A> +<LI><A HREF="#M35">VERSION HISTORY</A> +<LI><A HREF="#M36">REQUIREMENTS AND PORTABILITY</A> +<LI><A HREF="#M37">KNOW ISSUES</A> +<LI><A HREF="#M38">SOURCE CODE</A> +<LI><A HREF="#M39">CONTRIBUTIONS</A> +<LI><A HREF="#M40">LICENSE AND DISCLAIMER</A> +<LI><A HREF="#M41">SEE ALSO</A> +<LI><A HREF="#M42">KEYWORDS</A> </UL> <P><H2><A NAME="M1"></A>NAME</H2> addressbook - manipulate the Macintosh OSX Address Book database<P><H2><A NAME="M2"></A>SYNOPSIS</H2> @@ -106,16 +107,27 @@ <I>propName</I> for the record corresponding to <I>personID</I>. One can get the count of identifiers using the <B>addressbook identifier count</B> command. Identifiers are used by the <B>addressbook identifier set</B> -command. See the section <A HREF="#dist">Distribution list and identifiers</A> -below for explanations about identifiers.<P><H4><A NAME="M15"></A>addressbook identifier primary <I>personID</I> <I>propName</I></H4> -This command returns the primary identifier of property <I>propName</I> in -the record <I>personID</I>. This is the identifier which will be used by -default if no <I>distribution identifier</I> has been specified using the -<B>addressbook identifier set</B> command. Property <I>propName</I> must -be a multi-value list property (such as <I>Phone, Email</I>).<P><H4><A NAME="M16"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> +command. See the section <A HREF="#dist">Distribution lists and identifiers</A> +below for explanations about identifiers.<P><H4><A NAME="M15"></A>addressbook identifier index <I>personID</I> <I>propName</I> <I>ident</I></H4> +This command returns the index in a multi-value list corresponding to the +identifier given in the <I>ident</I> argument. If <I>ident</I> is not a +valid identifier, the command raises an error. The valid identifers are the +values obtained by the <B>addressbook identifier get</B> command.<P><H4><A NAME="M16"></A>addressbook identifier primary <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> +This command lets you get or set the primary identifier of property +<I>propName</I> in the record <I>personID</I>. This is the identifier +which will be used by default if no <I>distribution identifier</I> has +been specified using the <B>addressbook identifier set</B> command. +Property <I>propName</I> must be a multi-value list property (such as +<I>Phone, Email</I>). ((nl Used without the <I>ident</I> argument, the +command will return the <I>primary identifier</I> concerning property +<I>propName</I> for the person <I>personID</I>. +<P> If the <I>ident</I> argument is specified, the command will set the +primary value to be the value for the given identifier <I>ident</I>. This +value must be a valid identifier used by the multi-value list: one can get +the identifiers of any element of a multi-value list using the <B>addressbook identifier get</B> command.<P><H4><A NAME="M17"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> This command lets you get or set the <I>distribution identifier</I> for a multi-value list property of a person in a group. See the section -<A HREF="#dist"> Distribution list and identifiers</A> below for +<A HREF="#dist"> Distribution lists and identifiers</A> below for explanations about identifiers. <P> Used without the <I>ident</I> argument, the command will return the <I>distribution identifier</I> for the person <I>personID</I> belonging to the @@ -128,36 +140,36 @@ list for instance, in the case of an email property). This value must be a valid identifier used by the multi-value list: one can get the identifiers of any element of a multi-value list using the <B>addressbook identifier -get</B> command.<P><H4><A NAME="M17"></A>addressbook image <I>personID</I> ?<I>imageData</I>?</H4> +get</B> command.<P><H4><A NAME="M18"></A>addressbook image <I>personID</I> ?<I>imageData</I>?</H4> If no <I>imageData</I> argument is specified, this command returns the custom image associated with the record corresponding to the unique ID <I>personID</I>. The returned bytes are binary data. If no image exists, it raises an error. If an <I>imageData</I> argument is specified, it should contain valid binary data defining an image which will be associated the -record with unique ID <I>personID</I>.<P><H4><A NAME="M18"></A>addressbook import <I>vCardData</I></H4> +record with unique ID <I>personID</I>.<P><H4><A NAME="M19"></A>addressbook import <I>vCardData</I></H4> This command imports data in VCard format. The data specified by the <I>vCardData</I> argument must be valid data in VCard format: a new record is created in the database corresponding to the information contained in the -VCard. Note that the data can be binary if the VCard contains an image.<P><H4><A NAME="M19"></A>addressbook parents ?-ids? <I>recordID</I></H4> +VCard. Note that the data can be binary if the VCard contains an image.<P><H4><A NAME="M20"></A>addressbook parents ?-ids? <I>recordID</I></H4> This command returns a list of all the groups the record with unique ID <I>recordID</I> belongs to. The elements of this list are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the <I>-ids</I> option is specified, only IDs are -returned. <P><H4><A NAME="M20"></A>addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> +returned. <P><H4><A NAME="M21"></A>addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> This command returns a list of all the existing person records: if no option is specified, it is a list whose elements are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the <I>-ids</I> argument is specified, the returned list will contain only the unique IDs. If the <I>-ingroup</I> option is specified, only the members belonging to the group with ID <I>groupID</I> -will be returned.<P><H4><A NAME="M21"></A>addressbook property names (-groups | -persons)</H4> +will be returned.<P><H4><A NAME="M22"></A>addressbook property names (-groups | -persons)</H4> This command returns a list of all the properties defined in the database for group or person records. New properties can be created or removed with -the <B>addressbook property add</B> and <B>addressbook property remove</B> commands.<P><H4><A NAME="M22"></A>addressbook property type (-groups | -persons) <I>propName</I></H4> +the <B>addressbook property add</B> and <B>addressbook property remove</B> commands.<P><H4><A NAME="M23"></A>addressbook property type (-groups | -persons) <I>propName</I></H4> This command returns the type of the property specified by the <I>propName</I> argument. The returned type is one of the values listed with the <B>addressbook property add</B> command below -or <I>Unknown</I>. <P><H4><A NAME="M23"></A>addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> +or <I>Unknown</I>. <P><H4><A NAME="M24"></A>addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the <I>propName</I> argument: it must be unique. One can get the list of all the @@ -165,7 +177,7 @@ The type of the property is specified by the <I>propType</I> argument. This argument can have one of the following values: <I>Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, -MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M24"></A>addressbook property remove (-groups | -persons | recordID) <I>propName</I></H4> +MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M25"></A>addressbook property remove (-groups | -persons | recordID) <I>propName</I></H4> This command lets you remove a property from the database, either for person or for group records. The name of the property is specified in the <I>propName</I> argument. If the third argument is either <B>-groups</B> or @@ -176,7 +188,7 @@ property is removed for this record only and the command returns an empty string. <P> One can get the list of all the existing -properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M25"></A>addressbook record <I>recordID</I></H4> +properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M26"></A>addressbook record <I>recordID</I></H4> This command returns all the data available in the database concerning the record with unique ID <I>recordID</I>. The returned value takes the form of a keyed list. @@ -206,16 +218,16 @@ 00:00:00 CET 1970". <P> Note that keyed lists can be easily manipulated using the <B>keylget</B> and <B>keylset</B> commands defined in the TclX -extension.<P><H4><A NAME="M26"></A>addressbook remove <I>recordID</I> <I>groupID</I></H4> +extension.<P><H4><A NAME="M27"></A>addressbook remove <I>recordID</I> <I>groupID</I></H4> This command lets you remove an already existing item (person or group) designated by its unique ID <I>recordID</I> from the group with ID -<I>groupID</I>.<P><H4><A NAME="M27"></A>addressbook save</H4> +<I>groupID</I>.<P><H4><A NAME="M28"></A>addressbook save</H4> This command lets you save the changes made in the database. Commands such as <B>addressbook set</B>, <B>addressbook create</B> or <B>addressbook delete</B> modify the data in memory: to make the changes definitive in the database, one must call explicitely the <B>addressbook save</B> command. To check whether there has been changes in the database, use the -<B>addressbook changed</B> command.<P><H4><A NAME="M28"></A>addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> +<B>addressbook changed</B> command.<P><H4><A NAME="M29"></A>addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> This command returns all the records corresponding to the criterion described by the last three arguments: <UL> @@ -271,18 +283,18 @@ that no distinction be made between uppercase and lowercase letters. <P> To get a list of all possible properties, use the <B>addressbook property names</B> command. To know the type of a particular property, use -the <B>addressbook property type</B> command.<P><H4><A NAME="M29"></A>addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> +the <B>addressbook property type</B> command.<P><H4><A NAME="M30"></A>addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> This command lets you get or set the value of a particular property for the record with unique ID <I>recordID</I>. If the <I>value</I> argument is not specified, it returns the current value of the property specified in the <I>propertyName</I> argument. If <I>value</I> is specified, the property <I>propertyName</I> will be set to this value. See the <B>addressbook record</B> command for a description of the format used for the -various kinds of properties.<P><H4><A NAME="M30"></A>addressbook setme <I>recordID</I></H4> -This command sets the record that represents the logged-in user. <P><H4><A NAME="M31"></A>addressbook type <I>recordID</I></H4> +various kinds of properties.<P><H4><A NAME="M31"></A>addressbook setme <I>recordID</I></H4> +This command sets the record that represents the logged-in user. <P><H4><A NAME="M32"></A>addressbook type <I>recordID</I></H4> This command returns the type (<I>ABPerson</I> or <I>ABGroup</I>) of the record with unique ID <I>recordID</I>.<P><A NAME="dist"></A> -<H2><A NAME="M32"></A>DISTRIBUTION LIST AND IDENTIFIERS</H2> +<H2><A NAME="M33"></A>DISTRIBUTION LISTS AND IDENTIFIERS</H2> Identifiers are necessary when one wants to use a group as a distribution list, that is send something to all the members of the group. The members can be addressed by <I>Phone, Email</I> etc. For instance, a group could @@ -295,7 +307,7 @@ property has an identifier. One of them can be designated as the <I>distribution identifier</I>. The AddressBook database also has a notion of a <I>primary identifier</I>: it is the identifier which will be used by default by the distribution list if no <I>distribution identifier</I> as -been specified.<P><H2><A NAME="M33"></A>INSTALLATION</H2> +been specified.<P><H2><A NAME="M34"></A>INSTALLATION</H2> The extension is made of two files: the dynamic library (called addressbook1.0.dylib in version 1.0) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are @@ -305,7 +317,7 @@ <B>auto_path</B> Tcl variable. If you use the extension within the AlphaX editor (version 8.0b11 or greater), you can also install it in the <I>Tclextensions</I> folder which is located at the same level as the -application. <P><H2><A NAME="M34"></A>VERSION HISTORY</H2> +application. <P><H2><A NAME="M35"></A>VERSION HISTORY</H2> <UL> <LI> 1.0b1 -- 2004/01/25 -- First public release. <LI> 1.1b1 -- 2004/07/28 -- New commands [add] and [remove]. Modified @@ -314,13 +326,13 @@ <LI> 1.1b2 -- 2004/07/29 -- New command [setme]. <LI> 1.1b3 -- 2004/07/30 -- New command [identifier] to handle distribution lists. -</UL><P><H2><A NAME="M35"></A>REQUIREMENTS AND PORTABILITY</H2> +</UL><P><H2><A NAME="M36"></A>REQUIREMENTS AND PORTABILITY</H2> This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced -in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M36"></A>KNOW ISSUES</H2> +in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M37"></A>KNOW ISSUES</H2> Tcladdressbook was written by Bernard Desgraupes. Please e-mail any bug or problem you encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M37"></A>SOURCE CODE</H2> +<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M38"></A>SOURCE CODE</H2> Tcladdressbook is an Open Source Project. Its source code is public and can be found on the SourceForge site at the following address: <P> <A HREF="http://sourceforge.net/projects/tcladdressbook">http://sourceforge.net/projects/tcladdressbook</A><P><P> Tcladdressbook binary releases are available at @@ -329,17 +341,17 @@ <P> <A HREF="http://webperso.easyconnect.fr/bdesgraupes/tcl.html">http://webperso.easyconnect.fr/bdesgraupes/tcl.html</A><P><P> The code is under CVS control. You can retrieve the latest stage of development using any CVS client. See instructions at: <P> <A HREF="http://sourceforge.net/cvs/?group_id=96169">http://sourceforge.net/cvs/?group_id=96169</A><P><P> You can also browse the cvs repository online at -<P> <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M38"></A>CONTRIBUTIONS</H2> +<P> <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M39"></A>CONTRIBUTIONS</H2> Code contributions (Tcl scripts making use of the Tcladdressbook extension) are very welcome. There is a "Contribs" directory in the Tcladdressbook project on SourceForge for code contributions. They must be free software, distributed under an Open Source license acceptable by the SourceForge site -(for instance, the same licensing terms as the Tcl language itself).<P><H2><A NAME="M39"></A>LICENSE AND DISCLAIMER</H2> +(for instance, the same licensing terms as the Tcl language itself).<P><H2><A NAME="M40"></A>LICENSE AND DISCLAIMER</H2> This software is free software and distributed under the same licensing terms -as the Tcl language itself. See license.terms in the Tcl distribution.<P><P> © Copyright Bernard Desgraupes 2003-2004<P><H2><A NAME="M40"></A>SEE ALSO</H2> +as the Tcl language itself. See license.terms in the Tcl distribution.<P><P> © Copyright Bernard Desgraupes 2003-2004<P><H2><A NAME="M41"></A>SEE ALSO</H2> See the TclX extension for keyed lists: TclX(n). See the Mk4Tcl extension for -commands to open directly the database file.<P><H2><A NAME="M41"></A>KEYWORDS</H2> +commands to open directly the database file.<P><H2><A NAME="M42"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-07-30 14:43:34<P> +<P> Last updated 2004-07-30 23:21:29<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:31:13
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31582/Help Modified Files: TclAddressBookHelp.aida Log Message: Doc and examples for the [identifier index] command Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TclAddressBookHelp.aida 30 Jul 2004 13:08:10 -0000 1.17 +++ TclAddressBookHelp.aida 30 Jul 2004 21:30:51 -0000 1.18 @@ -5,7 +5,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-11-26 14:30:03 -:Modified: 2004-07-30 12:56:43 +:Modified: 2004-07-30 23:21:07 :Keywords: Address book, data base ((if $aida_params(target) eq "Pdf" @@ -114,12 +114,26 @@ command. See the section ((lk #dist ))Distribution lists and identifiers lk)) below for explanations about identifiers. -((s3 addressbook identifier primary ((i personID i)) ((i propName i)) -This command returns the primary identifier of property ((i propName i)) in -the record ((i personID i)). This is the identifier which will be used by -default if no ((i distribution identifier i)) has been specified using the -((b addressbook identifier set b)) command. Property ((i propName i)) must -be a multi-value list property (such as ((i Phone, Email i))). +((s3 addressbook identifier index ((i personID i)) ((i propName i)) ((i ident i)) +This command returns the index in a multi-value list corresponding to the +identifier given in the ((i ident i)) argument. If ((i ident i)) is not a +valid identifier, the command raises an error. The valid identifers are the +values obtained by the ((b addressbook identifier get b)) command. + +((s3 addressbook identifier primary ((i personID i)) ((i propName i)) ?((i ident i))? +This command lets you get or set the primary identifier of property +((i propName i)) in the record ((i personID i)). This is the identifier +which will be used by default if no ((i distribution identifier i)) has +been specified using the ((b addressbook identifier set b)) command. +Property ((i propName i)) must be a multi-value list property (such as +((i Phone, Email i))). ((nl Used without the ((i ident i)) argument, the +command will return the ((i primary identifier i)) concerning property +((i propName i)) for the person ((i personID i)). +((nl If the ((i ident i)) argument is specified, the command will set the +primary value to be the value for the given identifier ((i ident i)). This +value must be a valid identifier used by the multi-value list: one can get +the identifiers of any element of a multi-value list using the ((b +addressbook identifier get b)) command. ((s3 addressbook identifier set ((i groupID i)) ((i personID i)) ((i propName i)) ?((i ident i))? This command lets you get or set the ((i distribution identifier i)) for a |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:30:50
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31550/Help Modified Files: TclAddressBookHelp Log Message: Doc and examples for the [identifier index] command Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TclAddressBookHelp 30 Jul 2004 13:07:58 -0000 1.17 +++ TclAddressBookHelp 30 Jul 2004 21:30:42 -0000 1.18 @@ -5,7 +5,7 @@ Abstract This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1b3. +documents version 1.1b4. 1. NAME @@ -22,7 +22,8 @@ addressbook groups ?-ids? ?-ingroup groupID? addressbook identifier count personID propName addressbook identifier get personID propName index - addressbook identifier primary personID propName + addressbook identifier index personID propName ident + addressbook identifier primary personID propName ?ident? addressbook identifier set groupID personID propName ?ident? addressbook image personID ?imageData? addressbook import vCardData @@ -39,7 +40,7 @@ addressbook set recordID propertyName ?value? addressbook setme recordID addressbook type recordID - 5. DISTRIBUTION LIST AND IDENTIFIERS + 5. DISTRIBUTION LISTS AND IDENTIFIERS 6. INSTALLATION 7. VERSION HISTORY 8. REQUIREMENTS AND PORTABILITY @@ -135,20 +136,33 @@ propName for the record corresponding to personID. One can get the count of identifiers using the addressbook identifier count command. Identifiers are used by the addressbook identifier set -command. See the section Distribution list and identifiers <#dist> +command. See the section Distribution lists and identifiers <#dist> below for explanations about identifiers. - addressbook identifier primary personID propName -This command returns the primary identifier of property propName in -the record personID. This is the identifier which will be used by -default if no distribution identifier has been specified using the -addressbook identifier set command. Property propName must -be a multi-value list property (such as Phone, Email). + addressbook identifier index personID propName ident +This command returns the index in a multi-value list corresponding to the +identifier given in the ident argument. If ident is not a +valid identifier, the command raises an error. The valid identifers are the +values obtained by the addressbook identifier get command. + + addressbook identifier primary personID propName ?ident? +This command lets you get or set the primary identifier of property +propName in the record personID. This is the identifier +which will be used by default if no distribution identifier has +been specified using the addressbook identifier set command. +Property propName must be a multi-value list property (such as +Phone, Email). ((nl Used without the ident argument, the +command will return the primary identifier concerning property +propName for the person personID. + If the ident argument is specified, the command will set the +primary value to be the value for the given identifier ident. This +value must be a valid identifier used by the multi-value list: one can get +the identifiers of any element of a multi-value list using the addressbook identifier get command. addressbook identifier set groupID personID propName ?ident? This command lets you get or set the distribution identifier for a multi-value list property of a person in a group. See the section -Distribution list and identifiers <#dist> below for +Distribution lists and identifiers <#dist> below for explanations about identifiers. Used without the ident argument, the command will return the distribution identifier for the person personID belonging to the @@ -350,7 +364,7 @@ unique ID recordID. -5. DISTRIBUTION LIST AND IDENTIFIERS +5. DISTRIBUTION LISTS AND IDENTIFIERS Identifiers are necessary when one wants to use a group as a distribution list, that is send something to all the members of the group. The members can be addressed by Phone, Email etc. For instance, a group could @@ -441,7 +455,7 @@ ---------------------------------------------------------------------- - Last updated 2004-07-30 14:44:48 + Last updated 2004-07-30 23:22:23 |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:30:43
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31522/Help Modified Files: tcladdressbook.n Log Message: Doc and examples for the [identifier index] command Index: tcladdressbook.n =================================================================== RCS file: /cvsroot/tcladdressbook/Help/tcladdressbook.n,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- tcladdressbook.n 30 Jul 2004 13:07:48 -0000 1.7 +++ tcladdressbook.n 30 Jul 2004 21:30:32 -0000 1.8 @@ -85,20 +85,34 @@ \fI propName\fP for the record corresponding to \fI personID\fP. One can get the count of identifiers using the \fBaddressbook identifier count\fP command. Identifiers are used by the \fBaddressbook identifier set\fP -command. See the section Distribution list and identifiers <#dist> +command. See the section Distribution lists and identifiers <#dist> below for explanations about identifiers. -.SS addressbook identifier primary \fI personID\fP \fI propName\fP +.SS addressbook identifier index \fI personID\fP \fI propName\fP \fI ident\fP .PP -This command returns the primary identifier of property \fI propName\fP in -the record \fI personID\fP. This is the identifier which will be used by -default if no \fI distribution identifier\fP has been specified using the -\fBaddressbook identifier set\fP command. Property \fI propName\fP must -be a multi-value list property (such as \fI Phone, Email\fP). +This command returns the index in a multi-value list corresponding to the +identifier given in the \fI ident\fP argument. If \fI ident\fP is not a +valid identifier, the command raises an error. The valid identifers are the +values obtained by the \fBaddressbook identifier get\fP command. +.SS addressbook identifier primary \fI personID\fP \fI propName\fP ?\fI ident\fP? +.PP +This command lets you get or set the primary identifier of property +\fI propName\fP in the record \fI personID\fP. This is the identifier +which will be used by default if no \fI distribution identifier\fP has +been specified using the \fBaddressbook identifier set\fP command. +Property \fI propName\fP must be a multi-value list property (such as +\fI Phone, Email\fP). ((nl Used without the \fI ident\fP argument, the +command will return the \fI primary identifier\fP concerning property +\fI propName\fP for the person \fI personID\fP. +.PP + If the \fI ident\fP argument is specified, the command will set the +primary value to be the value for the given identifier \fI ident\fP. This +value must be a valid identifier used by the multi-value list: one can get +the identifiers of any element of a multi-value list using the \fBaddressbook identifier get\fP command. .SS addressbook identifier set \fI groupID\fP \fI personID\fP \fI propName\fP ?\fI ident\fP? .PP This command lets you get or set the \fI distribution identifier\fP for a multi-value list property of a person in a group. See the section -Distribution list and identifiers <#dist> below for +Distribution lists and identifiers <#dist> below for explanations about identifiers. .PP Used without the \fI ident\fP argument, the command will return the @@ -331,7 +345,7 @@ This command returns the type (\fI ABPerson\fP or \fI ABGroup\fP) of the record with unique ID \fI recordID\fP. -.SH DISTRIBUTION LIST AND IDENTIFIERS +.SH DISTRIBUTION LISTS AND IDENTIFIERS .PP Identifiers are necessary when one wants to use a group as a distribution list, that is send something to all the members of the group. The members |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:30:29
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31476/Help Modified Files: TclAB_QuickStart.html Log Message: Doc and examples for the [identifier index] command Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TclAB_QuickStart.html 30 Jul 2004 13:07:38 -0000 1.8 +++ TclAB_QuickStart.html 30 Jul 2004 21:30:11 -0000 1.9 @@ -9,7 +9,7 @@ <P> <A HREF="TclAB.html">Home Page</A> | <A HREF="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This file is a tutorial that demonstrates the [addressbook] command defined by the Tcladdressbook extension for Tcl. It documents -version 1.1b3. All the Tcl instructions in the sections +version 1.1b4. All the Tcl instructions in the sections below are very short one-line commands which you can try in any Tcl shell, like tclsh for instance. <P> For a detailed and complete description of the syntax of each subcommand, @@ -313,23 +313,35 @@ <PRE> set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids -ingroup $groupid] 0] -</PRE><P><P> Count the identifiers of the Phone property: +</PRE> +<P> Count the identifiers of the Phone property: <PRE> addressbook identifier count $theid Phone -</PRE><P><P> Get some identifiers (suppose here that there are at least two of them): +</PRE> +<P> Get some identifiers (suppose here that there are at least two of them): <PRE> set ident1 [addressbook identifier get $theid Phone 0] set ident2 [addressbook identifier get $theid Phone 1] -</PRE><P><P> Get the primary identifier (the one which is chosen by default if +</PRE> +<P> Get the primary identifier (the one which is chosen by default if none has been specified otherwise): <PRE> addressbook identifier primary $theid Phone -</PRE><P><P> Get the current distribution identifier: +</PRE> +<P> Get the current distribution identifier: <PRE> addressbook identifier set $groupid $theid Phone -</PRE><P><P> Set the distribution identifier to <I>ident2</I>: +</PRE> +<P> Set the distribution identifier to <I>ident2</I>: <PRE> addressbook identifier set $groupid $theid Phone $ident2 +</PRE> +<P> The reverse operation of the <B>addressbook identifier get</B> command +is the <B>addressbook identifier index</B> command which returns the +index corresponding to a given identifier. For instance, the following +instruction will return the index 1: +<PRE> + addressbook identifier index $theid Phone $ident2 </PRE><P><A NAME="ukl"></A> <H2><A NAME="M24"></A>Using keyed lists</H2> Keyed lists can be easily manipulated using the <B>keylget</B> and @@ -351,6 +363,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-07-30 14:46:44<P> +<P> Last updated 2004-07-30 23:25:49<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:30:10
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31377/Help Modified Files: TclAB_QuickStart.aida Log Message: Doc and examples for the [identifier index] command Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TclAB_QuickStart.aida 30 Jul 2004 13:07:28 -0000 1.8 +++ TclAB_QuickStart.aida 30 Jul 2004 21:30:01 -0000 1.9 @@ -6,7 +6,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-12-14 18:26:47 -:Modified: 2004-07-30 14:43:09 +:Modified: 2004-07-30 23:25:47 :Keywords: Address book, data base @@ -384,34 +384,35 @@ set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids -ingroup $groupid] 0] |)) - ((nl Count the identifiers of the Phone property: ((| addressbook identifier count $theid Phone |)) - ((nl Get some identifiers (suppose here that there are at least two of them): ((| set ident1 [addressbook identifier get $theid Phone 0] set ident2 [addressbook identifier get $theid Phone 1] |)) - ((nl Get the primary identifier (the one which is chosen by default if none has been specified otherwise): ((| addressbook identifier primary $theid Phone |)) - ((nl Get the current distribution identifier: ((| addressbook identifier set $groupid $theid Phone |)) - ((nl Set the distribution identifier to ((i ident2 i)): ((| addressbook identifier set $groupid $theid Phone $ident2 |)) - +((nl The reverse operation of the ((b addressbook identifier get b)) command +is the ((b addressbook identifier index b)) command which returns the +index corresponding to a given identifier. For instance, the following +instruction will return the index 1: +((| + addressbook identifier index $theid Phone $ident2 +|)) ((a ukl)) a)) |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:29:35
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31308/Source Modified Files: TclAddressBookUtils.h Log Message: [identifier index] command Index: TclAddressBookUtils.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TclAddressBookUtils.h 30 Jul 2004 13:06:48 -0000 1.11 +++ TclAddressBookUtils.h 30 Jul 2004 21:29:25 -0000 1.12 @@ -116,6 +116,11 @@ Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); +int TclAB_IdentifierIndex(Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[], + Tcl_Obj *resultPtr); + int TclAB_IdentifierPrimary(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:29:26
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31277/Source Modified Files: TclAddressBookUtils.c Log Message: [identifier index] command Index: TclAddressBookUtils.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TclAddressBookUtils.c 30 Jul 2004 13:05:58 -0000 1.17 +++ TclAddressBookUtils.c 30 Jul 2004 21:29:17 -0000 1.18 @@ -1,7 +1,7 @@ /* * File : "TclAddressBookUtils.c" * Created: 2003-12-05 10:08:03 - * Last modification: 2004-07-30 10:51:55 + * Last modification: 2004-07-30 23:12:50 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -1560,6 +1560,109 @@ /* *---------------------------------------------------------------------- * + * TclAB_IdentifierIndex -- + * + * This function is invoked to process the [addressbook identifier index] + * Tcl command. + * See the user documentation for details on what it does. + * + * Syntax: + * addressbook identifier index personID propName identifier + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +int +TclAB_IdentifierIndex( + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *CONST objv[], /* Argument values. */ + Tcl_Obj *resultPtr) /* Pointer to store the result. */ +{ + ABAddressBookRef ab; + CONST84 char * theProperty, * theUID, * theIdentifier; + CFStringRef propertyRef, identRef, multivalueRef; + ABRecordRef personRecord; + int index, length, result = TCL_OK; + + if (objc != 6) { + Tcl_WrongNumArgs(interp, 2, objv, "personID propName identifier"); + return TCL_ERROR; + } + + Tcl_ResetResult(interp); + + // Get the address book + ab = ABGetSharedAddressBook(); + + // Check if third argument is a person and get the corresponding record + theUID = Tcl_GetStringFromObj(objv[3], &length); + if ( !TclAB_CheckItem(interp, ab, theUID, "third", &personRecord, rec_person) ) { + return TCL_ERROR; + } + + // Make CFString object for property + Tcl_IncrRefCount(objv[4]); + theProperty = Tcl_GetStringFromObj(objv[4], &length); + propertyRef = CFStringCreateWithCString(NULL, theProperty, kCFStringEncodingUTF8); + if (!propertyRef) { + Tcl_AppendStringsToObj(resultPtr, "Problem getting CFString for property", (char *) NULL); + result = TCL_ERROR; + goto DONE; + } + + // Check the property's type + if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); + CFRelease(propertyRef); + result = TCL_ERROR; + goto DONE; + } + + Tcl_IncrRefCount(objv[5]); + theIdentifier = Tcl_GetStringFromObj(objv[5], &length); + identRef = CFStringCreateWithCString(NULL, theIdentifier, kCFStringEncodingUTF8); + if (!identRef) { + Tcl_AppendStringsToObj(resultPtr, "Problem getting CFString for identifier", (char *) NULL); + CFRelease(propertyRef); + result = TCL_ERROR; + goto DONE; + } + + multivalueRef = ABRecordCopyValue(personRecord, propertyRef); + if (!multivalueRef) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get value for '", theProperty, "' property", (char *) NULL); + result = TCL_ERROR; + } else { + index = ABMultiValueIndexForIdentifier((ABMutableMultiValueRef) multivalueRef, identRef); + if (index == 0x7fffffff) { + Tcl_AppendStringsToObj(resultPtr, "Bad identifier ", theIdentifier, (char *) NULL); + result = TCL_ERROR; + } else { + Tcl_SetObjResult(interp, Tcl_NewIntObj(index)); + } + CFRelease(multivalueRef); + } + CFRelease(identRef); + CFRelease(propertyRef); + +DONE: + Tcl_DecrRefCount(objv[4]); + Tcl_DecrRefCount(objv[5]); + CFRelease(personRecord); + return result; +} + + +/* + *---------------------------------------------------------------------- + * * TclAB_IdentifierPrimary -- * * This function is invoked to process the [addressbook identifier primary] @@ -1567,7 +1670,7 @@ * See the user documentation for details on what it does. * * Syntax: - * addressbook identifier primary personID propName + * addressbook identifier primary personID propName ?ident? * * Results: * A standard Tcl result. @@ -1587,14 +1690,17 @@ { ABAddressBookRef ab; Tcl_DString ds; - CONST84 char * theProperty, * theUID; - CFStringRef propertyRef, valueRef, identRef; + CONST84 char * theProperty, * theUID, * theNewValue; + CFStringRef propertyRef, newvalueRef, multivalueRef; ABRecordRef personRecord; char theString[256]; int length, result = TCL_OK; + Boolean setIt = false; + // Setting the primary does not seem to work. Temporarily disabling it. + // objc != 5 && objc != 6 if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "personID propName"); + Tcl_WrongNumArgs(interp, 2, objv, "personID propName ?identifier?"); return TCL_ERROR; } @@ -1627,28 +1733,54 @@ goto DONE; } - valueRef = ABRecordCopyValue(personRecord, propertyRef); - if (!valueRef) { + if (objc == 6) { + Tcl_IncrRefCount(objv[5]); + theNewValue = Tcl_GetStringFromObj(objv[5], &length); + newvalueRef = CFStringCreateWithCString(NULL, theNewValue, kCFStringEncodingUTF8); + if (!newvalueRef) { + Tcl_AppendStringsToObj(resultPtr, "Problem getting CFString for identifier", (char *) NULL); + CFRelease(propertyRef); + result = TCL_ERROR; + goto DONE; + } + setIt = true; + } + + multivalueRef = ABRecordCopyValue(personRecord, propertyRef); + if (!multivalueRef) { Tcl_AppendStringsToObj(resultPtr, "Couldn't get value for '", theProperty, "' property", (char *) NULL); result = TCL_ERROR; } else { - identRef = ABMultiValueCopyPrimaryIdentifier((ABMutableMultiValueRef) valueRef); - if (!identRef) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't get primary identifier for '", theProperty, "' property", (char *) NULL); - result = TCL_ERROR; + if (setIt) { + if (!ABMultiValueSetPrimaryIdentifier((ABMutableMultiValueRef) multivalueRef, newvalueRef)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't set primary identifier", (char *) NULL); + result = TCL_ERROR; + } else { + Tcl_ExternalToUtfDString(gMacRomanEnc, theNewValue, strlen(theNewValue), &ds); + Tcl_DStringResult(interp, &ds); + Tcl_DStringFree(&ds); + } + CFRelease(newvalueRef); } else { - CFStringGetCString(identRef, theString, sizeof(theString), NULL); - Tcl_ExternalToUtfDString(gMacRomanEnc, theString, strlen(theString), &ds); - Tcl_DStringResult(interp, &ds); - Tcl_DStringFree(&ds); - CFRelease(identRef); + CFStringRef identRef = ABMultiValueCopyPrimaryIdentifier((ABMutableMultiValueRef) multivalueRef); + if (!identRef) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get primary identifier for '", theProperty, "' property", (char *) NULL); + result = TCL_ERROR; + } else { + CFStringGetCString(identRef, theString, sizeof(theString), NULL); + CFRelease(identRef); + Tcl_ExternalToUtfDString(gMacRomanEnc, theString, strlen(theString), &ds); + Tcl_DStringResult(interp, &ds); + Tcl_DStringFree(&ds); + } } - CFRelease(valueRef); + CFRelease(multivalueRef); } CFRelease(propertyRef); DONE: Tcl_DecrRefCount(objv[4]); + if (objc == 6) Tcl_DecrRefCount(objv[5]); CFRelease(personRecord); return result; } @@ -1690,10 +1822,9 @@ { ABAddressBookRef ab; Tcl_DString ds; - CONST84 char * theProperty, * theGroupUID, * thePersonUID, * theNewVal; - CFStringRef propertyRef, valueRef; + CONST84 char * theProperty, * theGroupUID, * thePersonUID, * theNewValue; + CFStringRef propertyRef, newvalueRef; ABRecordRef groupRecord, personRecord; - ABPropertyType thePropType; int length, result = TCL_OK; Boolean setIt = false; @@ -1742,9 +1873,9 @@ if (objc == 7) { Tcl_IncrRefCount(objv[6]); - theNewVal = Tcl_GetStringFromObj(objv[6], &length); - valueRef = CFStringCreateWithCString(NULL, theNewVal, kCFStringEncodingUTF8); - if (!valueRef) { + theNewValue = Tcl_GetStringFromObj(objv[6], &length); + newvalueRef = CFStringCreateWithCString(NULL, theNewValue, kCFStringEncodingUTF8); + if (!newvalueRef) { Tcl_AppendStringsToObj(resultPtr, "Problem getting CFString for identifier", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; @@ -1754,16 +1885,16 @@ } if (setIt) { - if (!ABGroupSetDistributionIdentifier(groupRecord, personRecord, propertyRef, valueRef)) { + if (!ABGroupSetDistributionIdentifier(groupRecord, personRecord, propertyRef, newvalueRef)) { Tcl_AppendStringsToObj(resultPtr, "Couldn't set distribution identifier for '", theProperty, "' property", (char *) NULL); result = TCL_ERROR; } else { - Tcl_ExternalToUtfDString(gMacRomanEnc, theNewVal, strlen(theNewVal), &ds); + Tcl_ExternalToUtfDString(gMacRomanEnc, theNewValue, strlen(theNewValue), &ds); Tcl_DStringResult(interp, &ds); Tcl_DStringFree(&ds); } - CFRelease(valueRef); + CFRelease(newvalueRef); } else { CFStringRef identRef = ABGroupCopyDistributionIdentifier(groupRecord, personRecord, propertyRef); if (!identRef) { |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:29:15
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31246/Source Modified Files: TclAddressBook.c Log Message: [identifier index] command Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- TclAddressBook.c 30 Jul 2004 13:05:46 -0000 1.30 +++ TclAddressBook.c 30 Jul 2004 21:29:05 -0000 1.31 @@ -789,7 +789,8 @@ * Syntax: * addressbook identifier count personID propName * addressbook identifier get personID propName index - * addressbook identifier primary personID propName + * addressbook identifier index personID propName identifier + * addressbook identifier primary personID propName ?identifier? * addressbook identifier set groupID personID propName ?identifier? * * @@ -810,19 +811,19 @@ Tcl_Obj *CONST objv[], /* Argument values. */ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { - int result = TCL_ERROR, index, kind; + int result = TCL_ERROR, index; static CONST char *identSubcmdSwitches[] = { - "count", "get", "primary", "set", (char *) NULL + "count", "get", "index", "primary", "set", (char *) NULL }; enum { - TCLAB_IDENTIFIER_COUNT, TCLAB_IDENTIFIER_GET, + TCLAB_IDENTIFIER_COUNT, TCLAB_IDENTIFIER_GET, TCLAB_IDENTIFIER_INDEX, TCLAB_IDENTIFIER_PRIMARY, TCLAB_IDENTIFIER_SET }; if (objc < 5) { - Tcl_WrongNumArgs(interp, 2, objv, "(count|get|set) ?args?"); + Tcl_WrongNumArgs(interp, 2, objv, "(count|get|index|primary|set) ?args?"); return TCL_ERROR; } @@ -840,6 +841,10 @@ result = TclAB_IdentifierGet(interp, objc, objv, resultPtr); break; + case TCLAB_IDENTIFIER_INDEX: + result = TclAB_IdentifierIndex(interp, objc, objv, resultPtr); + break; + case TCLAB_IDENTIFIER_PRIMARY: result = TclAB_IdentifierPrimary(interp, objc, objv, resultPtr); break; |
|
From: Bernard D. <bde...@us...> - 2004-07-30 21:29:05
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31185/Source Modified Files: Changes.Log Log Message: [identifier index] command Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Changes.Log 30 Jul 2004 11:14:01 -0000 1.16 +++ Changes.Log 30 Jul 2004 21:28:54 -0000 1.17 @@ -31,12 +31,19 @@ Last modification: $Date$ ================================================================================ -= 1.1b3 last update: += 1.1b4 last update: +================================================================================ + Added a new [addressbook identifier index] command to return the + index corresponding to a particular identifier in a multi-value list. + Extended the [addressbook identifier primary] command to set, and + not only get, the primary identifier for a multi-value list. + +================================================================================ += 1.1b3 last update: 2004-07-30 23:15:35 ================================================================================ Extended the [addressbook identifier] command with subcommands to manage distribution lists. New subcommands are: count, get, primary, and set. - ================================================================================ = 1.1b2 last update: 2004-07-29 22:07:10 |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:08:36
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4625/Help Modified Files: TclAddressBookHelp.html Log Message: More [identifier] doc and examples Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- TclAddressBookHelp.html 30 Jul 2004 11:17:03 -0000 1.19 +++ TclAddressBookHelp.html 30 Jul 2004 13:08:26 -0000 1.20 @@ -99,9 +99,9 @@ <I>-ingroup</I> option is specified, only the subgroups contained in the group with ID <I>groupID</I> will be returned.<P><H4><A NAME="M13"></A>addressbook identifier count <I>personID</I> <I>propName</I></H4> This command returns the number of items in a multi-value list property -(such as Address, Phone, Email). <P><H4><A NAME="M14"></A>addressbook identifier get <I>personID</I> <I>propName</I> <I>index</I></H4> +(such as <I>Phone, Email, MSNInstant</I> etc.). <P><H4><A NAME="M14"></A>addressbook identifier get <I>personID</I> <I>propName</I> <I>index</I></H4> This command gets the unique identifier of an item in a multi-value list -property (such as Address, Phone, Email). It returns the identifier of the +property (such as <I>Phone, Email</I>). It returns the identifier of the item at index <I>index</I> in the multi-value list of property <I>propName</I> for the record corresponding to <I>personID</I>. One can get the count of identifiers using the <B>addressbook identifier count</B> @@ -112,7 +112,7 @@ the record <I>personID</I>. This is the identifier which will be used by default if no <I>distribution identifier</I> has been specified using the <B>addressbook identifier set</B> command. Property <I>propName</I> must -be a multi-value list property (such as <I>Address, Phone, Email</I>).<P><H4><A NAME="M16"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> +be a multi-value list property (such as <I>Phone, Email</I>).<P><H4><A NAME="M16"></A>addressbook identifier set <I>groupID</I> <I>personID</I> <I>propName</I> ?<I>ident</I>?</H4> This command lets you get or set the <I>distribution identifier</I> for a multi-value list property of a person in a group. See the section <A HREF="#dist"> Distribution list and identifiers</A> below for @@ -121,7 +121,7 @@ <I>distribution identifier</I> for the person <I>personID</I> belonging to the group <I>groupID</I> concerning property <I>propName</I> if it was set, otherwise the property's primary identifier. Property <I>propName</I> must -be a multi-value list property (such as <I>Address, Phone, Email</I>). +be a multi-value list property (such as <I>Phone, Email</I>). <P> If the <I>ident</I> argument is specified, this will assign a specific <I>distribution identifier</I> for the person's multi-value list property so that the group can be used as a distribution list (a mailing @@ -285,8 +285,8 @@ <H2><A NAME="M32"></A>DISTRIBUTION LIST AND IDENTIFIERS</H2> Identifiers are necessary when one wants to use a group as a distribution list, that is send something to all the members of the group. The members -can be addressed by <I>Phone, Email, Address</I> etc. For instance, a group could -be used as a mailing list. The <I>Phone, Email, Address</I> properties are +can be addressed by <I>Phone, Email</I> etc. For instance, a group could +be used as a mailing list. The <I>Phone, Email</I> properties are multi-value list properties: since a person can have several e-mail addresses, one must specify which one is to be used in the distribution list. Labels (such as Home, Work etc.) are not sufficient to specify precisely an @@ -340,6 +340,6 @@ See the TclX extension for keyed lists: TclX(n). See the Mk4Tcl extension for commands to open directly the database file.<P><H2><A NAME="M41"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-07-30 13:05:27<P> +<P> Last updated 2004-07-30 14:43:34<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:08:26
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4588/Help Modified Files: TclAddressBookHelp.aida Log Message: More [identifier] doc and examples Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- TclAddressBookHelp.aida 30 Jul 2004 11:16:53 -0000 1.16 +++ TclAddressBookHelp.aida 30 Jul 2004 13:08:10 -0000 1.17 @@ -102,16 +102,16 @@ ((s3 addressbook identifier count ((i personID i)) ((i propName i)) This command returns the number of items in a multi-value list property -(such as Address, Phone, Email). +(such as ((i Phone, Email, MSNInstant i)) etc.). ((s3 addressbook identifier get ((i personID i)) ((i propName i)) ((i index i)) This command gets the unique identifier of an item in a multi-value list -property (such as Address, Phone, Email). It returns the identifier of the +property (such as ((i Phone, Email i))). It returns the identifier of the item at index ((i index i)) in the multi-value list of property ((i propName i)) for the record corresponding to ((i personID i)). One can get the count of identifiers using the ((b addressbook identifier count b)) command. Identifiers are used by the ((b addressbook identifier set b)) -command. See the section ((lk #dist ))Distribution list and identifiers lk)) +command. See the section ((lk #dist ))Distribution lists and identifiers lk)) below for explanations about identifiers. ((s3 addressbook identifier primary ((i personID i)) ((i propName i)) @@ -119,18 +119,18 @@ the record ((i personID i)). This is the identifier which will be used by default if no ((i distribution identifier i)) has been specified using the ((b addressbook identifier set b)) command. Property ((i propName i)) must -be a multi-value list property (such as ((i Address, Phone, Email i))). +be a multi-value list property (such as ((i Phone, Email i))). ((s3 addressbook identifier set ((i groupID i)) ((i personID i)) ((i propName i)) ?((i ident i))? This command lets you get or set the ((i distribution identifier i)) for a multi-value list property of a person in a group. See the section -((lk #dist )) Distribution list and identifiers lk)) below for +((lk #dist )) Distribution lists and identifiers lk)) below for explanations about identifiers. ((nl Used without the ((i ident i)) argument, the command will return the ((i distribution identifier i)) for the person ((i personID i)) belonging to the group ((i groupID i)) concerning property ((i propName i)) if it was set, otherwise the property's primary identifier. Property ((i propName i)) must -be a multi-value list property (such as ((i Address, Phone, Email i))). +be a multi-value list property (such as ((i Phone, Email i))). ((nl If the ((i ident i)) argument is specified, this will assign a specific ((i distribution identifier i)) for the person's multi-value list property so that the group can be used as a distribution list (a mailing @@ -329,11 +329,11 @@ unique ID ((i recordID i)). ((a dist )) a)) -((s1 DISTRIBUTION LIST AND IDENTIFIERS +((s1 DISTRIBUTION LISTS AND IDENTIFIERS Identifiers are necessary when one wants to use a group as a distribution list, that is send something to all the members of the group. The members -can be addressed by ((i Phone, Email, Address i)) etc. For instance, a group could -be used as a mailing list. The ((i Phone, Email, Address i)) properties are +can be addressed by ((i Phone, Email i)) etc. For instance, a group could +be used as a mailing list. The ((i Phone, Email i)) properties are multi-value list properties: since a person can have several e-mail addresses, one must specify which one is to be used in the distribution list. Labels (such as Home, Work etc.) are not sufficient to specify precisely an |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:08:09
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4522/Help Modified Files: TclAddressBookHelp Log Message: More [identifier] doc and examples Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- TclAddressBookHelp 29 Jul 2004 20:14:55 -0000 1.16 +++ TclAddressBookHelp 30 Jul 2004 13:07:58 -0000 1.17 @@ -5,7 +5,7 @@ Abstract This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1b2. +documents version 1.1b3. 1. NAME @@ -20,7 +20,10 @@ addressbook export personID addressbook getme ?-id? addressbook groups ?-ids? ?-ingroup groupID? - addressbook identifier personID groupID propName ?label? + addressbook identifier count personID propName + addressbook identifier get personID propName index + addressbook identifier primary personID propName + addressbook identifier set groupID personID propName ?ident? addressbook image personID ?imageData? addressbook import vCardData addressbook parents ?-ids? recordID @@ -36,15 +39,16 @@ addressbook set recordID propertyName ?value? addressbook setme recordID addressbook type recordID - 5. INSTALLATION - 6. VERSION HISTORY - 7. REQUIREMENTS AND PORTABILITY - 8. KNOW ISSUES - 9. SOURCE CODE - 10. CONTRIBUTIONS - 11. LICENSE AND DISCLAIMER - 12. SEE ALSO - 13. KEYWORDS + 5. DISTRIBUTION LIST AND IDENTIFIERS + 6. INSTALLATION + 7. VERSION HISTORY + 8. REQUIREMENTS AND PORTABILITY + 9. KNOW ISSUES + 10. SOURCE CODE + 11. CONTRIBUTIONS + 12. LICENSE AND DISCLAIMER + 13. SEE ALSO + 14. KEYWORDS =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -120,22 +124,44 @@ -ingroup option is specified, only the subgroups contained in the group with ID groupID will be returned. - addressbook identifier personID groupID propName ?label? + addressbook identifier count personID propName +This command returns the number of items in a multi-value list property +(such as Phone, Email, MSNInstant etc.). + + addressbook identifier get personID propName index +This command gets the unique identifier of an item in a multi-value list +property (such as Phone, Email). It returns the identifier of the +item at index index in the multi-value list of property +propName for the record corresponding to personID. One can +get the count of identifiers using the addressbook identifier count +command. Identifiers are used by the addressbook identifier set +command. See the section Distribution list and identifiers <#dist> +below for explanations about identifiers. + + addressbook identifier primary personID propName +This command returns the primary identifier of property propName in +the record personID. This is the identifier which will be used by +default if no distribution identifier has been specified using the +addressbook identifier set command. Property propName must +be a multi-value list property (such as Phone, Email). + + addressbook identifier set groupID personID propName ?ident? This command lets you get or set the distribution identifier for a -multi-value list property of a person in a group. - Used without a label argument, this will return the +multi-value list property of a person in a group. See the section +Distribution list and identifiers <#dist> below for +explanations about identifiers. + Used without the ident argument, the command will return the distribution identifier for the person personID belonging to the group groupID concerning property propName if it was set, -otherwise the property¹s primary identifier. Property propName must -be a multi-value list property - If the label argument is specified, this will assign a -specific distribution identifier for the person¹s multi-value list property -so that the group can be used as a distribution list (a mailing list for -instance, in the case of an email property). This value must be a label -used by the multi-value list (such as home for an address -property). If label is an empty string, this command resets the -distribution identifier to its default, i-e the multi-value list¹s primary -identifier. +otherwise the property's primary identifier. Property propName must +be a multi-value list property (such as Phone, Email). + If the ident argument is specified, this will assign a +specific distribution identifier for the person's multi-value list +property so that the group can be used as a distribution list (a mailing +list for instance, in the case of an email property). This value must be a +valid identifier used by the multi-value list: one can get the identifiers +of any element of a multi-value list using the addressbook identifier +get command. addressbook image personID ?imageData? If no imageData argument is specified, this command returns the @@ -323,8 +349,24 @@ This command returns the type (ABPerson or ABGroup) of the record with unique ID recordID. + +5. DISTRIBUTION LIST AND IDENTIFIERS +Identifiers are necessary when one wants to use a group as a distribution +list, that is send something to all the members of the group. The members +can be addressed by Phone, Email etc. For instance, a group could +be used as a mailing list. The Phone, Email properties are +multi-value list properties: since a person can have several e-mail +addresses, one must specify which one is to be used in the distribution list. +Labels (such as Home, Work etc.) are not sufficient to specify precisely an +e-mail because they are not unique: one can have several e-mails with the +label Work. Here the identifiers come in: each value of a multi-value list +property has an identifier. One of them can be designated as the distribution identifier. The AddressBook database also has a notion of +a primary identifier: it is the identifier which will be used by +default by the distribution list if no distribution identifier as +been specified. -5. INSTALLATION + +6. INSTALLATION The extension is made of two files: the dynamic library (called addressbook1.0.dylib in version 1.0) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are @@ -337,28 +379,30 @@ application. -6. VERSION HISTORY +7. VERSION HISTORY 1.0b1 -- 2004/01/25 -- First public release. 1.1b1 -- 2004/07/28 -- New commands [add] and [remove]. Modified -[delete] command. New command [identifier]. Modified [property remove] +[delete] command. Modified [property remove] command. 1.1b2 -- 2004/07/29 -- New command [setme]. + 1.1b3 -- 2004/07/30 -- New command [identifier] to handle +distribution lists. -7. REQUIREMENTS AND PORTABILITY +8. REQUIREMENTS AND PORTABILITY This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced in version 10.2 of the System (aka Jaguar). -8. KNOW ISSUES +9. KNOW ISSUES Tcladdressbook was written by Bernard Desgraupes. Please e-mail any bug or problem you encounter: <bde...@us...> -9. SOURCE CODE +10. SOURCE CODE Tcladdressbook is an Open Source Project. Its source code is public and can be found on the SourceForge site at the following address: <http://sourceforge.net/projects/tcladdressbook> @@ -375,29 +419,29 @@ You can also browse the cvs repository online at <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook> -10. CONTRIBUTIONS +11. CONTRIBUTIONS Code contributions (Tcl scripts making use of the Tcladdressbook extension) are very welcome. There is a "Contribs" directory in the Tcladdressbook project on SourceForge for code contributions. They must be free software, distributed under an Open Source license acceptable by the SourceForge site (for instance, the same licensing terms as the Tcl language itself). -11. LICENSE AND DISCLAIMER +12. LICENSE AND DISCLAIMER This software is free software and distributed under the same licensing terms as the Tcl language itself. See license.terms in the Tcl distribution. © Copyright Bernard Desgraupes 2003-2004 -12. SEE ALSO +13. SEE ALSO See the TclX extension for keyed lists: TclX(n). See the Mk4Tcl extension for commands to open directly the database file. -13. KEYWORDS +14. KEYWORDS Address book, data base. ---------------------------------------------------------------------- - Last updated 2004-07-29 22:00:33 + Last updated 2004-07-30 14:44:48 |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:07:57
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4475/Help Modified Files: tcladdressbook.n Log Message: More [identifier] doc and examples Index: tcladdressbook.n =================================================================== RCS file: /cvsroot/tcladdressbook/Help/tcladdressbook.n,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tcladdressbook.n 29 Jul 2004 20:14:46 -0000 1.6 +++ tcladdressbook.n 30 Jul 2004 13:07:48 -0000 1.7 @@ -1,7 +1,7 @@ .de uline \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m' .. -.TH tcladdressbook n "" "2004-07-29" "addressbook extension for Tcl" +.TH tcladdressbook n "" "2004-07-30" "addressbook extension for Tcl" .SH NAME .PP addressbook - manipulate the Macintosh OSX Address Book database @@ -73,25 +73,47 @@ returned list will contain only the unique IDs of the groups. If the \fI -ingroup\fP option is specified, only the subgroups contained in the group with ID \fI groupID\fP will be returned. -.SS addressbook identifier \fI personID\fP \fI groupID\fP \fI propName\fP ?\fI label\fP? +.SS addressbook identifier count \fI personID\fP \fI propName\fP .PP -This command lets you get or set the distribution identifier for a -multi-value list property of a person in a group. +This command returns the number of items in a multi-value list property +(such as \fI Phone, Email, MSNInstant\fP etc.). +.SS addressbook identifier get \fI personID\fP \fI propName\fP \fI index\fP .PP - Used without a \fI label\fP argument, this will return the -distribution identifier for the person \fI personID\fP belonging to the +This command gets the unique identifier of an item in a multi-value list +property (such as \fI Phone, Email\fP). It returns the identifier of the +item at index \fI index\fP in the multi-value list of property +\fI propName\fP for the record corresponding to \fI personID\fP. One can +get the count of identifiers using the \fBaddressbook identifier count\fP +command. Identifiers are used by the \fBaddressbook identifier set\fP +command. See the section Distribution list and identifiers <#dist> +below for explanations about identifiers. +.SS addressbook identifier primary \fI personID\fP \fI propName\fP +.PP +This command returns the primary identifier of property \fI propName\fP in +the record \fI personID\fP. This is the identifier which will be used by +default if no \fI distribution identifier\fP has been specified using the +\fBaddressbook identifier set\fP command. Property \fI propName\fP must +be a multi-value list property (such as \fI Phone, Email\fP). +.SS addressbook identifier set \fI groupID\fP \fI personID\fP \fI propName\fP ?\fI ident\fP? +.PP +This command lets you get or set the \fI distribution identifier\fP for a +multi-value list property of a person in a group. See the section +Distribution list and identifiers <#dist> below for +explanations about identifiers. +.PP + Used without the \fI ident\fP argument, the command will return the +\fI distribution identifier\fP for the person \fI personID\fP belonging to the group \fI groupID\fP concerning property \fI propName\fP if it was set, -otherwise the property¹s primary identifier. Property \fI propName\fP must -be a multi-value list property +otherwise the property's primary identifier. Property \fI propName\fP must +be a multi-value list property (such as \fI Phone, Email\fP). .PP - If the \fI label\fP argument is specified, this will assign a -specific distribution identifier for the person¹s multi-value list property -so that the group can be used as a distribution list (a mailing list for -instance, in the case of an email property). This value must be a label -used by the multi-value list (such as \fI home\fP for an \fI address\fP -property). If \fI label\fP is an empty string, this command resets the -distribution identifier to its default, i-e the multi-value list¹s primary -identifier. + If the \fI ident\fP argument is specified, this will assign a +specific \fI distribution identifier\fP for the person's multi-value list +property so that the group can be used as a distribution list (a mailing +list for instance, in the case of an email property). This value must be a +valid identifier used by the multi-value list: one can get the identifiers +of any element of a multi-value list using the \fBaddressbook identifier +get\fP command. .SS addressbook image \fI personID\fP ?\fI imageData\fP? .PP If no \fI imageData\fP argument is specified, this command returns the @@ -308,6 +330,22 @@ .PP This command returns the type (\fI ABPerson\fP or \fI ABGroup\fP) of the record with unique ID \fI recordID\fP. + +.SH DISTRIBUTION LIST AND IDENTIFIERS +.PP +Identifiers are necessary when one wants to use a group as a distribution +list, that is send something to all the members of the group. The members +can be addressed by \fI Phone, Email\fP etc. For instance, a group could +be used as a mailing list. The \fI Phone, Email\fP properties are +multi-value list properties: since a person can have several e-mail +addresses, one must specify which one is to be used in the distribution list. +Labels (such as Home, Work etc.) are not sufficient to specify precisely an +e-mail because they are not unique: one can have several e-mails with the +label Work. Here the identifiers come in: each value of a multi-value list +property has an identifier. One of them can be designated as the \fI distribution identifier\fP. The AddressBook database also has a notion of +a \fI primary identifier\fP: it is the identifier which will be used by +default by the distribution list if no \fI distribution identifier\fP as +been specified. .SH INSTALLATION .PP The extension is made of two files: the dynamic library (called @@ -327,10 +365,13 @@ 1.0b1 -- 2004/01/25 -- First public release. .IP * 4 1.1b1 -- 2004/07/28 -- New commands [add] and [remove]. Modified -[delete] command. New command [identifier]. Modified [property remove] +[delete] command. Modified [property remove] command. .IP * 4 1.1b2 -- 2004/07/29 -- New command [setme]. +.IP * 4 +1.1b3 -- 2004/07/30 -- New command [identifier] to handle +distribution lists. .RE .SH REQUIREMENTS AND PORTABILITY .PP |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:07:48
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4437/Help Modified Files: TclAB_QuickStart.html Log Message: More [identifier] doc and examples Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TclAB_QuickStart.html 29 Jul 2004 13:31:45 -0000 1.7 +++ TclAB_QuickStart.html 30 Jul 2004 13:07:38 -0000 1.8 @@ -9,7 +9,7 @@ <P> <A HREF="TclAB.html">Home Page</A> | <A HREF="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This file is a tutorial that demonstrates the [addressbook] command defined by the Tcladdressbook extension for Tcl. It documents -version 1.1b1. All the Tcl instructions in the sections +version 1.1b3. All the Tcl instructions in the sections below are very short one-line commands which you can try in any Tcl shell, like tclsh for instance. <P> For a detailed and complete description of the syntax of each subcommand, @@ -23,23 +23,25 @@ <UL><LI><A HREF="#M3">The [persons] subcommand</A></UL> <UL><LI><A HREF="#M4">The [count] subcommand</A></UL> <UL><LI><A HREF="#M5">The [getme] subcommand</A></UL> -<UL><LI><A HREF="#M6">The [record] subcommand</A></UL> -<UL><LI><A HREF="#M7">The [type] subcommand</A></UL> -<UL><LI><A HREF="#M8">The [delete] subcommand</A></UL> -<UL><LI><A HREF="#M9">The [add] subcommand</A></UL> -<UL><LI><A HREF="#M10">The [remove] subcommand</A></UL> -<UL><LI><A HREF="#M11">The [parents] subcommand</A></UL> -<UL><LI><A HREF="#M12">The [create] subcommand</A></UL> -<UL><LI><A HREF="#M13">The [property names] subcommand</A></UL> -<UL><LI><A HREF="#M14">The [property type] subcommand</A></UL> -<UL><LI><A HREF="#M15">The [property add] subcommand</A></UL> -<UL><LI><A HREF="#M16">The [property remove] subcommand</A></UL> -<UL><LI><A HREF="#M17">The [export] subcommand</A></UL> -<UL><LI><A HREF="#M18">The [import] subcommand</A></UL> -<UL><LI><A HREF="#M19">The [image] subcommand</A></UL> -<UL><LI><A HREF="#M20">The [set] subcommand</A></UL> -<UL><LI><A HREF="#M21">The [search] subcommand</A></UL> -<LI><A HREF="#M22">Using keyed lists</A> +<UL><LI><A HREF="#M6">The [setme] subcommand</A></UL> +<UL><LI><A HREF="#M7">The [record] subcommand</A></UL> +<UL><LI><A HREF="#M8">The [type] subcommand</A></UL> +<UL><LI><A HREF="#M9">The [delete] subcommand</A></UL> +<UL><LI><A HREF="#M10">The [add] subcommand</A></UL> +<UL><LI><A HREF="#M11">The [remove] subcommand</A></UL> +<UL><LI><A HREF="#M12">The [parents] subcommand</A></UL> +<UL><LI><A HREF="#M13">The [create] subcommand</A></UL> +<UL><LI><A HREF="#M14">The [property names] subcommand</A></UL> +<UL><LI><A HREF="#M15">The [property type] subcommand</A></UL> +<UL><LI><A HREF="#M16">The [property add] subcommand</A></UL> +<UL><LI><A HREF="#M17">The [property remove] subcommand</A></UL> +<UL><LI><A HREF="#M18">The [export] subcommand</A></UL> +<UL><LI><A HREF="#M19">The [import] subcommand</A></UL> +<UL><LI><A HREF="#M20">The [image] subcommand</A></UL> +<UL><LI><A HREF="#M21">The [set] subcommand</A></UL> +<UL><LI><A HREF="#M22">The [search] subcommand</A></UL> +<UL><LI><A HREF="#M23">The [identifier] subcommand</A></UL> +<LI><A HREF="#M24">Using keyed lists</A> </UL> First load the extension like this <PRE> @@ -88,7 +90,13 @@ In that case the unique ID of the "Me" record is returned: <PRE> set myID [addressbook getme -id] -</PRE><P><H3><A NAME="M6"></A>The [record] subcommand</H3> +</PRE><P><H3><A NAME="M6"></A>The [setme] subcommand</H3> +Set the record that will represent in the database the logged-in user. +<PRE> + set theid [lindex [addressbook persons -ids] 2] + addressbook setme $theid + addressbook save +</PRE><P><H3><A NAME="M7"></A>The [record] subcommand</H3> Store the ID of the first record in the variable <I>theid</I> <PRE> set theid [lindex [addressbook persons -ids] 0] @@ -104,12 +112,12 @@ Store the info about this group in the variable <I>grp</I> <PRE> set grp [addressbook record $theid] -</PRE><P><H3><A NAME="M7"></A>The [type] subcommand</H3> +</PRE><P><H3><A NAME="M8"></A>The [type] subcommand</H3> Find the type (<I>ABPerson</I> or <I>ABGroup</I>) of the object corresponding to the ID <I>$theid</I> <PRE> addressbook type $theid -</PRE><P><H3><A NAME="M8"></A>The [delete] subcommand</H3> +</PRE><P><H3><A NAME="M9"></A>The [delete] subcommand</H3> Remove from the database the record corresponding to the ID <I>$theid</I> <PRE> addressbook delete $theid @@ -121,7 +129,7 @@ Save the changes to make them permanent <PRE> addressbook save -</PRE><P><H3><A NAME="M9"></A>The [add] subcommand</H3> +</PRE><P><H3><A NAME="M10"></A>The [add] subcommand</H3> Add to a specific group the record corresponding to the ID <I>$theid</I>: this can be a person as well as a group (which would then become a subgroup of the group to which it is added). @@ -129,14 +137,14 @@ set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] addressbook add $theid $groupid -</PRE><P><H3><A NAME="M10"></A>The [remove] subcommand</H3> +</PRE><P><H3><A NAME="M11"></A>The [remove] subcommand</H3> Remove from a specific group the record corresponding to the ID <I>$theid</I>: this can be a person as well as a group. <PRE> set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] addressbook remove $theid $groupid -</PRE><P><H3><A NAME="M11"></A>The [parents] subcommand</H3> +</PRE><P><H3><A NAME="M12"></A>The [parents] subcommand</H3> List the parents of a person record (the various groups it belongs to). <PRE> set theid [lindex [addressbook persons -ids] 0] @@ -145,7 +153,7 @@ List the parents of a person record (only ID) <PRE> addressbook parents -ids $theid -</PRE><P>One can also find the parents of a group using this command.<P><H3><A NAME="M12"></A>The [create] subcommand</H3> +</PRE><P>One can also find the parents of a group using this command.<P><H3><A NAME="M13"></A>The [create] subcommand</H3> One can create either a group's or a person's record. The third argument will be the "name" of the new record, that is to say the name of the new group or the last name of the new person respectively. The command returns @@ -160,26 +168,26 @@ set grpid [lindex [addressbook groups -ids] 0] set subgrpid [addressbook create group Composers -ingroup $grpid] addressbook create person Beethoven -ingroup $subgrpid -</PRE><P><H3><A NAME="M13"></A>The [property names] subcommand</H3> +</PRE><P><H3><A NAME="M14"></A>The [property names] subcommand</H3> Get the list of all existing properties for groups or for persons <PRE> addressbook property names -groups addressbook property names -persons -</PRE><P><H3><A NAME="M14"></A>The [property type] subcommand</H3> +</PRE><P><H3><A NAME="M15"></A>The [property type] subcommand</H3> Get the type of a particular property <PRE> addressbook property type -groups UID addressbook property type -persons Address </PRE> For the two examples above, the result is respectively -<I>String</I> and <I>MultiDictionary</I>.<P><H3><A NAME="M15"></A>The [property add] subcommand</H3> +<I>String</I> and <I>MultiDictionary</I>.<P><H3><A NAME="M16"></A>The [property add] subcommand</H3> Add a new person's property called <I>Instrument</I> with type <I>String</I> <PRE> addressbook property add -persons Instrument String </PRE><P>Add a new group's property called <I>Meeting</I> with type <I>Date</I> <PRE> addressbook property add -groups Meeting Date -</PRE><P><H3><A NAME="M16"></A>The [property remove] subcommand</H3> +</PRE><P><H3><A NAME="M17"></A>The [property remove] subcommand</H3> The third argument of this command can be either a record ID or the -persons and -groups keywords. If it is the former, the property is removed from the specified record, otherwise it is removed from all the records of @@ -194,13 +202,13 @@ <PRE> addressbook property remove -persons Instrument addressbook property remove -groups Meeting -</PRE><P><H3><A NAME="M17"></A>The [export] subcommand</H3> +</PRE><P><H3><A NAME="M18"></A>The [export] subcommand</H3> Create a VCard corresponding to a particular record: <PRE> set theid [lindex [addressbook persons -ids] 0] set vcardData [addressbook export $theid] </PRE> -The data returned is binary. You can store it in a file for instance.<P><H3><A NAME="M18"></A>The [import] subcommand</H3> +The data returned is binary. You can store it in a file for instance.<P><H3><A NAME="M19"></A>The [import] subcommand</H3> Import in the database some information stored in a .vcf file. A new record containing this info, is created in the database: <PRE> @@ -209,14 +217,14 @@ set vcard [read $fid] close $fid addressbook import $vcard -</PRE><P><H3><A NAME="M19"></A>The [image] subcommand</H3> +</PRE><P><H3><A NAME="M20"></A>The [image] subcommand</H3> Get the custom image corresponding to a particular record: <PRE> set theid [lindex [addressbook persons -ids] 0] set img [addressbook image $theid] </PRE> The data returned is binary. You can store it in a file for instance. -An error is raised if there is no custom image for this record.<P><H3><A NAME="M20"></A>The [set] subcommand</H3> +An error is raised if there is no custom image for this record.<P><H3><A NAME="M21"></A>The [set] subcommand</H3> This command lets you get or set the value of a particular field. For instance, to get the first name, dates and address fields of the first record: <PRE> @@ -253,7 +261,7 @@ <PRE> addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}]]] </PRE> -</UL><P><H3><A NAME="M21"></A>The [search] subcommand</H3> +</UL><P><H3><A NAME="M22"></A>The [search] subcommand</H3> This command can be used to report the IDs of the records corresponding to a single criterion. The criterion is expressed by a three elements list: the first element is the name of a property, the second is a comparison operator and @@ -296,8 +304,34 @@ <PRE> addressbook search -persons -nocase Address >= {"" {"" abc}} </PRE> -</UL><P><A NAME="ukl"></A> -<H2><A NAME="M22"></A>Using keyed lists</H2> +</UL><P><H3><A NAME="M23"></A>The [identifier] subcommand</H3> +This command is useful to manage distribution lists, groups used +as a mailing list for instance. It has several subcommands (count, +get, primary, set). +<P> Suppose <I>theid</I> is the record ID of a person in the +group <I>groupid</I>: +<PRE> + set groupid [lindex [addressbook groups -ids] 0] + set theid [lindex [addressbook persons -ids -ingroup $groupid] 0] +</PRE><P><P> Count the identifiers of the Phone property: +<PRE> + addressbook identifier count $theid Phone +</PRE><P><P> Get some identifiers (suppose here that there are at least two of them): +<PRE> + set ident1 [addressbook identifier get $theid Phone 0] + set ident2 [addressbook identifier get $theid Phone 1] +</PRE><P><P> Get the primary identifier (the one which is chosen by default if +none has been specified otherwise): +<PRE> + addressbook identifier primary $theid Phone +</PRE><P><P> Get the current distribution identifier: +<PRE> + addressbook identifier set $groupid $theid Phone +</PRE><P><P> Set the distribution identifier to <I>ident2</I>: +<PRE> + addressbook identifier set $groupid $theid Phone $ident2 +</PRE><P><A NAME="ukl"></A> +<H2><A NAME="M24"></A>Using keyed lists</H2> Keyed lists can be easily manipulated using the <B>keylget</B> and <B>keylset</B> commands defined by the TclX extension. For instance, if a record has been stored in some variable <I>myrecord</I>, one can extract @@ -317,6 +351,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-07-29 15:11:20<P> +<P> Last updated 2004-07-30 14:46:44<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-07-30 13:07:37
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4382/Help Modified Files: TclAB_QuickStart.aida Log Message: More [identifier] doc and examples Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TclAB_QuickStart.aida 29 Jul 2004 13:31:36 -0000 1.7 +++ TclAB_QuickStart.aida 30 Jul 2004 13:07:28 -0000 1.8 @@ -6,7 +6,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-12-14 18:26:47 -:Modified: 2004-07-29 01:35:42 +:Modified: 2004-07-30 14:43:09 :Keywords: Address book, data base @@ -93,6 +93,15 @@ |)) +((s2 The [setme] subcommand +Set the record that will represent in the database the logged-in user. +((| + set theid [lindex [addressbook persons -ids] 2] + addressbook setme $theid + addressbook save +|)) + + ((s2 The [record] subcommand Store the ID of the first record in the variable ((i theid i)) ((| @@ -365,6 +374,46 @@ lu)) +((s2 The [identifier] subcommand +This command is useful to manage distribution lists, groups used +as a mailing list for instance. It has several subcommands (count, +get, primary, set). +((nl Suppose ((i theid i)) is the record ID of a person in the +group ((i groupid i)): +((| + set groupid [lindex [addressbook groups -ids] 0] + set theid [lindex [addressbook persons -ids -ingroup $groupid] 0] +|)) + +((nl Count the identifiers of the Phone property: +((| + addressbook identifier count $theid Phone +|)) + +((nl Get some identifiers (suppose here that there are at least two of them): +((| + set ident1 [addressbook identifier get $theid Phone 0] + set ident2 [addressbook identifier get $theid Phone 1] +|)) + +((nl Get the primary identifier (the one which is chosen by default if +none has been specified otherwise): +((| + addressbook identifier primary $theid Phone +|)) + +((nl Get the current distribution identifier: +((| + addressbook identifier set $groupid $theid Phone +|)) + +((nl Set the distribution identifier to ((i ident2 i)): +((| + addressbook identifier set $groupid $theid Phone $ident2 +|)) + + + ((a ukl)) a)) ((s1 Using keyed lists Keyed lists can be easily manipulated using the ((b keylget b)) and |