From 7833ddb0581362b57e1aa7a33ec56a93b333780b Mon Sep 17 00:00:00 2001 From: wolfgang Date: Wed, 9 May 2007 20:13:32 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1053 d1b88da0-ebda-0310-925b-ed51d893ca5b --- .../Appointments/iCalEntityObject+LDAP.h | 34 --- .../Appointments/iCalEntityObject+LDAP.m | 39 --- SoObjects/Contacts/SOGoContactLDAPEntry.h | 50 ---- SoObjects/Contacts/SOGoContactLDAPEntry.m | 222 ------------------ 4 files changed, 345 deletions(-) delete mode 100644 SoObjects/Appointments/iCalEntityObject+LDAP.h delete mode 100644 SoObjects/Appointments/iCalEntityObject+LDAP.m delete mode 100644 SoObjects/Contacts/SOGoContactLDAPEntry.h delete mode 100644 SoObjects/Contacts/SOGoContactLDAPEntry.m diff --git a/SoObjects/Appointments/iCalEntityObject+LDAP.h b/SoObjects/Appointments/iCalEntityObject+LDAP.h deleted file mode 100644 index e65debfe..00000000 --- a/SoObjects/Appointments/iCalEntityObject+LDAP.h +++ /dev/null @@ -1,34 +0,0 @@ -/* iCalEntityObject+Agenor.h - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef ICALENTITYOBJECT_AGENOR_H -#define ICALENTITYOBJECT_AGENOR_H - -#import - -@interface iCalEntityObject (SOGoAgenorUserMgmt) - -- (void) setOrganizerWithUid: (NSString *) organizerUid; - -@end - -#endif /* ICALENTITYOBJECT_AGENOR_H */ diff --git a/SoObjects/Appointments/iCalEntityObject+LDAP.m b/SoObjects/Appointments/iCalEntityObject+LDAP.m deleted file mode 100644 index 2488917f..00000000 --- a/SoObjects/Appointments/iCalEntityObject+LDAP.m +++ /dev/null @@ -1,39 +0,0 @@ -/* iCalEntityObject+Agenor.m - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#import - -#import "iCalEntityObject+Agenor.h" - -@implementation iCalEntityObject (SOGoAgenorUserMgmt) - -- (void) setOrganizerWithUid: (NSString *) organizerUid -{ - iCalPerson *organizer; - - organizer - = [[AgenorUserManager sharedUserManager] iCalPersonWithUid: organizerUid]; - if (organizer) - [self setOrganizer: organizer]; -} - -@end diff --git a/SoObjects/Contacts/SOGoContactLDAPEntry.h b/SoObjects/Contacts/SOGoContactLDAPEntry.h deleted file mode 100644 index 44e40333..00000000 --- a/SoObjects/Contacts/SOGoContactLDAPEntry.h +++ /dev/null @@ -1,50 +0,0 @@ -/* SOGoContactLDAPEntry.h - this file is part of SOGo - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef SOGOCONTACTLDAPENTRY_H -#define SOGOCONTACTLDAPENTRY_H - -#import - -#import "SOGoContactObject.h" - -@class NSString; -@class SOGoContactLDAPFolder; -@class NGLdapEntry; - -@interface SOGoContactLDAPEntry : SOGoObject -{ - NGLdapEntry *ldapEntry; - NGVCard *vcard; -} - -+ (SOGoContactLDAPEntry *) contactEntryWithName: (NSString *) aName - withLDAPEntry: (NGLdapEntry *) anEntry - inContainer: (id) aContainer; -- (id) initWithName: (NSString *) aName - withLDAPEntry: (NGLdapEntry *) anEntry - inContainer: (id) aContainer; - -- (void) setLDAPEntry: (NGLdapEntry *) anEntry; - -@end - -#endif /* SOGOCONTACTLDAPENTRY_H */ diff --git a/SoObjects/Contacts/SOGoContactLDAPEntry.m b/SoObjects/Contacts/SOGoContactLDAPEntry.m deleted file mode 100644 index 9168ed31..00000000 --- a/SoObjects/Contacts/SOGoContactLDAPEntry.m +++ /dev/null @@ -1,222 +0,0 @@ -/* SOGoContactLDAPEntry.m - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#import -#import -#import - -#import -#import - -#import -#import - -#import "NGLdapEntry+Contact.h" - -#import "SOGoContactLDAPEntry.h" - -@implementation SOGoContactLDAPEntry - -+ (SOGoContactLDAPEntry *) contactEntryWithName: (NSString *) aName - withLDAPEntry: (NGLdapEntry *) anEntry - inContainer: (id) aContainer -{ - SOGoContactLDAPEntry *entry; - - entry = [[self alloc] initWithName: aName - withLDAPEntry: anEntry - inContainer: aContainer]; - [entry autorelease]; - - return entry; -} - -- (void) dumpEntry: (NGLdapEntry *) anEntry -{ - NSArray *keys; - unsigned int count, max; - - keys = [anEntry attributeNames]; - max = [keys count]; - - NSLog (@"dumping entry..."); - for (count = 0; count < max; count++) - NSLog (@"%d: %@ = '%@'", count, - [keys objectAtIndex: count], - [anEntry singleAttributeWithName: [keys objectAtIndex: count]]); - NSLog (@"dumping finished.."); -} - -- (id) initWithName: (NSString *) aName - withLDAPEntry: (NGLdapEntry *) anEntry - inContainer: (id) aContainer -{ - if ((self = [super initWithName: aName inContainer: aContainer])) - { - vcard = nil; - [self setLDAPEntry: anEntry]; - } - - [self dumpEntry: anEntry]; - - return self; -} - -- (void) dealloc -{ - if (vcard) - [vcard release]; - [super dealloc]; -} - -- (void) setLDAPEntry: (NGLdapEntry *) anEntry; -{ - ldapEntry = anEntry; -} - -- (NSString *) contentAsString -{ - return [[self vCard] versitString]; -} - -- (void) _setPhonesOfVCard: (NGVCard *) vCard -{ - NSString *info; - - info = [ldapEntry singleAttributeWithName: @"telephoneNumber"]; - if (info) - [vCard addTel: info - types: [NSArray arrayWithObjects: @"work", @"voice", @"pref", nil]]; - info = [ldapEntry singleAttributeWithName: @"homePhone"]; - if (info) - [vCard addTel: info - types: [NSArray arrayWithObjects: @"home", @"voice", nil]]; - info = [ldapEntry singleAttributeWithName: @"fax"]; - if (info) - [vCard addTel: info - types: [NSArray arrayWithObjects: @"work", @"fax", nil]]; - info = [ldapEntry singleAttributeWithName: @"pager"]; - if (info) - [vCard addTel: info - types: [NSArray arrayWithObjects: @"pager", nil]]; - info = [ldapEntry singleAttributeWithName: @"mobile"]; - if (info) - [vCard addTel: info - types: [NSArray arrayWithObjects: @"cell", @"voice", nil]]; - -// telephoneNumber: work phone -// homePhone: home phone -// fax: fax phone -// pager: page phone -// mobile: mobile phone - -} - -- (NGVCard *) vCard -{ - NSString *info, *surname, *streetAddress, *location; - CardElement *element; - - if (!vcard) - { - vcard = [[NGVCard alloc] initWithUid: [self nameInContainer]]; - [vcard setVClass: @"PUBLIC"]; - [vcard setProdID: @"-//OpenGroupware.org//SOGo"]; - [vcard setProfile: @"vCard"]; - info = [ldapEntry singleAttributeWithName: @"displayName"]; - if (!(info && [info length] > 0)) - info = [ldapEntry singleAttributeWithName: @"cn"]; - [vcard setFn: info]; - surname = [ldapEntry singleAttributeWithName: @"sn"]; - if (!surname) - surname = [ldapEntry singleAttributeWithName: @"surname"]; - [vcard setNWithFamily: surname - given: [ldapEntry singleAttributeWithName: @"givenName"] - additional: nil - prefixes: nil - suffixes: nil]; - info = [ldapEntry singleAttributeWithName: @"title"]; - if (info) - [vcard setTitle: info]; - info = [ldapEntry singleAttributeWithName: @"mozillaNickname"]; - if (info) - [vcard setNickname: info]; - info = [ldapEntry singleAttributeWithName: @"xmozillaNickname"]; - if (info) - [vcard setNickname: info]; - info = [ldapEntry singleAttributeWithName: @"notes"]; - if (info) - [vcard setNote: info]; - info = [ldapEntry singleAttributeWithName: @"mail"]; - if (info) - [vcard addEmail: info - types: [NSArray arrayWithObjects: @"internet", @"pref", nil]]; - [self _setPhonesOfVCard: vcard]; - streetAddress = [ldapEntry singleAttributeWithName: @"streetAddress"]; - location = [ldapEntry singleAttributeWithName: @"l"]; - element = [CardElement elementWithTag: @"adr" - attributes: nil values: nil]; - [element setValue: 0 ofAttribute: @"type" to: @"work"]; - if (streetAddress) - [element setValue: 2 to: streetAddress]; - if (location) - [element setValue: 3 to: location]; - if (streetAddress || location) - [vcard addChild: element]; - info = [ldapEntry singleAttributeWithName: @"calFBURL"]; - if (info) - [vcard addChildWithTag: @"FBURL" - types: nil - singleValue: info]; - } - - return vcard; -} - -- (NSString *) davEntityTag -{ - return [[ldapEntry attributeWithName: @"modifyTimeStamp"] - stringValueAtIndex: 0]; -} - -- (NSString *) davContentType -{ - return @"text/x-vcard"; -} - -- (NSArray *) aclsForUser: (NSString *) uid -{ - return nil; -} - -- (void) save -{ -} - -/* message type */ - -- (NSString *) outlookMessageClass -{ - return @"IPM.Contact"; -} - -@end -- 2.39.5