[Tcladdressbook-commits] Help TclAB_QuickStart.tcl,1.6,1.7
Status: Alpha
Brought to you by:
bdesgraupes
|
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 |