public class VCard extends AbstractImpl
| Modifier and Type | Class and Description |
|---|---|
static class |
VCard.PutVCardResult
putVCard operation return status.
|
static class |
VCard.VCardField
VCardField
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DATETIME_FORMAT |
static short |
DEFAULT_LOCALE |
static String |
FILE_EXTENSION |
static String |
MIME_TYPE |
static int |
MIME_TYPE_CODE |
static String |
PROD_ID |
static Map<Integer,String> |
salutations |
static String |
VCARD_SCHEMA |
| Modifier | Constructor and Description |
|---|---|
protected |
VCard()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
encodeString(String s)
Encode vcard string.
|
protected String |
escapeNewlines(String from)
Escape new lines.
|
protected Account |
findAccount(javax.jdo.PersistenceManager pm,
Segment accountSegment,
String uid)
Find account by vcard UID.
|
static VCard |
getInstance()
Get registered VCard backend.
|
protected Date |
getUtcDate(String dateTime,
SimpleDateFormat dateTimeFormatter)
Get UTC formatted date.
|
protected String |
getUtcDateTime(String dateTime,
SimpleDateFormat dateTimeFormatter)
Get UTC formatted dateTime.
|
String |
getVCardUid(String vcard)
Get UID of given vcard.
|
org.openmdx.base.jmi1.BasicObject |
importItem(byte[] item,
Account account,
short locale,
List<String> errors,
List<String> report)
Import vcard.
|
protected Account |
importItem(String vcardAsString,
Map<String,VCard.VCardField> vcard,
Account account,
short locale,
List<String> report)
Map vcard to given account.
|
String |
mergeVcard(Account account,
String sourceVcard,
List<String> statusMessage)
Update sourceVcard with account values and return merged vcard.
|
Map<String,VCard.VCardField> |
parseVCard(BufferedReader reader,
StringBuilder vcardAsString)
Parse vcard.
|
VCard.PutVCardResult |
putVCard(BufferedReader reader,
Segment accountSegment)
Updates existing or creates new account according to given VCARD.
|
static void |
register()
Register VCard backend.
|
Account |
updateAccount(String vcardAsString,
Map<String,VCard.VCardField> vcard,
Segment accountSegment,
short locale,
List<String> report)
Update account with given vcard.
|
boolean |
updateEMailAddress(EMailAddress address,
String newValue)
Update e-mail address with new value.
|
boolean |
updatePhoneNumber(PhoneNumber address,
String newValue)
Update phone number with new value.
|
boolean |
updatePostalAddress(PostalAddress address,
String newValue,
short locale,
Segment codeSegment)
Update postal address with new address value.
|
boolean |
updateWebAddress(WebAddress address,
String newValue)
Update web address with new value.
|
getInstance, getPersistenceManager, getUidAsString, preDelete, preStore, registerImplpublic static final String DATETIME_FORMAT
public static final String MIME_TYPE
public static final String FILE_EXTENSION
public static final String PROD_ID
public static final int MIME_TYPE_CODE
public static final short DEFAULT_LOCALE
public static final String VCARD_SCHEMA
public static void register()
public static VCard getInstance() throws org.openmdx.base.exception.ServiceException
org.openmdx.base.exception.ServiceExceptionprotected String escapeNewlines(String from)
from - protected String getUtcDateTime(String dateTime, SimpleDateFormat dateTimeFormatter) throws ParseException
dateTime - dateTimeFormatter - ParseExceptionprotected Date getUtcDate(String dateTime, SimpleDateFormat dateTimeFormatter) throws ParseException
dateTime - dateTimeFormatter - ParseExceptionpublic String mergeVcard(Account account, String sourceVcard, List<String> statusMessage) throws org.openmdx.base.exception.ServiceException
account - sourceVcard - statusMessage - org.openmdx.base.exception.ServiceExceptionpublic boolean updatePostalAddress(PostalAddress address, String newValue, short locale, Segment codeSegment) throws org.openmdx.base.exception.ServiceException
address - newValue - locale - codeSegment - org.openmdx.base.exception.ServiceExceptionpublic boolean updatePhoneNumber(PhoneNumber address, String newValue) throws org.openmdx.base.exception.ServiceException
address - newValue - org.openmdx.base.exception.ServiceExceptionpublic boolean updateWebAddress(WebAddress address, String newValue)
address - newValue - public boolean updateEMailAddress(EMailAddress address, String newValue)
address - newValue - public String getVCardUid(String vcard)
vcard - public Map<String,VCard.VCardField> parseVCard(BufferedReader reader, StringBuilder vcardAsString) throws IOException
reader - vcardAsString - IOExceptionpublic org.openmdx.base.jmi1.BasicObject importItem(byte[] item,
Account account,
short locale,
List<String> errors,
List<String> report)
throws org.openmdx.base.exception.ServiceException
item - account - locale - errors - report - org.openmdx.base.exception.ServiceExceptionprotected Account importItem(String vcardAsString, Map<String,VCard.VCardField> vcard, Account account, short locale, List<String> report) throws org.openmdx.base.exception.ServiceException
vcardAsString - vcard - account - locale - report - org.openmdx.base.exception.ServiceExceptionpublic Account updateAccount(String vcardAsString, Map<String,VCard.VCardField> vcard, Segment accountSegment, short locale, List<String> report) throws org.openmdx.base.exception.ServiceException
vcardAsString - vcard - accountSegment - locale - report - org.openmdx.base.exception.ServiceExceptionprotected Account findAccount(javax.jdo.PersistenceManager pm, Segment accountSegment, String uid)
pm - accountSegment - uid - public VCard.PutVCardResult putVCard(BufferedReader reader, Segment accountSegment) throws org.openmdx.base.exception.ServiceException
reader - accountSegment - org.openmdx.base.exception.ServiceExceptionThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.