tcladdressbook-commits Mailing List for TclAddressBook (Page 4)
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: Daniel A. S. <da...@us...> - 2004-08-02 09:32:33
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2522/Help Added Files: license.terms Log Message: fixes for 1.1, building against Tcl.framework outside of /Library/Frameworks, added license file --- NEW FILE: license.terms --- (This appears to be a binary file; contents omitted.) |
|
From: Bernard D. <bde...@us...> - 2004-08-02 08:21:18
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24556/Help Modified Files: TclAB.html Log Message: Update to 1.1 Index: TclAB.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TclAB.html 21 Dec 2003 14:35:33 -0000 1.3 +++ TclAB.html 2 Aug 2004 08:21:09 -0000 1.4 @@ -4,18 +4,7 @@ <META NAME=GENERATOR CONTENT="Aida Mode"> </HEAD> <BODY> - -<!-- :Title: TclAB --> -<!-- :Project: addressbook extension for Tcl --> -<!-- :Version: $Revision$ --> -<!-- :CVSDate: $Date$ --> -<!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> -<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> -<!-- :Created: 2003-12-14 18:26:47 --> -<!-- :Modified: 2003-12-16 11:47:56 --> -<!-- :Keywords: Address book, data base --> -<!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> -<P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P><P><HR><BLOCKQUOTE><P><I> +<P><P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P><P><HR><BLOCKQUOTE><P><I> Welcome to the Home Page of the Tcladdressbook extension for Tcl. </I></P></BLOCKQUOTE><HR> <UL> @@ -25,7 +14,8 @@ <LI><A HREF="#M4">Source code</A> <LI><A HREF="#M5">Help</A> <LI><A HREF="#M6">Bug reports</A> -</UL><P> <P><H2><A NAME="M1"></A> Description</H2> +</UL> + <P><H2><A NAME="M1"></A>Description</H2> The Tcladdressbook library is a Tcl extension defining a new command called <I>addressbook</I> which lets you manipulate the OSX AddressBook. Under OSX (versions 10.2 or greater) every user has a single addressbook which all @@ -40,39 +30,36 @@ </PRE> The <I>addressbook</I> command has many subcommands such as <I>addressbook create, addressbook persons, addressbook record, addressbook set</I> etc. used -to invoke the various actions to perform.<P><H2><A NAME="M2"></A> Requisites</H2> +to invoke the various actions to perform.<P><H2><A NAME="M2"></A>Requisites</H2> This extension is useful only on Macintosh platforms with OSX System. Version 10.2 (aka -Jaguar) or greater of the system is required.<P><H2><A NAME="M3"></A> Download</H2> +Jaguar) or greater of the system is required.<P><H2><A NAME="M3"></A>Download</H2> Binary releases of Tcladdressbook are available on the SourceForge site in -the <A href="http://sourceforge.net/project/showfiles.php?group_id=96169"> download area</A> +the <A HREF="http://sourceforge.net/project/showfiles.php?group_id=96169"> download area</A> of the project. -<P> The latest version is <B>1.0d12</B>.<P><H2><A NAME="M4"></A> Source code</H2> +<P> The latest version is <B>1.1</B>.<P><H2><A NAME="M4"></A>Source code</H2> Tcladdressbook is an open source project. Its code is publicly available and can be found on the -<A href="http://sourceforge.net/projects/tcladdressbook"> SourceForge site</A>. +<A HREF="http://sourceforge.net/projects/tcladdressbook"> SourceForge site</A>. <P> The code is under CVS control. You can retrieve the latest stage of development using any CVS client. -<A href="http://sourceforge.net/cvs/?group_id=96169"> See instructions there.</A> +<A HREF="http://sourceforge.net/cvs/?group_id=96169"> See instructions there.</A> You can also -<A href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook"> browse the cvs repository</A> -online.<P><H2><A NAME="M5"></A> Help</H2> +<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook"> browse the cvs repository</A> +online.<P><H2><A NAME="M5"></A>Help</H2> Tcladdressbook is distributed with a -<A href="TclAddressBookHelp.html"> help file</A> -containing the exact reference of +<A HREF="TclAddressBookHelp.html"> help file</A> +(in html, pdf, text and man formats) containing the exact reference of all the commands and a -<A href="TclAB_QuickStart.html"> Quick Start file</A> -which is a tutorial giving examples -of how to use this extension.<P><H2><A NAME="M6"></A> Bug reports</H2><P><P> Bugs can be officially reported via the -<A href="http://sourceforge.net/tracker/?atid=613882&group_id=96169&func=browse"> Bug Tracker</A> +<A HREF="TclAB_QuickStart.html"> Quick Start file</A> +which is a tutorial giving examples showing how to use this extension.<P><H2><A NAME="M6"></A>Bug reports</H2><P><P> Bugs can be officially reported via the +<A HREF="http://sourceforge.net/tracker/?atid=613882&group_id=96169&func=browse"> Bug Tracker</A> of the project. -You can also address <A href="http://sourceforge.net/tracker/?atid=613885&group_id=96169&func=browse"> feature requests</A> +You can also address <A HREF="http://sourceforge.net/tracker/?atid=613885&group_id=96169&func=browse"> feature requests</A> and propose -<A href="http://sourceforge.net/tracker/?atid=613884&group_id=96169&func=browse"> patches</A>.<P><P> Please e-mail about any question you might encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A><P><P> Last updated 2003-12-21 15:31:48 -<!-- logo SF --> -<!-- ------- --> +<A HREF="http://sourceforge.net/tracker/?atid=613884&group_id=96169&func=browse"> patches</A>.<P><P> Please e-mail about any question you might encounter: +<A HREF="mailto:bde...@us...">bde...@us...</A><P><P> Last updated 2004-08-02 10:19:18 <HR> <P> <I>Tcladdressbook is hosted by</I> -<A href="http://sourceforge.net"> <P><IMG SRC="http://sourceforge.net/sflogo.php?group_id=96169&type=4 " ALT="SourceForge.net Logo" ALIGN=bottom></P></A><P> +<A HREF="http://sourceforge.net"> <P><IMG SRC="http://sourceforge.net/sflogo.php?group_id=96169&type=4 " ALT="SourceForge.net Logo" ALIGN=bottom></P></A><P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-02 08:09:19
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22727/Help Modified Files: TclAddressBookHelp.html Log Message: Installation update to 1.1 Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- TclAddressBookHelp.html 1 Aug 2004 17:57:19 -0000 1.23 +++ TclAddressBookHelp.html 2 Aug 2004 08:09:09 -0000 1.24 @@ -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.1b5. +documents version 1.1. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">NAME</A> @@ -321,15 +321,16 @@ which will be used by default by the distribution list if no <I>distribution identifier</I> as been specified.<P><H2><A NAME="M35"></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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This -folder should be installed on your system in /Library/Tcl or in +addressbook1.1.dylib in version 1.1) and a +file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon +request. Both files are contained in a folder called +TclAddressBook1.1, in version 1.1. +This folder should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, more generally, in any folder contained in your <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="M36"></A>VERSION HISTORY</H2> +application.<P><H2><A NAME="M36"></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 @@ -341,6 +342,7 @@ <LI> 1.1b4 -- 2004/07/31 -- New command [identifier index]. <LI> 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. + <LI> 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. </UL><P><H2><A NAME="M37"></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 @@ -367,6 +369,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="M43"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-08-01 19:36:40<P> +<P> Last updated 2004-08-02 10:00:52<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-02 08:09:08
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22664/Help Modified Files: TclAddressBookHelp.aida Log Message: Installation update to 1.1 Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- TclAddressBookHelp.aida 1 Aug 2004 17:57:08 -0000 1.20 +++ TclAddressBookHelp.aida 2 Aug 2004 08:08:59 -0000 1.21 @@ -7,6 +7,7 @@ :Created: 2003-11-26 14:30:03 :Modified: 2004-08-01 19:26:59 :Keywords: Address book, data base +:TclCmd: set pkgversion 1.1 ((if $aida_params(target) eq "Pdf" ((s [set aida_keywd(TocDepth) 2; return ""] s)) @@ -374,15 +375,16 @@ ((s1 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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This -folder should be installed on your system in /Library/Tcl or in +addressbook((s $pkgversion s)).dylib in version ((s $pkgversion s))) and a +file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon +request. Both files are contained in a folder called +TclAddressBook((s $pkgversion s)), in version ((s $pkgversion s)). +This folder should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, more generally, in any folder contained in your ((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. +application. ((s1 VERSION HISTORY @@ -397,6 +399,7 @@ ((li 1.1b4 -- 2004/07/31 -- New command [identifier index]. ((li 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. +((li 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. lu)) |
|
From: Bernard D. <bde...@us...> - 2004-08-02 08:08:59
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22612/Help Modified Files: TclAddressBookHelp Log Message: Installation update to 1.1 Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- TclAddressBookHelp 1 Aug 2004 17:56:57 -0000 1.20 +++ TclAddressBookHelp 2 Aug 2004 08:08:50 -0000 1.21 @@ -5,7 +5,7 @@ Abstract This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1b5. +documents version 1.1. 1. NAME @@ -396,15 +396,14 @@ 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 +addressbook1.1.dylib in version 1.1) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are -contained in a folder called, in version 1.0, TclAddressBook1.0. This -folder should be installed on your system in /Library/Tcl or in -~/Library/Tcl or, more generally, in any folder contained in your -auto_path Tcl variable. If you use the extension within the AlphaX -editor (version 8.0b11 or greater), you can also install it in the -Tclextensions folder which is located at the same level as the -application. +contained in a folder called TclAddressBook1.1, in version 1.1. This folder +should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, +more generally, in any folder contained in your auto_path Tcl variable. If +you use the extension within the AlphaX editor (version 8.0b11 or greater), +you can also install it in the Tclextensions folder which is located at the +same level as the application. 7. VERSION HISTORY @@ -418,6 +417,7 @@ 1.1b4 -- 2004/07/31 -- New command [identifier index]. 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. + 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. @@ -472,7 +472,7 @@ ---------------------------------------------------------------------- - Last updated 2004-08-01 19:36:51 + Last updated 2004-08-02 10:02:09 |
|
From: Bernard D. <bde...@us...> - 2004-08-02 08:08:49
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22579/Help Modified Files: tcladdressbook.n Log Message: Installation update to 1.1 Index: tcladdressbook.n =================================================================== RCS file: /cvsroot/tcladdressbook/Help/tcladdressbook.n,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- tcladdressbook.n 1 Aug 2004 17:56:48 -0000 1.10 +++ tcladdressbook.n 2 Aug 2004 08:08:33 -0000 1.11 @@ -1,7 +1,7 @@ .de uline \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m' .. -.TH tcladdressbook n "" "2004-08-01" "addressbook extension for Tcl" +.TH tcladdressbook n "" "2004-08-02" "addressbook extension for Tcl" .SH NAME .PP addressbook - manipulate the Macintosh OSX Address Book database @@ -379,15 +379,16 @@ .SH INSTALLATION .PP 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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This -folder should be installed on your system in /Library/Tcl or in +addressbook1.1.dylib in version 1.1) and a +file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon +request. Both files are contained in a folder called +TclAddressBook1.1, in version 1.1. +This folder should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, more generally, in any folder contained in your \fBauto_path\fP Tcl variable. If you use the extension within the AlphaX editor (version 8.0b11 or greater), you can also install it in the \fI Tclextensions\fP folder which is located at the same level as the -application. +application. .SH VERSION HISTORY .PP .RS @@ -407,6 +408,8 @@ .IP * 4 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. +.IP * 4 +1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. .RE .SH REQUIREMENTS AND PORTABILITY .PP |
|
From: Bernard D. <bde...@us...> - 2004-08-02 07:37:29
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18332/Source Modified Files: TclAddressBook.c Log Message: Inspected all return result Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- TclAddressBook.c 1 Aug 2004 17:58:14 -0000 1.33 +++ TclAddressBook.c 2 Aug 2004 07:37:19 -0000 1.34 @@ -1,7 +1,7 @@ /* * File : "TclAddressBook.c" * Created: 2003-11-26 12:54:15 - * Last modification: 2004-08-01 19:19:06 + * Last modification: 2004-08-02 09:29:40 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -262,7 +262,7 @@ default: panic("Tcl_GetIndexFromObj returned unrecognized subcommand"); - return TCL_ERROR; /* Should never be reached. */ + result = TCL_ERROR; /* Should never be reached. */ } return result; } @@ -596,7 +596,7 @@ ABRecordRef theRecord; CONST84 char * theUID; CFStringRef strRef; - int length, result; + int length, result = TCL_OK; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "recordID"); @@ -905,13 +905,12 @@ ABRecordRef theRecord; CFStringRef uidRef; CFDataRef imageRef; - int length, kind, result; + int length, kind, result = TCL_OK; Tcl_Obj * objPtr; Boolean setIt = false; unsigned char * imageBytes; Tcl_ResetResult(interp); - result = TCL_OK; if (objc != 3 && objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "personID"); @@ -1003,11 +1002,10 @@ CFDataRef vCard; CFIndex theCount; char theUID[256]; - int i, length, result; + int i, length, result = TCL_OK; unsigned char * theBytes; Tcl_ResetResult(interp); - result = TCL_OK; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "VCardData"); @@ -2032,14 +2030,13 @@ CFStringRef typeRef; ABRecordRef theRecord; char theStr[256]; - int length, result; + int length, result = TCL_OK; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "recordID"); return TCL_ERROR; } - result = TCL_OK; theUID = Tcl_GetStringFromObj(objv[2], &length); // Make a CFString object |
|
From: Bernard D. <bde...@us...> - 2004-08-02 07:36:45
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18224/Help Modified Files: TclAB_QuickStart.tcl Log Message: Reoredered the commands in tutorial Index: TclAB_QuickStart.tcl =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.tcl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TclAB_QuickStart.tcl 2 Aug 2004 06:20:01 -0000 1.6 +++ TclAB_QuickStart.tcl 2 Aug 2004 07:36:35 -0000 1.7 @@ -119,6 +119,24 @@ +# # The [create] subcommand +# 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 +# the unique ID of the created record. For instance: + +% addressbook create group WorkingCommittee +% addressbook create person Beethoven + +# One can make them subgroups or members of an already existing group using +# the -ingroup option: + +% set grpid [lindex [addressbook groups -ids] 0] +% set subgrpid [addressbook create group Composers -ingroup $grpid] +% addressbook create person Beethoven -ingroup $subgrpid + + + # # The [delete] subcommand # Remove from the database the record corresponding to the ID $theid @@ -177,103 +195,18 @@ # One can also find the parents of a group using this command. -# # The [create] subcommand -# 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 -# the unique ID of the created record. For instance: - -% addressbook create group WorkingCommittee -% addressbook create person Beethoven - -# One can make them subgroups or members of an already existing group using -# the -ingroup option: - -% set grpid [lindex [addressbook groups -ids] 0] -% set subgrpid [addressbook create group Composers -ingroup $grpid] -% addressbook create person Beethoven -ingroup $subgrpid - - - -# # The [property names] subcommand -# Get the list of all existing properties for groups or for persons - -% addressbook property names -groups -% addressbook property names -persons - - - -# # The [property type] subcommand -# Get the type of a particular property - -% addressbook property type -groups UID -% addressbook property type -persons Address - -# For the two examples above, the result is respectively -# String and MultiDictionary. - - -# # The [property add] subcommand -# Add a new person's property called Instrument with type String - -% addressbook property add -persons Instrument String - - -# Add a new group's property called Meeting with type Date - -% addressbook property add -groups Meeting Date - - - -# # The [property remove] subcommand -# 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 -# this type and the return value is now the number of properties successfully -# removed. +# # The [label] subcommand +# Let's find the label of the first phone number for a record: % set theid [addressbook getme -id] -% addressbook set $theid MaidenName Violet -% addressbook save -% addressbook property remove $theid MaidenName - - -# Remove the properties created above: - -% addressbook property remove -persons Instrument -% addressbook property remove -groups Meeting - - - -# # The [export] subcommand -# Create a VCard corresponding to a particular record: - -% set theid [lindex [addressbook persons -ids] 0] -% set vcardData [addressbook export $theid] - -# The data returned is binary. You can store it in a file for instance. - - -# # The [import] subcommand -# Import in the database some information stored in a .vcf file. A new -# record containing this info, is created in the database: - -% set fname [file join /Users bernardo someVcard.vcf] -% set fid [open $fname r] -% set vcard [read $fid] -% close $fid -% addressbook import $vcard - - +% addressbook label $theid Phone 0 -# # The [image] subcommand -# Get the custom image corresponding to a particular record: +# The returned string could be Home for instance. Let's change it to +# Personal: -% set theid [lindex [addressbook persons -ids] 0] -% set img [addressbook image $theid] +% addressbook label $theid Phone 0 Personal +% addressbook save -# 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. # # The [set] subcommand @@ -368,10 +301,65 @@ +# # The [property] subcommand +# This command accepts four subcommands: names, type, add, and remove. + +# # The [property names] subcommand +# Get the list of all existing properties for groups or for persons + +% addressbook property names -groups +% addressbook property names -persons + + + +# # The [property type] subcommand +# Get the type of a particular property + +% addressbook property type -groups UID +% addressbook property type -persons Address + +# For the two examples above, the result is respectively +# String and MultiDictionary. + + +# # The [property add] subcommand +# Add a new person's property called Instrument with type String + +% addressbook property add -persons Instrument String + + +# Add a new group's property called Meeting with type Date + +% addressbook property add -groups Meeting Date + + + +# # The [property remove] subcommand +# 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 +# this type and the return value is now the number of properties successfully +# removed. + +% set theid [addressbook getme -id] +% addressbook set $theid MaidenName Violet +% addressbook save +% addressbook property remove $theid MaidenName + + +# Remove the properties created above: + +% addressbook property remove -persons Instrument +% addressbook property remove -groups Meeting + + + # # 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). +# get, index, primary, and set). + +# # The [identifier count] subcommand # # Suppose theid is the record ID of a person in the # group groupid: @@ -382,16 +370,23 @@ % addressbook identifier count $theid Phone -# # Get some identifiers (suppose here that there are at least two of them): + +# # The [identifier get] subcommand +# # Get some identifiers by index (suppose here that there are at least +# two of them). Indices start at 0: % set ident1 [addressbook identifier get $theid Phone 0] % set ident2 [addressbook identifier get $theid Phone 1] + +# # The [identifier primary] subcommand # # Get the primary identifier (the one which is chosen by default if # none has been specified otherwise): % addressbook identifier primary $theid Phone + +# # The [identifier set] subcommand # # Get the current distribution identifier: % addressbook identifier set $groupid $theid Phone @@ -400,6 +395,8 @@ % addressbook identifier set $groupid $theid Phone $ident2 + +# # The [identifier index] subcommand # # The reverse operation of the addressbook identifier get command # is the addressbook identifier index command which returns the # index corresponding to a given identifier. For instance, the following @@ -408,19 +405,36 @@ % addressbook identifier index $theid Phone $ident2 -# # The [label] subcommand -# Let's find the label of the first phone number for a record: -% set theid [addressbook getme -id] -% addressbook label $theid Phone 0 +# # The [export] subcommand +# Create a VCard corresponding to a particular record: -# The returned string could be Home for instance. Let's change it to -# "Personal": +% set theid [lindex [addressbook persons -ids] 0] +% set vcardData [addressbook export $theid] + +# The data returned is binary. You can store it in a file for instance. -% addressbook label $theid Phone 0 Personal -% addressbook save +# # The [import] subcommand +# Import in the database some information stored in a .vcf file. A new +# record containing this info, is created in the database: +% set fname [file join /Users bernardo someVcard.vcf] +% set fid [open $fname r] +% set vcard [read $fid] +% close $fid +% addressbook import $vcard + + + +# # The [image] subcommand +# Get the custom image corresponding to a particular record: + +% set theid [lindex [addressbook persons -ids] 0] +% set img [addressbook image $theid] + +# 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. # ((a ukl)) @@ -448,6 +462,6 @@ # # ---------------------------------------------------------------------- -# # Last updated 2004-08-02 08:13:35 +# # Last updated 2004-08-02 09:34:56 |
|
From: Bernard D. <bde...@us...> - 2004-08-02 07:36:35
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18183/Help Modified Files: TclAB_QuickStart.html Log Message: Reoredered the commands in tutorial Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TclAB_QuickStart.html 1 Aug 2004 17:56:39 -0000 1.11 +++ TclAB_QuickStart.html 2 Aug 2004 07:36:26 -0000 1.12 @@ -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.1b5. All the Tcl instructions in the sections +version 1.1. 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, @@ -26,23 +26,29 @@ <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> -<UL><LI><A HREF="#M24">The [label] subcommand</A></UL> -<LI><A HREF="#M25">Using keyed lists</A> +<UL><LI><A HREF="#M9">The [create] subcommand</A></UL> +<UL><LI><A HREF="#M10">The [delete] subcommand</A></UL> +<UL><LI><A HREF="#M11">The [add] subcommand</A></UL> +<UL><LI><A HREF="#M12">The [remove] subcommand</A></UL> +<UL><LI><A HREF="#M13">The [parents] subcommand</A></UL> +<UL><LI><A HREF="#M14">The [label] subcommand</A></UL> +<UL><LI><A HREF="#M15">The [set] subcommand</A></UL> +<UL><LI><A HREF="#M16">The [search] subcommand</A></UL> +<UL><LI><A HREF="#M17">The [property] subcommand</A></UL> +<UL><UL><LI><A HREF="#M18">The [property names] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M19">The [property type] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M20">The [property add] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M21">The [property remove] subcommand</A></UL></UL> +<UL><LI><A HREF="#M22">The [identifier] subcommand</A></UL> +<UL><UL><LI><A HREF="#M23">The [identifier count] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M24">The [identifier get] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M25">The [identifier primary] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M26">The [identifier set] subcommand</A></UL></UL> +<UL><UL><LI><A HREF="#M27">The [identifier index] subcommand</A></UL></UL> +<UL><LI><A HREF="#M28">The [export] subcommand</A></UL> +<UL><LI><A HREF="#M29">The [import] subcommand</A></UL> +<UL><LI><A HREF="#M30">The [image] subcommand</A></UL> +<LI><A HREF="#M31">Using keyed lists</A> </UL> First load the extension like this <PRE> @@ -118,7 +124,22 @@ to the ID <I>$theid</I> <PRE> addressbook type $theid -</PRE><P><H3><A NAME="M9"></A>The [delete] subcommand</H3> +</PRE><P><H3><A NAME="M9"></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 +the unique ID of the created record. For instance: +<PRE> + addressbook create group WorkingCommittee + addressbook create person Beethoven +</PRE> +One can make them subgroups or members of an already existing group using +the <I>-ingroup</I> option: +<PRE> + 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="M10"></A>The [delete] subcommand</H3> Remove from the database the record corresponding to the ID <I>$theid</I> <PRE> addressbook delete $theid @@ -130,7 +151,7 @@ Save the changes to make them permanent <PRE> addressbook save -</PRE><P><H3><A NAME="M10"></A>The [add] subcommand</H3> +</PRE><P><H3><A NAME="M11"></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). @@ -142,7 +163,7 @@ 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> +</PRE><P><H3><A NAME="M12"></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> @@ -153,7 +174,7 @@ 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> +</PRE><P><H3><A NAME="M13"></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] @@ -162,78 +183,18 @@ 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="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 -the unique ID of the created record. For instance: -<PRE> - addressbook create group WorkingCommittee - addressbook create person Beethoven -</PRE> -One can make them subgroups or members of an already existing group using -the <I>-ingroup</I> option: -<PRE> - 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="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="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="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="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 -this type and the return value is now the number of properties successfully -removed. +</PRE><P>One can also find the parents of a group using this command.<P><H3><A NAME="M14"></A>The [label] subcommand</H3> +Let's find the label of the first phone number for a record: <PRE> set theid [addressbook getme -id] - addressbook set $theid MaidenName Violet - addressbook save - addressbook property remove $theid MaidenName -</PRE><P>Remove the properties created above: -<PRE> - addressbook property remove -persons Instrument - addressbook property remove -groups Meeting -</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] + addressbook label $theid Phone 0 </PRE> -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> - set fname [file join /Users bernardo someVcard.vcf] - set fid [open $fname r] - set vcard [read $fid] - close $fid - addressbook import $vcard -</PRE><P><H3><A NAME="M20"></A>The [image] subcommand</H3> -Get the custom image corresponding to a particular record: +The returned string could be <I>Home</I> for instance. Let's change it to +<I>Personal</I>: <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="M21"></A>The [set] subcommand</H3> + addressbook label $theid Phone 0 Personal + addressbook save +</PRE><P><H3><A NAME="M15"></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> @@ -270,7 +231,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="M22"></A>The [search] subcommand</H3> +</UL><P><H3><A NAME="M16"></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 @@ -313,10 +274,45 @@ <PRE> addressbook search -persons -nocase Address >= {"" {"" abc}} </PRE> -</UL><P><H3><A NAME="M23"></A>The [identifier] subcommand</H3> +</UL><P><H3><A NAME="M17"></A>The [property] subcommand</H3> +This command accepts four subcommands: names, type, add, and remove.<P><H4><A NAME="M18"></A>The [property names] subcommand</H4> +Get the list of all existing properties for groups or for persons +<PRE> + addressbook property names -groups + addressbook property names -persons +</PRE><P><H4><A NAME="M19"></A>The [property type] subcommand</H4> +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><H4><A NAME="M20"></A>The [property add] subcommand</H4> +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><H4><A NAME="M21"></A>The [property remove] subcommand</H4> +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 +this type and the return value is now the number of properties successfully +removed. +<PRE> + set theid [addressbook getme -id] + addressbook set $theid MaidenName Violet + addressbook save + addressbook property remove $theid MaidenName +</PRE><P>Remove the properties created above: +<PRE> + addressbook property remove -persons Instrument + addressbook property remove -groups Meeting +</PRE><P><H3><A NAME="M22"></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). +get, index, primary, and set).<P><H4><A NAME="M23"></A>The [identifier count] subcommand</H4> <P> Suppose <I>theid</I> is the record ID of a person in the group <I>groupid</I>: <PRE> @@ -326,17 +322,18 @@ <P> Count the identifiers of the Phone property: <PRE> addressbook identifier count $theid Phone -</PRE> -<P> Get some identifiers (suppose here that there are at least two of them): +</PRE><P><H4><A NAME="M24"></A>The [identifier get] subcommand</H4> +<P> Get some identifiers by index (suppose here that there are at least +two of them). Indices start at 0: <PRE> set ident1 [addressbook identifier get $theid Phone 0] set ident2 [addressbook identifier get $theid Phone 1] -</PRE> +</PRE><P><H4><A NAME="M25"></A>The [identifier primary] subcommand</H4> <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> +</PRE><P><H4><A NAME="M26"></A>The [identifier set] subcommand</H4> <P> Get the current distribution identifier: <PRE> addressbook identifier set $groupid $theid Phone @@ -344,26 +341,37 @@ <P> Set the distribution identifier to <I>ident2</I>: <PRE> addressbook identifier set $groupid $theid Phone $ident2 -</PRE> +</PRE><P><H4><A NAME="M27"></A>The [identifier index] subcommand</H4> <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><H3><A NAME="M24"></A>The [label] subcommand</H3> -Let's find the label of the first phone number for a record: +</PRE><P><H3><A NAME="M28"></A>The [export] subcommand</H3> +Create a VCard corresponding to a particular record: <PRE> - set theid [addressbook getme -id] - addressbook label $theid Phone 0 + set theid [lindex [addressbook persons -ids] 0] + set vcardData [addressbook export $theid] </PRE> -The returned string could be Home for instance. Let's change it to -"Personal": +The data returned is binary. You can store it in a file for instance.<P><H3><A NAME="M29"></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> - addressbook label $theid Phone 0 Personal - addressbook save -</PRE><P><A NAME="ukl"></A> -<H2><A NAME="M25"></A>Using keyed lists</H2> + set fname [file join /Users bernardo someVcard.vcf] + set fid [open $fname r] + set vcard [read $fid] + close $fid + addressbook import $vcard +</PRE><P><H3><A NAME="M30"></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><A NAME="ukl"></A> +<H2><A NAME="M31"></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 @@ -383,6 +391,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-08-01 19:32:54<P> +<P> Last updated 2004-08-02 09:34:50<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-02 07:36:26
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18154/Help Modified Files: TclAB_QuickStart.aida Log Message: Reoredered the commands in tutorial Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TclAB_QuickStart.aida 1 Aug 2004 17:56:29 -0000 1.11 +++ TclAB_QuickStart.aida 2 Aug 2004 07:36:17 -0000 1.12 @@ -131,6 +131,24 @@ |)) +((s2 The [create] subcommand +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 +the unique ID of the created record. For instance: +((| + addressbook create group WorkingCommittee + addressbook create person Beethoven +|)) +One can make them subgroups or members of an already existing group using +the ((i -ingroup i)) option: +((| + set grpid [lindex [addressbook groups -ids] 0] + set subgrpid [addressbook create group Composers -ingroup $grpid] + addressbook create person Beethoven -ingroup $subgrpid +|)) + + ((s2 The [delete] subcommand Remove from the database the record corresponding to the ID ((i $theid i)) ((| @@ -189,103 +207,18 @@ One can also find the parents of a group using this command. -((s2 The [create] subcommand -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 -the unique ID of the created record. For instance: -((| - addressbook create group WorkingCommittee - addressbook create person Beethoven -|)) -One can make them subgroups or members of an already existing group using -the ((i -ingroup i)) option: -((| - set grpid [lindex [addressbook groups -ids] 0] - set subgrpid [addressbook create group Composers -ingroup $grpid] - addressbook create person Beethoven -ingroup $subgrpid -|)) - - -((s2 The [property names] subcommand -Get the list of all existing properties for groups or for persons -((| - addressbook property names -groups - addressbook property names -persons -|)) - - -((s2 The [property type] subcommand -Get the type of a particular property -((| - addressbook property type -groups UID - addressbook property type -persons Address -|)) -For the two examples above, the result is respectively -((i String i)) and ((i MultiDictionary i)). - - -((s2 The [property add] subcommand -Add a new person's property called ((i Instrument i)) with type ((i String i)) -((| - addressbook property add -persons Instrument String -|)) - -Add a new group's property called ((i Meeting i)) with type ((i Date i)) -((| - addressbook property add -groups Meeting Date -|)) - - -((s2 The [property remove] subcommand -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 -this type and the return value is now the number of properties successfully -removed. +((s2 The [label] subcommand +Let's find the label of the first phone number for a record: ((| set theid [addressbook getme -id] - addressbook set $theid MaidenName Violet - addressbook save - addressbook property remove $theid MaidenName -|)) - -Remove the properties created above: -((| - addressbook property remove -persons Instrument - addressbook property remove -groups Meeting -|)) - - -((s2 The [export] subcommand -Create a VCard corresponding to a particular record: -((| - set theid [lindex [addressbook persons -ids] 0] - set vcardData [addressbook export $theid] -|)) -The data returned is binary. You can store it in a file for instance. - - -((s2 The [import] subcommand -Import in the database some information stored in a .vcf file. A new -record containing this info, is created in the database: -((| - set fname [file join /Users bernardo someVcard.vcf] - set fid [open $fname r] - set vcard [read $fid] - close $fid - addressbook import $vcard + addressbook label $theid Phone 0 |)) - - -((s2 The [image] subcommand -Get the custom image corresponding to a particular record: +The returned string could be ((i Home i)) for instance. Let's change it to +((i Personal i)): ((| - set theid [lindex [addressbook persons -ids] 0] - set img [addressbook image $theid] + addressbook label $theid Phone 0 Personal + addressbook save |)) -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. ((s2 The [set] subcommand @@ -382,10 +315,65 @@ lu)) +((s2 The [property] subcommand +This command accepts four subcommands: names, type, add, and remove. + +((s3 The [property names] subcommand +Get the list of all existing properties for groups or for persons +((| + addressbook property names -groups + addressbook property names -persons +|)) + + +((s3 The [property type] subcommand +Get the type of a particular property +((| + addressbook property type -groups UID + addressbook property type -persons Address +|)) +For the two examples above, the result is respectively +((i String i)) and ((i MultiDictionary i)). + + +((s3 The [property add] subcommand +Add a new person's property called ((i Instrument i)) with type ((i String i)) +((| + addressbook property add -persons Instrument String +|)) + +Add a new group's property called ((i Meeting i)) with type ((i Date i)) +((| + addressbook property add -groups Meeting Date +|)) + + +((s3 The [property remove] subcommand +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 +this type and the return value is now the number of properties successfully +removed. +((| + set theid [addressbook getme -id] + addressbook set $theid MaidenName Violet + addressbook save + addressbook property remove $theid MaidenName +|)) + +Remove the properties created above: +((| + addressbook property remove -persons Instrument + addressbook property remove -groups Meeting +|)) + + ((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). +get, index, primary, and set). + +((s3 The [identifier count] subcommand ((nl Suppose ((i theid i)) is the record ID of a person in the group ((i groupid i)): ((| @@ -396,16 +384,23 @@ ((| addressbook identifier count $theid Phone |)) -((nl Get some identifiers (suppose here that there are at least two of them): + +((s3 The [identifier get] subcommand +((nl Get some identifiers by index (suppose here that there are at least +two of them). Indices start at 0: ((| set ident1 [addressbook identifier get $theid Phone 0] set ident2 [addressbook identifier get $theid Phone 1] |)) + +((s3 The [identifier primary] subcommand ((nl Get the primary identifier (the one which is chosen by default if none has been specified otherwise): ((| addressbook identifier primary $theid Phone |)) + +((s3 The [identifier set] subcommand ((nl Get the current distribution identifier: ((| addressbook identifier set $groupid $theid Phone @@ -414,6 +409,8 @@ ((| addressbook identifier set $groupid $theid Phone $ident2 |)) + +((s3 The [identifier index] subcommand ((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 @@ -422,20 +419,37 @@ addressbook identifier index $theid Phone $ident2 |)) -((s2 The [label] subcommand -Let's find the label of the first phone number for a record: + +((s2 The [export] subcommand +Create a VCard corresponding to a particular record: ((| - set theid [addressbook getme -id] - addressbook label $theid Phone 0 + set theid [lindex [addressbook persons -ids] 0] + set vcardData [addressbook export $theid] |)) -The returned string could be Home for instance. Let's change it to -"Personal": +The data returned is binary. You can store it in a file for instance. + + +((s2 The [import] subcommand +Import in the database some information stored in a .vcf file. A new +record containing this info, is created in the database: ((| - addressbook label $theid Phone 0 Personal - addressbook save + set fname [file join /Users bernardo someVcard.vcf] + set fid [open $fname r] + set vcard [read $fid] + close $fid + addressbook import $vcard |)) +((s2 The [image] subcommand +Get the custom image corresponding to a particular record: +((| + set theid [lindex [addressbook persons -ids] 0] + set img [addressbook image $theid] +|)) +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. + ((a ukl)) a)) ((s1 Using keyed lists |
|
From: Bernard D. <bde...@us...> - 2004-08-02 06:33:00
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9238/Help Modified Files: ReadMe Log Message: Updated for 1.1 release Index: ReadMe =================================================================== RCS file: /cvsroot/tcladdressbook/Help/ReadMe,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ReadMe 26 Jan 2004 23:06:18 -0000 1.4 +++ ReadMe 2 Aug 2004 06:32:51 -0000 1.5 @@ -1,4 +1,4 @@ -TclAddressBook 1.0 +TclAddressBook 1.1 ================== This is the Tcladdressbook extension implementing an [addressbook] command @@ -6,7 +6,7 @@ was introduced in this version of the System (Jaguar). This extension is only useful on Macintosh platforms. -The TclAddressBook1.0 folder should be installed on your system in +The TclAddressBook1.1 folder should be installed on your system in /Library/Tcl or ~/Library/Tcl or any folder contained in your auto_path variable. If you use it from within the AlphaX editor (version 8.0b11 or greater), you can also install it in the Tclextensions folder which is @@ -15,17 +15,18 @@ To load the extension in a Tcl script, just use the following instruction: package require addressbook -Please read the documentation about the command in the Help file - TclAddressBookHelp.html +Please read the documentation about the command in the "doc" subfolder +inside the distribution folder. The main file for reference is +TclAddressBookHelp.html. There is also a Tutorial named TclAB_QuickStart.html +to get you started. The file tcladdressbook.n contains the same documentation in troff format. -You can copy it to /usr/share/man/mann from the Terminal like this - sudo cp tcladdressbook.n /usr/share/man/mann -Then you can read it like any man page by just typing - man tcladdressbook +You should copy it to /Library/Tcl/man/mann then read it by typing + man tcladdressbook +from a Terminal window. Please e-mail any bug or problem you encounter to Bernard Desgraupes e-mail <bde...@us...> Web page <http://tcladdressbook.sourceforge.net/> -Last modification: $Date 2003-11-29 11:36:54$ \ No newline at end of file +Last modification: $Date$ \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-02 06:20:12
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7629/Help Modified Files: TclAB_QuickStart.tcl Log Message: Updated to 1.1b5 Index: TclAB_QuickStart.tcl =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.tcl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TclAB_QuickStart.tcl 6 Jan 2004 06:58:38 -0000 1.5 +++ TclAB_QuickStart.tcl 2 Aug 2004 06:20:01 -0000 1.6 @@ -1,18 +1,32 @@ + + + + + + + # This file is a tutorial that demonstrates the [addressbook] command # defined by the Tcladdressbook extension for Tcl. It documents -# version ((s $currentversion s)). -# For a detailed and complete description of the syntax of each subcommand, -# refer to the help file <TclAddressBookHelp.html>. +# version 1.1. 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. +# # For a detailed and complete description of the syntax of each subcommand, +# refer to the help file <TclAddressBookHelp.html>. +# The home page for Tcladdressbook is +# on the SourceForge site <http://tcladdressbook.sourceforge.net/>. -# Load the extension + + + +# First load the extension like this % package require addressbook # # Using the commands -# # The [groups] command +# # The [groups] subcommand # List all the groups (ID and name) % addressbook groups @@ -32,7 +46,7 @@ -# # The [persons] command +# # The [persons] subcommand # List all the persons records (ID and name) % addressbook persons @@ -43,7 +57,7 @@ -# # The [count] command +# # The [count] subcommand # Count the existing groups and persons records % addressbook count -groups @@ -52,7 +66,7 @@ -# # The [getme] command +# # The [getme] subcommand # Store the info about "me" in the variable myrecord. % set myrecord [addressbook getme] @@ -60,20 +74,33 @@ # The value of myrecord is a keyed list. One can use the usual Tcl list # commands to parse this value or special commands defined in the TclX # extension (see section Using keyed lists below). +# # The getme command can also be used with an -id option. +# In that case the unique ID of the "Me" record is returned: +% set myID [addressbook getme -id] -# # The [record] command + + +# # 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 + + + +# # The [record] subcommand # Store the ID of the first record in the variable theid % set theid [lindex [addressbook persons -ids] 0] # Store the info about this record in the variable person. The -# returned value has the same keyed list format as with the [getme] command. +# returned value has the same keyed list format as with the [getme] subcommand. % set person [addressbook record $theid] - # Similarly with a group: store the ID of the first group in the variable theid % set theid [lindex [addressbook groups -ids] 0] @@ -84,7 +111,7 @@ -# # The [type] command +# # The [type] subcommand # Find the type (ABPerson or ABGroup) of the object corresponding # to the ID $theid @@ -92,7 +119,7 @@ -# # The [remove] command +# # The [delete] subcommand # Remove from the database the record corresponding to the ID $theid % addressbook delete $theid @@ -106,17 +133,37 @@ % addressbook save + +# # The [add] subcommand +# Add to a specific group the record corresponding to the ID $theid: +# this can be a person as well as a group (which would then become a +# subgroup of the group to which it is added). + +% set groupid [lindex [addressbook groups -ids] 0] +% set theid [lindex [addressbook persons -ids] 0] +% addressbook add $groupid $theid + +# One can add several items at a time with this command: + +% addressbook add $groupid $theid1 $theid2 $theid3 + + + +# # The [remove] subcommand # Remove from a specific group the record corresponding to the ID $theid: -# it is removed as member of this subgroup but will be removed from the -# database only if it does not belong to other groups. +# this can be a person as well as a group. % set groupid [lindex [addressbook groups -ids] 0] % set theid [lindex [addressbook persons -ids] 0] -% addressbook delete $theid -fromgroup $groupid +% addressbook remove $groupid $theid + +# One can remove several items at a time with this command: +% addressbook remove $groupid $theid1 $theid2 $theid3 -# # The [parents] command + +# # The [parents] subcommand # List the parents of a person record (the various groups it belongs to). % set theid [lindex [addressbook persons -ids] 0] @@ -129,7 +176,8 @@ # One can also find the parents of a group using this command. -# # The [create] command + +# # The [create] subcommand # 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 @@ -147,7 +195,7 @@ -# # The [property names] command +# # The [property names] subcommand # Get the list of all existing properties for groups or for persons % addressbook property names -groups @@ -155,7 +203,7 @@ -# # The [property type] command +# # The [property type] subcommand # Get the type of a particular property % addressbook property type -groups UID @@ -164,7 +212,8 @@ # For the two examples above, the result is respectively # String and MultiDictionary. -# # The [property add] command + +# # The [property add] subcommand # Add a new person's property called Instrument with type String % addressbook property add -persons Instrument String @@ -175,7 +224,20 @@ % addressbook property add -groups Meeting Date -# # The [property remove] command + +# # The [property remove] subcommand +# 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 +# this type and the return value is now the number of properties successfully +# removed. + +% set theid [addressbook getme -id] +% addressbook set $theid MaidenName Violet +% addressbook save +% addressbook property remove $theid MaidenName + + # Remove the properties created above: % addressbook property remove -persons Instrument @@ -183,7 +245,7 @@ -# # The [export] command +# # The [export] subcommand # Create a VCard corresponding to a particular record: % set theid [lindex [addressbook persons -ids] 0] @@ -192,7 +254,7 @@ # The data returned is binary. You can store it in a file for instance. -# # The [import] command +# # The [import] subcommand # Import in the database some information stored in a .vcf file. A new # record containing this info, is created in the database: @@ -204,7 +266,7 @@ -# # The [image] command +# # The [image] subcommand # Get the custom image corresponding to a particular record: % set theid [lindex [addressbook persons -ids] 0] @@ -213,7 +275,8 @@ # 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. -# # The [set] command + +# # The [set] subcommand # 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: @@ -232,32 +295,31 @@ # permanent. # # When setting the value of a field it is important that the new value # be formatted correctly with respect to the type of the property, as explained -# in the help file <TclAddressBookHelp.html>. Here are a few +# in the help file <TclAddressBookHelp.html>. Here are a few # examples corresponding to various property types: - -# Multi string value +% Multi string value % addressbook set $theid Email {{Work BW...@ha...} {Concerts op...@so...}} -# Date value +% Date value % addressbook set $theid Birthday [clock scan "1 Apr 1985"] -# Multi date value +% Multi date value % addressbook set $theid ABDate [list [list "birthday Franny" 621597600] [list "birthday Zooey" 816692400]] -# Multi dictionary value +% Multi dictionary value % addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}]]] -# # The [search] command +# # The [search] subcommand # 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 @@ -274,38 +336,96 @@ # # When searching on a particular property, it is important that the # searched value be formatted correctly with respect to the type of the property, -# as explained in the help file <TclAddressBookHelp.html>. Specify +# as explained in the help file <TclAddressBookHelp.html>. Specify # an empty label or an empty key to search on all possible labels or keys # respectively. Here are a few examples corresponding to various property types: - -# Multi string value. This instruction searches one value at a time. +% Multi string value. This instruction searches one value at a time. % addressbook search -persons Phone == {Work "01 02 03 04 05"} -# Empty label to search on all phone numbers +% Empty label to search on all phone numbers % addressbook search -persons Phone >= {"" "01 02 03 04 05"} -# Multi dictionary value. This instruction searches one key +% Multi dictionary value. This instruction searches one key # in one dictionary at a time. % addressbook search -persons -nocase Address == {Home {ZIP 98765}} % addressbook search -persons -nocase Address >= {Home {ZIP 98}} -# Empty label to search on all labels +% Empty label to search on all labels % addressbook search -persons -nocase Address >= {"" {City Paris}} -# Empty key to search on all keys +% Empty key to search on all keys % addressbook search -persons -nocase Address >= {home {"" abc}} -# Empty label and key to search on all labels and keys +% Empty label and key to search on all labels and keys % addressbook search -persons -nocase Address >= {"" {"" abc}} + + + +# # 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). +# # Suppose theid is the record ID of a person in the +# group groupid: + +% set groupid [lindex [addressbook groups -ids] 0] +% set theid [lindex [addressbook persons -ids -ingroup $groupid] 0] + +# # Count the identifiers of the Phone property: + +% addressbook identifier count $theid Phone + +# # 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] + +# # Get the primary identifier (the one which is chosen by default if +# none has been specified otherwise): + +% addressbook identifier primary $theid Phone + +# # Get the current distribution identifier: + +% addressbook identifier set $groupid $theid Phone + +# # Set the distribution identifier to ident2: + +% addressbook identifier set $groupid $theid Phone $ident2 + +# # The reverse operation of the addressbook identifier get command +# is the addressbook identifier index 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 + + +# # The [label] subcommand +# Let's find the label of the first phone number for a record: + +% set theid [addressbook getme -id] +% addressbook label $theid Phone 0 + +# The returned string could be Home for instance. Let's change it to +# "Personal": + +% addressbook label $theid Phone 0 Personal +% addressbook save + + + + +# ((a ukl)) # # Using keyed lists -# Keyed lists can be easily manipulated using the keylget and +# Keyed lists can be easily manipulated using the keylget and # keylset commands defined by the TclX extension. For instance, if a # record has been stored in some variable myrecord, one can extract # various fields like this: @@ -326,3 +446,8 @@ + +# # ---------------------------------------------------------------------- +# # Last updated 2004-08-02 08:13:35 + + |
|
From: Bernard D. <bde...@us...> - 2004-08-02 05:41:03
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2639/Source Modified Files: TclAddressBook_version.h Log Message: 1.1 final Index: TclAddressBook_version.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_version.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TclAddressBook_version.h 1 Aug 2004 06:36:33 -0000 1.9 +++ TclAddressBook_version.h 2 Aug 2004 05:40:52 -0000 1.10 @@ -1,13 +1,13 @@ // File: "TclAddressBook_version.h" // Created: 2003-09-24 07:28:22 -// Last modification: 2004-08-01 08:35:35 +// Last modification: 2004-08-01 20:05:10 // Author: Bernard Desgraupes // Description: version numbering for Tcladdressbook #define TCLADDRESSBOOK_MAJOR 1 #define TCLADDRESSBOOK_MINOR 1 -#define TCLADDRESSBOOK_SUBMINOR 5 -#define TCLADDRESSBOOK_STAGE 'b' +#define TCLADDRESSBOOK_SUBMINOR 0 +#define TCLADDRESSBOOK_STAGE 'f' // 'd' for developStage // 'a' for alphaStage // 'b' for betaStage |
|
From: Bernard D. <bde...@us...> - 2004-08-02 05:40:44
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2593/Source Modified Files: Changes.Log Log Message: 1.1b5 changes |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:59:27
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1862/Source Modified Files: TclAddressBookUtils.h Log Message: TclAB_CheckMultiValueProperty() Index: TclAddressBookUtils.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- TclAddressBookUtils.h 30 Jul 2004 21:29:25 -0000 1.12 +++ TclAddressBookUtils.h 1 Aug 2004 17:59:19 -0000 1.13 @@ -1,7 +1,7 @@ /* * File : "TclAddressBookUtils.h" * Created: 2003-12-05 10:05:19 - * Last modification: 2004-07-30 11:36:23 + * Last modification: 2004-08-01 19:16:40 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -140,7 +140,7 @@ ABRecordRef * outItemRef, int inRecordType); -Boolean TclAB_CheckMultiString(ABAddressBookRef ab, +Boolean TclAB_CheckMultiValueProperty(ABAddressBookRef ab, CFStringRef inPropertyRef, int inRecordType); |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:59:08
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1744/Source Modified Files: TclAddressBookUtils.c Log Message: [identifier primary] can set values Index: TclAddressBookUtils.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- TclAddressBookUtils.c 1 Aug 2004 06:35:15 -0000 1.19 +++ TclAddressBookUtils.c 1 Aug 2004 17:58:59 -0000 1.20 @@ -1,7 +1,7 @@ /* * File : "TclAddressBookUtils.c" * Created: 2003-12-05 10:08:03 - * Last modification: 2004-07-30 23:12:50 + * Last modification: 2004-08-01 19:18:59 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -694,10 +694,11 @@ /* *---------------------------------------------------------------------- * - * TclAB_CheckMultiString -- + * TclAB_CheckMultiValueProperty -- * * This function is invoked to check if property is a multi-value - * property. Used with the [addressbook identifier] command. + * property. Used by the [addressbook identifier] and + * [addressbook label] commands. * * Results: * None. @@ -707,14 +708,16 @@ * *---------------------------------------------------------------------- */ -// // kABMultiArrayProperty -// // kABMultiDateProperty -// // kABMultiIntegerProperty -// // kABMultiRealProperty -// // kABMultiStringProperty +// // kABMultiStringProperty = 0x100 | kABStringProperty, +// // kABMultiIntegerProperty = 0x100 | kABIntegerProperty, +// // kABMultiRealProperty = 0x100 | kABRealProperty, +// // kABMultiDateProperty = 0x100 | kABDateProperty, +// // kABMultiArrayProperty = 0x100 | kABArrayProperty, +// // kABMultiDictionaryProperty = 0x100 | kABDictionaryProperty, +// // kABMultiDataProperty = 0x100 | kABDataProperty Boolean -TclAB_CheckMultiString(ABAddressBookRef ab, CFStringRef inPropertyRef, int inRecordType) +TclAB_CheckMultiValueProperty(ABAddressBookRef ab, CFStringRef inPropertyRef, int inRecordType) { ABPropertyType thePropType; @@ -724,7 +727,8 @@ thePropType = ABTypeOfProperty(ab, kABGroupRecordType, inPropertyRef); } - return (thePropType == kABMultiStringProperty); + // All multivalue constants are above 0x100 = 256 + return (thePropType > 256); } @@ -1432,7 +1436,7 @@ } // Check the property's type - if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + if ( ! TclAB_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; @@ -1526,7 +1530,7 @@ index = atoi(theIndex); // Check the property's type - if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + if ( ! TclAB_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; @@ -1622,7 +1626,7 @@ } // Check the property's type - if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + if ( ! TclAB_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; @@ -1701,9 +1705,7 @@ 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) { + if (objc != 5 && objc != 6) { Tcl_WrongNumArgs(interp, 2, objv, "personID propName ?identifier?"); return TCL_ERROR; } @@ -1730,7 +1732,7 @@ } // Check the property's type - if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + if ( ! TclAB_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; @@ -1749,24 +1751,32 @@ } setIt = true; } - + multivalueRef = ABRecordCopyValue(personRecord, propertyRef); if (!multivalueRef) { Tcl_AppendStringsToObj(resultPtr, "Couldn't get value for '", theProperty, "' property", (char *) NULL); result = TCL_ERROR; } else { if (setIt) { - if (!ABMultiValueSetPrimaryIdentifier((ABMutableMultiValueRef) multivalueRef, newvalueRef)) { - Tcl_AppendStringsToObj(resultPtr, "Couldn't set primary identifier", (char *) NULL); + ABMutableMultiValueRef mutableRef = ABMultiValueCreateMutableCopy(multivalueRef); + if (!mutableRef) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't copy value ref", (char *) NULL); result = TCL_ERROR; - } else { - Tcl_ExternalToUtfDString(gMacRomanEnc, theNewValue, strlen(theNewValue), &ds); - Tcl_DStringResult(interp, &ds); - Tcl_DStringFree(&ds); + } else { + if (!ABMultiValueSetPrimaryIdentifier(mutableRef, newvalueRef)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't set primary identifier", (char *) NULL); + result = TCL_ERROR; + } else { + ABRecordSetValue(personRecord, propertyRef, mutableRef); + Tcl_ExternalToUtfDString(gMacRomanEnc, theNewValue, strlen(theNewValue), &ds); + Tcl_DStringResult(interp, &ds); + Tcl_DStringFree(&ds); + } + CFRelease(mutableRef); } CFRelease(newvalueRef); } else { - CFStringRef identRef = ABMultiValueCopyPrimaryIdentifier((ABMutableMultiValueRef) multivalueRef); + CFStringRef identRef = ABMultiValueCopyPrimaryIdentifier(multivalueRef); if (!identRef) { Tcl_AppendStringsToObj(resultPtr, "Couldn't get primary identifier for '", theProperty, "' property", (char *) NULL); result = TCL_ERROR; @@ -1868,7 +1878,7 @@ } // Check the property's type - if ( ! TclAB_CheckMultiString(ab, propertyRef, rec_person) ) { + if ( ! TclAB_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); CFRelease(propertyRef); result = TCL_ERROR; |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:58:24
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1650/Source Modified Files: TclAddressBook.c Log Message: New command [addressbook label] Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- TclAddressBook.c 1 Aug 2004 06:34:50 -0000 1.32 +++ TclAddressBook.c 1 Aug 2004 17:58:14 -0000 1.33 @@ -1,7 +1,7 @@ /* * File : "TclAddressBook.c" * Created: 2003-11-26 12:54:15 - * Last modification: 2004-07-30 11:36:35 + * Last modification: 2004-08-01 19:19:06 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -37,6 +37,7 @@ static int TclABCmd_Identifier(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); static int TclABCmd_Image(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); static int TclABCmd_Import(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); +static int TclABCmd_Label(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); static int TclABCmd_Parents(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); static int TclABCmd_Persons(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); static int TclABCmd_Property(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr); @@ -85,23 +86,23 @@ } #endif - /* Register the [addressbook] command */ + // Register the [addressbook] command Tcl_CreateObjCommand(interp, "addressbook", TclABCmd_AddressBook, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); - /* Version numbering */ + // Version numbering if (TCLADDRESSBOOK_STAGE=='f') { if (TCLADDRESSBOOK_SUBMINOR) { - sprintf(vstr,"%d.%d\0", TCLADDRESSBOOK_MAJOR, TCLADDRESSBOOK_MINOR); - } else { sprintf(vstr,"%d.%d.%d\0", TCLADDRESSBOOK_MAJOR, TCLADDRESSBOOK_MINOR, TCLADDRESSBOOK_SUBMINOR); + } else { + sprintf(vstr,"%d.%d\0", TCLADDRESSBOOK_MAJOR, TCLADDRESSBOOK_MINOR); } } else { sprintf(vstr,"%d.%d%c%d\0", TCLADDRESSBOOK_MAJOR, TCLADDRESSBOOK_MINOR, TCLADDRESSBOOK_STAGE, TCLADDRESSBOOK_SUBMINOR); } - /* Declare the addressbook package */ + // Declare the addressbook package if (Tcl_PkgProvide(interp, "addressbook", vstr) != TCL_OK) { return TCL_ERROR; } @@ -146,16 +147,16 @@ static CONST char *switches[] = { "add", "changed", "count", "create", "delete", "export", - "getme", "groups", "identifier", "image", "import", "parents", - "persons", "property", "record", "remove", "save", "search", - "set", "setme", "type", (char *) NULL + "getme", "groups", "identifier", "image", "import", "label", + "parents", "persons", "property", "record", "remove", "save", + "search", "set", "setme", "type", (char *) NULL }; enum { TCLAB_ADD, TCLAB_CHANGED, TCLAB_COUNT, TCLAB_CREATE, TCLAB_DELETE, TCLAB_EXPORT, - TCLAB_GETME, TCLAB_GROUPS, TCLAB_IDENTIFIER, TCLAB_IMAGE, TCLAB_IMPORT, TCLAB_PARENTS, - TCLAB_PERSONS, TCLAB_PROPERTY, TCLAB_RECORD, TCLAB_REMOVE, TCLAB_SAVE, TCLAB_SEARCH, - TCLAB_SET, TCLAB_SETME, TCLAB_TYPE + TCLAB_GETME, TCLAB_GROUPS, TCLAB_IDENTIFIER, TCLAB_IMAGE, TCLAB_IMPORT, TCLAB_LABEL, + TCLAB_PARENTS, TCLAB_PERSONS, TCLAB_PROPERTY, TCLAB_RECORD, TCLAB_REMOVE, TCLAB_SAVE, + TCLAB_SEARCH, TCLAB_SET, TCLAB_SETME, TCLAB_TYPE }; resultPtr = Tcl_GetObjResult(interp); @@ -215,6 +216,10 @@ result = TclABCmd_Import(clientData, interp, objc, objv, resultPtr); break; + case TCLAB_LABEL: + result = TclABCmd_Label(clientData, interp, objc, objv, resultPtr); + break; + case TCLAB_PARENTS: result = TclABCmd_Parents(clientData, interp, objc, objv, resultPtr); break; @@ -1074,6 +1079,143 @@ /* *---------------------------------------------------------------------- * + * TclABCmd_Label -- + * + * This procedure is invoked to process the [addressbook parents] Tcl command. + * See the user documentation for details on what it does. + * + * Syntax: + * addressbook label personID propName index ?value? + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +int +TclABCmd_Label( + ClientData clientData, /* Not used. */ + 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; + Tcl_DString ds; + CONST84 char * theProperty, * thePersonUID, * theIndex, * theNewValue; + CFStringRef propertyRef, newvalueRef, multivalueRef; + ABRecordRef personRecord; + int index, length, result = TCL_OK; + Boolean setIt = false; + + if (objc != 5 && objc != 6) { + Tcl_WrongNumArgs(interp, 2, objv, "personID propName index ?value?"); + return TCL_ERROR; + } + + Tcl_ResetResult(interp); + + // Get the address book + ab = ABGetSharedAddressBook(); + + thePersonUID = Tcl_GetStringFromObj(objv[2], &length); + theProperty = Tcl_GetStringFromObj(objv[3], &length); + theIndex = Tcl_GetStringFromObj(objv[4], &length); + + // Check if second argument is a person and get the corresponding record + if ( !TclAB_CheckItem(interp, ab, thePersonUID, "second", &personRecord, rec_person) ) { + return TCL_ERROR; + } + + // Make CFString object for property + 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_CheckMultiValueProperty(ab, propertyRef, rec_person) ) { + Tcl_AppendStringsToObj(resultPtr, "Not a multi-string list property", (char *) NULL); + CFRelease(propertyRef); + result = TCL_ERROR; + goto DONE; + } + + // Retrieve the index + index = atoi(theIndex); + + 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 label", (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 property", (char *) NULL); + result = TCL_ERROR; + } else { + if (setIt) { + ABMutableMultiValueRef mutableRef = ABMultiValueCreateMutableCopy(multivalueRef); + if (!mutableRef) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't copy value ref", (char *) NULL); + result = TCL_ERROR; + } else { + if (!ABMultiValueReplaceLabel(mutableRef, newvalueRef, index)) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't set label", (char *) NULL); + result = TCL_ERROR; + } else { + ABRecordSetValue(personRecord, propertyRef, mutableRef); + Tcl_ExternalToUtfDString(gMacRomanEnc, theNewValue, strlen(theNewValue), &ds); + Tcl_DStringResult(interp, &ds); + Tcl_DStringFree(&ds); + } + CFRelease(mutableRef); + } + CFRelease(newvalueRef); + } else { + CFStringRef labelRef = ABMultiValueCopyLabelAtIndex(multivalueRef, index); + if (!labelRef) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get label", (char *) NULL); + result = TCL_ERROR; + } else { + char theString[256]; + CFStringRef localizedRef = ABCopyLocalizedPropertyOrLabel(labelRef); + CFStringGetCString(localizedRef, theString, sizeof(theString), NULL); + CFRelease(localizedRef); + CFRelease(labelRef); + Tcl_ExternalToUtfDString(gMacRomanEnc, theString, strlen(theString), &ds); + Tcl_DStringResult(interp, &ds); + Tcl_DStringFree(&ds); + } + } + CFRelease(multivalueRef); + } + CFRelease(propertyRef); + +DONE: + if (objc == 6) Tcl_DecrRefCount(objv[5]); + CFRelease(personRecord); + return result; +} + + +/* + *---------------------------------------------------------------------- + * * TclABCmd_Parents -- * * This procedure is invoked to process the [addressbook parents] Tcl command. |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:58:02
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1555/Source Modified Files: Changes.Log Log Message: 1.1b5 Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Changes.Log 1 Aug 2004 06:34:38 -0000 1.18 +++ Changes.Log 1 Aug 2004 17:57:53 -0000 1.19 @@ -33,7 +33,9 @@ ================================================================================ = 1.1b5 last update: ================================================================================ - + Command [addressbook identifier primary] can now set value. + New command [addressbook label] to get/set the label of an item in + a multi-value list property. ================================================================================ = 1.1b4 last update: 2004-08-01 07:58:05 |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:57:30
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1487/Help Modified Files: TclAddressBookHelp.html Log Message: Doc new command [addressbook label] Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- TclAddressBookHelp.html 1 Aug 2004 06:32:19 -0000 1.22 +++ TclAddressBookHelp.html 1 Aug 2004 17:57:19 -0000 1.23 @@ -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.1b4. +documents version 1.1b5. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">NAME</A> @@ -30,29 +30,30 @@ <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>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> -<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><UL><LI><A HREF="#M20">addressbook label <I>personID</I> <I>propName</I> <I>index</I> ?<I>value</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M21">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M22">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M23">addressbook property names (-groups | -persons)</A></UL></UL> +<UL><UL><LI><A HREF="#M24">addressbook property type (-groups | -persons) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M25">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> +<UL><UL><LI><A HREF="#M26">addressbook property remove (-groups | -persons | <I>recordID</I>) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M27">addressbook record <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M28">addressbook remove <I>groupID</I> <I>recordID ?recordID ...?</I></A></UL></UL> +<UL><UL><LI><A HREF="#M29">addressbook save</A></UL></UL> +<UL><UL><LI><A HREF="#M30">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> +<UL><UL><LI><A HREF="#M31">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M32">addressbook setme <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M33">addressbook type <I>recordID</I></A></UL></UL> +<LI><A HREF="#M34">DISTRIBUTION LISTS AND IDENTIFIERS</A> +<LI><A HREF="#M35">INSTALLATION</A> +<LI><A HREF="#M36">VERSION HISTORY</A> +<LI><A HREF="#M37">REQUIREMENTS AND PORTABILITY</A> +<LI><A HREF="#M38">KNOW ISSUES</A> +<LI><A HREF="#M39">SOURCE CODE</A> +<LI><A HREF="#M40">CONTRIBUTIONS</A> +<LI><A HREF="#M41">LICENSE AND DISCLAIMER</A> +<LI><A HREF="#M42">SEE ALSO</A> +<LI><A HREF="#M43">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> @@ -100,14 +101,14 @@ <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 <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> +(such as <I>Phone, Email, Address, 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 <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> +property (such as <I>Phone, Email, Address</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 <A HREF="#dist">Distribution lists and identifiers</A> +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 @@ -118,7 +119,7 @@ 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>). +<I>Phone, Email, Address</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>. @@ -135,7 +136,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>Phone, Email</I>). +be a multi-value list property (such as <I>Phone, Email, Address</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 @@ -152,26 +153,34 @@ 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="M20"></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 label <I>personID</I> <I>propName</I> <I>index</I> ?<I>value</I>?</H4> +This command lets you get or set the label of a value in a multi-value property +for a particular record. +<P> Used without the <I>value</I> argument, the command will return the +current label at index <I>index</I> in property <I>propName</I> for the +person <I>personID</I>. To determine the index range, one can use the +<B>addressbook identifier count</B> command. +<P> If the <I>value</I> argument is specified, the command will set the +label at index <I>index</I> to this value.<P><H4><A NAME="M21"></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="M21"></A>addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> +returned. <P><H4><A NAME="M22"></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="M22"></A>addressbook property names (-groups | -persons)</H4> +will be returned.<P><H4><A NAME="M23"></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="M23"></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="M24"></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="M24"></A>addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> +or <I>Unknown</I>. <P><H4><A NAME="M25"></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 @@ -179,7 +188,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="M25"></A>addressbook property remove (-groups | -persons | recordID) <I>propName</I></H4> +MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M26"></A>addressbook property remove (-groups | -persons | <I>recordID</I>) <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 @@ -190,7 +199,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="M26"></A>addressbook record <I>recordID</I></H4> +properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M27"></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. @@ -220,16 +229,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="M27"></A>addressbook remove <I>groupID</I> <I>recordID ?recordID ...?</I></H4> +extension.<P><H4><A NAME="M28"></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> +<I>groupID</I>.<P><H4><A NAME="M29"></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="M29"></A>addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> +<B>addressbook changed</B> command.<P><H4><A NAME="M30"></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> @@ -285,31 +294,32 @@ 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="M30"></A>addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> +the <B>addressbook property type</B> command.<P><H4><A NAME="M31"></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="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> +various kinds of properties.<P><H4><A NAME="M32"></A>addressbook setme <I>recordID</I></H4> +This command sets the record that represents the logged-in user. <P><H4><A NAME="M33"></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="M33"></A>DISTRIBUTION LISTS AND IDENTIFIERS</H2> +<H2><A NAME="M34"></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 -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 -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 <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="M34"></A>INSTALLATION</H2> +can be addressed by <I>Address, Phone, Email</I> etc. For instance, a +group could be used as a mailing list. The <I>Address, 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 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 <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="M35"></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 @@ -319,7 +329,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="M35"></A>VERSION HISTORY</H2> +application. <P><H2><A NAME="M36"></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 @@ -329,13 +339,15 @@ <LI> 1.1b3 -- 2004/07/30 -- New command [identifier] to handle 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> + <LI> 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed +setting value with [identifier primary]. +</UL><P><H2><A NAME="M37"></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="M37"></A>KNOW ISSUES</H2> +in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M38"></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="M38"></A>SOURCE CODE</H2> +<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M39"></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 @@ -344,17 +356,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="M39"></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="M40"></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="M40"></A>LICENSE AND DISCLAIMER</H2> +(for instance, the same licensing terms as the Tcl language itself).<P><H2><A NAME="M41"></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="M41"></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="M42"></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="M42"></A>KEYWORDS</H2> +commands to open directly the database file.<P><H2><A NAME="M43"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-08-01 08:09:45<P> +<P> Last updated 2004-08-01 19:36:40<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:57:17
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1436/Help Modified Files: TclAddressBookHelp.aida Log Message: Doc new command [addressbook label] Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- TclAddressBookHelp.aida 1 Aug 2004 06:32:10 -0000 1.19 +++ TclAddressBookHelp.aida 1 Aug 2004 17:57:08 -0000 1.20 @@ -5,7 +5,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-11-26 14:30:03 -:Modified: 2004-08-01 08:09:34 +:Modified: 2004-08-01 19:26:59 :Keywords: Address book, data base ((if $aida_params(target) eq "Pdf" @@ -102,16 +102,17 @@ ((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 ((i Phone, Email, MSNInstant i)) etc.). +(such as ((i Phone, Email, Address, 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 ((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)) +property (such as ((i Phone, Email, Address 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 lists and identifiers lk)) +command. +See the section ((lk #dist ))Distribution lists and identifiers lk)) below for explanations about identifiers. ((s3 addressbook identifier index ((i personID i)) ((i propName i)) ((i ident i)) @@ -126,7 +127,7 @@ 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))). +((i Phone, Email, Address 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)). @@ -145,7 +146,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 Phone, Email i))). +be a multi-value list property (such as ((i Phone, Email, Address 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 @@ -168,6 +169,16 @@ 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. +((s3 addressbook label ((i personID i)) ((i propName i)) ((i index i)) ?((i value i))? +This command lets you get or set the label of a value in a multi-value property +for a particular record. +((nl Used without the ((i value i)) argument, the command will return the +current label at index ((i index i)) in property ((i propName i)) for the +person ((i personID i)). To determine the index range, one can use the +((b addressbook identifier count b)) command. +((nl If the ((i value i)) argument is specified, the command will set the +label at index ((i index i)) to this value. + ((s3 addressbook parents ?-ids? ((i recordID i)) 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 @@ -205,7 +216,7 @@ Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, MultiDictionary, MultiInteger, MultiReal, MultiString. i)) -((s3 addressbook property remove (-groups | -persons | recordID) ((i propName i)) +((s3 addressbook property remove (-groups | -persons | ((i recordID i))) ((i propName i)) 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 @@ -347,18 +358,18 @@ ((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 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 -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 ((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. +can be addressed by ((i Address, Phone, Email i)) etc. For instance, a +group could be used as a mailing list. The ((i Address, 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 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 ((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. ((s1 INSTALLATION @@ -384,6 +395,8 @@ ((li 1.1b3 -- 2004/07/30 -- New command [identifier] to handle distribution lists. Subcommands: count, get, primary, set. ((li 1.1b4 -- 2004/07/31 -- New command [identifier index]. +((li 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed +setting value with [identifier primary]. lu)) |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:57:15
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1369/Help Modified Files: TclAddressBookHelp Log Message: Doc new command [addressbook label] Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- TclAddressBookHelp 1 Aug 2004 06:32:00 -0000 1.19 +++ TclAddressBookHelp 1 Aug 2004 17:56:57 -0000 1.20 @@ -5,7 +5,7 @@ Abstract This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1b4. +documents version 1.1b5. 1. NAME @@ -27,6 +27,7 @@ addressbook identifier set groupID personID propName ?ident? addressbook image personID ?imageData? addressbook import vCardData + addressbook label personID propName index ?value? addressbook parents ?-ids? recordID addressbook persons ?-ids? ?-ingroup groupID? addressbook property names (-groups | -persons) @@ -127,16 +128,16 @@ addressbook identifier count personID propName This command returns the number of items in a multi-value list property -(such as Phone, Email, MSNInstant etc.). +(such as Phone, Email, Address, 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 +property (such as Phone, Email, Address). 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 lists and identifiers <#dist> +command. +See the section Distribution lists and identifiers <#dist> below for explanations about identifiers. addressbook identifier index personID propName ident @@ -151,7 +152,7 @@ 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). +Phone, Email, Address). Used without the ident argument, the command will return the primary identifier concerning property propName for the person personID. @@ -170,7 +171,7 @@ 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 (such as Phone, Email). +be a multi-value list property (such as Phone, Email, Address). 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 @@ -193,6 +194,16 @@ 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. + addressbook label personID propName index ?value? +This command lets you get or set the label of a value in a multi-value property +for a particular record. + Used without the value argument, the command will return the +current label at index index in property propName for the +person personID. To determine the index range, one can use the +addressbook identifier count command. + If the value argument is specified, the command will set the +label at index index to this value. + addressbook parents ?-ids? recordID This command returns a list of all the groups the record with unique ID recordID belongs to. The elements of this list are sublists made of one @@ -369,17 +380,18 @@ 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 -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. +can be addressed by Address, Phone, Email etc. For instance, a +group could be used as a mailing list. The Address, 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. 6. INSTALLATION @@ -404,6 +416,8 @@ 1.1b3 -- 2004/07/30 -- New command [identifier] to handle distribution lists. Subcommands: count, get, primary, set. 1.1b4 -- 2004/07/31 -- New command [identifier index]. + 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed +setting value with [identifier primary]. @@ -458,7 +472,7 @@ ---------------------------------------------------------------------- - Last updated 2004-08-01 08:09:58 + Last updated 2004-08-01 19:36:51 |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:56:57
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1321/Help Modified Files: tcladdressbook.n Log Message: Doc new command [addressbook label] Index: tcladdressbook.n =================================================================== RCS file: /cvsroot/tcladdressbook/Help/tcladdressbook.n,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- tcladdressbook.n 1 Aug 2004 06:31:51 -0000 1.9 +++ tcladdressbook.n 1 Aug 2004 17:56:48 -0000 1.10 @@ -76,16 +76,16 @@ .SS addressbook identifier count \fI personID\fP \fI propName\fP .PP This command returns the number of items in a multi-value list property -(such as \fI Phone, Email, MSNInstant\fP etc.). +(such as \fI Phone, Email, Address, MSNInstant\fP etc.). .SS addressbook identifier get \fI personID\fP \fI propName\fP \fI index\fP .PP 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 +property (such as \fI Phone, Email, Address\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 lists and identifiers <#dist> +command. +See the section Distribution lists and identifiers <#dist> below for explanations about identifiers. .SS addressbook identifier index \fI personID\fP \fI propName\fP \fI ident\fP .PP @@ -100,7 +100,7 @@ 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). +\fI Phone, Email, Address\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 @@ -122,7 +122,7 @@ \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 (such as \fI Phone, Email\fP). +be a multi-value list property (such as \fI Phone, Email, Address\fP). .PP If the \fI ident\fP argument is specified, this will assign a specific \fI distribution identifier\fP for the person's multi-value list @@ -145,6 +145,18 @@ \fI vCardData\fP 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. +.SS addressbook label \fI personID\fP \fI propName\fP \fI index\fP ?\fI value\fP? +.PP +This command lets you get or set the label of a value in a multi-value property +for a particular record. +.PP + Used without the \fI value\fP argument, the command will return the +current label at index \fI index\fP in property \fI propName\fP for the +person \fI personID\fP. To determine the index range, one can use the +\fBaddressbook identifier count\fP command. +.PP + If the \fI value\fP argument is specified, the command will set the +label at index \fI index\fP to this value. .SS addressbook parents ?-ids? \fI recordID\fP .PP This command returns a list of all the groups the record with unique ID @@ -182,7 +194,7 @@ This argument can have one of the following values: \fI Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, MultiDictionary, MultiInteger, MultiReal, MultiString.\fP -.SS addressbook property remove (-groups | -persons | recordID) \fI propName\fP +.SS addressbook property remove (-groups | -persons | \fI recordID\fP) \fI propName\fP .PP 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 @@ -352,17 +364,18 @@ .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. +can be addressed by \fI Address, Phone, Email\fP etc. For instance, a +group could be used as a mailing list. The \fI Address, 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 @@ -391,6 +404,9 @@ distribution lists. Subcommands: count, get, primary, set. .IP * 4 1.1b4 -- 2004/07/31 -- New command [identifier index]. +.IP * 4 +1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed +setting value with [identifier primary]. .RE .SH REQUIREMENTS AND PORTABILITY .PP |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:56:48
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1279/Help Modified Files: TclAB_QuickStart.html Log Message: Doc new command [addressbook label] Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TclAB_QuickStart.html 1 Aug 2004 06:31:36 -0000 1.10 +++ TclAB_QuickStart.html 1 Aug 2004 17:56:39 -0000 1.11 @@ -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.1b4. All the Tcl instructions in the sections +version 1.1b5. 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, @@ -41,7 +41,8 @@ <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><LI><A HREF="#M24">The [label] subcommand</A></UL> +<LI><A HREF="#M25">Using keyed lists</A> </UL> First load the extension like this <PRE> @@ -350,8 +351,19 @@ instruction will return the index 1: <PRE> addressbook identifier index $theid Phone $ident2 +</PRE><P><H3><A NAME="M24"></A>The [label] subcommand</H3> +Let's find the label of the first phone number for a record: +<PRE> + set theid [addressbook getme -id] + addressbook label $theid Phone 0 +</PRE> +The returned string could be Home for instance. Let's change it to +"Personal": +<PRE> + addressbook label $theid Phone 0 Personal + addressbook save </PRE><P><A NAME="ukl"></A> -<H2><A NAME="M24"></A>Using keyed lists</H2> +<H2><A NAME="M25"></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 @@ -371,6 +383,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-08-01 08:10:55<P> +<P> Last updated 2004-08-01 19:32:54<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-01 17:56:38
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1243/Help Modified Files: TclAB_QuickStart.aida Log Message: Doc new command [addressbook label] Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TclAB_QuickStart.aida 1 Aug 2004 06:31:28 -0000 1.10 +++ TclAB_QuickStart.aida 1 Aug 2004 17:56:29 -0000 1.11 @@ -6,7 +6,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-12-14 18:26:47 -:Modified: 2004-08-01 08:09:16 +:Modified: 2004-08-01 19:32:52 :Keywords: Address book, data base @@ -422,6 +422,20 @@ addressbook identifier index $theid Phone $ident2 |)) +((s2 The [label] subcommand +Let's find the label of the first phone number for a record: +((| + set theid [addressbook getme -id] + addressbook label $theid Phone 0 +|)) +The returned string could be Home for instance. Let's change it to +"Personal": +((| + addressbook label $theid Phone 0 Personal + addressbook save +|)) + + ((a ukl)) a)) ((s1 Using keyed lists |
|
From: Bernard D. <bde...@us...> - 2004-08-01 06:36:43
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29799/Source Modified Files: TclAddressBook_version.h Log Message: 1.1b5 Index: TclAddressBook_version.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_version.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TclAddressBook_version.h 28 Jul 2004 23:25:03 -0000 1.8 +++ TclAddressBook_version.h 1 Aug 2004 06:36:33 -0000 1.9 @@ -1,12 +1,12 @@ // File: "TclAddressBook_version.h" // Created: 2003-09-24 07:28:22 -// Last modification: 2004-07-28 23:52:01 +// Last modification: 2004-08-01 08:35:35 // Author: Bernard Desgraupes // Description: version numbering for Tcladdressbook #define TCLADDRESSBOOK_MAJOR 1 #define TCLADDRESSBOOK_MINOR 1 -#define TCLADDRESSBOOK_SUBMINOR 1 +#define TCLADDRESSBOOK_SUBMINOR 5 #define TCLADDRESSBOOK_STAGE 'b' // 'd' for developStage // 'a' for alphaStage |