diff --git a/.gitignore b/.gitignore index a5ed35220..c34fbc107 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ */obj/ .scss-lint-config.yml_ ActiveSync/ActiveSync.SOGo +API/API.SOGo Documentation/*.docbook Documentation/*.pdf Documentation/*.html diff --git a/API/GNUmakefile b/API/GNUmakefile new file mode 100644 index 000000000..b426737d3 --- /dev/null +++ b/API/GNUmakefile @@ -0,0 +1,25 @@ + +# GNUstep makefile + +include common.make + +BUNDLE_NAME = API + +API_PRINCIPAL_CLASS = SOGoAPIProduct + +API_OBJC_FILES = \ + SOGoAPIProduct.m \ + SOGoAPI.m + +API_RESOURCE_FILES += \ + product.plist + +API_LANGUAGES = $(SOGO_LANGUAGES) + +API_LOCALIZED_RESOURCE_FILES = Localizable.strings + +ADDITIONAL_INCLUDE_DIRS += -I../SOPE/ -I../SoObjects/ + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/bundle.make +-include GNUmakefile.postamble diff --git a/API/GNUmakefile.preamble b/API/GNUmakefile.preamble new file mode 100644 index 000000000..ce44611a4 --- /dev/null +++ b/API/GNUmakefile.preamble @@ -0,0 +1,16 @@ +# compile settings + +ADDITIONAL_CPPFLAGS += \ + -DSOGO_MAJOR_VERSION=$(MAJOR_VERSION) \ + -DSOGO_MINOR_VERSION=$(MINOR_VERSION) \ + -DSOGO_PATCH_VERSION=$(SUBMINOR_VERSION) \ + -DSOGO_LIBDIR="@\"$(SOGO_LIBDIR)\"" + +ADDITIONAL_INCLUDE_DIRS += \ + -D_GNU_SOURCE -I../SOPE/ -I../SoObjects/ + +ADDITIONAL_LIB_DIRS += \ + -L../SoObjects/SOGo/SOGo.framework/sogo -lSOGo \ + -L../SOPE/GDLContentStore/$(GNUSTEP_OBJ_DIR)/ -lGDLContentStore \ + -L../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ -lNGCards \ + -lEOControl -lNGStreams -lNGMime -lNGExtensions -lNGObjWeb -lWEExtensions \ No newline at end of file diff --git a/API/SOGoAPI.h b/API/SOGoAPI.h new file mode 100644 index 000000000..e3ba9f19e --- /dev/null +++ b/API/SOGoAPI.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2004-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#import +#import +#import + +@interface SOGoAPI : NSObject +- (NSDictionary *) sogoVersionAction; +@end diff --git a/API/SOGoAPI.m b/API/SOGoAPI.m new file mode 100644 index 000000000..0a592a9f8 --- /dev/null +++ b/API/SOGoAPI.m @@ -0,0 +1,23 @@ +/* + Copyright (C) todo... +*/ + +#import + + +@implementation SOGoAPI + +- (NSDictionary *) sogoVersionAction { +NSDictionary* result; + +result = [[NSDictionary alloc] initWithObjectsAndKeys: + @"major", SOGO_MAJOR_VERSION, + @"minor", SOGO_MINOR_VERSION, + @"patch", SOGO_PATCH_VERSION, + nil]; +[result autorelease]; +return result; +} + + +@end /* SOGoAPI */ \ No newline at end of file diff --git a/API/SOGoAPIProduct.m b/API/SOGoAPIProduct.m new file mode 100644 index 000000000..cbc833874 --- /dev/null +++ b/API/SOGoAPIProduct.m @@ -0,0 +1,11 @@ +/* + Copyright (C) todo... +*/ + +#import + +@interface SOGoAPIProduct : NSObject +@end + +@implementation SOGoAPIProduct +@end /* SOGoAPIProduct */ diff --git a/API/common.make b/API/common.make new file mode 100644 index 000000000..bf77fa3be --- /dev/null +++ b/API/common.make @@ -0,0 +1,34 @@ +include ../config.make +include $(GNUSTEP_MAKEFILES)/common.make +include ../Version + +NEEDS_GUI=no +BUNDLE_EXTENSION = .SOGo +BUNDLE_INSTALL_DIR = $(SOGO_LIBDIR) +WOBUNDLE_EXTENSION = $(BUNDLE_EXTENSION) +WOBUNDLE_INSTALL_DIR = $(BUNDLE_INSTALL_DIR) + +# SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib + +ADDITIONAL_INCLUDE_DIRS += \ + -I.. \ + -I../.. \ + -I../../SOPE + +ADDITIONAL_LIB_DIRS += \ + -L../SoObjects/SOGo/SOGo.framework/Versions/Current/sogo \ + -L../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)/ \ + -L../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ \ + -L/usr/local/lib \ + -Wl,-rpath,$(SOGO_SYSLIBDIR)/sogo + +BUNDLE_LIBS += \ + -lSOGo \ + -lGDLContentStore \ + -lGDLAccess \ + -lNGObjWeb \ + -lNGCards -lNGMime -lNGLdap \ + -lNGStreams -lNGExtensions -lEOControl \ + -lDOM -lSaxObjC -lSBJson + +ADDITIONAL_BUNDLE_LIBS += $(BUNDLE_LIBS) diff --git a/API/product.plist b/API/product.plist new file mode 100644 index 000000000..809b101b9 --- /dev/null +++ b/API/product.plist @@ -0,0 +1,31 @@ +{ + requires = ( MAIN, Appointments, Contacts, Mailer ); + + publicResources = (); + + factories = {}; + + classes = { + SOGoAPI = { + protectedBy = ""; + defaultRoles = { + "View" = ( "Authenticated", "PublicUser" ); + }; + }; + }; + + categories = { + SOGoAPI = { + slots = { + }; + methods = { + Version = { + protectedBy = "View"; + pageName = "SOGoAPI"; + actionName = "sogoVersion"; + }; + }; + }; + }; + +} \ No newline at end of file diff --git a/GNUmakefile b/GNUmakefile index fdff4d793..ccb4631b8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,6 +9,7 @@ SUBPROJECTS = \ SoObjects \ Main \ UI \ + API \ Tools \ Tests/Unit \ diff --git a/SoObjects/SOGo/SOGoProductLoader.m b/SoObjects/SOGo/SOGoProductLoader.m index 5f531134d..050637ee1 100644 --- a/SoObjects/SOGo/SOGoProductLoader.m +++ b/SoObjects/SOGo/SOGoProductLoader.m @@ -122,28 +122,28 @@ static NSString *productDirectoryName = @"SOGo"; pathes = [[self productSearchPathes] objectEnumerator]; while ((lpath = [pathes nextObject])) + { + productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator]; + while ((productName = [productNames nextObject])) { - productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator]; - while ((productName = [productNames nextObject])) - { - if ([[productName pathExtension] isEqualToString: @"SOGo"]) - { - bpath = [lpath stringByAppendingPathComponent: productName]; - [registry registerProductAtPath: bpath]; - [loadedProducts addObject: productName]; - } - } - if ([loadedProducts count]) + if ([[productName pathExtension] isEqualToString: @"SOGo"]) { - if (verbose) - { - [self logWithFormat: @"SOGo products loaded from '%@':", lpath]; - [self logWithFormat: @" %@", - [loadedProducts componentsJoinedByString: @", "]]; - } - [loadedProducts removeAllObjects]; + bpath = [lpath stringByAppendingPathComponent: productName]; + [registry registerProductAtPath: bpath]; + [loadedProducts addObject: productName]; } } + if ([loadedProducts count]) + { + if (verbose) + { + [self logWithFormat: @"SOGo products loaded from '%@':", lpath]; + [self logWithFormat: @" %@", + [loadedProducts componentsJoinedByString: @", "]]; + } + [loadedProducts removeAllObjects]; + } + } if (![registry loadAllProducts] && verbose) [self warnWithFormat: @"could not load all products !"];