emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Strey <mstrey@strey.biz>
To: Daimrod <daimrod@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-contacts development
Date: Tue, 03 Jun 2014 12:23:37 +0200	[thread overview]
Message-ID: <87sinm1ec6.fsf@strey.biz> (raw)
In-Reply-To: <87zji1b7av.fsf@tanger.home>

[-- Attachment #1: Type: text/plain, Size: 3708 bytes --]

Hi Daimrod,

On 2014-05-29, Daimrod wrote:

> Hmm, I kinda like this. It seems a bit verbose but it's better than
> having multiple values per properties (IMHO).
>
> Though, if we adopt this scheme, we would need to add some helper
> bindings/functions so that we don't have to fill this by hands.

I'm using yasnippets and have snippets for organizations, job-related
contacts and private contacts.

I have attached them.

C-c C-x p helps to fill in optional properties.

I have all my contacts in one buffer with the following settings

#+BEGIN_SRC org
* Buffer settings
#+STARTUP: overview
#+STARTUP: hidestars
#+STARTUP: indent
#+TAGS: ADMIN(i) CHEF(f) EINKAUF(k) PRIVAT(t) SEKRETARIAT(s) 
#+TAGS: AUTO(u) BROADCASTER(b) DAB(d) DVB(v) EMPFÄNGER(m) HOCHSCHULE(h) NETZBETREIBER(n) SYSTEM(y) B2B B2C REG
#+TAGS: MAIL(l) PRESSE(e) KUNDE COMPETITOR
#+TAGS: ABI CI FAMILIE FREUNDE SCHULE TAICHI TURNEN
#+SEQ_TODO: TODO(t) NEXT(n) WAITING(w) | DONE(d) CANCELLED(c)
#+PROPERTY: Contact_Type_ALL individual organization
#+PROPERTY: Language_ALL de en ru
#+PROPERTY: Phone_1_Type_ALL Work Home Fax Mobile
#+PROPERTY: Phone_2_Type_ALL Work Home Fax Mobile
#+PROPERTY: Phone_3_Type_ALL Work Home Fax Mobile
#+PROPERTY: Phone_4_Type_ALL Work Home Fax Mobile
#+PROPERTY: Address_1_Type_ALL Work Home Post
#+PROPERTY: Address_2_Type_ALL Work Home Post
#+PROPERTY: Address_3_Type_ALL Work Home Post
#+PROPERTY: Website_1_Type_ALL Work Home
#+PROPERTY: Website_2_Type_ALL Work Home
#+END_SRC


>> Other user defined properties can be added and mapped to the appropriate
>> user defined keys during export.
>
> I'm not sure to understand what you mean. Could you give more details
> and maybe an example?

Actually, my statement was trivial.  Orgmode allows to define and add
every kind of additional properties.  What I wanted to say was that it
is possible to export those additional properties to Google Contacts as
well.

I have for instance the property :Language: that is not part of the
Google API.  I use it to store the preferred language of correspondence
for my job-related contacts for mailing actions.

Google Contacts accepts such fields in the CSV file to import and
creates user defined fields from them.


>> Please note that org-collector tries to convert property values from
>> strings into numbers if possible.  For postal codes with leading Zeros
>> this can lead to unexpected results.  I did not find any other way to
>> solve this problem than to add a national code like in the following
>> example
>>
>> :Address_1_Code:  01169
>> would lead to "1169" in the propview table.
>>
>> so I replaced it with
>> :Address_1_Code:  DE-01169
>
> What is `org-collector' and when does it happen?

From the Orgmode manual:

"An alternative way to capture and process property values into a table
is provided by Eric Schulte's org-collector.el which is a contributed
package.  It provides a general API to collect properties from entries
in a certain scope, and arbitrary Lisp expressions to process these
values before inserting them into a table or a dynamic block."

I'm using org-collector to create a table that can be exported to CSV
for import into Google Contacts (and maybe other contact managers).

> I've done a quick test and the 0 appears in `org-contacts-db'.

Yes, everything is fine with org-contacts.  The problem comes only from
org-collector.  The reason is org-collector's feature to allow Lisp
expressions to process property values.  Therefore it uses the function
`org-babel-read' that detects Lisp expressions and converts strings into
numbers.

So this remark is only relevant for those who want to follow my track with the
org-collector export.

-- 
Michael Strey 
www.strey.biz


[-- Attachment #2: Job-related contact --]
[-- Type: text/plain, Size: 1022 bytes --]

#name : Contact Individual
#key : contact
#contributor : Michael Strey <[EMAIL PROTECTED]>
#expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
# --
**** ${1:surname}, ${2:name}
:LOGBOOK:
- Contact added: [`(org-read-date nil nil "+0d")`]
:END:

:PROPERTIES:
:Contact_Type: individual
:Organization_1_Type: company
:Organization_1_Value: ${3:organisation}
:Organization_1_Department: ${4:devision}
:Organization_1_Title: ${5:title}
:FN: $2 $1
:Given_Name: $2
:Family_Name: $1
:Nickname: $19 $1
:Address_1_Type: Work
:Address_1_Street: ${6:adr1}
:Address_1_Box: ${7:adr2}
:Address_1_Extension: ${8:adr3}
:Address_1_City: ${9:city}
:Address_1_Region: ${10:state} 
:Address_1_Code: ${11:zip_code}
:Address_1_Country: ${12:country}
:Email_1_Type: Work
:Email_1_Value: ${13:company_email}
:Phone_1_Type: Work
:Phone_1_Value: ${14:tel}
:Phone_2_Type: Mobile
:Phone_2_Value: ${15:mobile}
:Phone_3_Type: Fax
:Phone_3_Value: ${16:fax}
:Website_1_Type: Work
:Website_1_Value: http://$17
:Language:     $18
:END:
$0

[-- Attachment #3: Private contact --]
[-- Type: text/plain, Size: 815 bytes --]

#name : Contact Individual (private)
#key : privat
#contributor : Michael Strey <[EMAIL PROTECTED]>
#expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
# --
**** ${1:surname}, ${2:name}   :NEW:
:LOGBOOK:
- Contact added: [`(org-read-date nil nil "+0d")`]
:END:
:PROPERTIES:
:Contact_Type: individual
:FN: $2 $1
:Family_Name: $1
:Given_Name: $2
:Name_Prefix: 
:Name_Suffix: 
:Nickname: ${3:salutation}
:Address_1_Type: Home
:Address_1_Street: ${4:street}
:Address_1_Box: 
:Address_1_Extension: 
:Address_1_City: ${5:Dresden}
:Address_1_Region: ${6:Sachsen}
:Address_1_Code: DE-${7:zip_code}
:Address_1_Country: ${8:Deutschland}
:Email_1_Type: Home
:Email_1_Value: ${9:email}
:Phone_1_Type: Home
:Phone_1_Value: ${10:tel}
:Phone_2_Type: Mobile
:Phone_2_Value: ${11:tel}
:Language: ${12:de}
:END:
$0

[-- Attachment #4: Organization --]
[-- Type: text/plain, Size: 827 bytes --]

#name : Contact Organisation
#key : org
#contributor : Michael Strey <[EMAIL PROTECTED]>
#expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil))
# --
*** ${1:organisation}    :NEW:
:LOGBOOK:
- Organization added: [`(org-read-date nil nil "+0d")`]
:END:
:PROPERTIES:
:Contact_Type: organization
:Organization_1_Name: $1
:Organization_1_Department: ${2:devision}
:Address_1_Type: Work
:Address_1_Street: ${3:adr1}
:Address_1_Box: ${4:adr2}
:Address_1_Extension: ${5:adr3}
:Address_1_City: ${6:city}
:Address_1_Region: ${7:state}
:Address_1_Code: ${8:zip_code}
:Address_1_Country: ${9:country}
:Email_1_Type: Work
:Email_1_Value: ${10:company_email}
:Phone_1_Type: Work
:Phone_1_Value: ${11:tel}
:Phone_2_Type: Fax
:Phone_2_Value: ${12:tel}
:Website_1_Type: Work
:Website_1_Value: http://$13
:Language: $14
:END:
$0

  reply	other threads:[~2014-06-03 10:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  4:07 org-contacts development Alexis
2014-05-23  9:06 ` Rasmus
2014-05-23 10:30 ` Alexander Baier
2014-05-24  4:02   ` Xebar Saram
2014-05-24 10:27     ` Alexis
2014-05-24 10:15   ` Alexis
2014-05-24 14:18     ` Alexander Baier
2014-05-24 14:55       ` Bastien
2014-05-24 15:05       ` Alexis
2014-05-24 15:43         ` Rasmus
2014-05-24 16:10           ` Alexis
2014-05-23 12:45 ` Bastien
2014-05-23 15:46   ` Rasmus
2014-05-24 10:04   ` Alexis
2014-05-24 12:17     ` Bastien
2014-05-24 14:07       ` Alexis
2014-05-24  9:00 ` Org-contacts standardization (was: org-contacts development) Karl Voit
     [not found] ` <878ups27km.fsf@gmx.us>
2014-05-24  9:59   ` org-contacts development Alexis
2014-05-24 16:51 ` Daimrod
2014-05-24 17:48   ` Alexis
2014-05-26  3:21     ` Daimrod
2014-05-26  4:06       ` Alexis
2014-05-26 15:20 ` Michael Strey
2014-05-27  9:27   ` Michael Strey
2014-05-29  3:19     ` Daimrod
2014-06-03 10:23       ` Michael Strey [this message]
2014-06-05  4:26         ` Daimrod
2014-07-23 13:40 ` Karl Voit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sinm1ec6.fsf@strey.biz \
    --to=mstrey@strey.biz \
    --cc=daimrod@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).