--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -115,17 +115,16 @@ MOZ_COMPOSER = @MOZ_COMPOSER@
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
ENABLE_TESTS = @ENABLE_TESTS@
IBMBIDI = @IBMBIDI@
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
ACCESSIBILITY = @ACCESSIBILITY@
MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
MOZ_LDAP_XPCOM = @MOZ_LDAP_XPCOM@
-MOZ_LDAP_XPCOM_EXPERIMENTAL = @MOZ_LDAP_XPCOM_EXPERIMENTAL@
MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
MOZ_INSTALLER = @MOZ_INSTALLER@
MOZ_UPDATER = @MOZ_UPDATER@
MOZ_UPDATE_PACKAGING = @MOZ_UPDATE_PACKAGING@
MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
MOZ_DISABLE_VISTA_SDK_REQUIREMENTS = @MOZ_DISABLE_VISTA_SDK_REQUIREMENTS@
MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
--- a/configure.in
+++ b/configure.in
@@ -5355,26 +5355,16 @@ MOZ_ARG_ENABLE_BOOL(tree-freetype,
[ --enable-tree-freetype Enable Tree FreeType],
MOZ_TREE_FREETYPE=1,
MOZ_TREE_FREETYPE= )
if test -n "$MOZ_TREE_FREETYPE"; then
CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype2,$(LIBXUL_DIST)/lib)'
fi
dnl ========================================================
-dnl experimental ldap features
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(ldap-experimental,
-[ --enable-ldap-experimental
- Enable LDAP experimental features],
- MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
- MOZ_LDAP_XPCOM_EXPERIMENTAL=)
-
-
-dnl ========================================================
dnl Installer
dnl ========================================================
case "$target_os" in
aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*|winmo*)
MOZ_INSTALLER=1
;;
esac
@@ -6819,17 +6809,16 @@ AC_SUBST(MOZ_JSDEBUGGER)
AC_SUBST(MOZ_PLUGINS)
AC_SUBST(MOZ_LOG_REFCNT)
AC_SUBST(MOZ_JPROF)
AC_SUBST(MOZ_SHARK)
AC_SUBST(MOZ_PROFILING)
AC_SUBST(MOZ_USE_NATIVE_UCONV)
AC_SUBST(MOZ_QUANTIFY)
AC_SUBST(MOZ_LDAP_XPCOM)
-AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
AC_SUBST(LDAP_CFLAGS)
AC_SUBST(LDAP_LIBS)
AC_SUBST(LIBICONV)
AC_SUBST(MOZ_PLACES_BOOKMARKS)
AC_SUBST(MOZ_STORAGE)
AC_SUBST(MOZ_FEEDS)
AC_SUBST(NS_PRINTING)
AC_SUBST(MOZ_HELP_VIEWER)
--- a/ldap/makefiles.sh
+++ b/ldap/makefiles.sh
@@ -33,12 +33,11 @@
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
add_makefiles "
ldap/xpcom/Makefile
-ldap/xpcom/base/Makefile
-ldap/xpcom/base/public/Makefile
-ldap/xpcom/base/src/Makefile
+ldap/xpcom/public/Makefile
+ldap/xpcom/src/Makefile
"
--- a/ldap/xpcom/Makefile.in
+++ b/ldap/xpcom/Makefile.in
@@ -38,24 +38,18 @@
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-DIRS = \
- base \
+PARALLEL_DIRS = \
+ public \
+ src \
$(NULL)
-ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-DIRS += \
- datasource \
- $(NULL)
-endif
-
ifdef ENABLE_TESTS
-DIRS += \
- tests
+TOOL_DIRS += tests
endif
include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/ldap/xpcom/base/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the mozilla.org LDAP XPCOM SDK.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Dan Mosedale <dmose@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = ../../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = mozldap
-DIRS = public src
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/ldap/xpcom/base/src/nsLDAPChannel.cpp
+++ /dev/null
@@ -1,960 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the mozilla.org LDAP XPCOM SDK.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Dan Mosedale <dmose@mozilla.org>
- * Warren Harris <warren@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsLDAPInternal.h"
-#include "nsLDAPConnection.h"
-#include "nsLDAPChannel.h"
-#include "nsString.h"
-#include "nsReadableUtils.h"
-#include "nsMimeTypes.h"
-#include "nsIPipe.h"
-#include "nsXPIDLString.h"
-#include "nsILDAPURL.h"
-#include "nsIProxyObjectManager.h"
-#include "nsIServiceManager.h"
-#include "nsIConsoleService.h"
-#include "nsILDAPMessage.h"
-
-#if !INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD
-#include "nsNetUtil.h"
-#endif
-
-static NS_DEFINE_IID(kILDAPMessageListenerIID, NS_ILDAPMESSAGELISTENER_IID);
-static NS_DEFINE_IID(kILoadGroupIID, NS_ILOADGROUP_IID);
-static NS_DEFINE_IID(kIProgressEventSink, NS_IPROGRESSEVENTSINK_IID);
-
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsLDAPChannel,
- nsIChannel,
- nsIRequest,
- nsILDAPMessageListener)
-
-nsLDAPChannel::nsLDAPChannel()
-{
-}
-
-nsLDAPChannel::~nsLDAPChannel()
-{
-}
-
-// initialize the channel
-//
-nsresult
-nsLDAPChannel::Init(nsIURI *uri)
-{
- nsresult rv;
-
- mStatus = NS_OK;
- mURI = uri;
- mLoadFlags = LOAD_NORMAL;
- mReadPipeOffset = 0;
- mReadPipeClosed = PR_FALSE;
-
- // create an LDAP connection
- //
- mConnection = do_CreateInstance("@mozilla.org/network/ldap-connection;1",
- &rv);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::Init(): could not create "
- "@mozilla.org/network/ldap-connection;1");
- return NS_ERROR_FAILURE;
- }
-
- // i think that in the general case, it will be worthwhile to leave the
- // callbacks for this channel be invoked on the LDAP connection thread.
- // however, for the moment, I want to leave the code that invokes it on
- // the main thread here (though turned off), because it provides a
- // useful demonstration of why PLEvents' lack of priorities hurts us
- // (in this case in ldap: searches that return a lot of results).
- //
-#if INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD
-
- // get a proxy for this callback, saving it off in mCallback
- //
- rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,
- kILDAPMessageListenerIID,
- static_cast<nsILDAPMessageListener *>(this),
- NS_PROXY_ASYNC|NS_PROXY_ALWAYS,
- getter_AddRefs(mCallback));
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::Init(): could not create proxy object");
- return NS_ERROR_FAILURE;
- }
-
-#else
- mCallback = this;
-#endif
-
- return NS_OK;
-}
-
-// impl code cribbed from nsJARChannel.cpp
-//
-NS_METHOD
-nsLDAPChannel::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
-{
- nsresult rv;
-
- if (aOuter)
- return NS_ERROR_NO_AGGREGATION;
-
- nsLDAPChannel* ldapChannel = new nsLDAPChannel();
- if (!ldapChannel)
- return NS_ERROR_OUT_OF_MEMORY;
-
- NS_ADDREF(ldapChannel);
- rv = ldapChannel->QueryInterface(aIID, aResult);
- NS_RELEASE(ldapChannel);
- return rv;
-}
-
-// nsIRequest methods
-
-NS_IMETHODIMP
-nsLDAPChannel::GetName(nsACString &result)
-{
- if (mURI)
- return mURI->GetSpec(result);
- result.Truncate();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::IsPending(PRBool *result)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::IsPending");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::GetStatus(nsresult *status)
-{
- return mStatus;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::Cancel(nsresult aStatus)
-{
- nsresult rv;
-
- // set the status
- //
- mStatus = aStatus;
-
- // if there is an operation running, abandon it and remove it from the
- // queue
- //
- if (mCurrentOperation) {
-
- // if this fails in a non-debug build, there's not much we can do
- //
- rv = mCurrentOperation->AbandonExt();
- NS_ASSERTION(NS_SUCCEEDED(rv), "nsLDAPChannel::Cancel(): "
- "mCurrentOperation->Abandon() failed\n");
-
- // make nsCOMPtr call Release()
- //
- mCurrentOperation = 0;
-
- }
-
- // if the read pipe exists and hasn't already been closed, close it
- //
- if (mReadPipeOut != 0 && !mReadPipeClosed) {
-
- // XXX set mReadPipeClosed?
-
- // if this fails in a non-debug build, there's not much we can do
- //
- rv = mReadPipeOut->Close();
- NS_ASSERTION(NS_SUCCEEDED(rv), "nsLDAPChannel::Cancel(): "
- "mReadPipeOut->Close() failed");
- }
-
- // remove self from loadgroup to stop the throbber
- //
- if (mLoadGroup) {
- rv = mLoadGroup->RemoveRequest(static_cast<nsIRequest *>(this),
- mResponseContext, aStatus);
- if (NS_FAILED(rv))
- return rv;
- }
-
- // call listener's onstoprequest
- //
- if (mUnproxiedListener) {
- rv = mListener->OnStopRequest(this, mResponseContext, aStatus);
- if (NS_FAILED(rv))
- return rv;
- }
-
- // Drop notification callbacks to prevent cycles.
- mCallbacks = nsnull;
- mEventSink = nsnull;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::Suspend(void)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::Suspend");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::Resume(void)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::Resume");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// nsIChannel methods
-//
-
-NS_IMETHODIMP
-nsLDAPChannel::SetOriginalURI(nsIURI *aOriginalURI)
-{
- mOriginalURI = aOriginalURI;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::GetOriginalURI(nsIURI **aOriginalURI)
-{
- *aOriginalURI = mOriginalURI ? mOriginalURI : mURI;
- NS_IF_ADDREF(*aOriginalURI);
-
- return NS_OK;
-}
-
-// getter for URI attribute:
-//
-// Returns the URL to which the channel currently refers. If a redirect
-// or URI resolution occurs, this accessor returns the current location
-// to which the channel is referring.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetURI(nsIURI* *aURI)
-{
- *aURI = mURI;
- NS_IF_ADDREF(*aURI);
- return NS_OK;
-}
-
-// getter and setter for loadFlags attribute:
-//
-// The load attributes for the request. E.g. setting the load
-// attributes with the LOAD_QUIET bit set causes the loading process to
-// not deliver status notifications to the program performing the load,
-// and to not contribute to keeping any nsILoadGroup it may be contained
-// in from firing its OnLoadComplete notification.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetLoadFlags(nsLoadFlags *aLoadFlags)
-{
- *aLoadFlags = mLoadFlags;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
-{
- mLoadFlags = aLoadFlags;
- return NS_OK;
-}
-
-// getter and setter for contentType attribute:
-//
-// The content MIME type of the channel if available. Note that the
-// content type can often be wrongly specified (wrong file extension, wrong
-// MIME type, wrong document type stored on a server, etc.) and the caller
-// most likely wants to verify with the actual data.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetContentType(nsACString &aContentType)
-{
- aContentType.AssignLiteral(TEXT_PLAIN);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetContentType(const nsACString &aContentType)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::SetContentType");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::GetContentCharset(nsACString &aContentCharset)
-{
- aContentCharset.Truncate();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetContentCharset(const nsACString &aContentCharset)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::SetContentCharset");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// getter and setter for contentLength attribute:
-//
-// Returns the length of the data associated with the channel if available.
-// If the length is unknown then -1 is returned.
-
-NS_IMETHODIMP
-nsLDAPChannel::GetContentLength(PRInt32 *)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::GetContentLength");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetContentLength(PRInt32)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::SetContentLength");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// getter and setter for the owner attribute:
-//
-// The owner corresponding to the entity that is responsible for this
-// channel. Used by security code to grant or deny privileges to
-// mobile code loaded from this channel.
-//
-// Note: This is a strong reference to the owner, so if the owner is also
-// holding a pointer to the channel, care must be taken to explicitly drop
-// its reference to the channel -- otherwise a leak will result.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetOwner(nsISupports* *aOwner)
-{
- *aOwner = mOwner;
- NS_IF_ADDREF(*aOwner);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetOwner(nsISupports *aOwner)
-{
- mOwner = aOwner;
- return NS_OK;
-}
-
-// getter and setter for the loadGroup attribute:
-//
-// the load group of which the channel is a currently a member.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
-{
- *aLoadGroup = mUnproxiedLoadGroup;
- NS_IF_ADDREF(*aLoadGroup);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
-{
- mUnproxiedLoadGroup = aLoadGroup;
-
- // in the case where the LDAP callbacks happen on the connection thread,
- // we'll need to call into the loadgroup from there
- //
-#if INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD
-
- mLoadGroup = mUnproxiedLoadGroup;
-
-#else
- nsresult rv;
-
- // get and save a proxy for the load group
- //
- rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, kILoadGroupIID,
- mUnproxiedLoadGroup,
- NS_PROXY_SYNC|NS_PROXY_ALWAYS,
- getter_AddRefs(mLoadGroup));
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::SetLoadGroup(): could not create proxy "
- "event");
- return NS_ERROR_FAILURE;
- }
-#endif
-
- return NS_OK;
-}
-
-// getter and setter for the notificationCallbacks
-//
-// The capabilities callbacks of the channel. This is set by clients
-// who wish to provide a means to receive progress, status and
-// protocol-specific notifications.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetNotificationCallbacks(nsIInterfaceRequestor*
- *aNotificationCallbacks)
-{
- *aNotificationCallbacks = mCallbacks;
- NS_IF_ADDREF(*aNotificationCallbacks);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::SetNotificationCallbacks(nsIInterfaceRequestor*
- aNotificationCallbacks)
-{
- nsresult rv;
-
- // save off the callbacks
- //
- mCallbacks = aNotificationCallbacks;
- if (mCallbacks) {
-
- // get the (unproxied) event sink interface
- //
- nsCOMPtr<nsIProgressEventSink> eventSink;
- rv = mCallbacks->GetInterface(NS_GET_IID(nsIProgressEventSink),
- getter_AddRefs(eventSink));
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::SetNotificationCallbacks(): "
- "mCallbacks->GetInterface failed");
- return NS_ERROR_FAILURE;
- }
-
-#if INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD
- mEventSink = eventSink;
-#else
- // get a proxy for this callback, saving it off in mEventSink
- //
- rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,
- kIProgressEventSink, eventSink,
- NS_PROXY_ASYNC | NS_PROXY_ALWAYS,
- getter_AddRefs(mEventSink));
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::SetNotificationCallbacks(): "
- "couldn't get proxy for event sink");
- return NS_ERROR_FAILURE;
- }
-#endif
- }
-
- return NS_OK;
-}
-
-// getter for securityInfo attribute:
-//
-// Any security information about this channel. This can be null.
-//
-NS_IMETHODIMP
-nsLDAPChannel::GetSecurityInfo(nsISupports* *aSecurityInfo)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::GetSecurityInfo");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// nsIChannel operations
-
-// Opens a blocking input stream to the URL's specified source.
-// @param startPosition - The offset from the start of the data
-// from which to read.
-// @param readCount - The number of bytes to read. If -1, everything
-// up to the end of the data is read. If greater than the end of
-// the data, the amount available is returned in the stream.
-//
-NS_IMETHODIMP
-nsLDAPChannel::Open(nsIInputStream* *result)
-{
- NS_NOTYETIMPLEMENTED("nsLDAPChannel::OpenInputStream");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLDAPChannel::AsyncOpen(nsIStreamListener* aListener,
- nsISupports* aCtxt)
-{
- nsresult rv;
- nsCAutoString host;
-
- // slurp out relevant pieces of the URL
- //
- rv = mURI->GetAsciiHost(host);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::AsyncRead(): mURI->GetAsciiHost failed\n");
- return NS_ERROR_FAILURE;
- }
-
- // we don't currently allow for a default host
- //
- if (host.IsEmpty())
- return NS_ERROR_MALFORMED_URI;
-
- // QI to nsILDAPURL so that we can call one of the methods on that iface
- //
- nsCOMPtr<nsILDAPURL> mLDAPURL = do_QueryInterface(mURI, &rv);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::AsyncRead(): QI to nsILDAPURL failed\n");
- return NS_ERROR_FAILURE;
- }
-
- rv = NS_CheckPortSafety(mURI);
- if (NS_FAILED(rv))
- return rv;
-
- // save off the args
- //
- mResponseContext = aCtxt;
- mUnproxiedListener = aListener;
-
- // add ourselves to the appropriate loadgroup
- //
- if (mLoadGroup) {
- mLoadGroup->AddRequest(this, mResponseContext);
- }
-
- // since the LDAP SDK does all the socket management, we don't have
- // an underlying transport channel to create an nsIInputStream to hand
- // back to the nsIStreamListener. So we do it ourselves:
- //
- if (!mReadPipeIn) {
-
- // get a new pipe, propagating any error upwards
- //
- rv = NS_NewPipe(getter_AddRefs(mReadPipeIn),
- getter_AddRefs(mReadPipeOut),
- 0, 0, PR_TRUE, PR_FALSE, 0);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::AsyncRead(): unable to create new pipe");
- return NS_ERROR_FAILURE;
- }
- }
-
- // get an AsyncStreamListener to proxy for mListener, if we're
- // compiled to have the LDAP callbacks happen on the LDAP connection=
- // thread.
- //
-#if INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD
- mListener = aListener;
-#else
- rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,
- NS_GET_IID(nsIStreamListener),
- mUnproxiedListener,
- NS_PROXY_ASYNC | NS_PROXY_ALWAYS,
- getter_AddRefs(mListener));
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::AsyncRead(): unable to create new "
- "AsyncStreamListener");
- return NS_ERROR_FAILURE;
- }
-
-#endif
-
- // we already know the content type, so we can fire this now
- //
- mUnproxiedListener->OnStartRequest(this, mResponseContext);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::AsyncRead(): error firing OnStartRequest");
- return NS_ERROR_FAILURE;
- }
-
- // initialize it with the defaults
- // XXXdmose - need to deal with bind name
- // Need to deal with VERSION2 pref - don't know how to get it from here.
- rv = mConnection->Init(mLDAPURL, EmptyCString(), this, nsnull, nsILDAPConnection::VERSION3);
- switch (rv) {
- case NS_OK:
- break;
-
- case NS_ERROR_OUT_OF_MEMORY:
- case NS_ERROR_NOT_AVAILABLE:
- case NS_ERROR_FAILURE:
- return rv;
-
- case NS_ERROR_ILLEGAL_VALUE:
- default:
- return NS_ERROR_UNEXPECTED;
- }
-
- // create and initialize an LDAP operation (to be used for the bind)
- //
- mCurrentOperation = do_CreateInstance(
- "@mozilla.org/network/ldap-operation;1", &rv);
- if (NS_FAILED(rv)) {
- return NS_ERROR_FAILURE;
- }
-
- // our OnLDAPMessage accepts all result callbacks
- //
- rv = mCurrentOperation->Init(mConnection, mCallback, nsnull);
- if (NS_FAILED(rv))
- return NS_ERROR_UNEXPECTED; // this should never happen
-
- // kick off a bind operation
- //
- PR_LOG(gLDAPLogModule, PR_LOG_DEBUG, ("initiating SimpleBind\n"));
- rv = mCurrentOperation->SimpleBind(EmptyCString());
- if (NS_FAILED(rv)) {
-
- // XXXdmose better error handling / passthrough; deal with password
- //
- NS_WARNING("mCurrentOperation->SimpleBind failed.");
- return(rv);
- }
-
- return NS_OK;
-}
-
-/**
- * Messages received are passed back via this function.
- *
- * @arg aMessage The message that was returned, 0 if none was.
- *
- * void OnLDAPMessage (in nsILDAPMessage aMessage)
- */
-NS_IMETHODIMP
-nsLDAPChannel::OnLDAPMessage(nsILDAPMessage *aMessage)
-{
- PRInt32 messageType;
-
- // figure out what sort of message was returned
- //
- nsresult rv = aMessage->GetType(&messageType);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::OnLDAPMessage(): unexpected error in "
- "nsLDAPChannel::GetType()");
- return NS_ERROR_UNEXPECTED;
- }
-
- switch (messageType) {
-
- case LDAP_RES_BIND:
-
- // a bind has completed
- //
- return OnLDAPBind(aMessage);
- break;
-
- case LDAP_RES_SEARCH_ENTRY:
-
- // a search entry has been returned
- //
- return OnLDAPSearchEntry(aMessage);
- break;
-
- case LDAP_RES_SEARCH_RESULT:
-
- // the search is finished; we're all done
- //
- return OnLDAPSearchResult(aMessage);
- break;
-
- default:
- NS_WARNING("nsLDAPChannel::OnLDAPMessage(): unexpected LDAP message "
- "received");
-
- // get the console service so we can log a message
- //
- nsCOMPtr<nsIConsoleService> consoleSvc =
- do_GetService("@mozilla.org/consoleservice;1", &rv);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::OnLDAPMessage() couldn't get console "
- "service");
- break;
- }
-
- // log the message
- //
- rv = consoleSvc->LogStringMessage(
- NS_LITERAL_STRING("LDAP: WARNING: nsLDAPChannel::OnLDAPMessage(): Unexpected LDAP message received").get());
- NS_ASSERTION(NS_SUCCEEDED(rv), "nsLDAPChannel::OnLDAPMessage(): "
- "consoleSvc->LogStringMessage() failed");
- break;
- }
-
- return NS_OK;
-}
-
-nsresult
-nsLDAPChannel::OnLDAPBind(nsILDAPMessage *aMessage)
-{
- nsCOMPtr<nsILDAPURL> url;
- nsCAutoString baseDn;
- nsCAutoString filter;
- PRInt32 scope;
- nsresult rv;
-
- // XXX should call ldap_parse_result() here
-
- mCurrentOperation = 0; // done with bind op; make nsCOMPtr release it
-
- // create and initialize an LDAP operation (to be used for the search
- //
- mCurrentOperation = do_CreateInstance(
- "@mozilla.org/network/ldap-operation;1", &rv);
- if (NS_FAILED(rv)) {
- NS_ERROR("nsLDAPChannel::OnLDAPBind(): couldn't create "
- "@mozilla.org/network/ldap-operation;1");
- // XXX abort entire asyncread
- return NS_ERROR_FAILURE;
- }
-
- rv = mCurrentOperation->Init(mConnection, mCallback, nsnull);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // QI() the URI to an nsILDAPURL so we get can the LDAP specific portions
- //
- url = do_QueryInterface(mURI, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // get a base DN.
- // XXXdmose - is it reasonable to barf on an empty dn?
- //
- rv = url->GetDn(baseDn);
- NS_ENSURE_SUCCESS(rv, rv);
- if (baseDn.IsEmpty()) {
- return NS_ERROR_MALFORMED_URI;
- }
-
- // get the scope
- //
- rv = url->GetScope(&scope);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // and the filter
- //
- rv = url->GetFilter(filter);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // time to kick off the search.
- //
- // XXX what about timeouts?
- // XXX failure is a reasonable thing; don't assert
- //
- PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
- ("bind completed; starting search\n"));
- rv = mCurrentOperation->SearchExt(baseDn, scope, filter, 0, 0, 0,
- LDAP_NO_LIMIT);
- NS_ENSURE_SUCCESS(rv,rv);
-
- return NS_OK;
-}
-
-// void onLDAPInit (in nsresult aStatus); */
-//
-NS_IMETHODIMP
-nsLDAPChannel::OnLDAPInit(nsILDAPConnection *aConnection, nsresult aStatus)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// void OnLDAPSearchResult (in nsILDAPMessage aMessage);
-//
-nsresult
-nsLDAPChannel::OnLDAPSearchResult(nsILDAPMessage *aMessage)
-{
- PRInt32 errorCode; // the LDAP error code
- nsresult rv;
-
- PR_LOG(gLDAPLogModule, PR_LOG_DEBUG, ("result returned\n"));
-
- // XXX should use GetErrorString here?
- //
- rv = aMessage->GetErrorCode(&errorCode);
- if ( NS_FAILED(rv) ) {
- NS_ERROR(ldap_err2string(errorCode));
- return NS_ERROR_FAILURE;
- }
-
- // we're done with the current operation. cause nsCOMPtr to Release() it
- // so that if nsLDAPChannel::Cancel gets called, that doesn't try to call
- // mCurrentOperation->Abandon().
- //
- mCurrentOperation = 0;
-
- // if the read pipe exists and hasn't already been closed, close it
- //
- if (mReadPipeOut != 0 && !mReadPipeClosed) {
-
- // if this fails in a non-debug build, there's not much we can do
- //
- rv = mReadPipeOut->Close();
- NS_ASSERTION(NS_SUCCEEDED(rv), "nsLDAPChannel::OnLDAPSearchResult(): "
- "mReadPipeOut->Close() failed");
- }
-
- // remove self from loadgroup to stop the throbber
- //
- if (mLoadGroup) {
- rv = mLoadGroup->RemoveRequest(static_cast<nsIRequest *>(this),
- mResponseContext, NS_OK);
- if (NS_FAILED(rv)) {
- NS_WARNING("nsLDAPChannel::OnSearchResult(): "
- "mLoadGroup->RemoveChannel() failed");
- return rv;
- }
- }
-
- // call listener's onstoprequest
- //
- if (mListener) {
- rv = mListener->OnStopRequest(this, mResponseContext, NS_OK);
- if (NS_FAILED(rv)) {
- NS_WARNING("nsLDAPChannel::OnSearchResult(): "
- "mListener->OnStopRequest failed\n");
- return rv;
- }
- }
-
- // Drop notification callbacks to prevent cycles.
- mCallbacks = nsnull;
- mEventSink = nsnull;
-
- return NS_OK;
-}
-
-// void OnLDAPSearchEntry (in nsILDAPMessage aMessage);
-//
-// XXXdmose most of this function should live in nsILDAPMessage::toString()
-//
-nsresult
-nsLDAPChannel::OnLDAPSearchEntry(nsILDAPMessage *aMessage)
-{
- nsresult rv;
- nsCAutoString dn;
- nsCString entry;
-
- PR_LOG(gLDAPLogModule, PR_LOG_DEBUG, ("entry returned!\n"));
-
- // get the DN
- // XXX better err handling
- //
- rv = aMessage->GetDn(dn);
- NS_ENSURE_SUCCESS(rv, rv);
-
- entry.SetCapacity(256);
- entry = NS_LITERAL_CSTRING("dn: ") + dn + NS_LITERAL_CSTRING("\n");
-
- char **attrs;
- PRUint32 attrCount;
-
- // get an array of all the attribute names
- // XXX better error-handling
- //
- rv = aMessage->GetAttributes(&attrCount, &attrs);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // XXX is this an error? should log in non-debug console too?
- //
- if (!attrCount) {
- NS_WARNING("Warning: entry received with no attributes");
- }
-
- // iterate through the attributes
- //
- for ( PRUint32 i=0 ; i < attrCount ; i++ ) {
-
- PRUnichar **vals;
- PRUint32 valueCount;
-
- // get the values of this attribute
- // XXX better failure handling
- //
- rv = aMessage->GetValues(attrs[i], &valueCount, &vals);
- if (NS_FAILED(rv)) {
- NS_WARNING("nsLDAPChannel:OnLDAPSearchEntry(): "
- "aMessage->GetValues() failed\n");
- NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(attrCount, attrs);
- return rv;;
- }
-
- // print all values of this attribute
- //
- for ( PRUint32 j=0 ; j < valueCount; j++ ) {
- entry.Append(attrs[i]);
- entry.Append(": ");
- AppendUTF16toUTF8(vals[j], entry);
- entry.Append('\n');
- }
- NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(valueCount, vals);
-
- }
- NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(attrCount, attrs);
-
- // XXXdmose better error handling
- //
- if (NS_FAILED(rv)) {
- PR_LOG(gLDAPLogModule, PR_LOG_ERROR,
- ("aMessage: error getting attribute\n"));
- return rv;
- }
-
- // separate this entry from the next
- //
- entry.Append('\n');
-
- // do the write
- // XXX better err handling
- //
- PRUint32 bytesWritten = 0;
- PRUint32 entryLength = entry.Length();
-
- rv = mReadPipeOut->Write(entry.get(), entryLength, &bytesWritten);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // short writes shouldn't happen on blocking pipes!
- // XXX runtime error handling too
- //
- NS_ASSERTION(bytesWritten == entryLength,
- "nsLDAPChannel::OnLDAPSearchEntry(): "
- "internal error: blocking pipe returned a short write");
-
- // XXXdmose deal more gracefully with an error here
- //
- rv = mListener->OnDataAvailable(this, mResponseContext, mReadPipeIn,
- mReadPipeOffset, entryLength);
- NS_ENSURE_SUCCESS(rv, rv);
-
- mReadPipeOffset += entryLength;
-
- return NS_OK;
-}
deleted file mode 100644
--- a/ldap/xpcom/base/src/nsLDAPChannel.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the mozilla.org LDAP XPCOM SDK.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Dan Mosedale <dmose@mozilla.org>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsLDAPChannel_h__
-#define nsLDAPChannel_h__
-
-#include "nsCOMPtr.h"
-#include "nsIRunnable.h"
-#include "nsIThread.h"
-#include "nsIChannel.h"
-#include "nsILoadGroup.h"
-#include "nsIInputStream.h"
-#include "nsIOutputStream.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIStreamListener.h"
-#include "nsILDAPConnection.h"
-#include "nsILDAPOperation.h"
-#include "nsILDAPMessageListener.h"
-#include "nsIProgressEventSink.h"
-#include "nsILDAPURL.h"
-
-// if the code related to the following #define ever gets removed, also
-// be sure to remove mCallback as well as the most (but not all) of the
-// various mUnproxied stuff
-//
-#define INVOKE_LDAP_CALLBACKS_ON_MAIN_THREAD 0
-
-// {97cce72b-8ce9-466e-b21d-05da7c1e02a6}
-#define NS_LDAPCHANNEL_CID \
- { 0x97cce72b, 0x8ce9, 0x466e, \
- { 0xb2, 0x1d, 0x05, 0xda, 0x7c, 0x1e, 0x02, 0xa6 } }
-
-class nsLDAPChannel : public nsIChannel, public nsILDAPMessageListener
-{
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIREQUEST
- NS_DECL_NSICHANNEL
- NS_DECL_NSILDAPMESSAGELISTENER
-
- nsLDAPChannel();
- virtual ~nsLDAPChannel();
-
- nsresult Init(nsIURI *uri);
-
- // this actually only gets called by nsLDAPHandler::NewChannel()
- //
- static NS_METHOD
- Create(nsISupports* aOuter, REFNSIID aIID, void **aResult);
-
- protected:
-
- // these are internal functions, called by the dispatcher function
- // OnLDAPMessage()
- //
- nsresult OnLDAPSearchResult(nsILDAPMessage *aMessage);
- nsresult OnLDAPSearchEntry(nsILDAPMessage *aMessage);
- nsresult OnLDAPBind(nsILDAPMessage *aMessage);
-
- // instance vars for read/write nsIChannel attributes
- //
- nsresult mStatus;
- nsCOMPtr<nsIURI> mURI; // the URI we're processing
- nsCOMPtr<nsILoadGroup> mUnproxiedLoadGroup; // the load group we belong to
- nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
- nsCOMPtr<nsIURI> mOriginalURI; // the URI we started processing
- nsLoadFlags mLoadFlags; // load attributes for this channel
- nsCOMPtr<nsISupports> mOwner; // entity responsible for this channel
-
- // various other instance vars
- //
- nsCOMPtr<nsIStreamListener> mUnproxiedListener; // for calls on main thread
- nsCOMPtr<nsILoadGroup> mLoadGroup; // possibly an nsISupports proxy
- nsCOMPtr<nsILDAPConnection> mConnection; // LDAP connection
- nsCOMPtr<nsIStreamListener> mListener; // for calls on LDAP callback thread
- // which _might_ be the main thread
- nsCOMPtr<nsISupports> mResponseContext;
- nsCOMPtr<nsIInputStream> mReadPipeIn; // this end given to the listener
- nsCOMPtr<nsIOutputStream> mReadPipeOut; // for writes from the channel
- nsCOMPtr<nsILDAPOperation> mCurrentOperation; // current ldap operation
- PRUint32 mReadPipeOffset; // how many bytes written so far?
- PRBool mReadPipeClosed; // has the pipe already been closed?
- nsCOMPtr<nsILDAPMessageListener> mCallback; // callback
- nsCOMPtr<nsIProgressEventSink> mEventSink; // fire status against this
-
-};
-
-#endif // nsLDAPChannel_h__
deleted file mode 100644
--- a/ldap/xpcom/datasource/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the mozilla.org LDAP XPCOM SDK.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Dan Mosedale <dmose@mozilla.org>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = ../../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXTRA_COMPONENTS = nsLDAPDataSource.manifest nsLDAPDataSource.js
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/ldap/xpcom/datasource/nsLDAPDataSource.js
+++ /dev/null
@@ -1,1462 +0,0 @@
-/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the mozilla.org LDAP RDF datasource.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Dan Mosedale <dmose@mozilla.org>
- * Brendan Eich <brendan@mozilla.org>
- * Peter Van der Beken <peter.vanderbeken@pandora.be>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const DEBUG = true;
-
-// core RDF schema
-//
-const RDF_NAMESPACE_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-const NC_NAMESPACE_URI = "http://home.netscape.com/NC-rdf#";
-const LDAPATTR_NAMESPACE_URI = "http://www.mozilla.org/LDAPATTR-rdf#";
-
-// RDF-specific success nsresults
-//
-const NS_ERROR_RDF_BASE = 0x804f0000; // XXX is this right?
-const NS_RDF_CURSOR_EMPTY = NS_ERROR_RDF_BASE + 1;
-const NS_RDF_NO_VALUE = NS_ERROR_RDF_BASE + 2;
-const NS_RDF_ASSERTION_ACCEPTED = Components.results.NS_OK;
-const NS_RDF_ASSERTION_REJECTED = NS_ERROR_RDF_BASE + 3;
-
-// Scope constants
-//
-const SCOPE_BASE = Components.interfaces.nsILDAPURL.SCOPE_BASE;
-const SCOPE_ONELEVEL = Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL;
-const SCOPE_SUBTREE = Components.interfaces.nsILDAPURL.SCOPE_SUBTREE;
-
-// Types of delegates
-const MESSAGE = 1;
-const FLAT_LIST = 2;
-const RECURSIVE_LIST = 3;
-
-// ArrayEnumerator courtesy of Brendan Eich <brendan@mozilla.org>
-//
-function ArrayEnumerator(array) {
- this.array = array;
- this.index = 0;
-}
-ArrayEnumerator.prototype = {
- hasMoreElements: function() { return this.index < this.array.length; },
- getNext: function () { return (this.index < this.array.length) ?
- this.array[this.index++] : null; }
-}
-
-// nsISupportsArrayEnumerator
-//
-function nsISupportsArrayEnumerator(array) {
- this.array = array;
- this.index = 0;
-}
-nsISupportsArrayEnumerator.prototype = {
- hasMoreElements: function() { return this.index < this.array.Count(); },
- getNext: function () { return (this.index < this.array.Count()) ?
- this.array.GetElementAt(this.index++) : null; }
-}
-
-/**
- * getProxyOnUIThread returns a proxy to aObject on the main (UI) thread.
- * We need this because the RDF service should only be used on the main
- * thread. Moreover, the RDF classes aren't (marked as?) thread-safe, so
- * any objects we create using the RDF service should only be used on the
- * main thread.
- */
-function getProxyOnUIThread(aObject, aInterface) {
- var eventQSvc = Components.
- classes["@mozilla.org/event-queue-service;1"].
- getService(Components.interfaces.nsIEventQueueService);
- var uiQueue = eventQSvc.
- getSpecialEventQueue(Components.interfaces.
- nsIEventQueueService.UI_THREAD_EVENT_QUEUE);
- var proxyMgr = Components.
- classes["@mozilla.org/xpcomproxy;1"].
- getService(Components.interfaces.nsIProxyObjectManager);
-
- return proxyMgr.getProxyForObject(uiQueue,
- aInterface, aObject, 5);
- // 5 == PROXY_ALWAYS | PROXY_SYNC
-}
-
-
-// the datasource object itself
-//
-const NS_LDAPDATASOURCE_CONTRACTID =
- '@mozilla.org/rdf/datasource;1?name=ldap';
-const NS_LDAPDATASOURCE_CID =
- Components.ID('{8da18684-6486-4a7e-b261-35331f3e7163}');
-
-function nsLDAPDataSource() {}
-
-nsLDAPDataSource.prototype = {
-
- // who is watching us; XXX ok to use new Array?
- mObserverList: new Array(),
-
- // RDF property constants.
- //
- // XXXdmose - can these can actually be statics (ie JS class
- // properties rather than JS instance properties)? or would that
- // make it hard for the datasource and/or component to be GCed?
- //
- kRDF_instanceOf: {},
- kNC_DN: {},
- kNC_child: {},
- kNC_recursiveChild: {},
-
- mRdfSvc: {},
-
- // since we implement multiple interfaces, we have to provide QI
- //
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIRDFDataSource) ||
- iid.equals(Components.interfaces.nsIRDFRemoteDataSource) ||
- iid.equals(Components.interfaces.nsIRDFObserver))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- /**
- * nsIRDFRemoteDataSource
- */
-
- /**
- * This value is <code>true</code> when the datasource has
- * fully loaded itself.
- */
- get loaded() {
- debug("getter for loaded called\n");
- // We're never fully loaded
- return false;
- },
-
- /**
- * Specify the URI for the data source: this is the prefix
- * that will be used to register the data source in the
- * data source registry.
- * @param aURI the URI to load
- */
- Init: function(aURI)
- {
- if (DEBUG) {
- dump("Init() called with args: \n\t" + aURI + "\n\n");
- }
-
- // XXX - if this a "single-connection" datasource
- // (ie non-anonymous to a specific server); we should figure
- // that out here by noticing that there is a ; after "rdf:ldap", and
- // that after that there is a cookie which happens to be an LDAP URL
- // designating the connection. for now, we just assume that this will
- // be a "universal" (anonymous to any & all servers) datasource.
- //
- // XXX rayw changed the delimiter char; it's not a ; any more.
- // I think it might be ? now. He or waterson would know. The code
- // that knows about this is somewhere in rdf, perhaps in the XUL
- // template builder.
-
- // get the RDF service
- //
- this.mRdfSvc = Components.
- classes["@mozilla.org/rdf/rdf-service;1"].
- getService(Components.interfaces.nsIRDFService);
-
- // get some RDF Resources that we'll need
- //
- this.kRDF_instanceOf = this.mRdfSvc.GetResource(RDF_NAMESPACE_URI +
- "instanceOf");
- this.kNC_DN = this.mRdfSvc.GetResource(NC_NAMESPACE_URI + "DN");
- this.kNC_child = this.mRdfSvc.GetResource(NC_NAMESPACE_URI + "child");
- this.kNC_recursiveChild = this.mRdfSvc.GetResource(NC_NAMESPACE_URI +
- "recursiveChild");
-
- return;
- },
-
- /**
- * Refresh the remote datasource, re-loading its contents
- * from the URI.
- *
- * @param aBlocking If <code>true</code>, the call will block
- * until the datasource has completely reloaded.
- */
- Refresh: function(aBlocking)
- {
- if (DEBUG) {
- dump("Refresh() called with args: \n\t" + aBlocking + "\n\n");
- }
- return;
- },
-
- /**
- * Request that a data source write it's contents out to
- * permanent storage, if applicable.
- */
- Flush: function()
- {
- if (DEBUG) {
- dump("Flush() called\n\n");
- }
- return;
- },
-
- /**
- * nsIRDFDataSource
- */
-
- /** Find an RDF resource that points to a given node over the
- * specified arc & truth value
- *
- * @return NS_RDF_NO_VALUE if there is no source that leads
- * to the target with the specified property.
- *
- * nsIRDFResource GetSource (in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget,
- * in boolean aTruthValue);
- */
- GetSource: function(aProperty, aTarget, aTruthValue) {
- if (DEBUG) {
- dump("GetSource() called with args: \n\t" + aProperty.Value +
- "\n\t" + aTarget.Value + "\n\t" + aTruthValue + "\n\n");
- }
-
- Components.returnCode = NS_RDF_NO_VALUE;
- return null;
- },
-
- /**
- * Find all RDF resources that point to a given node over the
- * specified arc & truth value
- *
- * @return NS_OK unless a catastrophic error occurs. If the
- * method returns NS_OK, you may assume that nsISimpleEnumerator points
- * to a valid (but possibly empty) cursor.
- *
- * nsISimpleEnumerator GetSources (in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget,
- * in boolean aTruthValue);
- */
- GetSources: function(aProperty, aTarget, aTruthValue) {
- if (DEBUG) {
- dump("GetSources() called with args: \n\t" + aProperty.Value +
- "\n\t" + aTarget.Value + "\n\t" + aTruthValue + "\n\n");
- }
-
- return new ArrayEnumerator(new Array());
- },
-
- /**
- * Find a child of that is related to the source by the given arc
- * and truth value
- *
- * @return NS_RDF_NO_VALUE if there is no target accessible from the
- * source via the specified property.
- *
- * nsIRDFNode GetTarget (in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in boolean aTruthValue);
- */
- GetTarget: function(aSource, aProperty, aTruthValue) {
- if (DEBUG) {
- dump("GetTarget() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n");
- }
-
- // We don't handle negative assertions.
- // XXX Should we? Can we?
- if (!aTruthValue) {
- Components.returnCode = NS_RDF_NO_VALUE;
- return null;
- }
-
- var delegate;
- var enumerator;
-
- if (aProperty.EqualsNode(this.kNC_child)
- || aProperty.EqualsNode(this.kNC_recursiveChild)) {
- // Find a child or recursiveChild. Get the messagelist delegate
- // (flat for child, recursive for recursiveChild) for aSource and
- // return the first element of the list, if available.
- var listType = (aProperty.EqualsNode(this.kNC_child) ?
- "flat.messagelist.ldap" :
- "recursive.messagelist.ldap");
- try {
- delegate = aSource.GetDelegate(listType,
- Components.interfaces.nsISupportsArray);
- }
- catch (e) {
- }
- if (delegate != null) {
- try {
- var target = delegate.QueryElementAt(0,
- Components.interfaces.nsIRDFNode);
- return target;
- }
- catch (e) {
- }
- }
- }
- else if (aProperty.EqualsNode(this.kNC_DN)) {
- // Find the DN arc. Get the message delegate for aSource
- // and return the resource for the dn property of the message,
- // if available.
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- return this.mRdfSvc.GetResource(delegate.dn);
- }
- }
- else {
- // Find a different arc. See if we're looking for an LDAP attribute
- // arc. If so, get the message delegate for aSource, if we find one
- // get the attribute array for the specified LDAP attribute and
- // return the first value if it isn't empty.
- var refStart = aProperty.Value.indexOf("#");
- if (aProperty.Value.slice(0, refStart + 1) ==
- LDAPATTR_NAMESPACE_URI) {
-
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- var attributeName = aProperty.Value.slice(refStart + 1);
- enumerator = new ArrayEnumerator(this.getAttributeArray(
- delegate, attributeName));
- if (enumerator.hasMoreElements()) {
- return enumerator.getNext();
- }
- }
- }
- }
-
- // Found nothing.
- Components.returnCode = NS_RDF_NO_VALUE;
- return null;
- },
-
- /**
- * Find all children of that are related to the source by the given arc
- * arc and truth value.
- *
- * @return NS_OK unless a catastrophic error occurs. If the
- * method returns NS_OK, you may assume that nsISimpleEnumerator points
- * to a valid (but possibly empty) cursor.
- *
- * nsISimpleEnumerator GetTargets (in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in boolean aTruthValue);
- */
- GetTargets: function(aSource, aProperty, aTruthValue) {
- if (DEBUG) {
- dump("GetTargets() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n");
- }
-
- // We don't handle negative assertions.
- // XXX Should we? Can we?
- if (!aTruthValue) {
- return new ArrayEnumerator(new Array());
- }
-
- var delegate;
-
- if (aProperty.EqualsNode(this.kNC_child)
- || aProperty.EqualsNode(this.kNC_recursiveChild)) {
- // Find children or recursiveChildren. Get the messagelist delegate
- // (flat for child, recursive for recursiveChild) for aSource and
- // return an enumerator for the list, if available.
- var listType = (aProperty.EqualsNode(this.kNC_child) ?
- "flat.messagelist.ldap" :
- "recursive.messagelist.ldap");
- try {
- delegate = aSource.GetDelegate(listType,
- Components.interfaces.nsISupportsArray);
- }
- catch (e) {
- }
- if (delegate != null) {
- return new nsISupportsArrayEnumerator(delegate);
- }
- }
- else if (aProperty.EqualsNode(this.kNC_DN)) {
- // Find the DN arc. Get the message delegate for aSource
- // and return the resource for the dn property of the message,
- // if available.
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- return this.mRdfSvc.GetResource(delegate.dn);
- }
- }
- else {
- // Find a different arc. See if we're looking for an LDAP attribute
- // arc. If so, get the message delegate for aSource, if we find one
- // get the attribute array for the specified LDAP attribute and
- // an enumerator for the array.
- var refStart = aProperty.Value.indexOf("#");
- if (aProperty.Value.slice(0, refStart + 1) ==
- LDAPATTR_NAMESPACE_URI) {
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- var attributeName = aProperty.Value.slice(refStart + 1);
- return new ArrayEnumerator(
- this.getAttributeArray(delegate, attributeName));
- }
- }
- }
-
- // Found nothing, return enumerator for empty array.
- return new ArrayEnumerator(new Array());
- },
-
- /**
- * Add an assertion to the graph.
- *
- * void Assert (in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget,
- * in boolean aTruthValue);
- */
- Assert: function(aSource, aProperty, aTarget, aTruthValue) {
- if (DEBUG) {
- dump("Assert() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTarget.Value +
- "\n\t" + aTruthValue + "\n\n");
- }
- },
-
- /**
- * Remove an assertion from the graph.
- *
- * void Unassert (in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget);
- */
- Unassert: function(aSource, aProperty, aTarget) {
- if (DEBUG) {
- dump("Unassert() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTarget.Value + "\n\n");
- }
- },
-
- /**
- * Change an assertion from
- *
- * [aSource]--[aProperty]-->[aOldTarget]
- *
- * to
- *
- * [aSource]--[aProperty]-->[aNewTarget]
- *
- * void Change (in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in nsIRDFNode aOldTarget,
- * in nsIRDFNode aNewTarget);
- */
- Change: function(aSource, aProperty, aOldTarget, aNewTarget) {
- if (DEBUG) {
- dump("Change() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aOldTarget.Value +
- "\n\t" + aNewTarget.Value + "\n\n");
- }
- },
-
- /**
- * 'Move' an assertion from
- *
- * [aOldSource]--[aProperty]-->[aTarget]
- *
- * to
- *
- * [aNewSource]--[aProperty]-->[aTarget]
- *
- * void Move (in nsIRDFResource aOldSource,
- * in nsIRDFResource aNewSource,
- * in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget);
- */
- Move: function(aOldSource, aNewSource, aProperty, aTarget) {
- if (DEBUG) {
- dump("Move() called with args: \n\t" + aOldSource.Value +
- "\n\t" + aNewSource.Value + "\n\t" + aProperty.Value +
- "\n\t" + aTarget.Value + "\n\n");
- }
- },
-
- /**
- * Query whether an assertion exists in this graph.
- *
- * boolean HasAssertion(in nsIRDFResource aSource,
- * in nsIRDFResource aProperty,
- * in nsIRDFNode aTarget,
- * in boolean aTruthValue);
- */
- HasAssertion: function(aSource, aProperty, aTarget, aTruthValue) {
- // The datasource doesn't currently use any sort of standard
- // RDF containers.
- if (aProperty.EqualsNode(this.kRDF_instanceOf)) {
- return false;
- }
-
- if (DEBUG) {
- dump("HasAssertion() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTarget.Value + "\n\t" +
- aTruthValue + "\n\n");
- }
-
- // We don't handle negative assertions.
- // XXX Should we? Can we?
- if (!aTruthValue) {
- return false;
- }
-
- var delegate;
-
- if (aProperty.EqualsNode(this.kNC_child)
- || aProperty.EqualsNode(this.kNC_recursiveChild)) {
- // Find out if aTarget is in the children or recursiveChildren of
- // aSource. Get the messagelist delegate (flat for child, recursive
- // for recursiveChild) for aSource.
- var listType = (aProperty.EqualsNode(this.kNC_child) ?
- "flat.messagelist.ldap" :
- "recursive.messagelist.ldap");
- try {
- delegate = aSource.GetDelegate(listType,
- Components.interfaces.nsISupportsArray);
- }
- catch (e) {
- }
- if (delegate != null) {
- // We have a delegate message list, loop through it and return
- // true if the target is in the list.
- var enumerator = delegate.Enumerate();
- var done = false;
- try {
- enumerator.isDone();
- }
- catch (e) {
- done = true;
- }
- while(!done) {
- var resource = enumerator.currentItem().QueryInterface(
- Components.interfaces.nsIRDFResource);
- if (resource.Value == aTarget.Value) {
- return true;
- }
- try {
- enumerator.next();
- }
- catch (e) {
- done = true;
- }
- }
- }
- }
- else if (aProperty.EqualsNode(this.kNC_DN)) {
- // Find the DN arc. Get the message delegate for aSource
- // and return the resource for the dn property of the message,
- // if available.
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- return (delegate.dn == aTarget.Value);
- }
- }
- else {
- // Find a different arc. See if we're looking for an LDAP attribute
- // arc. If so, get the message delegate for aSource, if we find one
- // get the attribute array for the specified LDAP attribute and
- // an enumerator for the array.
- var refStart = aProperty.Value.indexOf("#");
- if (aProperty.Value.slice(0, refStart + 1) ==
- LDAPATTR_NAMESPACE_URI) {
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- var attributeName = aProperty.Value.slice(refStart + 1);
- var attributeArray = this.getAttributeArray(delegate,
- attributeName);
- var attributes = new ArrayEnumerator(attributeArray);
- while (attributes.hasMoreElements()) {
- var attribute = attributes.getNext();
- if (attribute.Value == aTarget.Value) {
- return true;
- }
- }
- }
- }
- }
-
- // if we haven't returned true yet, there's nothing here
- //
- return false;
- },
-
- /**
- * Add an observer to this data source. If the datasource
- * supports observers, the datasource source should hold a strong
- * reference to the observer.
- *
- * void AddObserver(in nsIRDFObserver aObserver);
- */
- AddObserver: function(aObserver) {
- if (DEBUG) {
- dump("AddObserver() called\n\n");
- }
-
- // We need to proxy our observers on the main (UI) thread, because
- // the RDF code wants to run on the main thread.
- this.mObserverList.push(getProxyOnUIThread(aObserver,
- Components.interfaces.nsIRDFObserver));
- },
-
- /**
- * Remove an observer from this data source.
- *
- * void RemoveObserver (in nsIRDFObserver aObserver);
- */
- RemoveObserver: function(aObserver) {
- if (DEBUG) {
- dump("RemoveObserver() called" + "\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext())) {
- if (nextObserver == aObserver) {
- splice(iter.index, 1);
- }
- }
- },
-
- /**
- * Get a cursor to iterate over all the arcs that point into a node.
- *
- * @return NS_OK unless a catastrophic error occurs. If the method
- * returns NS_OK, you may assume that labels points to a valid (but
- * possible empty) nsISimpleEnumerator object.
- *
- * nsISimpleEnumerator ArcLabelsIn (in nsIRDFNode aNode);
- */
- ArcLabelsIn: function(aNode) {
- if (DEBUG) {
- dump("ArcLabelsIn() called with args: \n\t" + aNode.Value +
- "\n\n");
- }
-
- return new ArrayEnumerator(new Array());
- },
-
- /**
- * Get a cursor to iterate over all the arcs that originate in
- * a resource.
- *
- * @return NS_OK unless a catastrophic error occurs. If the method
- * returns NS_OK, you may assume that labels points to a valid (but
- * possible empty) nsISimpleEnumerator object.
- *
- * nsISimpleEnumerator ArcLabelsOut(in nsIRDFResource aSource);
- */
- ArcLabelsOut: function(aSource)
- {
- if (DEBUG) {
- dump("ArcLabelsOut() called with args: \n\t" + aSource.Value +
- "\n\n");
- }
-
- return new ArrayEnumerator(new Array());
- },
-
- /**
- * Returns true if the specified node is pointed to by the specified arc.
- * Equivalent to enumerating ArcLabelsIn and comparing for the specified
- * arc.
- *
- * boolean hasArcIn (in nsIRDFNode aNode,
- * in nsIRDFResource aArc);
- */
- hasArcIn: function(aNode, aArc)
- {
- if (DEBUG) {
- dump("hasArcIn() called with args: \n\t" + aNode.Value +
- "\n\t" + aArc.Value + "\n\n");
- }
-
- return false;
- },
-
- /**
- * Returns true if the specified node has the specified outward arc.
- * Equivalent to enumerating ArcLabelsOut and comparing for the specified
- * arc.
- *
- * boolean hasArcOut (in nsIRDFResource aSource,
- * in nsIRDFResource aArc);
- */
- hasArcOut: function(aSource, aArc)
- {
- if (DEBUG) {
- dump("hasArcOut() called with args: \n\t" + aSource.Value +
- "\n\t" + aArc.Value + "\n\n");
- }
-
- var delegate;
-
- if (aArc.EqualsNode(this.kNC_child)
- || aArc.EqualsNode(this.kNC_recursiveChild)) {
- // Find children or recursiveChildren. Get the messagelist delegate
- // (flat for child, recursive for recursiveChild) for aSource and
- // return true if we have one.
- var listType = (aArc.EqualsNode(this.kNC_child) ?
- "flat.messagelist.ldap" :
- "recursive.messagelist.ldap");
- try {
- delegate = aSource.GetDelegate(listType,
- Components.interfaces.nsISupportsArray);
- }
- catch (e) {
- }
- if (delegate != null) {
- return true;
- }
- }
- else if (aArc.EqualsNode(this.kNC_DN)) {
- // Find the DN arc. Get the message delegate for aSource
- // and return true if we have a delegate and its dn
- // attribute is non-null.
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- return (delegate != null);
- }
-
- // Find a different arc. See if we're looking for an LDAP attribute
- // arc. If so, get the message delegate for aSource, if we find one
- // get the attribute array for the specified LDAP attribute and
- // return true if it contains at least one value.
- var refStart = aArc.Value.indexOf("#");
- if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) {
- try {
- delegate = aSource.GetDelegate("message.ldap",
- Components.interfaces.nsILDAPMessage);
- }
- catch (e) {
- }
- if (delegate != null) {
- var attributeName = aArc.Value.slice(refStart + 1);
- var attributeArray = this.getAttributeArray(delegate,
- attributeName);
- if (attributeArray.length > 0) {
- return true;
- }
- }
- }
- return false;
- },
-
- /**
- * Private functions
- */
-
- onAssert: function(aDataSource, aSource, aProperty, aTarget)
- {
- if (DEBUG) {
- dump("OnAssert() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTarget.Value + "\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext()) != null) {
- nextObserver.onAssert(this, aSource, aProperty, aTarget);
- }
- },
-
- onUnassert: function(aDataSource, aSource, aProperty, aTarget)
- {
- if (DEBUG) {
- dump("onUnassert() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aTarget.Value + "\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext()) != null) {
- nextObserver.onUnassert(this, aSource, aProperty, aTarget);
- }
- },
-
- onChange: function(aDataSource, aSource, aProperty, aOldTarget, aNewTarget)
- {
- if (DEBUG) {
- dump("onChange() called with args: \n\t" + aSource.Value +
- "\n\t" + aProperty.Value + "\n\t" + aOldTarget.Value +
- "\n\t" + aNewTarget.Value + "\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext()) != null) {
- nextObserver.onChange(this, aSource, aProperty, aOldTarget, aNewTarget);
- }
- },
-
- onBeginUpdateBatch: function()
- {
- if (DEBUG) {
- dump("onBeginUpdateBatch() called\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext()) != null) {
- nextObserver.onBeginUpdateBatch(this);
- }
- },
-
- onEndUpdateBatch: function()
- {
- if (DEBUG) {
- dump("onEndUpdateBatch() called\n\n");
- }
-
- var iter = new ArrayEnumerator(this.mObserverList);
- var nextObserver;
- while ((nextObserver = iter.getNext()) != null) {
- nextObserver.onEndUpdateBatch(this);
- }
- },
-
- /**
- * Fills an array with the RDF nodes for the values of an attribute
- * out of a nsLDAPMessage.
- */
- getAttributeArray: function(aMessage, aAttributeName) {
- var resultArray = new Array();
- var valuesCount = {};
- try {
- var values = aMessage.getValues(aAttributeName, valuesCount);
- for (var j = 0; j < valuesCount.value; j++) {
- var attributeValue = this.mRdfSvc.GetLiteral(values[j]);
- resultArray.push(attributeValue);
- }
- }
- catch (e) {
- // Error or the attribute was not there.
- // XXX Do we need to do something about the real errors?
- // XXX Just returning empty array for now.
- }
- return resultArray;
- }
-}
-
-// the nsILDAPMessage associated with a given resource
-//
-const NS_LDAPMESSAGERDFDELEGATEFACTORY_CONTRACTID =
- '@mozilla.org/rdf/delegate-factory;1?key='+"message.ldap"+'&scheme=ldap'
-const NS_LDAPFLATMESSAGELISTRDFDELEGATEFACTORY_CONTRACTID =
- '@mozilla.org/rdf/delegate-factory;1?key=flat.messagelist.ldap&scheme=ldap'
-const NS_LDAPRECURSIVEMESSAGELISTRDFDELEGATEFACTORY_CONTRACTID =
- '@mozilla.org/rdf/delegate-factory;1?key=recursive.messagelist.ldap&scheme=ldap'
-const NS_LDAPMESSAGERDFDELEGATEFACTORY_CID =
- Components.ID('{4b6fb566-1dd2-11b2-a1a9-889a3f852b0b}');
-
-function nsLDAPMessageRDFDelegateFactory() {}
-
-nsLDAPMessageRDFDelegateFactory.prototype =
-{
- mRdfSvc: {},
- mLDAPSvc: {},
- mLDAPDataSource: {},
- kNC_child: {},
- kNC_recursiveChild: {},
-
- mConnection: {}, // connection to the LDAP server
- mOperation: {}, // current LDAP operation
- mMessagesHash: {}, // hash with the currently known messages
- // (hashed on URI)
- mMessagesListHash: {},
- mInProgressHash: {},
- kInited: -1,
-
- Init: function() {
- if (this.kInited == -1) {
- this.kInited = 0;
-
- // get the RDF service
- //
- this.mRdfSvc = Components.
- classes["@mozilla.org/rdf/rdf-service;1"].
- getService(Components.interfaces.nsIRDFService);
- this.mLDAPSvc = Components.
- classes["@mozilla.org/network/ldap-service;1"].
- getService(Components.interfaces.nsILDAPService);
- this.mLDAPDataSource = this.mRdfSvc.GetDataSource("rdf:ldap").
- QueryInterface(Components.interfaces.nsIRDFObserver);
-
- // get some RDF Resources that we'll need
- //
- this.kNC_child = this.mRdfSvc.GetResource(NC_NAMESPACE_URI +
- "child");
- this.kNC_recursiveChild = this.mRdfSvc.GetResource(NC_NAMESPACE_URI +
- "recursiveChild");
- }
- },
-
- QueryInterface: function(iid) {
- if (DEBUG) {
- dump("QueryInterface called\n\n");
- }
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIRDFDelegateFactory))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // from nsIRDFDelegateFactory:
- //
- // Create a delegate for the specified RDF resource.
- //
- // The created delegate should forward AddRef() and Release()
- // calls to the aOuter object.
- //
- // void CreateDelegate(in nsIRDFResource aOuter,
- // in string aKey,
- // in nsIIDRef aIID,
- // [retval, iid_is(aIID)] out nsQIResult aResult);
- CreateDelegate: function (aOuter, aKey, aIID) {
-
- function generateGetTargetsBoundCallback() {
- function getTargetsBoundCallback() {
- }
-
- getTargetsBoundCallback.prototype.QueryInterface =
- function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsILDAPMessageListener))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-
- getTargetsBoundCallback.prototype.onLDAPMessage =
- function(aMessage) {
- if (DEBUG) {
- dump("getTargetsBoundCallback.onLDAPMessage()" +
- "called with scope: \n\t" +
- aOuter.Value + "\n\n");
- }
-
- // XXX how do we deal with this in release builds?
- // XXX deal with already bound case
- //
- if (aMessage.type != aMessage.RES_BIND) {
- dump("bind failed\n");
- delete callerObject.mInProgressHash[queryURL.spec];
- return;
- }
-
- // kick off a search
- //
- var searchOp = Components.classes[
- "@mozilla.org/network/ldap-operation;1"].
- createInstance(Components.interfaces.
- nsILDAPOperation);
-
- // XXX err handling
- searchOp.init(connection,
- generateGetTargetsSearchCallback());
- // XXX err handling (also for url. accessors)
- // XXX constipate this
- // XXX real timeout
- searchOp.searchExt(queryURL.dn, queryURL.scope,
- queryURL.filter, 0, new Array(),
- 0, -1);
- }
-
- getTargetsBoundCallback.prototype.onLDAPInit =
- function(aConn, aStatus) {
- if (DEBUG) {
- dump("getTargetsBoundCallback.onLDAPInit()" +
- " called with status of " + aStatus + "\n\n");
- }
-
- // get and initialize an operation object
- //
- var operation = Components.classes
- ["@mozilla.org/network/ldap-operation;1"].
- createInstance(Components.interfaces.nsILDAPOperation);
- operation.init(connection,
- getProxyOnUIThread(this, Components.interfaces.
- nsILDAPMessageListener));
-
- caller.mInProgressHash[aOuter.Value] = 1;
-
- // bind to the server. we'll get a callback when this
- // finishes. XXX handle a password
- //
- operation.simpleBind(null);
- }
-
- return getProxyOnUIThread(new getTargetsBoundCallback(),
- Components.interfaces.nsILDAPMessageListener);
- }
-
- function generateGetTargetsSearchCallback() {
- function getTargetsSearchCallback() {
- }
-
- getTargetsSearchCallback.prototype.QueryInterface = function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsILDAPMessageListener))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- };
-
- getTargetsSearchCallback.prototype.onLDAPMessage =
- function(aMessage) {
- if (DEBUG) {
- dump("getTargetsSearchCallback() called with message" +
- " of type " + aMessage.type + "\n\n");
- }
-
- var listHash = caller.mMessagesListHash;
- if (aMessage.type == aMessage.RES_SEARCH_ENTRY) {
- if (DEBUG) {
- dump("getTargetsSearchCallback() called with " +
- "message " + aMessage.dn + " for " +
- aOuter.Value + "\n\n");
- }
-
- // Create a resource for the message we just got.
- // This is a single entry for which we'll cache the
- // nsILDAPMessage. If we got this as a result of a
- // "list" query we'll also add it to the result array.
- var newURL = Components.classes["@mozilla.org/network/ldap-url;1"]
- .createInstance(Components.interfaces.nsILDAPURL);
- newURL.spec = queryURL.spec;
- newURL.dn = aMessage.dn;
- newURL.scope = SCOPE_BASE;
- newURL.filter = "(objectClass=*)";
- var newResource =
- caller.mRdfSvc.GetResource(newURL.spec);
-
- // Add the LDAP message for the new resource in our
- // messages hashlist. We do this before adding it to
- // a query result array (when applicable), so that
- // when we onAssert this as a result for a query
- // returning multiple results, it is already cached.
- // If we wouldn't do this here, we'd start another
- // query for this resource.
- var messageHash = caller.mMessagesHash;
- if (!messageHash.hasOwnProperty(newURL.spec)) {
- messageHash[newURL.spec] = aMessage;
- }
-
- if (queryType == MESSAGE) {
- // XXX - we need to onAssert this resource. However,
- // we need to know somehow what the caller wanted
- // to use this delegate for, so that we can limit
- // the onAssert to what was asked for. This might be
- // tricky, as we'd need to keep track of multiple
- // "questions" coming in while the LDAP server
- // hasn't responded yet.
- }
- else {
- // Add the LDAP message to the result array for
- // the query resource and onAssert the result
- // as a child of the query resource.
- var queryResource =
- caller.mRdfSvc.GetResource(queryURL.spec);
- if (!listHash.hasOwnProperty(queryURL.spec)) {
- // No entry for the query resource in the
- // results hashlist, let's create one.
- listHash[queryURL.spec] = Components.classes
- ["@mozilla.org/supports-array;1"].
- createInstance(
- Components.interfaces.nsISupportsArray);
- }
- listHash[queryURL.spec].AppendElement(newResource);
- if (queryType == FLAT_LIST) {
- caller.mLDAPDataSource.onAssert(
- caller.mLDAPDataSource, aOuter,
- caller.kNC_child, newResource);
- }
- else if (queryType == RECURSIVE_LIST) {
- caller.mLDAPDataSource.onAssert(
- caller.mLDAPDataSource, queryResource,
- caller.kNC_child, newResource);
- caller.mLDAPDataSource.onAssert(
- caller.mLDAPDataSource, aOuter,
- caller.kNC_recursiveChild, newResource);
- }
- }
- }
- else if (aMessage.type == aMessage.RES_SEARCH_RESULT) {
- // We got all the results for the query.
- // If we were looking for a list, let's check if we
- // have an entry for the query resource in the result's
- // hashlist. If we don't, add an empty array to help
- // performance, otherwise we'll keep requerying for this
- // query resource.
- if (queryType == FLAT_LIST || queryType == RECURSIVE_LIST) {
- if (!listHash.hasOwnProperty(queryURL.spec)) {
- // No entry for the query resource in the
- // results hashlist, let's create an empty one.
- listHash[queryURL.spec] = Components.classes
- ["@mozilla.org/supports-array;1"].
- createInstance(
- Components.interfaces.nsISupportsArray);
- }
- }
- delete caller.mInProgressHash[queryURL.spec];
- }
- }
-
- return getProxyOnUIThread(new getTargetsSearchCallback(),
- Components.interfaces.nsILDAPMessageListener);
- }
-
- // end of closure decls; the CreateDelegate code proper begins below
-
- // XXX - We need to keep track of queries that are in progress for a
- // message too (cf. mInProgressHash for messagelist's).
- //
- if (DEBUG) {
- dump("GetDelegate() called with args: \n\t" + aOuter.Value +
- "\n\t" + aKey + "\n\t" + aIID + "\n\n");
- }
-
- var caller = this;
- var queryURL;
- var queryType;
-
- if (aKey == "message.ldap") {
- queryType = MESSAGE;
- }
- else if (aKey == "flat.messagelist.ldap") {
- queryType = FLAT_LIST;
- }
- else if (aKey == "recursive.messagelist.ldap") {
- queryType = RECURSIVE_LIST;
- }
-
- switch (queryType) {
- case MESSAGE:
- if (this.mMessagesHash.hasOwnProperty(aOuter.Value)) {
- return (this.mMessagesHash[aOuter.Value].QueryInterface(aIID));
- }
- break;
- case FLAT_LIST:
- if (this.mMessagesListHash.hasOwnProperty(aOuter.Value)) {
- return (this.mMessagesListHash[aOuter.Value].QueryInterface(aIID));
- }
- break;
- case RECURSIVE_LIST:
- queryURL = Components.classes["@mozilla.org/network/ldap-url;1"]
- .createInstance(Components.interfaces.nsILDAPURL);
- queryURL.spec = aOuter.Value;
- if (queryURL.scope == SCOPE_BASE) {
- // Retarget the URL, asking for recursive children on
- // a base URL should descend, so we do a one-level search.
- queryURL.scope = SCOPE_ONELEVEL;
- }
- if (this.mMessagesListHash.hasOwnProperty(queryURL.spec)) {
- return (this.mMessagesListHash[queryURL.spec].QueryInterface(aIID));
- }
- break;
- }
-
- if (queryURL == null) {
- queryURL = Components.classes["@mozilla.org/network/ldap-url;1"]
- .createInstance(Components.interfaces.nsILDAPURL);
- queryURL.spec = aOuter.Value;
- }
-
- // make sure that this if this URL is for a messagelist, it
- // represents something other than a base search
- //
- if ((queryType == FLAT_LIST) && (queryURL.scope == SCOPE_BASE)) {
- if (DEBUG) {
- dump("Early return, asking for a list of children for an " +
- "URL with a BASE scope\n\n");
- }
- throw Components.results.NS_ERROR_FAILURE;
- }
-
- if (!this.mInProgressHash.hasOwnProperty(queryURL.spec)) {
- this.Init();
-
- // XXX - not sure what this should be
- var key = queryURL.host + ":" + queryURL.port;
-
- // Get the LDAP service and request a connection to the server from
- // the service
- var server;
- try {
- server = this.mLDAPSvc.getServer(key);
- }
- catch (e) {
- }
- if (!server) {
- // Create a server object and let the service know about it
- // XXX - not sure if I initialize enough here
- server = Components.classes
- ["@mozilla.org/network/ldap-server;1"].
- createInstance(Components.interfaces.nsILDAPServer);
- server.key = key;
- server.url = queryURL;
- this.mLDAPSvc.addServer(server);
- }
-
- // Mark this URL as being in progress, to avoid requerying for the
- // same URL
- this.mInProgressHash[queryURL.spec] = 1;
-
- // get a connection object
- //
- var connection = Components.classes
- ["@mozilla.org/network/ldap-connection;1"].
- createInstance(Components.interfaces.nsILDAPConnection);
- connection.init(queryURL.host, queryURL.port, null,
- generateGetTargetsBoundCallback(), null,
- Components.interfaces.nsILDAPConnection.VERSION3);
-
- // XXXdmose - in this case, we almost certainly shouldn't be
- // falling through to an error case, but instead returning
- // something reasonable, since this is actually a success
- // condition
- //
- debug("falling through!\n");
- }
-
- throw Components.results.NS_ERROR_FAILURE;
- }
-
-}
-
-
-// the nsILDAPURL associated with a given resource
-//
-const NS_LDAPURLRDFDELEGATEFACTORY_CONTRACTID =
- '@mozilla.org/rdf/delegate-factory/url.ldap;1';
-const NS_LDAPURLRDFDELEGATEFACTORY_CID =
- Components.ID('b6048700-1dd1-11b2-ae88-a5e18bb1f25e');
-
-function nsLDAPURLRDFDelegateFactory() {}
-
-nsLDAPURLRDFDelegateFactory.prototype =
-{
- // from nsIRDFDelegateFactory:
- //
- // Create a delegate for the specified RDF resource.
- //
- // The created delegate should forward AddRef() and Release()
- // calls to the aOuter object.
- //
- // void CreateDelegate(in nsIRDFResource aOuter,
- // in string aKey,
- // in nsIIDRef aIID,
- // [retval, iid_is(aIID)] out nsQIResult aResult);
- CreateDelegate: function (aOuter, aKey, aIID) {
- }
-}
-
-// the nsILDAPConnection associated with a given resource
-//
-const NS_LDAPCONNECTIONRDFDELEGATEFACTORY_CONTRACTID =
- '@mozilla.org/rdf/delegate-factory/connection.ldap;1';
-const NS_LDAPCONNECTIONRDFDELEGATEFACTORY_CID =
- Components.ID('57075fc6-1dd2-11b2-9df5-dbb9111d1b38');
-
-function nsLDAPConnectionRDFDelegateFactory() {}
-
-nsLDAPConnectionRDFDelegateFactory.prototype =
-{
- // from nsIRDFDelegateFactory:
- //
- // Create a delegate for the specified RDF resource.
- //
- // The created delegate should forward AddRef() and Release()
- // calls to the aOuter object.
- //
- // void CreateDelegate(in nsIRDFResource aOuter,
- // in string aKey,
- // in nsIIDRef aIID,
- // [retval, iid_is(aIID)] out nsQIResult aResult);
- CreateDelegate: function (aOuter, aKey, aIID) {
- }
-}
-
-var Datasource = null;
-var MessageDelegateFactory = null;
-
-// nsLDAPDataSource Module (for XPCOM registration)
-//
-var nsLDAPDataSourceModule = {
-
- registerSelf: function (compMgr, fileSpec, location, type) {
- debug("*** Registering LDAP datasource components" +
- " (all right -- a JavaScript module!)\n");
-
- compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(
- NS_LDAPDATASOURCE_CID,
- 'LDAP RDF DataSource',
- NS_LDAPDATASOURCE_CONTRACTID,
- fileSpec, location,
- type);
-
- compMgr.registerFactoryLocation(
- NS_LDAPMESSAGERDFDELEGATEFACTORY_CID,
- 'LDAP Message RDF Delegate',
- NS_LDAPMESSAGERDFDELEGATEFACTORY_CONTRACTID,
- fileSpec, location,
- type);
-
- compMgr.registerFactoryLocation(
- NS_LDAPMESSAGERDFDELEGATEFACTORY_CID,
- 'LDAP Flat MessageList RDF Delegate',
- NS_LDAPFLATMESSAGELISTRDFDELEGATEFACTORY_CONTRACTID,
- fileSpec, location,
- type);
-
- compMgr.registerFactoryLocation(
- NS_LDAPMESSAGERDFDELEGATEFACTORY_CID,
- 'LDAP Recursive MessageList RDF Delegate',
- NS_LDAPRECURSIVEMESSAGELISTRDFDELEGATEFACTORY_CONTRACTID,
- fileSpec, location,
- type);
-
- compMgr.registerFactoryLocation(
- NS_LDAPURLRDFDELEGATEFACTORY_CID,
- 'LDAP URL RDF Delegate',
- NS_LDAPURLRDFDELEGATEFACTORY_CONTRACTID,
- fileSpec, location,
- type);
- },
-
- getClassObject: function(compMgr, cid, iid) {
- if (!iid.equals(Components.interfaces.nsIFactory)) {
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- }
-
- if (cid.equals(NS_LDAPDATASOURCE_CID))
- return this.nsLDAPDataSourceFactory;
- else if (cid.equals(NS_LDAPMESSAGERDFDELEGATEFACTORY_CID))
- return this.nsLDAPMessageRDFDelegateFactoryFactory;
- else if (cid.equals(NS_LDAPURLRDFDELEGATEFACTORY_CID))
- return this.nsLDAPURLRDFDelegateFactoryFactory;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- nsLDAPDataSourceFactory: {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- if (Datasource == null) {
- Datasource = new nsLDAPDataSource();
- }
-
- return Datasource.QueryInterface(iid);
- }
- },
-
- nsLDAPMessageRDFDelegateFactoryFactory: {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- if (MessageDelegateFactory == null) {
- MessageDelegateFactory = new nsLDAPMessageRDFDelegateFactory();
- }
-
- return MessageDelegateFactory.QueryInterface(iid);
- }
- },
-
- nsLDAPURLRDFDelegateFactoryFactory: {
- createInstance: function(outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
-
- return (new nsLDAPURLRDFDelegateFactory()).QueryInterface(iid);
- }
- },
-
- // because of the way JS components work (the JS garbage-collector
- // keeps track of all the memory refs and won't unload until appropriate)
- // this ends up being a dummy function; it can always return true.
- //
- canUnload: function(compMgr) { return true; }
-};
-
-function NSGetModule(compMgr, fileSpec) { return nsLDAPDataSourceModule; }
rename from ldap/xpcom/base/public/Makefile.in
rename to ldap/xpcom/public/Makefile.in
--- a/ldap/xpcom/base/public/Makefile.in
+++ b/ldap/xpcom/public/Makefile.in
@@ -31,17 +31,17 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
-DEPTH = ../../../..
+DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = mozldap
XPIDL_MODULE = mozldap
@@ -60,15 +60,10 @@ XPIDLSRCS = \
nsILDAPBERElement.idl \
nsILDAPModification.idl \
$(NULL)
ifdef MOZ_PREF_EXTENSIONS
XPIDLSRCS += nsILDAPSyncQuery.idl
endif
-ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-XPIDLSRCS += \
- $(NULL)
-endif
-
include $(topsrcdir)/config/rules.mk
rename from ldap/xpcom/base/public/nsILDAPBERElement.idl
rename to ldap/xpcom/public/nsILDAPBERElement.idl
rename from ldap/xpcom/base/public/nsILDAPBERValue.idl
rename to ldap/xpcom/public/nsILDAPBERValue.idl
rename from ldap/xpcom/base/public/nsILDAPConnection.idl
rename to ldap/xpcom/public/nsILDAPConnection.idl
rename from ldap/xpcom/base/public/nsILDAPControl.idl
rename to ldap/xpcom/public/nsILDAPControl.idl
rename from ldap/xpcom/base/public/nsILDAPErrors.idl
rename to ldap/xpcom/public/nsILDAPErrors.idl
rename from ldap/xpcom/base/public/nsILDAPMessage.idl
rename to ldap/xpcom/public/nsILDAPMessage.idl
rename from ldap/xpcom/base/public/nsILDAPMessageListener.idl
rename to ldap/xpcom/public/nsILDAPMessageListener.idl
rename from ldap/xpcom/base/public/nsILDAPModification.idl
rename to ldap/xpcom/public/nsILDAPModification.idl
rename from ldap/xpcom/base/public/nsILDAPOperation.idl
rename to ldap/xpcom/public/nsILDAPOperation.idl
rename from ldap/xpcom/base/public/nsILDAPServer.idl
rename to ldap/xpcom/public/nsILDAPServer.idl
rename from ldap/xpcom/base/public/nsILDAPService.idl
rename to ldap/xpcom/public/nsILDAPService.idl
rename from ldap/xpcom/base/public/nsILDAPSyncQuery.idl
rename to ldap/xpcom/public/nsILDAPSyncQuery.idl
rename from ldap/xpcom/base/public/nsILDAPURL.idl
rename to ldap/xpcom/public/nsILDAPURL.idl
rename from ldap/xpcom/base/src/Makefile.in
rename to ldap/xpcom/src/Makefile.in
--- a/ldap/xpcom/base/src/Makefile.in
+++ b/ldap/xpcom/src/Makefile.in
@@ -31,17 +31,17 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
-DEPTH = ../../../..
+DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = mozldap
LIBRARY_NAME = mozldap
@@ -71,30 +71,20 @@ CPPSRCS = \
$(NULL)
ifdef MOZ_PREF_EXTENSIONS
DEFINES += -DMOZ_PREF_EXTENSIONS
CPPSRCS += nsLDAPSyncQuery.cpp
endif
-ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-DEFINES += -DMOZ_LDAP_XPCOM_EXPERIMENTAL
-
-CPPSRCS += \
- nsLDAPChannel.cpp \
- $(NULL)
-
-endif
-
ifdef MOZ_PSM
DEFINES += -DMOZ_PSM
CPPSRCS += \
nsLDAPSecurityGlue.cpp \
$(NULL)
endif
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(LDAP_LIBS)
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = $(LDAP_CFLAGS)
-
rename from ldap/xpcom/base/src/ldapComponents.manifest
rename to ldap/xpcom/src/ldapComponents.manifest
rename from ldap/xpcom/base/src/nsLDAPBERElement.cpp
rename to ldap/xpcom/src/nsLDAPBERElement.cpp
rename from ldap/xpcom/base/src/nsLDAPBERElement.h
rename to ldap/xpcom/src/nsLDAPBERElement.h
rename from ldap/xpcom/base/src/nsLDAPBERValue.cpp
rename to ldap/xpcom/src/nsLDAPBERValue.cpp
rename from ldap/xpcom/base/src/nsLDAPBERValue.h
rename to ldap/xpcom/src/nsLDAPBERValue.h
rename from ldap/xpcom/base/src/nsLDAPConnection.cpp
rename to ldap/xpcom/src/nsLDAPConnection.cpp
rename from ldap/xpcom/base/src/nsLDAPConnection.h
rename to ldap/xpcom/src/nsLDAPConnection.h
rename from ldap/xpcom/base/src/nsLDAPControl.cpp
rename to ldap/xpcom/src/nsLDAPControl.cpp
rename from ldap/xpcom/base/src/nsLDAPControl.h
rename to ldap/xpcom/src/nsLDAPControl.h
rename from ldap/xpcom/base/src/nsLDAPInternal.h
rename to ldap/xpcom/src/nsLDAPInternal.h
rename from ldap/xpcom/base/src/nsLDAPMessage.cpp
rename to ldap/xpcom/src/nsLDAPMessage.cpp
rename from ldap/xpcom/base/src/nsLDAPMessage.h
rename to ldap/xpcom/src/nsLDAPMessage.h
rename from ldap/xpcom/base/src/nsLDAPModification.cpp
rename to ldap/xpcom/src/nsLDAPModification.cpp
rename from ldap/xpcom/base/src/nsLDAPModification.h
rename to ldap/xpcom/src/nsLDAPModification.h
rename from ldap/xpcom/base/src/nsLDAPOperation.cpp
rename to ldap/xpcom/src/nsLDAPOperation.cpp
rename from ldap/xpcom/base/src/nsLDAPOperation.h
rename to ldap/xpcom/src/nsLDAPOperation.h
rename from ldap/xpcom/base/src/nsLDAPProtocolHandler.js
rename to ldap/xpcom/src/nsLDAPProtocolHandler.js
rename from ldap/xpcom/base/src/nsLDAPProtocolModule.cpp
rename to ldap/xpcom/src/nsLDAPProtocolModule.cpp
--- a/ldap/xpcom/base/src/nsLDAPProtocolModule.cpp
+++ b/ldap/xpcom/src/nsLDAPProtocolModule.cpp
@@ -52,51 +52,41 @@
#include "nsLDAPBERValue.h"
#include "nsLDAPBERElement.h"
#include "nsLDAPControl.h"
#ifdef MOZ_PREF_EXTENSIONS
#include "nsLDAPSyncQuery.h"
#endif
#include "ldappr.h"
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-#include "nsLDAPChannel.h"
-#endif
-
// use the default constructor
//
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPConnection)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPOperation)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPMessage)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLDAPModification, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPServer)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPURL)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLDAPService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPBERValue)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPBERElement)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPControl)
#ifdef MOZ_PREF_EXTENSIONS
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPSyncQuery)
#endif
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPChannel)
-#endif
NS_DEFINE_NAMED_CID(NS_LDAPCONNECTION_CID);
NS_DEFINE_NAMED_CID(NS_LDAPOPERATION_CID);
NS_DEFINE_NAMED_CID(NS_LDAPMESSAGE_CID);
NS_DEFINE_NAMED_CID(NS_LDAPMODIFICATION_CID);
NS_DEFINE_NAMED_CID(NS_LDAPSERVER_CID);
NS_DEFINE_NAMED_CID(NS_LDAPSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_LDAPURL_CID);
NS_DEFINE_NAMED_CID(NS_LDAPBERVALUE_CID);
NS_DEFINE_NAMED_CID(NS_LDAPBERELEMENT_CID);
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-NS_DEFINE_NAMED_CID(NS_LDAPCHANNEL_CID);
-#endif
#ifdef MOZ_PREF_EXTENSIONS
NS_DEFINE_NAMED_CID(NS_LDAPSYNCQUERY_CID);
#endif
NS_DEFINE_NAMED_CID(NS_LDAPCONTROL_CID);
// a table of the CIDs implemented by this module
//
@@ -105,19 +95,16 @@ const mozilla::Module::CIDEntry kLDAPPro
{ &kNS_LDAPOPERATION_CID, false, NULL, nsLDAPOperationConstructor},
{ &kNS_LDAPMESSAGE_CID, false, NULL, nsLDAPMessageConstructor},
{ &kNS_LDAPMODIFICATION_CID, false, NULL, nsLDAPModificationConstructor},
{ &kNS_LDAPSERVER_CID, false, NULL, nsLDAPServerConstructor},
{ &kNS_LDAPSERVICE_CID, false, NULL, nsLDAPServiceConstructor},
{ &kNS_LDAPURL_CID, false, NULL, nsLDAPURLConstructor},
{ &kNS_LDAPBERVALUE_CID, false, NULL, nsLDAPBERValueConstructor},
{ &kNS_LDAPBERELEMENT_CID, false, NULL, nsLDAPBERElementConstructor},
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
- { &kNS_LDAPCHANNEL_CID, false, NULL, nsLDAPChannelConstructor},
-#endif
#ifdef MOZ_PREF_EXTENSIONS
{ &kNS_LDAPSYNCQUERY_CID, false, NULL, nsLDAPSyncQueryConstructor},
#endif
{ &kNS_LDAPCONTROL_CID, false, NULL, nsLDAPControlConstructor},
{ NULL }
};
@@ -126,19 +113,16 @@ const mozilla::Module::ContractIDEntry k
{ "@mozilla.org/network/ldap-operation;1", &kNS_LDAPOPERATION_CID},
{ "@mozilla.org/network/ldap-message;1", &kNS_LDAPMESSAGE_CID},
{ "@mozilla.org/network/ldap-modification;1", &kNS_LDAPMODIFICATION_CID},
{ "@mozilla.org/network/ldap-server;1", &kNS_LDAPSERVER_CID},
{ "@mozilla.org/network/ldap-service;1", &kNS_LDAPSERVICE_CID},
{ "@mozilla.org/network/ldap-url;1", &kNS_LDAPURL_CID},
{ "@mozilla.org/network/ldap-ber-value;1", &kNS_LDAPBERVALUE_CID},
{ "@mozilla.org/network/ldap-ber-element;1", &kNS_LDAPBERELEMENT_CID},
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
- { "@mozilla.org/network/ldap-channel;1", &kNS_LDAPCHANNEL_CID},
-#endif
#ifdef MOZ_PREF_EXTENSIONS
{ "@mozilla.org/ldapsyncquery;1", &kNS_LDAPSYNCQUERY_CID},
#endif
{ "@mozilla.org/network/ldap-control;1", &kNS_LDAPCONTROL_CID},
{ NULL }
};
static nsresult
rename from ldap/xpcom/base/src/nsLDAPSecurityGlue.cpp
rename to ldap/xpcom/src/nsLDAPSecurityGlue.cpp
rename from ldap/xpcom/base/src/nsLDAPServer.cpp
rename to ldap/xpcom/src/nsLDAPServer.cpp
rename from ldap/xpcom/base/src/nsLDAPServer.h
rename to ldap/xpcom/src/nsLDAPServer.h
rename from ldap/xpcom/base/src/nsLDAPService.cpp
rename to ldap/xpcom/src/nsLDAPService.cpp
rename from ldap/xpcom/base/src/nsLDAPService.h
rename to ldap/xpcom/src/nsLDAPService.h
rename from ldap/xpcom/base/src/nsLDAPSyncQuery.cpp
rename to ldap/xpcom/src/nsLDAPSyncQuery.cpp
rename from ldap/xpcom/base/src/nsLDAPSyncQuery.h
rename to ldap/xpcom/src/nsLDAPSyncQuery.h
rename from ldap/xpcom/base/src/nsLDAPURL.cpp
rename to ldap/xpcom/src/nsLDAPURL.cpp
rename from ldap/xpcom/base/src/nsLDAPURL.h
rename to ldap/xpcom/src/nsLDAPURL.h
--- a/ldap/xpcom/tests/Makefile.in
+++ b/ldap/xpcom/tests/Makefile.in
@@ -35,38 +35,15 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
-relativesrcdir = directory/xpcom/tests
+relativesrcdir = ldap/xpcom/tests
include $(DEPTH)/config/autoconf.mk
XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk
-
-# Note that for the time being "ldapshell" requires LDAP Experimental
-#
-
-ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-
-DEFINES += -DMOZ_LDAP_XPCOM_EXPERIMENTAL
-
-ifeq ($(OS_ARCH),WINNT)
-# need this because xpcshell built with readline won't work in cygwin shells
-RUN = cmd /c start
-else
-RUN = $(DIST)/bin/run-mozilla.sh
-endif
-
-XPCSHELL = $(DIST)/bin/xpcshell
-
-.PHONY: ldapshell
-ldapshell:
- $(CYGWIN_WRAPPER) $(RUN) $(XPCSHELL) \
- -f $(srcdir)/ldapshell.js \
- -f -
-endif
deleted file mode 100644
--- a/ldap/xpcom/tests/example.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF
- xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:NC="http://home.netscape.com/NC-rdf#"
- xmlns:WEB="http://home.netscape.com/WEB-rdf#"
- xmlns:LDAPATTR="http://www.mozilla.org/LDAPATTR-rdf#">
-
-<RDF:Description about="urn:root">
- <NC:child>
- <RDF:Description about="ldap://memberdir.netscape.com:389/ou=member_directory,o=netcenter.com??one?(sn=Rasputin)">
-
- <NC:child>
- <RDF:Description about="ldap://memberdir.netscape.com:389/uid=17680694:SWDv1,ou=member_directory,o=netcenter.com??base">
- <LDAPATTR:mail>lordrasputin@geocities.com</LDAPATTR:mail>
- <LDAPATTR:cn>Lord Rasputin</LDAPATTR:cn>
- </RDF:Description>
- </NC:child>
-
- <NC:child>
- <RDF:Description about="ldap://memberdir.netscape.com:389/uid=30653926:PAGEv1,ou=member_directory,o=netcenter.com??base">
- <LDAPATTR:mail>jesusrasputin@hotmail.com</LDAPATTR:mail>
- <LDAPATTR:cn>Jesus Rasputin</LDAPATTR:cn>
- </RDF:Description>
- </NC:child>
-
- </RDF:Description>
- </NC:child>
-</RDF:Description>
-
-</RDF:RDF>
\ No newline at end of file
deleted file mode 100644
--- a/ldap/xpcom/tests/example.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- orient="vertical">
- <tree id="tree"
- flex="1"
- datasources="rdf:ldap"
- ref="ldap://alpha.dante.org.uk:389/dc=dante,dc=org,dc=uk??one?(objectclass=*)"
- containment="http://home.netscape.com/NC-rdf#recursiveChild"
- flags="dont-build-content">
- <treecols>
- <treecol id="description"
- class="sortDirectionIndicator"
- flex="1"
- label="Description"
- sort="rdf:http://www.mozilla.org/LDAPATTR-rdf#description"
- sortActive="true"
- primary="true"
- persist="width sortActive sortDirection" />
-
- <splitter class="tree-splitter" />
-
- <treecol id="cn"
- class="sortDirectionIndicator"
- flex="1"
- label="CN"
- sort="rdf:http://www.mozilla.org/LDAPATTR-rdf#cn"
- persist="width sortActive sortDirection" />
- </treecols>
- <template>
- <treechildren>
- <treeitem uri="rdf:http://home.netscape.com/NC-rdf#recursiveChild">
- <treerow>
- <treecell ref="description"
- label="rdf:http://www.mozilla.org/LDAPATTR-rdf#description" />
- <treecell ref="cn"
- label="rdf:http://www.mozilla.org/LDAPATTR-rdf#cn" />
- </treerow>
- </treeitem>
- </treechildren>
- </template>
- </tree>
-</window>
deleted file mode 100644
--- a/ldap/xpcom/tests/jar.mn
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef MOZ_LDAP_XPCOM_EXPERIMENTAL
-comm.jar:
- content/communicator/ldapviewer/example.xul
- content/communicator/ldapviewer/example.rdf
-#endif
deleted file mode 100644
--- a/ldap/xpcom/tests/ldapshell.js
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org calendar code.
- *
- * The Initial Developer of the Original Code is Oracle Corporation
- * Portions created by the Initial Developer are Copyright (C) 2004, 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Dan Mosedale <dan.mosedale@oracle.com>
- * Mike Shaver <mike.x.shaver@oracle.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/*
- * This file is intended to allow for an easy synchronous interface to
- * the LDAP methods, both for writing tests simply, and for typing at
- * a shell by hand to experiment with the LDAP XPCOM SDK. "make ldapshell" in
- * mozilla/directory/xpcom/tests (or the equivalent objdir) will start a shell
- * with this code pre-loaded.
- */
-
-const C = Components;
-const Ci = C.interfaces;
-const CC = C.classes;
-const evQSvc = getService("@mozilla.org/event-queue-service;1",
- "nsIEventQueueService");
-const evQ = evQSvc.getSpecialEventQueue(Ci.nsIEventQueueService.CURRENT_THREAD_EVENT_QUEUE);
-
-// this is necessary so that the event pump isn't used with providers which
-// call the listener before returning, since it would run forever in that case.
-var done = false;
-
-function runEventPump()
-{
- dump("in runEventPump()\n");
-
- if (done) { // XXX needed?
- done = false;
- return;
- }
- pumpRunning = true;
- while (pumpRunning) {
- evQ.processPendingEvents();
- }
- done = false; // XXX needed?
- return;
-}
-
-function stopEventPump()
-{
- pumpRunning = false;
-}
-
-// I wonder how many copies of this are floating around
-function findErr(result)
-{
- for (var i in C.results) {
- if (C.results[i] == result) {
- return i;
- }
- }
- dump("No result code found for " + result + "\n");
-}
-// I wonder how many copies of this are floating around
-function findIface(iface)
-{
- for (var i in Ci) {
- if (iface.equals(Ci[i])) {
- return i;
- }
- }
- dump("No interface found for " + iface + "\n");
-}
-
-function findMsgTypeName(type)
-{
- for (var i in Ci.nsILDAPMessage) {
- if (type == Ci.nsILDAPMessage[i]) {
- return i;
- }
- }
- dump("message type " + op + "unknown\n");
-}
-
-function findLDAPErr(err)
-{
- for (var i in Ci.nsILDAPErrors) {
- if (err == Ci.nsILDAPErrors[i]) {
- return i;
- }
- }
- dump("ldap error " + err + "unknown\n");
-}
-
-function getService(contract, iface)
-{
- return C.classes[contract].getService(Ci[iface]);
-}
-
-function createInstance(contract, iface)
-{
- return C.classes[contract].createInstance(Ci[iface]);
-}
-
-function ldapMsgListener() {
-}
-ldapMsgListener.prototype =
-{
- mStatus: null,
-
- QueryInterface: function QI(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsILDAPMessageListener))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- onLDAPInit: function onLDAPInit(aConn, aStatus) {
- stopEventPump();
-
- mStatus = aStatus;
- if (!C.isSuccessCode(aStatus)) {
- throw aStatus;
- }
-
- dump("connection initialized successfully!\n");
- return;
- },
-
- onLDAPMessage: function onLDAPMessage(aMsg) {
-
- dump(findMsgTypeName(aMsg.type) + " received; ");
-
- if (aMsg.type == 0x64) {
- dump("dn: " + aMsg.dn);
-
- // if this is just a search entry, don't stop the pump, since
- // the result won't have arrived yet
-
- } else{
- dump("errorCode: " + findLDAPErr(aMsg.errorCode));
- stopEventPump();
- }
-
- dump("\n");
-
- mMessage = aMsg;
- return;
- }
-}
-
-function createProxiedLdapListener() {
-
- var l = new ldapMsgListener();
-
- /*
- var uiQueue = evqSvc.getSpecialEventQueue(Components.interfaces.
- nsIEventQueueService.
- UI_THREAD_EVENT_QUEUE);
- */
- var proxyMgr = getService("@mozilla.org/xpcomproxy;1",
- "nsIProxyObjectManager");
-
- dump("about to get proxy\n");
-
- return proxyMgr.getProxyForObject(evQ, Components.interfaces.
- nsILDAPMessageListener, l, 5);
- // 5 == PROXY_ALWAYS | PROXY_SYNC
-}
-
-const ioSvc = getService("@mozilla.org/network/io-service;1", "nsIIOService");
-
-function URLFromSpec(spec)
-{
- return ioSvc.newURI(spec, null, null);
-}
-
-/**
- * convenience method for setting up the global connection "conn"
- */
-var conn;
-function createConn(host, port, bindname) {
-
- dump("in createConn\n");
-
- conn = createInstance("@mozilla.org/network/ldap-connection;1",
- "nsILDAPConnection");
-
- try {
- var listener = createProxiedLdapListener();
- } catch (ex) {
- dump("exception " + ex + "caught\n");
- }
-
- dump("about to call conn.init\n");
- conn.init(host, port, false, bindname, listener, null, 3);
-
- dump("about to call runEventPump\n");
- runEventPump();
-}
-
-function jsArrayToMutableArray(a)
-{
- var mArray = createInstance("@mozilla.org/array;1", "nsIMutableArray");
-
- for each ( i in a ) {
- mArray.appendElement(i, false);
- }
-
- return mArray;
-}
-
-/**
- * convenience wrappers around various nsILDAPOperation methods so that shell
- * callers don't have to deal with lots of async and objectivity
- */
-function simpleBind(passwd)
-{
- var op = createInstance("@mozilla.org/network/ldap-operation;1",
- "nsILDAPOperation");
-
- var listener = createProxiedLdapListener();
- op.init(conn, listener, null);
-
- op.simpleBind(passwd);
- runEventPump();
-}
-
-function searchExt(basedn, scope, filter, serverControls, clientControls)
-{
- var op = createInstance("@mozilla.org/network/ldap-operation;1",
- "nsILDAPOperation");
-
- var listener = createProxiedLdapListener();
- op.init(conn, listener, null);
-
- op.serverControls = jsArrayToMutableArray(serverControls);
- op.clientControls = jsArrayToMutableArray(clientControls);
- op.searchExt(basedn, scope, filter, null, null, 0, 0);
- dump("searchExt sent\n");
- runEventPump();
-}
-
-dump("ldapshell loaded\n");