diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-04-27 23:17:58 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-04-27 23:17:58 +0000 |
commit | cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6 (patch) | |
tree | 6a4c89e03522095ad3ac2943929129e91146b0f8 | |
parent | e230e448e4c38ae8725d39dc0157dc95f85aa4e9 (diff) | |
download | ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.tar.gz ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.tar.xz ds-cbf08332dc9d3e1af6a8c79b1808fe1ce86ce4a6.zip |
Resolves: #237356
Summary: Move DS Admin Code into Admin Server (Comment #5)
Description: DSMLGW and ORGCHART are moved out; removing from ldapserver
53 files changed, 0 insertions, 8566 deletions
diff --git a/ldap/clients/dsmlgw/Makefile b/ldap/clients/dsmlgw/Makefile deleted file mode 100644 index 25590cfe..00000000 --- a/ldap/clients/dsmlgw/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK - -NOSTDCLEAN=true -NO_BUILD_NUM=true -COMPONENT_DEPS=true - - -BUILD_ROOT=../../.. - -include $(BUILD_ROOT)/nsconfig.mk -include $(BUILD_ROOT)/ldap/javarules.mk - -all: $(ANT_DEP) $(LDAPJDK_DEP) - @if [ ! -d $(DSMLGWJARS_BUILD_DIR) ] ; then \ - mkdir $(DSMLGWJARS_BUILD_DIR) ; \ - fi - @if [ ! -f $(DSMLGWJARS_BUILD_DIR)/axis.jar ]; then \ - if [ -f $(CLASS_DEST)/$(AXIS_REL_DIR)/lib/axis.jar ]; then \ - cp $(CLASS_DEST)/$(AXIS_REL_DIR)/lib/axis.jar $(DSMLGWJARS_BUILD_DIR) ; \ - fi ; \ - if [ -f $(CLASS_DEST)/$(AXIS_REL_DIR)/axis.jar ]; then \ - cp $(CLASS_DEST)/$(AXIS_REL_DIR)/axis.jar $(DSMLGWJARS_BUILD_DIR) ; \ - fi ; \ - fi - $(ANT) -Dglobaldist.dir=$(DSMLGWJARS_BUILD_DIR) -Dldapdist.dir=$(LDAPJDK_DIR) - -clean: - $(ANT) clean - diff --git a/ldap/clients/dsmlgw/build.xml b/ldap/clients/dsmlgw/build.xml deleted file mode 100644 index 0a050e11..00000000 --- a/ldap/clients/dsmlgw/build.xml +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version='1.0'?> -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<!-- ANT build script for the new dsml gateway --> -<!-- Possible to compile by hand, use - cd /ldapserver/ldap/clients/dsmlgw - ant -Dxerces=../../../../dist/classes/jakarta-tomcat-5.0.27/common/endorsed - --> -<project name="dsmlgw" default="dist" basedir="."> - -<!-- ******************** Adjustable Properties *********************** --> -<property name="mcom.root" value="../../.."/> -<property name="globaldist.dir" value="${mcom.root}/../dist/classes"/> -<property name="ldapdist.dir" value="${mcom.root}/../dist/classes"/> -<property name="app.name" value="dsmlgw"/> -<property name="taglib.name" value="dsmlgw"/> - -<property name="ldapjdk.jar" value="${ldapdist.dir}/ldapjdk.jar"/> -<property name="activation.jar" value="${globaldist.dir}/activation.jar"/> -<property name="jaf.jar" value="${globaldist.dir}/jaf.jar"/> -<property name="jaxrpc-api.jar" value="${globaldist.dir}/jaxrpc-api.jar"/> -<property name="jaxrpc.jar" value="${globaldist.dir}/jaxrpc.jar"/> -<property name="saaj.jar" value="${globaldist.dir}/saaj.jar"/> -<property name="xercesImpl.jar" value="${globaldist.dir}/xercesImpl.jar"/> -<property name="xmlParserAPIs.jar" value="${globaldist.dir}/xml-apis.jar"/> -<property name="axis.jar" value="${globaldist.dir}/axis.jar"/> -<property name="codec.jar" value="${globaldist.dir}/jakarta-commons-codec.jar"/> -<property environment="env"/> - -<path id="class.path"> -<pathelement location="${ldapjdk.jar}"/> -<pathelement location="${activation.jar}"/> -<pathelement location="${jaf.jar}"/> -<pathelement location="${jaxrpc-api.jar}"/> -<pathelement location="${jaxrpc.jar}"/> -<pathelement location="${saaj.jar}"/> - -<pathelement location="${xercesImpl.jar}"/> -<pathelement location="${xmlParserAPIs.jar}"/> -<pathelement location="${axis.jar}"/> -<pathelement location="${codec.jar}"/> -</path> - -<property name="build.dir" value="${mcom.root}/built/dsmlgw"/> -<property name="dist.dir" value="${mcom.root}/../dist/dsmlgw"/> - - - -<target name="prepare" description="prepares the output directories"> - <mkdir dir="${build.dir}"/> - <mkdir dir="${dist.dir}"/> -</target> - -<target name="library" depends="classpath,prepare" description="builds it"> -<javac srcdir="." destdir="${build.dir}" classpathref="class.path" debug="on"/> -</target> - - - <!-- Create the library distribution files --> -<target name="dist" depends="classpath,library" description="makes the distribution"> - <jar jarfile="${dist.dir}/dsmlgw.jar" basedir="${build.dir}"/> - - </target> - - <target name="clean" description="makes clean"> - <delete dir="${build.dir}"/> - <delete dir="${dist.dir}"/> - </target> - -<property name="classpath" refid="class.path"/> - <target name="classpath"> - <echo message="${classpath}"/> - </target> - - -</project> - diff --git a/ldap/clients/dsmlgw/misc/dsmlgw.cfg b/ldap/clients/dsmlgw/misc/dsmlgw.cfg deleted file mode 100644 index 2370987d..00000000 --- a/ldap/clients/dsmlgw/misc/dsmlgw.cfg +++ /dev/null @@ -1,50 +0,0 @@ -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK -# -#properties file for the -#Netscape DSMLGW -# DSML Gateway - -ServerHost=localhost -ServerPort=389 -BindDN= -BindPW= - -MinLoginPool=1 -MaxLoginPool=2 -MinPool=3 -MaxPool=15 diff --git a/ldap/clients/dsmlgw/misc/server-config.wsdd b/ldap/clients/dsmlgw/misc/server-config.wsdd deleted file mode 100644 index e9a57edd..00000000 --- a/ldap/clients/dsmlgw/misc/server-config.wsdd +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> - <globalConfiguration> - <parameter name="adminPassword" value="admin"/> - <parameter name="sendMultiRefs" value="true"/> - <parameter name="sendXsiTypes" value="true"/> - <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/> - <parameter name="sendXMLDeclaration" value="true"/> - <requestFlow> - <handler type="java:org.apache.axis.handlers.JWSHandler"> - <parameter name="scope" value="session"/> - </handler> - <handler type="java:org.apache.axis.handlers.JWSHandler"> - <parameter name="scope" value="request"/> - <parameter name="extension" value=".jwr"/> - </handler> - </requestFlow> - </globalConfiguration> - <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/> - <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/> - <requestFlow name="checks"> - <handler type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> - <handler type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"/> - </requestFlow> - <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> - - <service name="dsmlgw" provider="Handler"> - <parameter name="handlerClass" value="com.netscape.dsml.gateway.gatewayHandler"/> - </service> - - <transport name="http"> - <requestFlow> - <handler type="URLMapper"/> - <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> - </requestFlow> - <parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/> - <parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/> - <parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/> - </transport> - <transport name="local"> - <responseFlow> - <handler type="LocalResponder"/> - </responseFlow> - </transport> -</deployment> diff --git a/ldap/clients/dsmlgw/misc/web-app_2_3.dtd b/ldap/clients/dsmlgw/misc/web-app_2_3.dtd deleted file mode 100644 index 5e3ab01c..00000000 --- a/ldap/clients/dsmlgw/misc/web-app_2_3.dtd +++ /dev/null @@ -1,1063 +0,0 @@ -<!-- -Copyright (c) 2000 Sun Microsystems, Inc., -901 San Antonio Road, -Palo Alto, California 94303, U.S.A. -All rights reserved. - -Sun Microsystems, Inc. has intellectual property rights relating to -technology embodied in the product that is described in this document. -In particular, and without limitation, these intellectual property -rights may include one or more of the U.S. patents listed at -http://www.sun.com/patents and one or more additional patents or -pending patent applications in the U.S. and in other countries. - -This document and the product to which it pertains are distributed -under licenses restricting their use, copying, distribution, and -decompilation. This document may be reproduced and distributed but may -not be changed without prior written authorization of Sun and its -licensors, if any. - -Third-party software, including font technology, is copyrighted and -licensed from Sun suppliers. - -Sun, Sun Microsystems, the Sun logo, Java, JavaServer Pages, Java -Naming and Directory Interface, JDBC, JDK, JavaMail and and -Enterprise JavaBeans are trademarks or registered trademarks of Sun -Microsystems, Inc. in the U.S. and other countries. - -Federal Acquisitions: Commercial Software - Government Users Subject to -Standard License Terms and Conditions. - -DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED -CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED -WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR -NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH -DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - - -_________________________________________________________________________ - -Copyright (c) 2000 Sun Microsystems, Inc., -901 San Antonio Road, -Palo Alto, California 94303, E'tats-Unis. -Tous droits re'serve's. - -Sun Microsystems, Inc. a les droits de proprie'te' intellectuels -relatants a` la technologie incorpore'e dans le produit qui est de'crit -dans ce document. En particulier, et sans la limitation, ces droits de -proprie'te' intellectuels peuvent inclure un ou plus des brevets -ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les -brevets plus supple'mentaires ou les applications de brevet en attente -dans les E'tats-Unis et dans les autres pays. - -Ce produit ou document est prote'ge' par un copyright et distribue' -avec des licences qui en restreignent l'utilisation, la copie, la -distribution, et la de'compilation. Ce documention associe n peut -e^tre reproduite et distribuer, par quelque moyen que ce soit, sans -l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de -licence, le cas e'che'ant. - -Le logiciel de'tenu par des tiers, et qui comprend la technologie -relative aux polices de caracte`res, est prote'ge' par un copyright et -licencie' par des fournisseurs de Sun. - -Sun, Sun Microsystems, le logo Sun, Java, JavaServer Pages, Java -Naming and Directory Interface, JDBC, JDK, JavaMail et and -Enterprise JavaBeans sont des marques de fabrique ou des marques -de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres -pays. - -LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS, -DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT -EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS -NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A -L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE -CONTREFAC,ON. ---> - -<!-- -This is the XML DTD for the Servlet 2.3 deployment descriptor. -All Servlet 2.3 deployment descriptors must include a DOCTYPE -of the following form: - - <!DOCTYPE web-app PUBLIC - "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> - ---> - -<!-- -The following conventions apply to all J2EE deployment descriptor -elements unless indicated otherwise. - -- In elements that contain PCDATA, leading and trailing whitespace - in the data may be ignored. - -- In elements whose value is an "enumerated type", the value is - case sensitive. - -- In elements that specify a pathname to a file within the same - JAR file, relative filenames (i.e., those not starting with "/") - are considered relative to the root of the JAR file's namespace. - Absolute filenames (i.e., those starting with "/") also specify - names in the root of the JAR file's namespace. In general, relative - names are preferred. The exception is .war files where absolute - names are preferred for consistency with the servlet API. ---> - - -<!-- -The web-app element is the root of the deployment descriptor for -a web application. ---> -<!ELEMENT web-app (icon?, display-name?, description?, distributable?, -context-param*, filter*, filter-mapping*, listener*, servlet*, -servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, -error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, -login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)> - -<!-- -The auth-constraint element indicates the user roles that should -be permitted access to this resource collection. The role-name -used here must either correspond to the role-name of one of the -security-role elements defined for this web application, or be -the specially reserved role-name "*" that is a compact syntax for -indicating all roles in the web application. If both "*" and -rolenames appear, the container interprets this as all roles. -If no roles are defined, no user is allowed access to the portion of -the web application described by the containing security-constraint. -The container matches role names case sensitively when determining -access. - - -Used in: security-constraint ---> -<!ELEMENT auth-constraint (description?, role-name*)> - -<!-- -The auth-method element is used to configure the authentication -mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization -constraint, a user must have authenticated using the configured -mechanism. Legal values for this element are "BASIC", "DIGEST", -"FORM", or "CLIENT-CERT". - -Used in: login-config ---> -<!ELEMENT auth-method (#PCDATA)> - -<!-- -The context-param element contains the declaration of a web -application's servlet context initialization parameters. - -Used in: web-app ---> -<!ELEMENT context-param (param-name, param-value, description?)> - -<!-- -The description element is used to provide text describing the parent -element. The description element should include any information that -the web application war file producer wants to provide to the consumer of -the web application war file (i.e., to the Deployer). Typically, the tools -used by the web application war file consumer will display the description -when processing the parent element that contains the description. - -Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref, -env-entry, filter, init-param, resource-env-ref, resource-ref, run-as, -security-role, security-role-ref, servlet, user-data-constraint, -web-app, web-resource-collection ---> -<!ELEMENT description (#PCDATA)> - -<!-- -The display-name element contains a short name that is intended to be -displayed by tools. The display name need not be unique. - -Used in: filter, security-constraint, servlet, web-app - -Example: - -<display-name>Employee Self Service</display-name> ---> -<!ELEMENT display-name (#PCDATA)> - -<!-- -The distributable element, by its presence in a web application -deployment descriptor, indicates that this web application is -programmed appropriately to be deployed into a distributed servlet -container - -Used in: web-app ---> -<!ELEMENT distributable EMPTY> - -<!-- -The ejb-link element is used in the ejb-ref or ejb-local-ref -elements to specify that an EJB reference is linked to an -enterprise bean. - -The name in the ejb-link element is composed of a -path name specifying the ejb-jar containing the referenced enterprise -bean with the ejb-name of the target bean appended and separated from -the path name by "#". The path name is relative to the war file -containing the web application that is referencing the enterprise bean. -This allows multiple enterprise beans with the same ejb-name to be -uniquely identified. - -Used in: ejb-local-ref, ejb-ref - -Examples: - - <ejb-link>EmployeeRecord</ejb-link> - - <ejb-link>../products/product.jar#ProductEJB</ejb-link> - ---> -<!ELEMENT ejb-link (#PCDATA)> - -<!-- -The ejb-local-ref element is used for the declaration of a reference to -an enterprise bean's local home. The declaration consists of: - - - an optional description - - the EJB reference name used in the code of the web application - that's referencing the enterprise bean - - the expected type of the referenced enterprise bean - - the expected local home and local interfaces of the referenced - enterprise bean - - optional ejb-link information, used to specify the referenced - enterprise bean - -Used in: web-app ---> -<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type, - local-home, local, ejb-link?)> - -<!-- -The ejb-ref element is used for the declaration of a reference to -an enterprise bean's home. The declaration consists of: - - - an optional description - - the EJB reference name used in the code of - the web application that's referencing the enterprise bean - - the expected type of the referenced enterprise bean - - the expected home and remote interfaces of the referenced - enterprise bean - - optional ejb-link information, used to specify the referenced - enterprise bean - -Used in: web-app ---> -<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, - home, remote, ejb-link?)> - -<!-- -The ejb-ref-name element contains the name of an EJB reference. The -EJB reference is an entry in the web application's environment and is -relative to the java:comp/env context. The name must be unique -within the web application. - -It is recommended that name is prefixed with "ejb/". - -Used in: ejb-local-ref, ejb-ref - -Example: - -<ejb-ref-name>ejb/Payroll</ejb-ref-name> ---> -<!ELEMENT ejb-ref-name (#PCDATA)> - -<!-- -The ejb-ref-type element contains the expected type of the -referenced enterprise bean. - -The ejb-ref-type element must be one of the following: - - <ejb-ref-type>Entity</ejb-ref-type> - <ejb-ref-type>Session</ejb-ref-type> - -Used in: ejb-local-ref, ejb-ref ---> -<!ELEMENT ejb-ref-type (#PCDATA)> - -<!-- -The env-entry element contains the declaration of a web application's -environment entry. The declaration consists of an optional -description, the name of the environment entry, and an optional -value. If a value is not specified, one must be supplied -during deployment. ---> -<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?, -env-entry-type)> - -<!-- -The env-entry-name element contains the name of a web applications's -environment entry. The name is a JNDI name relative to the -java:comp/env context. The name must be unique within a web application. - -Example: - -<env-entry-name>minAmount</env-entry-name> - -Used in: env-entry ---> -<!ELEMENT env-entry-name (#PCDATA)> - -<!-- -The env-entry-type element contains the fully-qualified Java type of -the environment entry value that is expected by the web application's -code. - -The following are the legal values of env-entry-type: - - java.lang.Boolean - java.lang.Byte - java.lang.Character - java.lang.String - java.lang.Short - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - -Used in: env-entry ---> -<!ELEMENT env-entry-type (#PCDATA)> - -<!-- -The env-entry-value element contains the value of a web application's -environment entry. The value must be a String that is valid for the -constructor of the specified type that takes a single String -parameter, or for java.lang.Character, a single character. - -Example: - -<env-entry-value>100.00</env-entry-value> - -Used in: env-entry ---> -<!ELEMENT env-entry-value (#PCDATA)> - -<!-- -The error-code contains an HTTP error code, ex: 404 - -Used in: error-page ---> -<!ELEMENT error-code (#PCDATA)> - -<!-- -The error-page element contains a mapping between an error code -or exception type to the path of a resource in the web application - -Used in: web-app ---> -<!ELEMENT error-page ((error-code | exception-type), location)> - -<!-- -The exception type contains a fully qualified class name of a -Java exception type. - -Used in: error-page ---> -<!ELEMENT exception-type (#PCDATA)> - -<!-- -The extension element contains a string describing an -extension. example: "txt" - -Used in: mime-mapping ---> -<!ELEMENT extension (#PCDATA)> - -<!-- -Declares a filter in the web application. The filter is mapped to -either a servlet or a URL pattern in the filter-mapping element, using -the filter-name value to reference. Filters can access the -initialization parameters declared in the deployment descriptor at -runtime via the FilterConfig interface. - -Used in: web-app ---> -<!ELEMENT filter (icon?, filter-name, display-name?, description?, -filter-class, init-param*)> - -<!-- -The fully qualified classname of the filter. - -Used in: filter ---> -<!ELEMENT filter-class (#PCDATA)> - -<!-- -Declaration of the filter mappings in this web application. The -container uses the filter-mapping declarations to decide which filters -to apply to a request, and in what order. The container matches the -request URI to a Servlet in the normal way. To determine which filters -to apply it matches filter-mapping declarations either on servlet-name, -or on url-pattern for each filter-mapping element, depending on which -style is used. The order in which filters are invoked is the order in -which filter-mapping declarations that match a request URI for a -servlet appear in the list of filter-mapping elements.The filter-name -value must be the value of the <filter-name> sub-elements of one of the -<filter> declarations in the deployment descriptor. - -Used in: web-app ---> -<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))> - -<!-- -The logical name of the filter. This name is used to map the filter. -Each filter name is unique within the web application. - -Used in: filter, filter-mapping ---> -<!ELEMENT filter-name (#PCDATA)> - -<!-- -The form-error-page element defines the location in the web app -where the error page that is displayed when login is not successful -can be found. The path begins with a leading / and is interpreted -relative to the root of the WAR. - -Used in: form-login-config ---> -<!ELEMENT form-error-page (#PCDATA)> - -<!-- -The form-login-config element specifies the login and error pages -that should be used in form based login. If form based authentication -is not used, these elements are ignored. - -Used in: login-config ---> -<!ELEMENT form-login-config (form-login-page, form-error-page)> - -<!-- -The form-login-page element defines the location in the web app -where the page that can be used for login can be found. The path -begins with a leading / and is interpreted relative to the root of the WAR. - -Used in: form-login-config ---> -<!ELEMENT form-login-page (#PCDATA)> - -<!-- -The home element contains the fully-qualified name of the enterprise -bean's home interface. - -Used in: ejb-ref - -Example: - -<home>com.aardvark.payroll.PayrollHome</home> ---> -<!ELEMENT home (#PCDATA)> - -<!-- -The http-method contains an HTTP method (GET | POST |...). - -Used in: web-resource-collection ---> -<!ELEMENT http-method (#PCDATA)> - -<!-- -The icon element contains small-icon and large-icon elements that -specify the file names for small and a large GIF or JPEG icon images -used to represent the parent element in a GUI tool. - -Used in: filter, servlet, web-app ---> -<!ELEMENT icon (small-icon?, large-icon?)> - -<!-- -The init-param element contains a name/value pair as an -initialization param of the servlet - -Used in: filter, servlet ---> -<!ELEMENT init-param (param-name, param-value, description?)> - -<!-- -The jsp-file element contains the full path to a JSP file within -the web application beginning with a `/'. - -Used in: servlet ---> -<!ELEMENT jsp-file (#PCDATA)> - -<!-- -The large-icon element contains the name of a file -containing a large (32 x 32) icon image. The file -name is a relative path within the web application's -war file. - -The image may be either in the JPEG or GIF format. -The icon can be used by tools. - -Used in: icon - -Example: - -<large-icon>employee-service-icon32x32.jpg</large-icon> ---> -<!ELEMENT large-icon (#PCDATA)> - -<!-- -The listener element indicates the deployment properties for a web -application listener bean. - -Used in: web-app ---> -<!ELEMENT listener (listener-class)> - -<!-- -The listener-class element declares a class in the application must be -registered as a web application listener bean. The value is the fully qualified classname of the listener class. - - -Used in: listener ---> -<!ELEMENT listener-class (#PCDATA)> - -<!-- -The load-on-startup element indicates that this servlet should be -loaded (instantiated and have its init() called) on the startup -of the web application. The optional contents of -these element must be an integer indicating the order in which -the servlet should be loaded. If the value is a negative integer, -or the element is not present, the container is free to load the -servlet whenever it chooses. If the value is a positive integer -or 0, the container must load and initialize the servlet as the -application is deployed. The container must guarantee that -servlets marked with lower integers are loaded before servlets -marked with higher integers. The container may choose the order -of loading of servlets with the same load-on-start-up value. - -Used in: servlet ---> -<!ELEMENT load-on-startup (#PCDATA)> - -<!-- - -The local element contains the fully-qualified name of the -enterprise bean's local interface. - -Used in: ejb-local-ref - ---> -<!ELEMENT local (#PCDATA)> - -<!-- - -The local-home element contains the fully-qualified name of the -enterprise bean's local home interface. - -Used in: ejb-local-ref ---> -<!ELEMENT local-home (#PCDATA)> - -<!-- -The location element contains the location of the resource in the web -application relative to the root of the web application. The value of -the location must have a leading `/'. - -Used in: error-page ---> -<!ELEMENT location (#PCDATA)> - -<!-- -The login-config element is used to configure the authentication -method that should be used, the realm name that should be used for -this application, and the attributes that are needed by the form login -mechanism. - -Used in: web-app ---> -<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)> - -<!-- -The mime-mapping element defines a mapping between an extension -and a mime type. - -Used in: web-app ---> -<!ELEMENT mime-mapping (extension, mime-type)> - -<!-- -The mime-type element contains a defined mime type. example: -"text/plain" - -Used in: mime-mapping ---> -<!ELEMENT mime-type (#PCDATA)> - -<!-- -The param-name element contains the name of a parameter. Each parameter -name must be unique in the web application. - - -Used in: context-param, init-param ---> -<!ELEMENT param-name (#PCDATA)> - -<!-- -The param-value element contains the value of a parameter. - -Used in: context-param, init-param ---> -<!ELEMENT param-value (#PCDATA)> - -<!-- -The realm name element specifies the realm name to use in HTTP -Basic authorization. - -Used in: login-config ---> -<!ELEMENT realm-name (#PCDATA)> - -<!-- -The remote element contains the fully-qualified name of the enterprise -bean's remote interface. - -Used in: ejb-ref - -Example: - -<remote>com.wombat.empl.EmployeeService</remote> ---> -<!ELEMENT remote (#PCDATA)> - -<!-- -The res-auth element specifies whether the web application code signs -on programmatically to the resource manager, or whether the Container -will sign on to the resource manager on behalf of the web application. In the -latter case, the Container uses information that is supplied by the -Deployer. - -The value of this element must be one of the two following: - - <res-auth>Application</res-auth> - <res-auth>Container</res-auth> - -Used in: resource-ref ---> -<!ELEMENT res-auth (#PCDATA)> - -<!-- -The res-ref-name element specifies the name of a resource manager -connection factory reference. The name is a JNDI name relative to the -java:comp/env context. The name must be unique within a web application. - -Used in: resource-ref ---> -<!ELEMENT res-ref-name (#PCDATA)> - -<!-- -The res-sharing-scope element specifies whether connections obtained -through the given resource manager connection factory reference can be -shared. The value of this element, if specified, must be one of the -two following: - - <res-sharing-scope>Shareable</res-sharing-scope> - <res-sharing-scope>Unshareable</res-sharing-scope> - -The default value is Shareable. - -Used in: resource-ref ---> -<!ELEMENT res-sharing-scope (#PCDATA)> - -<!-- -The res-type element specifies the type of the data source. The type -is specified by the fully qualified Java language class or interface -expected to be implemented by the data source. - -Used in: resource-ref ---> -<!ELEMENT res-type (#PCDATA)> - -<!-- -The resource-env-ref element contains a declaration of a web application's -reference to an administered object associated with a resource -in the web application's environment. It consists of an optional -description, the resource environment reference name, and an -indication of the resource environment reference type expected by -the web application code. - -Used in: web-app - -Example: - -<resource-env-ref> - <resource-env-ref-name>jms/StockQueue</resource-env-ref-name> - <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type> -</resource-env-ref> ---> -<!ELEMENT resource-env-ref (description?, resource-env-ref-name, - resource-env-ref-type)> - -<!-- -The resource-env-ref-name element specifies the name of a resource -environment reference; its value is the environment entry name used in -the web application code. The name is a JNDI name relative to the -java:comp/env context and must be unique within a web application. - -Used in: resource-env-ref ---> -<!ELEMENT resource-env-ref-name (#PCDATA)> - -<!-- -The resource-env-ref-type element specifies the type of a resource -environment reference. It is the fully qualified name of a Java -language class or interface. - -Used in: resource-env-ref ---> -<!ELEMENT resource-env-ref-type (#PCDATA)> - -<!-- -The resource-ref element contains a declaration of a web application's -reference to an external resource. It consists of an optional -description, the resource manager connection factory reference name, -the indication of the resource manager connection factory type -expected by the web application code, the type of authentication -(Application or Container), and an optional specification of the -shareability of connections obtained from the resource (Shareable or -Unshareable). - -Used in: web-app - -Example: - - <resource-ref> - <res-ref-name>jdbc/EmployeeAppDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <res-auth>Container</res-auth> - <res-sharing-scope>Shareable</res-sharing-scope> - </resource-ref> ---> -<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth, - res-sharing-scope?)> - -<!-- -The role-link element is a reference to a defined security role. The -role-link element must contain the name of one of the security roles -defined in the security-role elements. - -Used in: security-role-ref ---> -<!ELEMENT role-link (#PCDATA)> - -<!-- -The role-name element contains the name of a security role. - -The name must conform to the lexical rules for an NMTOKEN. - -Used in: auth-constraint, run-as, security-role, security-role-ref ---> -<!ELEMENT role-name (#PCDATA)> - -<!-- -The run-as element specifies the run-as identity to be used for the -execution of the web application. It contains an optional description, and -the name of a security role. - -Used in: servlet ---> -<!ELEMENT run-as (description?, role-name)> - -<!-- -The security-constraint element is used to associate security -constraints with one or more web resource collections - -Used in: web-app ---> -<!ELEMENT security-constraint (display-name?, web-resource-collection+, -auth-constraint?, user-data-constraint?)> - -<!-- -The security-role element contains the definition of a security -role. The definition consists of an optional description of the -security role, and the security role name. - -Used in: web-app - -Example: - - <security-role> - <description> - This role includes all employees who are authorized - to access the employee service application. - </description> - <role-name>employee</role-name> - </security-role> ---> -<!ELEMENT security-role (description?, role-name)> - -<!-- -The security-role-ref element contains the declaration of a security -role reference in the web application's code. The declaration consists -of an optional description, the security role name used in the code, -and an optional link to a security role. If the security role is not -specified, the Deployer must choose an appropriate security role. - -The value of the role-name element must be the String used as the -parameter to the EJBContext.isCallerInRole(String roleName) method -or the HttpServletRequest.isUserInRole(String role) method. - -Used in: servlet - ---> -<!ELEMENT security-role-ref (description?, role-name, role-link?)> - -<!-- -The servlet element contains the declarative data of a -servlet. If a jsp-file is specified and the load-on-startup element is -present, then the JSP should be precompiled and loaded. - -Used in: web-app ---> -<!ELEMENT servlet (icon?, servlet-name, display-name?, description?, -(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)> - -<!-- -The servlet-class element contains the fully qualified class name -of the servlet. - -Used in: servlet ---> -<!ELEMENT servlet-class (#PCDATA)> - -<!-- -The servlet-mapping element defines a mapping between a servlet -and a url pattern - -Used in: web-app ---> -<!ELEMENT servlet-mapping (servlet-name, url-pattern)> - -<!-- -The servlet-name element contains the canonical name of the -servlet. Each servlet name is unique within the web application. - -Used in: filter-mapping, servlet, servlet-mapping ---> -<!ELEMENT servlet-name (#PCDATA)> - -<!-- -The session-config element defines the session parameters for -this web application. - -Used in: web-app ---> -<!ELEMENT session-config (session-timeout?)> - -<!-- -The session-timeout element defines the default session timeout -interval for all sessions created in this web application. The -specified timeout must be expressed in a whole number of minutes. -If the timeout is 0 or less, the container ensures the default -behaviour of sessions is never to time out. - -Used in: session-config ---> -<!ELEMENT session-timeout (#PCDATA)> - -<!-- -The small-icon element contains the name of a file -containing a small (16 x 16) icon image. The file -name is a relative path within the web application's -war file. - -The image may be either in the JPEG or GIF format. -The icon can be used by tools. - -Used in: icon - -Example: - -<small-icon>employee-service-icon16x16.jpg</small-icon> ---> -<!ELEMENT small-icon (#PCDATA)> - -<!-- -The taglib element is used to describe a JSP tag library. - -Used in: web-app ---> -<!ELEMENT taglib (taglib-uri, taglib-location)> - -<!-- -the taglib-location element contains the location (as a resource -relative to the root of the web application) where to find the Tag -Libary Description file for the tag library. - -Used in: taglib ---> -<!ELEMENT taglib-location (#PCDATA)> - -<!-- -The taglib-uri element describes a URI, relative to the location -of the web.xml document, identifying a Tag Library used in the Web -Application. - -Used in: taglib ---> -<!ELEMENT taglib-uri (#PCDATA)> - -<!-- -The transport-guarantee element specifies that the communication -between client and server should be NONE, INTEGRAL, or -CONFIDENTIAL. NONE means that the application does not require any -transport guarantees. A value of INTEGRAL means that the application -requires that the data sent between the client and server be sent in -such a way that it can't be changed in transit. CONFIDENTIAL means -that the application requires that the data be transmitted in a -fashion that prevents other entities from observing the contents of -the transmission. In most cases, the presence of the INTEGRAL or -CONFIDENTIAL flag will indicate that the use of SSL is required. - -Used in: user-data-constraint ---> -<!ELEMENT transport-guarantee (#PCDATA)> - -<!-- -The url-pattern element contains the url pattern of the mapping. Must -follow the rules specified in Section 11.2 of the Servlet API -Specification. - -Used in: filter-mapping, servlet-mapping, web-resource-collection ---> -<!ELEMENT url-pattern (#PCDATA)> - -<!-- -The user-data-constraint element is used to indicate how data -communicated between the client and container should be protected. - -Used in: security-constraint ---> -<!ELEMENT user-data-constraint (description?, transport-guarantee)> - -<!-- -The web-resource-collection element is used to identify a subset -of the resources and HTTP methods on those resources within a web -application to which a security constraint applies. If no HTTP methods -are specified, then the security constraint applies to all HTTP -methods. - -Used in: security-constraint ---> -<!ELEMENT web-resource-collection (web-resource-name, description?, -url-pattern*, http-method*)> - -<!-- -The web-resource-name contains the name of this web resource -collection. - -Used in: web-resource-collection ---> -<!ELEMENT web-resource-name (#PCDATA)> - -<!-- -The welcome-file element contains file name to use as a default -welcome file, such as index.html - -Used in: welcome-file-list ---> -<!ELEMENT welcome-file (#PCDATA)> - -<!-- -The welcome-file-list contains an ordered list of welcome files -elements. - -Used in: web-app ---> -<!ELEMENT welcome-file-list (welcome-file+)> - -<!-- -The ID mechanism is to allow tools that produce additional deployment -information (i.e., information beyond the standard deployment -descriptor information) to store the non-standard information in a -separate file, and easily refer from these tool-specific files to the -information in the standard deployment descriptor. - -Tools are not allowed to add the non-standard information into the -standard deployment descriptor. ---> - -<!ATTLIST auth-constraint id ID #IMPLIED> -<!ATTLIST auth-method id ID #IMPLIED> -<!ATTLIST context-param id ID #IMPLIED> -<!ATTLIST description id ID #IMPLIED> -<!ATTLIST display-name id ID #IMPLIED> -<!ATTLIST distributable id ID #IMPLIED> -<!ATTLIST ejb-link id ID #IMPLIED> -<!ATTLIST ejb-local-ref id ID #IMPLIED> -<!ATTLIST ejb-ref id ID #IMPLIED> -<!ATTLIST ejb-ref-name id ID #IMPLIED> -<!ATTLIST ejb-ref-type id ID #IMPLIED> -<!ATTLIST env-entry id ID #IMPLIED> -<!ATTLIST env-entry-name id ID #IMPLIED> -<!ATTLIST env-entry-type id ID #IMPLIED> -<!ATTLIST env-entry-value id ID #IMPLIED> -<!ATTLIST error-code id ID #IMPLIED> -<!ATTLIST error-page id ID #IMPLIED> -<!ATTLIST exception-type id ID #IMPLIED> -<!ATTLIST extension id ID #IMPLIED> -<!ATTLIST filter id ID #IMPLIED> -<!ATTLIST filter-class id ID #IMPLIED> -<!ATTLIST filter-mapping id ID #IMPLIED> -<!ATTLIST filter-name id ID #IMPLIED> -<!ATTLIST form-error-page id ID #IMPLIED> -<!ATTLIST form-login-config id ID #IMPLIED> -<!ATTLIST form-login-page id ID #IMPLIED> -<!ATTLIST home id ID #IMPLIED> -<!ATTLIST http-method id ID #IMPLIED> -<!ATTLIST icon id ID #IMPLIED> -<!ATTLIST init-param id ID #IMPLIED> -<!ATTLIST jsp-file id ID #IMPLIED> -<!ATTLIST large-icon id ID #IMPLIED> -<!ATTLIST listener id ID #IMPLIED> -<!ATTLIST listener-class id ID #IMPLIED> -<!ATTLIST load-on-startup id ID #IMPLIED> -<!ATTLIST local id ID #IMPLIED> -<!ATTLIST local-home id ID #IMPLIED> -<!ATTLIST location id ID #IMPLIED> -<!ATTLIST login-config id ID #IMPLIED> -<!ATTLIST mime-mapping id ID #IMPLIED> -<!ATTLIST mime-type id ID #IMPLIED> -<!ATTLIST param-name id ID #IMPLIED> -<!ATTLIST param-value id ID #IMPLIED> -<!ATTLIST realm-name id ID #IMPLIED> -<!ATTLIST remote id ID #IMPLIED> -<!ATTLIST res-auth id ID #IMPLIED> -<!ATTLIST res-ref-name id ID #IMPLIED> -<!ATTLIST res-sharing-scope id ID #IMPLIED> -<!ATTLIST res-type id ID #IMPLIED> -<!ATTLIST resource-env-ref id ID #IMPLIED> -<!ATTLIST resource-env-ref-name id ID #IMPLIED> -<!ATTLIST resource-env-ref-type id ID #IMPLIED> -<!ATTLIST resource-ref id ID #IMPLIED> -<!ATTLIST role-link id ID #IMPLIED> -<!ATTLIST role-name id ID #IMPLIED> -<!ATTLIST run-as id ID #IMPLIED> -<!ATTLIST security-constraint id ID #IMPLIED> -<!ATTLIST security-role id ID #IMPLIED> -<!ATTLIST security-role-ref id ID #IMPLIED> -<!ATTLIST servlet id ID #IMPLIED> -<!ATTLIST servlet-class id ID #IMPLIED> -<!ATTLIST servlet-mapping id ID #IMPLIED> -<!ATTLIST servlet-name id ID #IMPLIED> -<!ATTLIST session-config id ID #IMPLIED> -<!ATTLIST session-timeout id ID #IMPLIED> -<!ATTLIST small-icon id ID #IMPLIED> -<!ATTLIST taglib id ID #IMPLIED> -<!ATTLIST taglib-location id ID #IMPLIED> -<!ATTLIST taglib-uri id ID #IMPLIED> -<!ATTLIST transport-guarantee id ID #IMPLIED> -<!ATTLIST url-pattern id ID #IMPLIED> -<!ATTLIST user-data-constraint id ID #IMPLIED> -<!ATTLIST web-app id ID #IMPLIED> -<!ATTLIST web-resource-collection id ID #IMPLIED> -<!ATTLIST web-resource-name id ID #IMPLIED> -<!ATTLIST welcome-file id ID #IMPLIED> -<!ATTLIST welcome-file-list id ID #IMPLIED> diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java deleted file mode 100644 index 30cb1349..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java +++ /dev/null @@ -1,242 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; - -import org.apache.xerces.parsers.DOMParser; -import java.util.logging.*; -import netscape.ldap.controls.LDAPProxiedAuthControl; -import netscape.ldap.LDAPSearchConstraints; - -public class BatchProcessor { - - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.BatchProcessor"); - - private boolean attribute_resumeOnError = false; - private boolean FirstRequest = true; - private boolean dontHalt = true; - - private javax.xml.soap.SOAPElement root = null; - private javax.xml.soap.SOAPElement batch = null; - private java.util.Vector requests = new java.util.Vector(1); - - static private javax.xml.soap.MessageFactory messageFactory ; - static private javax.xml.soap.SOAPFactory sef ; - - private IConnectionManager ldap_pool = null; - - public javax.xml.parsers.DocumentBuilderFactory dbf; - public javax.xml.parsers.DocumentBuilder builder; - LDAPSearchConstraints proxyAuth = null; - - public BatchProcessor(javax.xml.soap.SOAPBody sb) { - - root = (javax.xml.soap.SOAPElement) sb; - - - - } - - public void init() throws gatewayException { - - try { - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - ldap_pool = pmc.getInstance(); - } - catch (Exception e) { - throw new gatewayException( e.getMessage() ); - - } - - try { - dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); - builder = dbf.newDocumentBuilder(); - org.w3c.dom.Document d = builder.newDocument(); - - } - catch (Exception e) { - throw new gatewayException( e.getMessage() ); - } - - } - - public void setProxy(String DN){ - LDAPProxiedAuthControl ctrl = new LDAPProxiedAuthControl( DN, true ); - proxyAuth = new LDAPSearchConstraints(); - proxyAuth.setServerControls( ctrl ); - - } - - public boolean preprocess() throws javax.xml.soap.SOAPException { - - if (root.getChildElements().hasNext() && - ((javax.xml.soap.SOAPElement) root.getChildElements().next()).getLocalName().equalsIgnoreCase("batchRequest")) { - - this.batch = (javax.xml.soap.SOAPElement) root.getChildElements().next(); - - /* attributes for batchRequest: - * "reponseOrder" -- not implemented - * "processing" -- not implemented - * "onError" -- implemented - */ - if (batch.getAttribute("onError") == null ) - attribute_resumeOnError = false; - else - attribute_resumeOnError = (batch.getAttribute("onError").equalsIgnoreCase("resume ")) ? true : false ; - - java.util.Iterator i = batch.getChildElements(); - - while (i.hasNext()) { - requests.add( i.next() ); - logger.log(Level.INFO, "adding request"); - } - return true; - } - else { - // error, no batchrequest... exit gracefully - - logger.log(Level.INFO, "NO batchRequest in this envelope"); - return false; - } - - - - } - - void process(int index) { - - /* This is a hack: - * This code is required because of Axis' incomplete - * implementation. Without these, whenever getNodeValue() and friends are - * called, exceptions are deliberately thrown. When Axis is fully - * functional it should be able to be removed. The following lines - * probably impact performance negatively. */ - DOMParser p = new DOMParser(); - try { - p.parse(new org.xml.sax.InputSource(new java.io.StringReader(this.requests.get(index).toString()))); - } catch (Exception E) { E.printStackTrace(); } - /* END */ - - Document doc = p.getDocument(); - Node myRequest = doc.getDocumentElement(); - - String RequestType = myRequest.getLocalName(); - gatewayContext context = new gatewayContext(); - - - Node res = null; - if (proxyAuth != null) - context.setConstraints( proxyAuth); - context.setRootNode(myRequest.cloneNode(true)); - - logger.log(Level.INFO, "Processing: starting {0}", RequestType); - - if (FirstRequest && RequestType.equals("authRequest")){ - if (FirstRequest) { - - OperationAuth CurrentOperation = new OperationAuth(); - res = CurrentOperation.getResponse(context) ; - - FirstRequest = false; - } else { - // error - } - - } else if (RequestType.equals("searchRequest")) { - - OperationSearch CurrentOperation = new OperationSearch(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("modifyRequest")){ - - OperationModify CurrentOperation= new OperationModify(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("addRequest")) { - - OperationAdd CurrentOperation = new OperationAdd(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("delRequest")) { - - OperationDelete CurrentOperation = new OperationDelete(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("modDNRequest")) { - - OperationModifyDN CurrentOperation = new OperationModifyDN(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("compareRequest")) { - - OperationCompare CurrentOperation = new OperationCompare(); - res = CurrentOperation.getResponse(context) ; - - } else if (RequestType.equals("extendedRequest")) { - - OperationExtended CurrentOperation = new OperationExtended(); - res = CurrentOperation.getResponse(context) ; - - } else { - // output = echoHeaderStringHandler.sef.createElement("errorReponse"); - } - - - - - requests.set(index,res); - logger.log(Level.INFO, "Processing: finished {0}", RequestType); - FirstRequest = false; - ldap_pool.releaseConnection( context.getLdapConnection() ); - } - - - - public boolean Error(){ - return !this.dontHalt; - } - - public int getRequestCount(){ - return this.requests.size(); - } - - public javax.xml.soap.SOAPElement getRequestItem(int index) { - return (javax.xml.soap.SOAPElement) this.requests.get(index); - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java deleted file mode 100644 index bafbfc4f..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java +++ /dev/null @@ -1,126 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.io.*; -import java.util.Properties; -import java.util.logging.*; - -public class Configuration { - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.Configuration"); - - private static String propertiesFilename; - private final static String header = "properties file for the Netscape DSMLGW"; - private final static String[][] defaults = new String[][] - { { "MinPool", "5" }, - { "MaxPool", "10" }, - { "MinLoginPool", "2" }, - { "MaxLoginPool", "5" }, - { "ServerHost", "localhost" }, - { "ServerPort", "389" }, - { "BindDN", "" }, - { "BindPW" , "" }, - { "UseAuth", "false" } - }; - - private static Configuration _instance = null; - private static Object lock = new Object(); - private static Properties properties = null; - - /** Creates a new instance of Config */ - private Configuration() { - - propertiesFilename = System.getProperty("user.home","") + System.getProperty("file.separator") + "dsmlgw.cfg"; - logger.log( Level.CONFIG, "using properties filename " + propertiesFilename); - load(); - } - - public static Configuration getInstance() { - if (null == _instance ) { - synchronized(lock) { - if (_instance == null ) - _instance = new Configuration(); - - } - } - return _instance; - } - - - private void load() { - try { - - properties = new Properties(); - - for (int i=0; i< defaults.length; i++) - properties.setProperty(defaults[i][0], defaults[i][1] ); - - - FileInputStream in = null; - in = new FileInputStream(propertiesFilename); - properties.load(in); - - } catch (java.io.FileNotFoundException e) { - - System.err.println("Can't find properties file: " + propertiesFilename + ". " + - "Using defaults."); - - } catch (java.io.IOException e) { - - System.err.println("Can't read properties file: " + propertiesFilename + ". " + - "Using defaults."); - - } - - } - - - public int getMinPool() { return Integer.parseInt(properties.getProperty("MinPool")); } - public int getMaxPool() { return Integer.parseInt(properties.getProperty("MaxPool")); } - public int getMinLoginPool() { return Integer.parseInt(properties.getProperty("MinLoginPool")); } - public int getMaxLoginPool() { return Integer.parseInt(properties.getProperty("MaxLoginPool")); } - public int getServerPort() { return Integer.parseInt(properties.getProperty("ServerPort")); } - - public String getServerHost() { return properties.getProperty("ServerHost"); } - - public String getBindDN() { return properties.getProperty("BindDN"); } - public String getBindPW() { return properties.getProperty("BindPW"); } - - public boolean getUseAuth() { return Boolean.valueOf( properties.getProperty("UseAuth").trim() ).booleanValue(); } - -} - diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java deleted file mode 100644 index badc7945..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java +++ /dev/null @@ -1,171 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * Constants used in the code. - */ -public class Constants -{ - public static final String DSML20_URN = "urn:oasis:dsml:names:tc:DSML:2:0:core"; - public static final String BATCH_REQUEST = "batchRequest"; - public static final String BATCH_RESPONSE = "batchResponse"; - - public static final String DSML_REQUEST = "DSMLRequest"; - public static final String DSML_RESPONSE = "DSMLResponse"; - - public static final String AUTH_REQUEST = "authRequest"; - public static final String SEARCH_REQUEST = "searchRequest"; - public static final String MODIFY_REQUEST = "modifyRequest"; - public static final String ADD_REQUEST = "addRequest"; - public static final String DEL_REQUEST = "delRequest"; - public static final String MODDN_REQUEST = "modDNRequest"; - public static final String COMPARE_REQUEST = "compareRequest"; - public static final String ABANDON_REQUEST = "abandonRequest"; - public static final String EXTENDED_REQ = "extendedRequest"; - - - public static final String AUTH_RESPONSE = "authResponse"; - public static final String SEARCH_RES_ENTRY = "searchResultEntry"; - public static final String SEARCH_RES_REF = "searchResultReference"; - public static final String SEARCH_RES_DONE = "searchResultDone"; - public static final String MODIFY_RESPONSE = "modifyResponse"; - public static final String ADD_RESPONSE = "addResponse"; - public static final String DEL_RESPONSE = "delResponse"; - public static final String MODDN_RESPONSE = "modDNResponse"; - public static final String COMPARE_RESPONSE = "compareResponse"; - public static final String ABANDON_RESPONSE = "abandonResponse"; - public static final String EXTENDED_RESPONSE= "extendedResponse"; - public static final String ERROR_RESPONSE = "errorResponse"; - public static final String SEARCH_RESPONSE = "searchResponse"; - - public static final String ERROR_TYPE = "type"; - public static final String ERROR_MESSAGE = "message"; - - - public static final String REQUEST_ID = "requestID"; - - public static final String PROCESSING = "processing"; - public static final String SEQUENTIAL = "sequential"; - public static final String PARALLEL = "parallel"; - - public static final String RESPONSE_ORDER = "responseOrder"; - public static final String UNORDERED = "unOrdered"; - - public static final String ON_ERROR = "onError"; - public static final String RESUME = "resume"; - public static final String EXIT = "exit"; - - - public static final String NOT_ATTEMPTED = "notAttempted"; - public static final String UNKNOWN_REQ = "Unknown Request"; - - public static final String BINDREQ_ERROR_MESSAGE = "Found a BindRequest which is not the first request"; - public static final String BATCH_RESPONSE_START_TAG = "<batchResponse xmlns=\"" + DSML20_URN + "\">"; - public static final String BATCH_RESPONSE_END_TAG = "</batchResponse>"; - - public static final String DN = "dn"; - //Modify Request - public static final String ATTR = "attr"; - public static final String OPERATION = "operation"; - public static final String ADD_OPERATION = "add"; - public static final String DELETE_OPERATION = "delete"; - public static final String REPLACE_OPERATION = "replace"; - public static final String NAME = "name"; - public static final String VALUE = "value"; - public static final String RESULT_CODE = "resultCode"; - public static final String CODE = "code"; - public static final String DESC = "desc"; - - public static final String FILTER = "filter"; - public static final String SUBSTRINGS = "substrings"; - public static final String EQUALITY_MATCH = "equalityMatch"; - public static final String GREATER_OR_EQAUAL = "greaterOrEqual"; - public static final String LESS_OR_EQAUAL = "lessOrEqual"; - public static final String PRESENT = "present"; - public static final String APPROX_MATCH = "approxMatch"; - public static final String EXTENSIBLE_MATCH = "extensibleMatch"; - public static final String MATCHING_RULE = "matchingRule"; - public static final String DN_ATTRIBUTES = "dnAttributes"; - public static final String AND = "and"; - public static final String OR = "or"; - public static final String NOT = "not"; - - public static final String SUBSTRING_INITIAL = "initial"; - public static final String SUBSTRING_ANY = "any"; - public static final String SUBSTRING_FINAL = "final"; - - public static final String CONTROL = "control"; - public static final String CONTROL_TYPE = "type"; - public static final String CONTROL_CRITICALITY = "criticality"; - public static final String CONTROL_VALUE = "controlValue"; - - public static final String SCOPE = "scope"; - public static final String BASE_SCOPE = "baseObject"; - public static final String SINGLE_LEVEL_SCOPE = "singleLevel"; - public static final String WHOLE_TREE_SCOPE = "wholeSubTree"; - - - public static final String DREF_ALIASES = "derefAliases"; - public static final String NEVER_DREF_ALIASES = "neverDerefAliases"; - public static final String DEREF_IN_SEARCH = "derefInSearching"; - public static final String DREF_FIND_BASE_OBJ = "derefFindingBaseObj"; - public static final String DREF_ALWAYS = "derefAlways"; - - public static final String SIZE_LIMIT = "sizeLimit"; - public static final String TIME_LIMIT = "timeLimit"; - public static final String TYPES_ONLY = "typesOnly"; - - public static final String ATTRIBUTES = "attributes"; - public static final String ATTRIBUTE = "attribute"; - - public static final String ERRORMESSAGE = "errorMessage"; - public static final String MATCHED_DN = "matchedDN"; - public static final String ERR_REFERRAL_STR = "referral"; - public static final String REF = "ref"; - public static final String NEWRDN = "newrdn"; - public static final String DELETEOLDRDN = "deleteoldrdn"; - public static final String NEWSUPERIOR = "newSuperior"; - public static final String ASSERTION = "assertion"; - public static final String REQUESTNAME = "requestName"; - public static final String REQUESTVALUE = "requestValue"; - public static final String DSMLNS = "dsml:"; - - public static final int BATCH = 0; - public static final int DSML_REQ = 1; - public static final int DEFAULT_PORT = 389; -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java deleted file mode 100644 index f44dbcd3..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java +++ /dev/null @@ -1,76 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - - -import netscape.ldap.*; -import org.w3c.dom.*; - -/** - * - * @author elliot - * - * This {interface|class} is the standard request. Specific requests / reponses - * inherit from this. - */ -class GenericOperation { - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - /** Creates a new instance of OperationCompare */ - public GenericOperation() { - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace();} - } - - - public void setRoot(org.w3c.dom.Node op) { - if (root == null) - root = op; - - } - - public void setLDAPConnection(LDAPConnection lc) { - if (ldapConn == null) - ldapConn = lc; - } - // abstract javax.xml.soap.SOAPElement getResponse(gatewayContext ctx); -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java deleted file mode 100644 index 96166a1d..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java +++ /dev/null @@ -1,51 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * This interface defines the factory interfaces. Each connection manager implements - * must use the factory interface. The design patterns used are: Abstract Factory, - * Factory Method and Functor patterns in the GoF book. - */ - -public interface IConnMgrFactoryFunctor -{ - /** - * @return An instance of the connection manager factory - */ - public IConnectionManager getInstance() throws Exception; -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java deleted file mode 100644 index 51867d29..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.io.IOException; -import netscape.ldap.LDAPConnection; - -public interface IConnectionManager { - - - public void shutdown(); - public LDAPConnection getConnection(); - public LDAPConnection getLoginConnection(); - public void releaseConnection(LDAPConnection ld); - /** - * release the connection - * - * @param the login ctx - * @param the LDAP connection - */ - public void releaseConnection(String loginCtx, LDAPConnection ld); - public LDAPConnection getConnection(String loginCtx); - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java deleted file mode 100644 index 09484b41..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -/** - * - * @author elliot - */ -public class LDAPAuthenticator { - - String DN = null; - String PW = null; - - - /** Creates a new instance of LDAPAuthenticator */ - public LDAPAuthenticator(String username, String password) { - DN = username; - PW = password; - } - - public int authenticate() { - - if (DN == null && PW == null) - return 0; - - LDAPConnection ldc = null; - - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - IConnectionManager ldap_pool= pmc.getInstance(); - - ldc = ldap_pool.getLoginConnection(); - - if (ldc != null) { - try { - ldc.authenticate( DN, PW ); - } catch ( LDAPException e ) { - switch( e.getLDAPResultCode() ) { - case LDAPException.NO_SUCH_OBJECT: - // System.out.println( "The specified user does not exist." ); - return LDAPException.NO_SUCH_OBJECT; - - case LDAPException.INVALID_CREDENTIALS: - // System.out.println( "Invalid password." ); - return LDAPException.INVALID_CREDENTIALS; - - default: - // System.out.println( "Error number: " + e.getLDAPResultCode() ); - // System.out.println( "Failed to authentice as " + DN ); - return e.getLDAPResultCode() ; - - } - } - // System.out.println( "Authenticated as " + DN ); - return 0; - } else { - - // System.out.println( "Can't establish connection to LDAP server"); - return LDAPException.UNAVAILABLE ; - } - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java deleted file mode 100644 index 4d84cd9c..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java +++ /dev/null @@ -1,126 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationAdd extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - LDAPAttributeSet ldAttrSet = new LDAPAttributeSet(); - // XXX is this really necessary? - // if (ldAttrSet == null ) { - // throw new Exception("MEMORY_ALLOCATION_ERROR"); - // } - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - Node attr = nl.item(i).getFirstChild(); - if (attr.getNodeType() == Node.TEXT_NODE) - attr = attr.getNextSibling(); - - String attrName = nl.item(i).getAttributes().getNamedItem("name").getNodeValue(); - byte[] attrValue; - - if (nl.item(i).getFirstChild().getNodeType() == Node.ELEMENT_NODE) - attrValue = ParseValue.parseValueFromNode( nl.item(i).getFirstChild() ); - else - attrValue = ParseValue.parseValueFromNode( nl.item(i).getFirstChild().getNextSibling() ); - - - LDAPAttribute ldapAttr = new LDAPAttribute( attrName, attrValue); - - if (ldapAttr != null ) { - ldAttrSet.add(ldapAttr); - } - - - - } - catch (Exception e) { e.printStackTrace();} - } - - } - - int resultCode= 0; - String errorMessage = "completed"; - LDAPEntry entry = new LDAPEntry(dn,ldAttrSet); - javax.xml.soap.SOAPElement output = null; - - try { - - - - - if (ctx.getConstraints() != null) { - ldapConn.add(entry, ctx.getConstraints() ); } - else { - ldapConn.add( entry ); } - - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage(); - - - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("addResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java deleted file mode 100644 index 3bf19717..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java +++ /dev/null @@ -1,65 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationAuth extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("authResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer( netscape.ldap.LDAPException.AUTH_METHOD_NOT_SUPPORTED).toString() ); - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - } - - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java deleted file mode 100644 index 28ff6157..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java +++ /dev/null @@ -1,111 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationCompare extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - LDAPAttribute attr = null; - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("assertion") ) { - - String field = nl.item(i).getAttributes().getNamedItem("name").getNodeValue(); - attr = new LDAPAttribute(field); - - NodeList Values = nl.item(i).getChildNodes(); - - for (int j=0; j< Values.getLength(); j++) { - if (Values.item(j).getNodeType() == Node.ELEMENT_NODE && - Values.item(j).getLocalName().equals("value")) { - attr.addValue(Values.item(j).getFirstChild().getNodeValue()); - - } - - } - } - } catch (Exception e) { } - } - } - - boolean result; - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - LDAPAttribute attribute=null; - - - - try { - if (ctx.getConstraints() != null) - result = ldapConn.compare(dn, attr, ctx.getConstraints() ); - else - result = ldapConn.compare(dn, attr); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modDNResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java deleted file mode 100644 index 5f673b57..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java +++ /dev/null @@ -1,87 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - - -public class OperationDelete extends GenericOperation { - - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - - try { - if (ctx.getConstraints() != null) - ldapConn.delete(dn, ctx.getConstraints() ); - else - ldapConn.delete(dn); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("deleteResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java deleted file mode 100644 index d168a440..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java +++ /dev/null @@ -1,122 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; -import netscape.ldap.util.ByteBuf; -import netscape.ldap.util.MimeBase64Decoder; - -public class OperationExtended extends GenericOperation { - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - java.util.Vector modifications = new java.util.Vector(1); - - String oid = new String(); - ByteBuf value=new ByteBuf(); - String binaryStr = null; - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("requestName") ) { - oid = nl.item(i).getFirstChild().getNodeValue().trim(); - - } else if (nl.item(i).getLocalName().equals("requestValue") ) { - - // Assuming the it is base64Binary - binaryStr = nl.item(i).getFirstChild().getNodeValue(); - ByteBuf inputBuf = new ByteBuf(binaryStr); - value = new ByteBuf(); - MimeBase64Decoder decoder = new MimeBase64Decoder(); - decoder.translate(inputBuf, value); - decoder.eof(value); - - } - - } catch (Exception e) { } - } - } - - - LDAPExtendedOperation extendedOperation = new LDAPExtendedOperation(oid, null ); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - LDAPExtendedOperation result = null; - try { - if (ctx.getConstraints() != null) - result = ldapConn.extendedOperation(extendedOperation, ctx.getConstraints() ); - else - result = ldapConn.extendedOperation(extendedOperation); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("extendedResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - sbe.addChildElement("reponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("xsi:type"), "xsd:base64Binary" ).setNodeValue( result.getValue().toString() ); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - - } -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java deleted file mode 100644 index 17aa356b..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java +++ /dev/null @@ -1,166 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; -import java.util.logging.*; - -public class OperationModify extends GenericOperation { - private static Logger logger = Logger.getLogger("com.netscape.dsml.gateway.OperationModify"); - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - OperationModify(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - - root = ctx.getRootNode(); - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - java.util.Vector modifications = new java.util.Vector(1); - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("modification") ) { - - // should check to make sure there's only one child to this filter - - Node mod = nl.item(i); - - String modify_field = mod.getAttributes().getNamedItem("name").getNodeValue().trim(); - String modify_op = mod.getAttributes().getNamedItem("operation").getNodeValue(); - - logger.log(Level.INFO, "modify_field: {0}", modify_field); - logger.log(Level.INFO, "modify_op: {0}", modify_op); - - int op = -1; - LDAPAttribute attr = new LDAPAttribute(modify_field); - - NodeList Values = mod.getChildNodes(); - - for (int j=0; j< Values.getLength(); j++) { - if (Values.item(j).getNodeType() == Node.ELEMENT_NODE && - Values.item(j).getLocalName().equals("value")) { - attr.addValue( ParseValue.parseValueFromNode(Values.item(j)) ); - - } - - } - - - - if (modify_op.equals("replace")) { - op =LDAPModification.REPLACE; - } else if (modify_op.equals("delete")) { - op =LDAPModification.DELETE; - } else if (modify_op.equals("add")) { - op =LDAPModification.ADD; - } - - modifications.add(new LDAPModification(op, attr)); - - } - - - - } - catch (Exception e) { e.printStackTrace();} - - } - } - - LDAPModification[] lm = new LDAPModification[modifications.size()]; - for (int i=0; i< modifications.size(); i++) - lm[i] = (LDAPModification) modifications.get(i); - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - ldapConn = ctx.getLdapConnection(); - - try { - if (ctx.getConstraints() != null) - ldapConn.modify(dn, lm, ctx.getConstraints() ); - else - ldapConn.modify(dn, lm); - - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - if (! ldapConn.isConnected()) { - errorMessage = "GATEWAY NOT CONNECTED"; - } - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modifyResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java deleted file mode 100644 index b42025f0..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java +++ /dev/null @@ -1,125 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -public class OperationModifyDN extends GenericOperation { - - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - - OperationModifyDN(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - ldapConn = ctx.getLdapConnection(); - root = ctx.getRootNode(); - - - LDAPException ldException = null; - LDAPSearchResults results = null; - LDAPSearchConstraints searchConstraint = new LDAPSearchConstraints(); - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - String newRDN= root.getAttributes().getNamedItem("newrdn").getNodeValue().trim(); - - boolean deleteOldRDN= true; - - try { - if (root.getAttributes().getNamedItem("deleteoldrdn") != null) - deleteOldRDN = new Boolean( root.getAttributes().getNamedItem("deleteoldrdn").getNodeValue().trim()).booleanValue(); - } catch (Exception e) { } - - - // This is unsupported, but it's here for the sake of completion. - String newSuperior = null; - try { - if (root.getAttributes().getNamedItem("newSuperior") != null) - newSuperior = root.getAttributes().getNamedItem("newSuperior").getNodeValue().trim(); - } catch (Exception e) { newSuperior = null; } - - int resultCode= 0; - String errorMessage = "completed"; - - javax.xml.soap.SOAPElement output = null; - - - - try { - if (ctx.getConstraints() != null) - ldapConn.rename(dn, newRDN, newSuperior, deleteOldRDN,ctx.getConstraints() ); - else - ldapConn.rename(dn, newRDN, newSuperior, deleteOldRDN); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("modDNResponse") ); - sbe.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - if (errorMessage != null) - sbe.addChildElement("errorMessage").addTextNode(errorMessage); - - - } catch (Exception E) { - E.printStackTrace(); - } - - return sbe; - - - } - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java deleted file mode 100644 index 482abaee..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java +++ /dev/null @@ -1,352 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - -import java.util.logging.*; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Node; -import org.w3c.dom.traversal.NodeIterator; -import org.w3c.dom.traversal.DocumentTraversal; -import org.w3c.dom.traversal.TreeWalker; -import org.w3c.dom.traversal.NodeFilter; - -class OperationSearch extends GenericOperation { - - org.w3c.dom.Node root = null; - LDAPConnection ldapConn = null; - javax.xml.soap.MessageFactory messageFactory = null ; - javax.xml.soap.SOAPFactory sef = null; - private static Logger logger = - Logger.getLogger("com.netscape.dsml.service.ProxyConnectionManager"); - - OperationSearch(){ - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception E) {E.printStackTrace(); - } - } - - public void setRoot(org.w3c.dom.Node op){ - if (root == null) - root = op; - } - - public void setLDAPConnection(LDAPConnection lc) { - if (ldapConn == null) - ldapConn = lc; - } - - public javax.xml.soap.SOAPElement getResponse(gatewayContext ctx) { - - - root = ctx.getRootNode(); - - - int scope = -1; - int derefAliases = -1; - - LDAPException ldException = null; - LDAPSearchResults results = null; - - String dn = root.getAttributes().getNamedItem("dn").getNodeValue().trim(); - String scopeRaw = root.getAttributes().getNamedItem("scope").getNodeValue().trim(); - String derefAliasesRaw = root.getAttributes().getNamedItem("derefAliases").getNodeValue().trim(); - - int sizeLimit = 0; - try { - if ( root.getAttributes().getNamedItem("sizeLimit") != null) - sizeLimit = Integer.parseInt( root.getAttributes().getNamedItem("sizeLimit").getNodeValue()); - } catch (Exception e) {} - - - int timeLimit = 0; - try { - if ( root.getAttributes().getNamedItem("timeLimit") != null) - timeLimit = Integer.parseInt( root.getAttributes().getNamedItem("timeLimit").getNodeValue()); - } catch (Exception e) {} - - boolean typesOnly = false; - try { - if ( root.getAttributes().getNamedItem("typesOnly") != null ) - typesOnly = Boolean.valueOf(root.getAttributes().getNamedItem("typesOnly").getNodeValue()).booleanValue(); - } catch (Exception e) {} - - - String attributeList[] = null; - java.util.Vector attributeRaw = new java.util.Vector(); - java.util.Vector Controls = new java.util.Vector(); - String filterString = new String(); - - root.normalize(); - - int whattoshow = NodeFilter.SHOW_ALL; - NodeFilter nodefilter = null; - boolean expandreferences = false; - - - org.w3c.dom.NodeList nl = root.getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - try { - if (nl.item(i).getLocalName().equals("filter") ) { - // should check to make sure there's only one child to this filter - NodeList filters = nl.item(i).getChildNodes(); - for (int j=0; j< filters.getLength(); j++) { - if (filters.item(j).getNodeType() == Node.ELEMENT_NODE){ - filterString = ParseFilter.parseFilterFromNode( filters.item(j)); - } - } - - - } else if (nl.item(i).getLocalName().equals("attributes") ) { - NodeList attributes = nl.item(i).getChildNodes(); - - for (int j=0; j< attributes.getLength(); j++) { - if (attributes.item(j).getNodeType() == Node.ELEMENT_NODE){ - attributeRaw.add( attributes.item(j).getAttributes().getNamedItem("name").getNodeValue() ); - } - } - attributeList= new String[ attributeRaw.size()]; - for (int j=0; j< attributeRaw.size(); j++) - attributeList[j] = (String) attributeRaw.get(j); - - } else if (nl.item(i).getLocalName().equals("control") ) { - Controls.add( ParseControl.parseControlFromNode(nl.item(i)) ); - - } - - } - catch (Exception e) { e.printStackTrace();} - - } } - // XXX - - if (scopeRaw.equals("baseObject")) - scope = ldapConn.SCOPE_BASE; - else if (scopeRaw.equals("singleLevel")) - scope = ldapConn.SCOPE_ONE; - else if (scopeRaw.equals("wholeSubtree")) - scope = ldapConn.SCOPE_SUB; - else - scope = ldapConn.SCOPE_BASE; - - - if (derefAliasesRaw.equals("neverDerefAliases")) - derefAliases = ldapConn.DEREF_NEVER; - else if (derefAliasesRaw.equals("derefInSearching")) - derefAliases = ldapConn.DEREF_SEARCHING; - else if (derefAliasesRaw.equals("derefFindingBaseObj")) - derefAliases = ldapConn.DEREF_FINDING; - else if (derefAliasesRaw.equals("derefAlways")) - derefAliases = ldapConn.DEREF_ALWAYS; - else - derefAliases = ldapConn.DEREF_NEVER; - - - - logger.log(Level.INFO, "dn: {0}", dn); - logger.log(Level.INFO, "scope: {0}", scopeRaw); - logger.log(Level.INFO, "derefAliases: {0}", derefAliasesRaw); - - logger.log(Level.INFO, "sizeLimit: {0}", String.valueOf(sizeLimit) ); - logger.log(Level.INFO, "timeLimit: {0}", String.valueOf(timeLimit) ); - logger.log(Level.INFO, "typesOnly: {0}", String.valueOf(typesOnly) ); - if (attributeList ==null) - logger.log(Level.INFO, "attributeList: {0}", "null"); - else - logger.log(Level.INFO, "attributeList: {0}", attributeList.toString() ); - logger.log(Level.INFO, "filter: {0}", filterString ); - - /* - * System.out.println("dn : " + dn ); - * System.out.println("scope : " + scopeRaw ); - * System.out.println("derefAliases : " + derefAliasesRaw ); - * System.out.println("sizeLimit : " + sizeLimit ); - * System.out.println("timeLimit : " + timeLimit ); - * System.out.println("typesOnly : " + typesOnly ); - * System.out.println("filterString : " + filterString ); - * - * System.out.println("attributeList[]"); - * if (attributeList == null) - * System.out.println("null"); - * else { - * for (int i=0; i < attributeList.length ; i++ ) - * System.out.println("attributeList[" + i + "] : " + attributeList[i]); - *} - */ - - int resultCode = 0; - String errorMessage = "completed"; - - ctx.setConstraints( new LDAPSearchConstraints() ); - ctx.getConstraints().setTimeLimit(timeLimit); - ctx.getConstraints().setDereference(derefAliases); - ctx.getConstraints().setMaxResults(sizeLimit); - - try { - if (Controls.size() >0 ) { - if (ctx.getConstraints() == null) { - ctx.setConstraints( new LDAPSearchConstraints() ); - } - // XXX this gave a class cast exception, don't understand why - - netscape.ldap.LDAPControl tmp[] = new netscape.ldap.LDAPControl[ Controls.size() ]; - for (int i=0; i< Controls.size(); i++) { - tmp[i] = (netscape.ldap.LDAPControl) Controls.get(i); - } - - ctx.getConstraints().setServerControls( tmp ); - - } - - ldapConn = ctx.getLdapConnection(); - - if (ctx.getConstraints() != null) - results = ldapConn.search(dn, scope, filterString, attributeList, false, ctx.getConstraints() ); - else - results = ldapConn.search( dn, scope, filterString, attributeList, false); - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = "LDAP Error code " + new Integer(resultCode).toString(); - // This line should work - // XXX errorMessage = LDAPException.errorCodeToString(resultCode); - E.printStackTrace(); - } - - - javax.xml.soap.SOAPEnvelope elementFactory = null; - javax.xml.soap.SOAPBody entryFactory = null; - javax.xml.soap.SOAPBodyElement sbe = null; - try { - sbe = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("searchResponse") ); - entryFactory = messageFactory.createMessage().getSOAPBody(); - elementFactory = messageFactory.createMessage().getSOAPPart().getEnvelope(); - } catch (Exception E) { }; - - if (results != null) { - while (results.hasMoreElements()) { - try { - LDAPEntry entry = results.next(); - LDAPAttributeSet attributeset = entry.getAttributeSet(); - java.util.Enumeration attribs = attributeset.getAttributes(); - dn = entry.getDN(); - - javax.xml.soap.SOAPBodyElement searchresultentry = null; - try { - searchresultentry = entryFactory.addBodyElement(elementFactory.createName("searchResultEntry") ); - searchresultentry.addAttribute(elementFactory.createName("dn"), dn); - sbe.addChildElement(searchresultentry); - } catch (Exception E) { E.printStackTrace(); } - - - while (attribs.hasMoreElements()) { - LDAPAttribute att = (LDAPAttribute) attribs.nextElement(); - - String[] values = att.getStringValueArray(); - javax.xml.soap.SOAPElement attr = null; - attr = searchresultentry.addChildElement( elementFactory.createName("attr")); - attr.addAttribute(elementFactory.createName( "name" ), att.getName() ); - - for (int k=0; k< values.length;k++) { - javax.xml.soap.SOAPElement val = attr.addChildElement("value"); - val.addTextNode( values[k] ); - } - - } - - } catch (LDAPException E) { - resultCode = E.getLDAPResultCode(); - errorMessage = E.getLDAPErrorMessage() ; - } catch (Exception E) { E.printStackTrace(); } - - } - - } - - try { - javax.xml.soap.SOAPBodyElement resultdone = null; - - resultdone = messageFactory.createMessage().getSOAPBody().addBodyElement(elementFactory.createName("searchResultDone") ); - - /* if there are controls to add to this envelope, they go in the searchresultdone tag */ - - netscape.ldap.LDAPControl serverControls[] = null; - if (results!=null) - serverControls = results.getResponseControls(); - - if (serverControls != null && serverControls.length >0) { - - for (int k=0; k< serverControls.length; k++) { - if ( serverControls[k] instanceof netscape.ldap.controls.LDAPVirtualListResponse ) { - netscape.ldap.controls.LDAPVirtualListResponse lvlr = (netscape.ldap.controls.LDAPVirtualListResponse) serverControls[k]; - javax.xml.soap.SOAPBodyElement ctl = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("control") ); - ctl.addAttribute( messageFactory.createMessage().getSOAPPart().getEnvelope().createName("type"), netscape.ldap.controls.LDAPVirtualListResponse.VIRTUALLISTRESPONSE ); - resultCode = lvlr.getResultCode(); - - javax.xml.soap.SOAPElement controlValue = messageFactory.createMessage().getSOAPBody().addChildElement("controlValue", "", ""); - controlValue.addChildElement("begin", "").addTextNode( new Integer( lvlr.getFirstPosition() ).toString() ); - controlValue.addChildElement("count", "").addTextNode( new Integer( lvlr.getContentCount() ).toString() ); - - resultdone.addChildElement( controlValue); - - resultdone.addChildElement(ctl); - } else if ( serverControls[k] instanceof netscape.ldap.controls.LDAPSortControl ) { - netscape.ldap.controls.LDAPSortControl lsc = (netscape.ldap.controls.LDAPSortControl) serverControls[k]; - javax.xml.soap.SOAPBodyElement ctl = messageFactory.createMessage().getSOAPBody().addBodyElement(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("control") ); - ctl.addAttribute( messageFactory.createMessage().getSOAPPart().getEnvelope().createName("type"), netscape.ldap.controls.LDAPSortControl.SORTRESPONSE ); - resultdone.addChildElement(ctl); - resultCode = lsc.getResultCode(); // new result code now by way of control - } - } - } /* end of control section */ - - - resultdone.addChildElement("resultCode").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), new Integer(resultCode).toString() ); - sbe.addChildElement(resultdone); - } catch (Exception E) {E.printStackTrace(); } - - return sbe; - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java deleted file mode 100644 index 41c977bc..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; -import java.util.logging.*; - -public class ParseControl { - - public static netscape.ldap.LDAPControl parseControlFromNode(org.w3c.dom.Node n) { - Logger logger = Logger.getLogger("com.netscape.dsml.gateway.ParseControl"); - String type = null; - byte[] value = null; - boolean criticality = false; - - - try { - type = n.getAttributes().getNamedItem("type").getNodeValue(); - } catch (Exception e) { - // throw new gatewayException("control type can not be omitted"); - } - - try { - criticality = Boolean.valueOf( n.getAttributes().getNamedItem("criticality").getNodeValue() ).booleanValue(); - } catch (Exception e) { /* ignore */ } - - - netscape.ldap.LDAPControl lc = null; - if (type.equals( netscape.ldap.controls.LDAPSortControl.SORTREQUEST ) ) { - try { - java.util.Vector ldskv = new java.util.Vector(); - - org.w3c.dom.NodeList nl = n.getFirstChild().getNextSibling().getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - - if (nl.item(i).getLocalName().equals("attr") ) { - - // should check to make sure there's only one child to this filter - - Node mod = nl.item(i); - - String attribute = mod.getAttributes().getNamedItem("name").getNodeValue().trim(); - boolean reverse = false; - - try { - reverse = new Boolean( mod.getAttributes().getNamedItem("reverse").getNodeValue().trim()).booleanValue(); - } catch (Exception e) {} - - netscape.ldap.LDAPSortKey ldsk = new netscape.ldap.LDAPSortKey(attribute, reverse); - logger.log(Level.FINE, "SSS: reverse: {0}", String.valueOf(reverse)); - logger.log(Level.FINE, "SSS: attribute: {0}", attribute ); - - ldskv.add(ldsk); - - } - } - } - - netscape.ldap.LDAPSortKey sortkeys[] = new netscape.ldap.LDAPSortKey[ ldskv.size() ]; - for (int j=0; j< ldskv.size(); j++) - sortkeys[j] = (netscape.ldap.LDAPSortKey) ldskv.get(j); - lc = new netscape.ldap.controls.LDAPSortControl(sortkeys, criticality); - - } catch (Exception e) - { e.printStackTrace(); } - - - } else if (type.equals( netscape.ldap.controls.LDAPVirtualListControl.VIRTUALLIST ) ) { - //lc = new netscape.ldap.controls.LDAPVirtualListControl(,); - int index = 0; - int before = 0; - int after = 0; - int content = 0; - java.util.Vector ldskv = new java.util.Vector(); - - org.w3c.dom.NodeList nl = n.getFirstChild().getNextSibling().getChildNodes(); - for (int i=0; i< nl.getLength(); i++) { - if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) { - - if (nl.item(i).getLocalName().equals("index") ) { - try { - index = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - } else if (nl.item(i).getLocalName().equals("before") ) { - try { - before = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - } else if (nl.item(i).getLocalName().equals("after") ) { - try { - after = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - } else if (nl.item(i).getLocalName().equals("count") ) { - try { - content = Integer.parseInt( nl.item(i).getFirstChild().getNodeValue() ); - } catch (Exception e) {} - - - - } - } - } - - logger.log(Level.FINE, "VLV: index: {0}", String.valueOf(index)); - logger.log(Level.FINE, "VLV: before: {0}", String.valueOf(before)); - logger.log(Level.FINE, "VLV: after: {0}", String.valueOf(after)); - logger.log(Level.FINE, "VLV: content: {0}", String.valueOf(content)); - lc = new netscape.ldap.controls.LDAPVirtualListControl( index, before, after, content ); - - } else { - if (criticality) { - // throw new gatewayException("unrecognized control oid"); - } else { - // do nothing - } - - } - - - - return lc; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java deleted file mode 100644 index 5302c734..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java +++ /dev/null @@ -1,182 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.w3c.dom.*; -import java.util.logging.*; - -public class ParseFilter { - - public static String parseFilterFromNode(org.w3c.dom.Node n) { - Logger logger = Logger.getLogger("com.netscape.dsml.gateway.FilterProcess"); - StringBuffer sb = new java.lang.StringBuffer(); - String output = new String(); - - if ( n != null && n.getNodeType() != Node.TEXT_NODE) { - String NodeName = n.getLocalName(); - - if ( NodeName.equals("present") ) { - logger.log(Level.ALL, "got filter: present"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append("=*"); - - } else if ( NodeName.equals("and") ) { - logger.log(Level.FINE, "got filter: and"); - Node it = n.getFirstChild(); - - sb.append('&'); - - while (it != null ) { - if (it.getNodeType() != Node.TEXT_NODE) - sb.append( parseFilterFromNode( it ) ); - it = it.getNextSibling(); - } - - } else if ( NodeName.equals("or") ) { - logger.log(Level.FINE, "got filter: or"); - Node it = n.getFirstChild(); - - sb.append('|'); - - while (it != null ) { - if (it.getNodeType() != Node.TEXT_NODE) - sb.append( parseFilterFromNode( it ) ); - it = it.getNextSibling(); - } - - } else if ( NodeName.equals("not") ) { - logger.log(Level.FINE, "got filter: not"); - Node it = n.getFirstChild(); - - sb.append('!'); - - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append( parseFilterFromNode(it) ); - - } else if ( NodeName.equals("greaterOrEqual") ) { - logger.log(Level.FINE, "got filter: greaterOrEqual"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append(">="); - - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - // if (n.getFirstChild().getNextSibling().getFirstChild().getNodeValue() != null) - // sb.append(it.getFirstChild().getNodeValue()); - // else - // sb.append( n.getFirstChild().getFirstChild().getNodeValue()); - - } else if ( NodeName.equals("lessOrEqual") ) { - logger.log(Level.FINE, "got filter: lessOrEqual"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append("<="); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - } else if ( NodeName.equals("equalityMatch") ) { - logger.log(Level.FINE, "got filter: equalityMatch"); - logger.log(Level.FINER," eq: " + n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue() ); - logger.log(Level.FINER," eq: = "); - sb.append('='); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - - } else if ( NodeName.equals("approxMatch") ) { - logger.log(Level.FINE, "got filter: approxMatch"); - sb.append(n.getAttributes().getNamedItem("name").getNodeValue() ); - sb.append("~="); - Node it = n.getFirstChild(); - if (it.getNodeType() == Node.TEXT_NODE) - it = it.getNextSibling(); - - sb.append(it.getFirstChild().getNodeValue()); - - - } else if ( NodeName.equals("substrings") ) { - logger.log(Level.FINE, "got filter: substrings"); - - Node it = n.getFirstChild(); - - sb.append(n.getAttributes().getNamedItem("name").getNodeValue()); - sb.append('='); - - boolean noStar = false; - - - while (it != null) { - - if (it.getNodeType() != Node.TEXT_NODE){ - if (it.getLocalName().equals("any")){ - if ( ! noStar ) - sb.append('*'); - noStar = true; - sb.append(it.getFirstChild().getNodeValue()); - sb.append('*'); - } else if (it.getLocalName().equals("initial")){ - noStar = true; - sb.append(it.getFirstChild().getNodeValue()); - sb.append('*'); - } if (it.getLocalName().equals("final")){ - if (! noStar) - sb.append('*'); - sb.append(it.getFirstChild().getNodeValue()); - } - } - it=it.getNextSibling(); - } - } else return new String(); - - - } - logger.log(Level.INFO, "returning: (" + sb.toString() + ")" ); - return new StringBuffer().append('(').append(sb).append(')').toString(); - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java deleted file mode 100644 index c1697f17..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java +++ /dev/null @@ -1,79 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import org.apache.commons.codec.binary.Base64; - -/** - * - * @author elliot - */ -public class ParseValue { - - /** Creates a new instance of ParseValue */ - public ParseValue() { - } - - public static byte[] parseValueFromNode(org.w3c.dom.Node n) { - byte[] ret = null; - // <xsd:union memberTypes="xsd:string xsd:base64Binary xsd:anyURI"/> - - org.w3c.dom.Node type = n.getAttributes().getNamedItem("xsi:type"); - if (type != null && type.getNodeValue().equalsIgnoreCase("xsd:base64Binary") ) { - // This value is encoded in base64. decode it. - Base64 bd = new Base64(); - try { - ret = bd.decode( n.getFirstChild().getNodeValue().getBytes() ) ; - } - catch (org.w3c.dom.DOMException de) { - ret = "".getBytes(); - } - catch (Exception e) { - // couldn't decode auth info - } - - } else { - // anyURI is unsupported. - ret = new String(n.getFirstChild().getNodeValue()).getBytes(); - - } - return ret; - - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java deleted file mode 100644 index a7fb6870..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -/** - * This provides a factory interface to the proxy connection manager. In the - * proxy mode, the user connections are bound to the directory server using a - * proxy user. - */ - -public class ProxyConnMgrFactory implements IConnMgrFactoryFunctor { - - public ProxyConnMgrFactory() { - } - - /** - * @return An instance of the connection manager - * - * @exception DSMLConfigException if unable to initialize. - */ - public synchronized IConnectionManager getInstance() { - - if (_proxyConnMgr == null) { - _proxyConnMgr = ProxyConnectionManager.getInstance(); - } - return _proxyConnMgr; - } - private ProxyConnectionManager _proxyConnMgr= null; - - - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java deleted file mode 100644 index 86577c2a..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java +++ /dev/null @@ -1,289 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import java.lang.Exception ; -import java.util.*; -import java.util.logging.*; -import netscape.ldap.LDAPConnection; -import netscape.ldap.util.ConnectionPool; -import netscape.ldap.LDAPConstraints; -import netscape.ldap.LDAPSearchConstraints; -import netscape.ldap.controls.LDAPProxiedAuthControl; -import netscape.ldap.LDAPBind; -import netscape.ldap.LDAPException; -import java.io.IOException; - -/** - * ProxyConnectionManager is respossible for creating a pool of connections - * to the directory server. The pool is initialized with configured set of - * connections. Two pools are created; one for authentication and the other - * for operations. The pool parameters (max and min) can be configured. - * - */ -class ProxyConnectionManager implements IConnectionManager { - /* - * Default maximum backlog queue size - */ - static final int MAX_BACKLOG = 100; - static final String LDAP_MAXBACKLOG = "maxbacklog"; - static final String LDAP_REFERRAL = "referral"; - - - private static Logger logger = - Logger.getLogger("com.netscape.dsml.service.ProxyConnectionManager"); - static private ConnectionPool _ldapPool = null; - static private ConnectionPool _ldapLoginPool = null; - static private LDAPConnection _trialConn = null; - static private LDAPSearchConstraints _defaultSearchConstraints = null; - static private ProxyConnectionManager m_instance = null; - - private String m_host = null; - private int m_port = 0; - private String m_user = ""; - private String m_password = ""; - - /** - * Initialize by reading the informaton from the config manager. - * - * throws DSMLConfigException if unable to get the config - * information. - */ - private ProxyConnectionManager() { - init(); - } - - - private void init() { - // Get an instance of the config manager - Configuration config = Configuration.getInstance(); - - m_host = config.getServerHost(); - m_port = config.getServerPort(); - m_user = config.getBindDN(); - m_password = config.getBindPW(); - - logger.log(Level.INFO, "m_host: {0}", m_host); - logger.log(Level.INFO, "m_port: {0}", String.valueOf(m_port) ); - logger.log(Level.INFO, "m_user: {0}", m_user); - logger.log(Level.INFO, "m_password: {0}", m_password); - - logger.log(Level.FINER, "Initializing the ldap pool"); - initLdapPool( config.getMinPool(), config.getMaxPool()); - - logger.log(Level.FINER, "Initializing the ldap LOGIN pool"); - initLoginPool(config.getMinLoginPool(), config.getMaxLoginPool()); - - logger.log(Level.FINER, "Pool initialization done"); - } - - - /** - * create the singelton LDAPLayer object if it doesn't exist already. - * - * @exception DSMLConfigException if unable initialize configurations. - */ - public static synchronized ProxyConnectionManager getInstance( ) { - if (m_instance == null) { - m_instance = new ProxyConnectionManager(); - } - return m_instance; - } - - /** - * Get a connection to authenticate. - * - * @return a ldap connection handle - * - */ - public LDAPConnection getLoginConnection() { - if (_ldapLoginPool == null ) { - return null; - } - return _ldapLoginPool.getConnection(); - } - - /** - * Returns the connection (used for authentication) to the pool. - * - */ - public void releaseLoginConnection(String _loginCtx, LDAPConnection conn ) { - // Release the connection - _ldapLoginPool.close( conn ); - } - - public void releaseLoginConnection(LDAPConnection conn ) { - // Release the connection - _ldapLoginPool.close( conn ); - } - - /** - * Get connection from pool. This connection is used for - * all operations except authentication. - * - * @param the loginctx (or the authenticated token) - * @return connection that is available to use or null otherwise - */ - public LDAPConnection getConnection(String loginCtx) { - - // XXX this behaves poorly if the server goes down. - if (_ldapPool == null ) { - return null; - } - - LDAPConnection conn ; - - conn= _ldapPool.getConnection(); - - return conn; - } - - - public LDAPConnection getConnection() { - return getConnection(""); - } - - /** - * Just call the pool method to release the connection so that the - * given connection is free for others to use - * - * @param the login ctx used. - * @param conn connection in the pool to be released for others to use - */ - public void releaseConnection( String loginCtx, LDAPConnection conn ) { - // Since we return the connecton to the pool and use a - //proxy mode, loginCtx is not used. - // XXX should change function signature - - if (_ldapPool == null || conn == null) return; - - // XXX reset the original constraints after before connection is released - // conn.setSearchConstraints(_defaultSearchConstraints); - - // A soft close on the connection. - // Returns the connection to the pool and make it available. - _ldapPool.close( conn ); - } - - - public void releaseConnection( LDAPConnection conn ) { - if (_ldapPool == null || conn == null) - return; - - // reset the original constraints - //conn.setSearchConstraints(_defaultSearchConstraints); - - // A soft close on the connection. - // Returns the connection to the pool and make it available. - _ldapPool.close( conn ); - } - - - /** - * Initialize the pool shared by all. It is expected that the - * host and port (and all configuration) information has been - * initialized. - */ - private synchronized void initLdapPool(int poolMin, int poolMax) { - // Don't do anything if pool is already initialized - if (_ldapPool != null) { - logger.log(Level.FINER, "The pool is already initialized"); - return; - } - int maxBackLog = 10; - boolean referrals = false; - - try { - logger.log(Level.FINER, "Host={0}", m_host); - logger.log(Level.FINER, "Port={0}", String.valueOf(m_port) ); - logger.log(Level.FINER, "DN={0}", m_user); - logger.log(Level.FINE, "password={0}", m_password); - - _ldapPool = new ConnectionPool(poolMin, poolMax, m_host, m_port, m_user, m_password); - - logger.log(Level.FINER, "Pool initialized"); - - } catch (LDAPException lde) { - _ldapPool = null; - logger.log(Level.SEVERE, "Pool not initialized\nError Code: " + - lde.getLDAPResultCode() + "\n" + lde.getMessage() ); - - } catch (Exception ex) { - //logger.log(Level.SEVERE, "Pool init failed:{0}", ex.getMessage()); - //XXX throw new Exception("couldn't connect to ldap server"); - - } - } - - /* - * Initialize the login pool. This pool of connections is used - * for authentication. - */ - private synchronized void initLoginPool(int poolMin, int poolMax) { - if ( _ldapLoginPool != null) - return; - - LDAPConnection conn = new LDAPConnection(); - logger.log(Level.FINER, "Creating the LOGIN Pool"); - try { - conn.connect(3, m_host, m_port, m_user, m_password); - _ldapLoginPool = new ConnectionPool(poolMin, poolMax, m_host, m_port, m_user, m_password); - - } catch (LDAPException lde) { - _ldapLoginPool = null; - logger.log(Level.SEVERE, "Pool not initialized\nError Code: " + - lde.getLDAPResultCode() + "\n" + - lde.getMessage() ); - - } catch (Exception ex) { - // logger.log(Level.SEVERE, "Pool init failed:{0}", ex.getMessage()); - //XXX throw new Exception("couldn't connect to ldap server"); - _ldapLoginPool = null; - } - } - - public void shutdown() { - try { - _ldapPool.destroy(); - } catch (java.lang.NullPointerException e ) {} - try { - _ldapLoginPool.destroy(); - } catch (java.lang.NullPointerException e) {} - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java deleted file mode 100644 index 7dbed1a8..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java +++ /dev/null @@ -1,127 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import netscape.ldap.*; -import org.w3c.dom.*; - - -/** - * - * @author elliot - */ -public class gatewayContext { - - - /** - * Holds value of property ldapConnection. - */ - private LDAPConnection ldapConnection; - - /** - * Holds value of property constraints. - */ - private netscape.ldap.LDAPSearchConstraints constraints; - - /** - * Holds value of property rootNode. - */ - private org.w3c.dom.Node rootNode; - - /** - * Getter for property ldapConnection. - * @return Value of property ldapConnection. - */ - public LDAPConnection getLdapConnection() { - - if (this.ldapConnection == null || this.ldapConnection.isConnected() == false ) { - - IConnectionManager ldap_pool = null; - try { - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - ldap_pool = pmc.getInstance(); - } - catch (Exception e) { - - } - this.ldapConnection = ldap_pool.getConnection(); - } - - return this.ldapConnection; - } - - /** - * Setter for property ldapConnection. - * @param ldapConnection New value of property ldapConnection. - */ - public void setLdapConnection(LDAPConnection ldapConnection) { - // this.ldapConnection = ldapConnection; - } - - /** - * Getter for property constraints. - * @return Value of property constraints. - */ - public netscape.ldap.LDAPSearchConstraints getConstraints() { - return this.constraints; - } - - /** - * Setter for property constraints. - * @param constraints New value of property constraints. - */ - public void setConstraints(netscape.ldap.LDAPSearchConstraints constraints) { - this.constraints = constraints; - } - - /** - * Getter for property rootNode. - * @return Value of property rootNode. - */ - public org.w3c.dom.Node getRootNode() { - return this.rootNode; - } - - /** - * Setter for property rootNode. - * @param rootNode New value of property rootNode. - */ - public void setRootNode(org.w3c.dom.Node rootNode) { - this.rootNode = rootNode; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java deleted file mode 100644 index 006bf05d..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java +++ /dev/null @@ -1,65 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -package com.netscape.dsml.gateway; - -public class gatewayException extends Exception { - - /** Creates a new instance of gatewayException */ - public gatewayException(String message) { - super(message); - } - - public gatewayException() { - super("LDAP Server Unavailable"); - } - - public Throwable getCause() { - Throwable retValue; - - retValue = super.getCause(); - return retValue; - } - - public String getMessage() { - String retValue; - - retValue = super.getMessage(); - return retValue; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java deleted file mode 100644 index b20438df..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java +++ /dev/null @@ -1,256 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -package com.netscape.dsml.gateway; - -import java.io.*; -import java.util.Iterator; -import javax.xml.namespace.QName; -import javax.xml.parsers.*; -import javax.xml.rpc.handler.Handler; -import javax.xml.rpc.handler.HandlerInfo; -import javax.xml.rpc.handler.soap.SOAPMessageContext; -import javax.xml.soap.Name; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPHeader; -import javax.xml.soap.SOAPHeaderElement; -import javax.xml.soap.SOAPMessage; -import javax.xml.soap.SOAPPart; -import javax.xml.soap.SOAPConstants; -import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import org.w3c.dom.Document; -import org.xml.sax.*; -import org.w3c.dom.*; -import javax.xml.soap.*; -import org.apache.axis.AxisFault; -import org.apache.axis.Message; -import org.apache.axis.MessageContext; -import org.apache.axis.handlers.BasicHandler; -import org.apache.commons.codec.binary.Base64; - -public class gatewayHandler extends BasicHandler { - private HandlerInfo handlerInfo; - static private javax.xml.soap.MessageFactory messageFactory ; - static private javax.xml.soap.SOAPFactory sef ; - private static boolean ready = false; - - public gatewayHandler() { - super(); - - try { - messageFactory = javax.xml.soap.MessageFactory.newInstance(); - sef = javax.xml.soap.SOAPFactory.newInstance(); - } catch (Exception e) { } - } - - - public void invoke(MessageContext context) throws AxisFault { - if (context.getPastPivot() == false) { - handleRequest(context); - } - } - - public void cleanup() { - super.cleanup(); - } - - - protected void finalize() { - new ProxyConnMgrFactory().getInstance().shutdown(); - } - - - public boolean handleRequest(MessageContext context) { - /* - * this section will set user, pwd, if it came via a http authentication header - * - */ - Configuration config = Configuration.getInstance(); - String tmp = (String)context.getProperty("Authorization"); - - String user=null ; - String pwd =null; - if ( tmp != null ) - tmp = tmp.trim(); - if ( tmp != null && tmp.startsWith("Basic ") ) { - - int i ; - Base64 bd = new Base64(); - try { - tmp = new String( (bd.decode(tmp.substring(6).getBytes() ))); - } - catch (Exception e) { - // couldn't decode auth info - } - - i = tmp.indexOf( ':' ); - if ( i == -1 ) - user = new String(tmp) ; - else - user = new String(tmp.substring( 0, i)); - - if ( i != -1 ) { - pwd= new String(tmp.substring(i+1)); - if ( pwd != null && pwd.equals("") ) pwd = null ; - - } - } - - org.apache.axis.Message out_m = null; - SOAPEnvelope out_env = null; - javax.xml.soap.SOAPBody out_body = null; - javax.xml.soap.SOAPElement out_fResponse = null; - - try { - javax.xml.soap.SOAPPart sp = ((SOAPMessageContext) context).getMessage().getSOAPPart(); - javax.xml.soap.SOAPEnvelope se = sp.getEnvelope(); - javax.xml.soap.SOAPBody sb = se.getBody(); - - out_m= new Message(context.getRequestMessage().getSOAPEnvelope()); - out_env = out_m.getSOAPPart().getEnvelope(); - out_body = out_env.getBody(); - out_fResponse = out_body.addBodyElement(out_env.createName("batchResponse")); - out_fResponse.addAttribute(out_env.createName("xmlns"), "urn:oasis:names:tc:DSML:2:0:core"); - - int authorizationCode = new com.netscape.dsml.gateway.LDAPAuthenticator(user, pwd).authenticate(); - - if (config.getUseAuth() && authorizationCode >0 ) { - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), String.valueOf(authorizationCode) ); - } - else { - BatchProcessor batchProcessor = new BatchProcessor(sb); - batchProcessor.init(); - - if (config.getUseAuth()) - batchProcessor.setProxy(user); - else - batchProcessor.setProxy(""); - - boolean preprocess_successful = batchProcessor.preprocess(); - Message request= context.getRequestMessage(); - if (request != null) - { - java.util.Iterator request_elements = request.getSOAPBody().getChildElements(); - if (request_elements != null) - { - if (request_elements.hasNext()){ - ((org.apache.axis.message.RPCElement) request_elements.next()).detachNode(); - } - } - } - - - if (preprocess_successful) { - int i = -1; - int NumberRequests = batchProcessor.getRequestCount(); - - while (++i < NumberRequests && ! batchProcessor.Error()) { - batchProcessor.process(i); - SOAPElement RequestedItem = batchProcessor.getRequestItem(i); - if ( RequestedItem != null ) - out_fResponse.addChildElement( RequestedItem ); - } - } - - if ( out_fResponse.getChildElements().hasNext() == false) { - try { - /* This is slightly inaccurate. This simply checks to see if the batch is empty, and if it is, return - * something. the error isn't always 91, but hopefully it's slightly more descriptive to the end user */ - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), "91" ); - } - catch (javax.xml.soap.SOAPException soapException) { } /* Not important to catch this */ - } - } - } - catch (gatewayException gwe) { - try { - out_fResponse.addChildElement("errorResponse").addAttribute(messageFactory.createMessage().getSOAPPart().getEnvelope().createName("code"), "81" ); - } - catch (javax.xml.soap.SOAPException soapException) { - /* We did our best to try and exit gracefully. Give up. */ - } - } - - catch (javax.xml.soap.SOAPException soapException) { - } - catch (Exception e) { - e.printStackTrace(); - - } - - /* To return false means do not try and continue onto the - * deployed service. Since we context.setProperty our - * SOAPResponse message, it will be sent as soon as the request - * turns the other way into a reponse. - */ - context.setResponseMessage( (Message)out_m ); - return false; - - } - - - - public boolean handleFault(MessageContext context) { - return false; - } - - public void init(HandlerInfo config) { - handlerInfo = config; - } - - public QName[] getHeaders() { - return handlerInfo.getHeaders(); - } - - public void destroy() { - - /* Bad things happen if the pool isn't shutdown before the servlet goes away */ - IConnectionManager ldap_pool = null; - ProxyConnMgrFactory pmc = new ProxyConnMgrFactory(); - try { - ldap_pool = pmc.getInstance(); - ldap_pool.shutdown(); - } - catch (Exception e) { } - - - } - - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java deleted file mode 100644 index 232eaca2..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.gateway; - -import javax.activation.DataHandler; - - -/** - * This is the dummy endpoint for axis. It doesn't actually do anything. The - * "real" meat is in gatewayHandler. - * @author elliot@bozemanpass.com - */ -public class gatewayService { - - - public gatewayService() { - } - - /** - * - * @param inputData - * @return - */ - public javax.activation.DataHandler process( javax.activation.DataHandler inputData) { - return inputData; - } - - /** - * - * @param inputData the javax.activation.DataHandler "attachment" of the incoming xml data - * from the SOAP client. - * @return the javax.activation.DataHandler "attachment" of the outgoing xml data - * (responses) to the SOAP client. - */ - public javax.activation.DataHandler batchRequest(javax.activation.DataHandler inputData) { - return inputData; - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java deleted file mode 100644 index afc86414..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java +++ /dev/null @@ -1,102 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - - -import java.util.Properties; -import java.io.*; -import java.net.*; -import java.io.FileInputStream; -import javax.xml.transform.stream.StreamSource; -import javax.xml.soap.*; -/** - * - * @author elliot - */ -public class SOAPClient { - - private String in = null; - private String out = null; - private String SOAPUrl = null; - - public SOAPClient() { } - - public void setIn(String in) { - this.in = in; - } - - public void setOut(String out) { - this.out = out; - } - - public void setSOAPUrl(String SOAPUrl) { - this.SOAPUrl = SOAPUrl; - } - - public void go() throws Exception { - - String SOAPAction = ""; - - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - FileInputStream fin = new FileInputStream(in); - FileOutputStream fout = new FileOutputStream(out); - - SOAPMessage message = javax.xml.soap.MessageFactory.newInstance().createMessage(); - - SOAPPart soapPart = message.getSOAPPart(); - - StreamSource preppedMsgSrc = new StreamSource(new FileInputStream(in)); - - soapPart.setContent(preppedMsgSrc); - message.saveChanges(); - - SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection(); - - SOAPMessage response = con.call(message, url); - - response.writeTo(fout); - - fout.close(); - fin.close(); - con.close(); - - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java deleted file mode 100644 index c43307c9..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java +++ /dev/null @@ -1,131 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - -import javax.xml.parsers.*; -import org.w3c.dom.*; -import org.w3c.dom.traversal.*; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.io.File; - -public class dsmlClient { - - - public dsmlClient() { - } - - - public static void main(String[] args) { - File f = null; - - if (args.length==2) { - try { - - SOAPClient mySoapClient = new SOAPClient(); - f = File.createTempFile("TET-DSML",null); - f.deleteOnExit(); - mySoapClient.setIn( args[1] ); - mySoapClient.setOut( f.getPath() ); - - mySoapClient.setSOAPUrl( args[0] ); - // mySoapClient.setSOAPUrl("http://desktop3:8180/axis/services/dsmlgw"); - - mySoapClient.go(); } - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); // no response or other error like it's not a dsml file - - } - - - - try { - java.io.BufferedReader in = new java.io.BufferedReader(new java.io.FileReader(f)); - String str; - while ((str = in.readLine()) != null) { - System.out.println(str); - } - in.close(); - } catch (IOException e) { - } - - try { - javax.xml.parsers.DocumentBuilder db= javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder(); - org.w3c.dom.Document doc = db.parse( f ); - - // Create the NodeIterator - DocumentTraversal traversable = (DocumentTraversal) doc; - NodeIterator iterator = traversable.createNodeIterator(doc, NodeFilter.SHOW_ALL , null, true); - - // Iterate over the comments - Node node; - while ((node = iterator.nextNode()) != null) { - if (node.getNodeName().equals("resultCode")) { - int result = Integer.parseInt(node.getAttributes().getNamedItem("code").getNodeValue()); - System.exit(result); - } else if (node.getNodeName().equals("errorResponse ")) { - int result = Integer.parseInt(node.getAttributes().getNamedItem("code").getNodeValue()); - System.exit(result); - } else if (node.getNodeName().equals("faultcode")) { - System.exit(253); - } - } - - } - catch (javax.xml.parsers.ParserConfigurationException pce ) { - pce.printStackTrace(); - System.exit( 254 ); } - catch (org.xml.sax.SAXException saxe) { - saxe.printStackTrace(); - System.exit( 254 ); } // ? - catch (java.io.IOException ioe) { - ioe.printStackTrace(); - System.exit( 254 ); } // bad url - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); } // bad url - - } - else { - System.err.println("wrong number of arguments"); - System.err.println("usage: dsmlClient soap-url dsml-file"); - System.exit(255); // wrong arguments - } - } - -} diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java deleted file mode 100644 index 15d336f8..00000000 --- a/ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java +++ /dev/null @@ -1,91 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ -package com.netscape.dsml.test; - -import javax.xml.parsers.*; -import org.w3c.dom.*; -import org.w3c.dom.traversal.*; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.io.File; -import java.io.BufferedReader; -import java.io.FileReader; - -public class dsmlSearch { - - public static void main(String[] args) { - File f = null; - - if (args.length==2) { - try { - - SOAPClient mySoapClient = new SOAPClient(); - f = File.createTempFile("TET-DSML",null); - f.deleteOnExit(); - mySoapClient.setIn( args[1] ); - mySoapClient.setOut( f.getPath() ); - - mySoapClient.setSOAPUrl( args[0] ); - - mySoapClient.go(); } - catch (Exception e) { - e.printStackTrace(); - System.exit( 254 ); // no response or other error like it's not a dsml file - - } - - try { - BufferedReader in = new BufferedReader(new FileReader( f.getPath() )); - String str; - while (( str = in.readLine()) != null) { - - System.out.println(str); } - in.close(); } - catch (IOException e) { - e.printStackTrace(); - System.exit( 254 ); - } - - } - else { - System.err.println("wrong number of arguments"); - System.err.println("usage: dsmlSearch soap-url dsml-file"); - System.exit(255); // wrong arguments - } - } - -} diff --git a/ldap/clients/orgchart/aim-online.gif b/ldap/clients/orgchart/aim-online.gif Binary files differdeleted file mode 100644 index b364017e..00000000 --- a/ldap/clients/orgchart/aim-online.gif +++ /dev/null diff --git a/ldap/clients/orgchart/arrow.gif b/ldap/clients/orgchart/arrow.gif Binary files differdeleted file mode 100644 index 94eff507..00000000 --- a/ldap/clients/orgchart/arrow.gif +++ /dev/null diff --git a/ldap/clients/orgchart/botframe.html b/ldap/clients/orgchart/botframe.html deleted file mode 100644 index 9285c78b..00000000 --- a/ldap/clients/orgchart/botframe.html +++ /dev/null @@ -1,62 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<html> -<head> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> - <title>Directory Server Org Chart</title> - <LINK REL=stylesheet TYPE="text/css" HREF="styles.css"> -</head> -<body bgcolor="#FFFFFF"> -<table cellspacing="-1" cellpadding="2" border="0" width="100%"> -<tr> -<td align="left" class="pageHeader">Welcome!<br><br></td> -</tr> -<tr> -<td align="left" class="startPage"> -To find a person in your corporate organization chart, enter their<br> -name in the search box above, then click "Go"<br><br> -Below is a sample of an organization chart, with a description of the<br> -types of actions you can take<BR><BR> -Thank you for using the Directory Server Org Chart! -</td> -</tr> -</table> -<br><br> -<tr align="center"><img src="starthelp.gif" border="0" alt=""></tr> -</body> -</html> diff --git a/ldap/clients/orgchart/branch-cc1.gif b/ldap/clients/orgchart/branch-cc1.gif Binary files differdeleted file mode 100644 index 80aec59b..00000000 --- a/ldap/clients/orgchart/branch-cc1.gif +++ /dev/null diff --git a/ldap/clients/orgchart/config.tmpl b/ldap/clients/orgchart/config.tmpl deleted file mode 100644 index 1eeaffcd..00000000 --- a/ldap/clients/orgchart/config.tmpl +++ /dev/null @@ -1,224 +0,0 @@ -# -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK -# - -#ldap-host localhost -#ldap-port 389 -#ldap-search-base dc=example,dc=com - -# -# A name that has no value after it equates to "" for the value, -# like the two below settings. -# -# Not listing an entire name/value pair at all in this file -# sets its value to "" as well. -# -# So the below two names therefore don't even need to be in this file -# (but are here to show them as possible options that can be changed). -# -# Having no value below for "ldap-bind-dn" and "ldap-bind-pass" -# indicates that you want anonymous binding to the LDAP server. -# - -ldap-bind-dn -ldap-bind-pass - -# -# Allowed values for below icon-related setting: -# -# forefront means show this icon next to the person's name -# layer means show this icon inside the person's floating layer -# no means never show this icon anywhere, but MyOrgChart settings can override this setting. -# disabled means never show this icon. Period. So MyOrgChart will not even show this icon as a setting. -# - -icons-aim-visible disabled -icons-email-visible layer -icons-phonebook-visible forefront -icons-locator-visible disabled - -# -# There is also the same concept below for a person-locator -# type application, to show graphically where a given employee's office is located. -# You also specify the partial URL, up until where the user's URL- -# encoded cn value will be concatenated. -# -# url-locator-base http://hostname.domain.com/submit.cgi?empfullname= -# - -url-locator-base http://maps.example.com/submit2.cgi?r_loc= - - - -# -# This is where you specify which specific LDAP attributes -# from your LDAP server that you would like used for both org chart -# generation as well as final display values. -# -# The value of the attribute specified for "attrib-job-title" will -# be listed below anybody's name that is listed in their own box. -# If you don't specify this setting in this file, the default used -# will be "title". -# -# For "attrib-farleft-rdn", this specifies which attribute you are -# using as the leftmost RDN for the DN's of your user entries. -# - -attrib-job-title title -attrib-manager manager -attrib-farleft-rdn uid - -# -# This is where you specify the maximum levels that are allowed -# to be generated for any given org chart, and the MyOrgChart version -# of this setting will never be allowed to be higher than the below. -# -# A "level" is defined as a reporting level, meaning that if you -# generate an org chart for a given director, all direct reports to him -# (whether they have people below them or not) are level 1, people below -# any of them are level 2, etc. -# -# So a setting of 1 would list the full name of the user entered, and -# then just people that directly report to that person only. -# -# The purpose of having this configuration setting is to give you -# control over users that may try to generate an org chart on the -# CEO of a company, and heavily tax the LDAP server to generate -# an org chart that may be thousands of people deep. -# -# If this setting is not listed below, the default is 3. -# -# The valid range of values for this setting would be a minimum of 1, -# with no hard-coded maximum. -# - -max-levels-drawn 3 - -# -# The below setting relates to whether a specific assumption should be made -# on all values that you currently have stored for your manager LDAP attribute. -# -# The assumption: That all user entries are stored in LDAP on the -# same flat level location, at least for a given -# group of people that org charts will be generated for. -# -# So when you enter: -# -# Steve Jones -# -# to generate an org chart on, which let's say equates to this DN: -# -# uid=sjones, ou=People, dc=acme, dc=com -# -# then should this application assume that the manager attrib value -# of this entry is in this same location as Steve Jones: -# -# manager = "uid=XXXXXX, ou=People, dc=acme, dc=com" -# -# or is it possible that the manager's LDAP entry is at another level? -# -# -# The below two options for this setting specifies one of two scenarios, -# based on how you have configured your directory information tree: -# -# -# Either the value: -# -# same This means assume the same location (such as -# "ou=People, dc=acme, dc=com" above) that the inital -# user entry is found at for all subsequent entries -# involved in drawing that given org chart. -# -# In other words, this setting assumes a totally -# flat namespace, at least for all users that will -# be in a given generated org chart. -# -# search This means there is no guarantee that other entries -# that need to be discovered to draw the org chart -# are in the same area of the directory tree, so when -# searching the manager attribute DN values for a given -# exact uid, search like this instead: -# -# manager = "uid=sjones,*" -# -# This will be much more expensive of a search, so -# if you fit this scenario, at least make sure on your LDAP -# server that you have the substring index created for your -# manager attribute, to make drawing the org chart as fast -# as possible. -# -# Default value (if this setting is not listed in this file): same -# - - -manager-DN-location same - - -# -# This setting helps you configure against users entering LDAP -# queries for "A" or "MI" and then taxing the LDAP server by asking -# for thousands of search results back. -# -# The value you specify below for "min-chars-searchstring" means -# that the user must enter AT LEAST this many characters for -# their request to even make it to the LDAP server. If they type -# less characters than this setting, they will get a message that -# they need to enter at least X characters to search, where X will -# be the below value. -# -# NOTE: This setting purposely does not apply to allowing a user -# to search for an exact UID (to avoid search results). The logic -# is that: -# -# [1] Search LDAP for an equality search of (uid=XXXX), regardless -# of both this below setting / how many characters were entered. -# -# [2] If this single LDAP entry was not found, then make sure the -# number of characters entered for the search are at least the below -# number of characters, before sending a broader search to LDAP. -# -# If this setting is not configured below (the line is absent), -# the default value used is 4. - -min-chars-searchstring 4 - -# Allowed characters in search filters. If the user enters a search that -# contains a character not in the allowed-filter-chars list, the user -# will be notified the search needs to be modified. - -allowed-filter-chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _- diff --git a/ldap/clients/orgchart/index.html b/ldap/clients/orgchart/index.html deleted file mode 100644 index a8f00fa3..00000000 --- a/ldap/clients/orgchart/index.html +++ /dev/null @@ -1,69 +0,0 @@ -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<HTML> -<HEAD> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> -<META HTTP-EQUIV="Expires" CONTENT="Thu, 01 Feb 1996 00:00:00 GMT"> - <TITLE>Directory Server Org Chart</TITLE> - - -<SCRIPT LANGUAGE="javascript"> - - - var agt = navigator.userAgent.toLowerCase(); - var is_major = parseInt(navigator.appVersion); - var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) - && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) - && (agt.indexOf('webtv')==-1)); - - if (!is_nav || (is_major < 5)) - { - //document.write('<BASE HREF="http://localhost/cvsorg/">'); - } - -</SCRIPT> -</HEAD> - - -<frameset frameborder=no border=0 framespacing="0" ROWS="50,*"> - <frame name="input_window" src="topframe.html" SCROLLING=NO noresize marginwidth="5" marginheight="5"> - <frame name="output_window" src="botframe.html" marginwidth="10" marginheight="10"> - -</frameset> - - -</HTML> diff --git a/ldap/clients/orgchart/ldap-person.gif b/ldap/clients/orgchart/ldap-person.gif Binary files differdeleted file mode 100644 index f3b86d11..00000000 --- a/ldap/clients/orgchart/ldap-person.gif +++ /dev/null diff --git a/ldap/clients/orgchart/mag.gif b/ldap/clients/orgchart/mag.gif Binary files differdeleted file mode 100644 index 03b4a27f..00000000 --- a/ldap/clients/orgchart/mag.gif +++ /dev/null diff --git a/ldap/clients/orgchart/mail.gif b/ldap/clients/orgchart/mail.gif Binary files differdeleted file mode 100644 index 7747a009..00000000 --- a/ldap/clients/orgchart/mail.gif +++ /dev/null diff --git a/ldap/clients/orgchart/myorg.bat b/ldap/clients/orgchart/myorg.bat deleted file mode 100644 index eb96390f..00000000 --- a/ldap/clients/orgchart/myorg.bat +++ /dev/null @@ -1,38 +0,0 @@ -@rem // --- BEGIN COPYRIGHT BLOCK --- -@rem // This Program is free software; you can redistribute it and/or modify it under -@rem // the terms of the GNU General Public License as published by the Free Software -@rem // Foundation; version 2 of the License. -@rem // -@rem // This Program is distributed in the hope that it will be useful, but WITHOUT -@rem // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -@rem // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -@rem // -@rem // You should have received a copy of the GNU General Public License along with -@rem // this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -@rem // Place, Suite 330, Boston, MA 02111-1307 USA. -@rem // -@rem // In addition, as a special exception, Red Hat, Inc. gives You the additional -@rem // right to link the code of this Program with code not covered under the GNU -@rem // General Public License ("Non-GPL Code") and to distribute linked combinations -@rem // including the two, subject to the limitations in this paragraph. Non-GPL Code -@rem // permitted under this exception must only link to the code of this Program -@rem // through those well defined interfaces identified in the file named EXCEPTION -@rem // found in the source code files (the "Approved Interfaces"). The files of -@rem // Non-GPL Code may instantiate templates or use macros or inline functions from -@rem // the Approved Interfaces without causing the resulting work to be covered by -@rem // the GNU General Public License. Only Red Hat, Inc. may make changes or -@rem // additions to the list of Approved Interfaces. You must obey the GNU General -@rem // Public License in all respects for all of the Program code and other code used -@rem // in conjunction with the Program except the Non-GPL Code covered by this -@rem // exception. If you modify this file, you may extend this exception to your -@rem // version of the file, but you are not obligated to do so. If you do not wish to -@rem // provide this exception without modification, you must delete this exception -@rem // statement from your version and license this file solely under the GPL without -@rem // exception. -@rem // -@rem // -@rem // Copyright (C) 2005 Red Hat, Inc. -@rem // All rights reserved. -@rem // --- END COPYRIGHT BLOCK --- -@set path=..\..\..\bin\slapd\admin\bin;%path% -@perl myorg.pl diff --git a/ldap/clients/orgchart/myorg.pl b/ldap/clients/orgchart/myorg.pl deleted file mode 100755 index e00fd5ba..00000000 --- a/ldap/clients/orgchart/myorg.pl +++ /dev/null @@ -1,671 +0,0 @@ -#!/usr/bin/env perl -# -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK -# - -# -#set ts=4 - -$|=1; -print "Content-type: text/html;charset=UTF-8\n\n"; -#print "Content-type: text/html\n\n"; - -# -# Read config.txt settings for MyOrgChart-specific items -# -&read_config_file(); - -#------------------------------------- -print " -<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> -<html> -<head> -<title>Customize: Directory Server Org Chart</title> -<LINK REL=stylesheet TYPE=\"text/css\" HREF=\"../html/styles.css\"> -"; -#------------------------------------- - -&print_javascript(); - -print "</head>"; - -&print_body(); - -print "</html>"; - -exit(0); - - -#============================================================================== - -sub read_config_file() -{ - - if (!open (FILE, "../config.txt") ) - { - print "\n\n<BR><BR>Can't open configuration file: config.txt\n\n<BR><BR>Error from OS: $!\n\n"; - exit; - } - - # - # let's set some default values, so in case a setting - # does not exist both in the config.txt file, as well - # as does not exist via a user's MyOrgChart cookie, - # we at least have some type of valid value present. - # - %config_tokens = ( - "icons-aim-visible","disabled", - "icons-email-visible","disabled", - "icons-phonebook-visible","disabled", - "icons-locator-visible","disabled", - "max-levels-drawn", "3", - ); - - # - # read in the config.txt file - # - while(<FILE>) - { - chop; - - foreach $f (keys %config_tokens) - { - $config_tokens{$f} = $1 if ($_ =~ /^$f[ \t]+(.+)/); - } - } - close (FILE); - - # - # check the "max-levels-drawn" setting for numeric, and to - # make sure it is a number greater than zero. - # - # If a bad setting, let's set it to 3 so that at least it - # is set to a valid number, but then a user's MyOrgChart - # preferences can override it (if their setting is 1, 2, - # or 3 only). - # - - # check for non-numeric first - - $temp = $config_tokens{"max-levels-drawn"}; - $temp =~ s/[\d]//g; - - if ( length($temp) != 0 ) - { - # a non-numeric setting - $config_tokens{"max-levels-drawn"} = 3; - } - else - { - # a numeric setting, but: check for less than value of 1 - if ( $config_tokens{"max-levels-drawn"} < 1 ) - { - $config_tokens{"max-levels-drawn"} = 3; - } - } - - - # - # if every icon has been disabled, set a state so that later on - # we don't draw the header and the footer text for the icons. - # - if ( ($config_tokens{"icons-email-visible"} eq "disabled") && ($config_tokens{"icons-phonebook-visible"} eq "disabled") && ($config_tokens{"icons-aim-visible"} eq "disabled") && ($config_tokens{"icons-locator-visible"} eq "disabled") ) - { - $all_icons_disabled = "yes"; - } - else - { - $all_icons_disabled = "no"; - } -} - -#============================================================================== - -sub print_body() -{ - -print " - -<body bgcolor=\"#FFFFFF\" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=\"initValues()\"> -<FORM name=\"customize\"> - - -<table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> - <tr> - <td height=\"20\"> </td></tr> -</table> - -<table width=\"500\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> -<tr> - <td width=\"500\" height=\"22\" valign=\"top\" bgcolor=\"#cccccc\" class=\"pageHeader\">Customize View</td> -</tr> - -<tr> - <td height=\"236\" valign=\"top\"> - <table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\"> - <tr height=\"7\"></tr> -"; - - -# -# If all icons are "disabled" by the admin, we better not display the -# window dressing (header and footer) text that normally surrounds the -# icon options. This is the header. -# -if ( "$all_icons_disabled" eq "no" ) -{ - print " - - <tr> - <td width=\"28\" height=\"21\" valign=\"top\"> </td> - <td valign=\"top\" colspan=\"4\" class=\"prefsPageHead\">Icon Settings</td> - </tr> - <tr height =\"7\"></tr> - <tr> - <td width=\"35\" height=\"21\"></td> - <td width=\"35\" valign=\"top\" class=\"prefsPageData\">Icon:</td> - <td width=\"25\"></td> - <td width=\"105\" valign=\"top\" class=\"prefsPageData\">Description:</td> - <td width=\"21\"></td> - <td width=\"205\" valign=\"top\" class=\"prefsPageData\">Location:</td> - </tr> - "; -} - -# -# don't draw the email option if admin has disabled it ! -# -if ( $config_tokens{"icons-email-visible"} ne "disabled" ) -{ - - print " - - <tr height=\"6\"></tr> - <tr> - <td width=\"33\" height=\"21\"></td> - <td width=\"20\" valign=\"top\" class=\"prefsPageData\"> <img src=\"../html/mail.gif\" alt=\"\" width=\"14\" height=\"16\" border=\"0\"></td> - <td width=\"25\"></td> - <td width=\"105\" valign=\"top\" class=\"prefsPageData\">EMail</td> - <td width=\"21\"></td> - <td width=\"205\" valign=\"center\" class=\"prefsPageData\"><select NAME=\"email\"> -"; - -# -------------------------------------------- - -$selected1 = $selected2 = $selected3 = ""; -if ($config_tokens{"icons-email-visible"} eq "no") { $selected1 = " SELECTED"; } -if ($config_tokens{"icons-email-visible"} eq "forefront") { $selected2 = " SELECTED"; } -if ($config_tokens{"icons-email-visible"} eq "layer") { $selected3 = " SELECTED"; } - -# -------------------------------------------- - -print " - <option value=\"no\"$selected1>Never display this icon</option> - <option value=\"forefront\"$selected2>Next to name</option> - <option value=\"layer\"$selected3>In floating layer</option> - </select></td> - - </tr> - "; -} - -# -# don't draw the phonebook option if admin has disabled it ! -# -if ( $config_tokens{"icons-phonebook-visible"} ne "disabled" ) -{ - print " - <tr height=\"6\"></tr> - <tr> - <td width=\"33\" height=\"21\"></td> - <td width=\"20\" valign=\"top\" class=\"prefsPageData\"> <img src=\"../html/ldap-person.gif\" alt=\"\" width=\"12\" height=\"16\" border=\"0\"></td> - <td width=\"25\"></td> - <td width=\"125\" valign=\"top\" class=\"prefsPageData\" nowrap>Phonebook Entry</td> - <td width=\"21\"></td> - <td width=\"205\" valign=\"center\" class=\"prefsPageData\"><select NAME=\"phonebook\"> -"; - -# -------------------------------------------- - -$selected1 = $selected2 = $selected3 = ""; -if ($config_tokens{"icons-phonebook-visible"} eq "no") { $selected1 = " SELECTED"; } -if ($config_tokens{"icons-phonebook-visible"} eq "forefront") { $selected2 = " SELECTED"; } -if ($config_tokens{"icons-phonebook-visible"} eq "layer") { $selected3 = " SELECTED"; } - -# -------------------------------------------- - -print " - <option value=\"no\"$selected1>Never display this icon</option> - <option value=\"forefront\"$selected2>Next to name</option> - <option value=\"layer\"$selected3>In floating layer</option> - </select></td> - </tr> - "; -} - -# -# don't draw the locator option if admin has disabled it ! -# -if ( $config_tokens{"icons-locator-visible"} ne "disabled" ) -{ - - print " - - <tr height=\"6\"></tr> - <tr> - <td width=\"33\" height=\"21\"></td> - <td width=\"20\" valign=\"top\" class=\"prefsPageData\"> <img src=\"../html/mag.gif\" alt=\"\" width=\"15\" height=\"15\" border=\"0\"></td> - <td width=\"25\"></td> - <td width=\"125\" valign=\"top\" class=\"prefsPageData\" nowrap>Locate User</td> - <td width=\"21\"></td> - <td width=\"205\" valign=\"top\" class=\"prefsPageData\"><select NAME=\"locate\"> - -"; - -# -------------------------------------------- - -$selected1 = $selected2 = $selected3 = ""; -if ($config_tokens{"icons-locator-visible"} eq "no") { $selected1 = " SELECTED"; } -if ($config_tokens{"icons-locator-visible"} eq "forefront") { $selected2 = " SELECTED"; } -if ($config_tokens{"icons-locator-visible"} eq "layer") { $selected3 = " SELECTED"; } - -# -------------------------------------------- - -print " - <option value=\"no\"$selected1>Never display this icon</option> - <option value=\"forefront\"$selected2>Next to name</option> - <option value=\"layer\"$selected3>In floating layer</option> - </select></td> - </tr> - "; -} - -# -# don't draw the AIM option if admin has disabled it ! -# -if ( $config_tokens{"icons-aim-visible"} ne "disabled" ) -{ - - print " - <tr height=\"6\"></tr> - <tr> - <td width=\"33\" height=\"21\"></td> - <td width=\"20\" valign=\"top\" class=\"prefsPageData\"> <img src=\"../html/aim-online.gif\" alt=\"\" width=\"15\" height=\"15\" border=\"0\"></td> - <td width=\"25\"></td> - <td width=\"125\" valign=\"top\" class=\"prefsPageData\" nowrap>AIM Presence</td> - <td width=\"21\"></td> - <td width=\"205\" valign=\"top\" class=\"prefsPageData\"><select NAME=\"aim\"> -"; - -# -------------------------------------------- - -$selected1 = $selected2 = $selected3 = ""; -if ($config_tokens{"icons-aim-visible"} eq "no") { $selected1 = " SELECTED"; } -if ($config_tokens{"icons-aim-visible"} eq "forefront") { $selected2 = " SELECTED"; } -if ($config_tokens{"icons-aim-visible"} eq "layer") { $selected3 = " SELECTED"; } - -# -------------------------------------------- - -print " - <option value=\"no\"$selected1>Never display this icon</option> - <option value=\"forefront\"$selected2>Next to name</option> - <option value=\"layer\"$selected3>In floating layer</option> - </select></td> - </tr> - "; -} - -# -# If all icons are "disabled" by the admin, we better not display the -# window dressing (header and footer) text that normally surrounds the -# icon options. This is the footer. -# -if ( "$all_icons_disabled" eq "no" ) -{ - print " - <tr height=\"15\"> - </tr> - <tr> - <td width=\"28\" height=\"21\" valign=\"top\"> </td> - <td valign=\"middle\" colspan=\"4\"><hr></td> - </tr> - "; -} - -print " - <tr> - <td width=\"28\" height=\"21\" valign=\"top\"> </td> - <td valign=\"top\" colspan=\"4\" class=\"prefsPageHead\">Organization Chart Depth</td> - </tr> - <tr height=\"10\"> - </tr> - <tr> - <td width=\"35\" height=\"28\"></td> - <td width=\"10\" valign=\"top\" class=\"prefsPageData\">Show </td> - <td width=\"20\" valign=\"top\" class=\"prefsPageData\"><select NAME=\"leveldepth\"> -"; - -for ( $num = 1 ; $num <= $config_tokens{"max-levels-drawn"} ; $num++ ) -{ - if ( $num < $config_tokens{"max-levels-drawn"} ) - { - print "<option value=\"$num\">$num</option>"; - } - else - { - print "<option value=\"$num\" SELECTED>$num</option>"; - } -} - -print " - </select></td> - <td width=\"350\" colspan=\"3\" class=\"prefsPageData\"> levels of organization depth</td> - </tr> - <td height=\"30\"></td> - </table> - </td> - </tr> - -</table> - -<table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> - <tr> - <td height=\"20\"> </td></tr> - <tr> - <td align=\"right\"><input type=\"button\" name=\"save\" value=\" Finished \" onClick=\"saveSettings();\"></td> - <td width=\"20\"</td> - <td><input type=\"button\" name=\"del_cookie\" value=\"Restore Defaults\" onClick=\"deleteCookie();\"></td> - </tr> - </table> -</form> -</body> -"; - -} - -#============================================================================== - -sub print_javascript() -{ - -print " - -<SCRIPT language=\"javascript\"> - -var today = new Date(); -var expires = new Date(); -var expired = new Date(today.getTime() - 1000 * 24 * 60 * 60 * 1000); - -function initValues() -{ - var myorgsettings = getCookie(\"MyOrgChart\"); - var possvalues = new Array(\"no\",\"forefront\",\"layer\"); -"; - - -# -------------------------------------------------------------- - -# -# let's build up a string like the contents below of Array -# (if max-levels-drawn was 3): -# -# var posslevelvalues = new Array("1","2","3"); -# -$finalstring = "var posslevelvalues = new Array("; - -for ( $num = 1 ; $num <= $config_tokens{"max-levels-drawn"} ; $num++ ) -{ - $finalstring = "$finalstring\"$num\""; - - if ( $num != $config_tokens{"max-levels-drawn"} ) - { - $finalstring = "$finalstring,"; - } -} -$finalstring = "$finalstring);"; - -# -------------------------------------------------------------- - -print " - - $finalstring - - // If there is a cookie already set, let's correct the - // values of the HTML form to be based on their personal - // settings, for easier editing and also lack of confusion - if ( myorgsettings != \"\" ) - { - var splitorgvalues = myorgsettings.split(\"&\"); - var tempstr; - - // alert(myorgsettings); - - for (var loop=0; loop < splitorgvalues.length; loop++) - { - tempstr = splitorgvalues[loop].split(\"=\"); -"; - -# --start--------------------------------------------------------- - -if ( $config_tokens{"icons-email-visible"} ne "disabled" ) -{ - -print " - if ( tempstr[0] == \"email\" ) - { - for (var innerloop=0; innerloop < possvalues.length; innerloop++) - { - if ( tempstr[1] == possvalues[innerloop] ) - document.customize.email.options[innerloop].selected = true; - } - } -"; -} - -# --end--------------------------------------------------------- - -# --start--------------------------------------------------------- - -if ( $config_tokens{"icons-phonebook-visible"} ne "disabled" ) -{ - -print " - - if ( tempstr[0] == \"pb\" ) - { - for (var innerloop=0; innerloop < possvalues.length; innerloop++) - { - if ( tempstr[1] == possvalues[innerloop] ) - document.customize.phonebook[innerloop].selected = true; - } - } -"; -} - -# --end--------------------------------------------------------- - -# --start--------------------------------------------------------- - -if ( $config_tokens{"icons-locator-visible"} ne "disabled" ) -{ - -print " - - if ( tempstr[0] == \"maps\" ) - { - for (var innerloop=0; innerloop < possvalues.length; innerloop++) - { - if ( tempstr[1] == possvalues[innerloop] ) - document.customize.locate[innerloop].selected = true; - } - } -"; -} - -# --end--------------------------------------------------------- - -# --start--------------------------------------------------------- - -if ( $config_tokens{"icons-aim-visible"} ne "disabled" ) -{ - -print " - - if ( tempstr[0] == \"aim\" ) - { - for (var innerloop=0; innerloop < possvalues.length; innerloop++) - { - if ( tempstr[1] == possvalues[innerloop] ) - document.customize.aim[innerloop].selected = true; - } - } -"; -} - -# --end--------------------------------------------------------- - -print " - - if ( tempstr[0] == \"maxlevels\" ) - { - for (var innerloop=0; innerloop < $config_tokens{\"max-levels-drawn\"}; innerloop++) - { - if ( tempstr[1] == posslevelvalues[innerloop] ) - document.customize.leveldepth.options[innerloop].selected=true; - } - } - } - - } - - return; -} - -function getCookie(Name) -{ - var search = Name + \"=\" - if (document.cookie.length > 0) - { // if there are any cookies - offset = document.cookie.indexOf(search) - if (offset != -1) - { // if cookie exists - offset += search.length // set index of beginning of value - end = document.cookie.indexOf(\";\", offset) // set index of end of cookie value - if (end == -1) - end = document.cookie.length - return unescape(document.cookie.substring(offset, end)) - } - } - - return (\"\"); -} - -function deleteCookie() -{ - document.cookie=\"MyOrgChart\" + \"=null; expires=\" + expired.toGMTString(); - alert(\"Your preferences have been deleted from your browser.\"); - document.location.href = \"myorg\"; -} - -function saveSettings() -{ - var i; - var finalString; - - finalString = \"\"; - - // alert(document.customize.email.options[document.customize.email.selectedIndex].value); - -"; - -if ( $config_tokens{"icons-email-visible"} ne "disabled" ) -{ -print" - finalString += \"&email=\" + document.customize.email.options[document.customize.email.selectedIndex].value; -"; -} - -if ( $config_tokens{"icons-phonebook-visible"} ne "disabled" ) -{ -print" - finalString += \"&pb=\" + document.customize.phonebook.options[document.customize.phonebook.selectedIndex].value; -"; -} - -if ( $config_tokens{"icons-locator-visible"} ne "disabled" ) -{ -print" - finalString += \"&maps=\" + document.customize.locate.options[document.customize.locate.selectedIndex].value; -"; -} - -if ( $config_tokens{"icons-aim-visible"} ne "disabled" ) -{ -print" - finalString += \"&aim=\" + document.customize.aim.options[document.customize.aim.selectedIndex].value; -"; -} - -print " - - finalString += \"&maxlevels=\" + document.customize.leveldepth.options[document.customize.leveldepth.selectedIndex].value; - - expires.setTime(today.getTime() + 1000*60*60*24*365); - setCookie(\"MyOrgChart\", finalString, expires); - - alert(\"Your preferences have been saved in your browser.\"); - // alert(\"Your preferences have been saved in your browser as:\\n\" + finalString); - return; -} - -function setCookie(name, value, expire) -{ - document.cookie = name + \"=\" + escape(value) - + ((expire == null) ? \"\" : (\"; expires=\" + expire.toGMTString())); -} - -</SCRIPT> - -"; - -} - -#============================================================================== - - - diff --git a/ldap/clients/orgchart/new-branch-blank.gif b/ldap/clients/orgchart/new-branch-blank.gif Binary files differdeleted file mode 100644 index e5dfeebb..00000000 --- a/ldap/clients/orgchart/new-branch-blank.gif +++ /dev/null diff --git a/ldap/clients/orgchart/new-branch-first.gif b/ldap/clients/orgchart/new-branch-first.gif Binary files differdeleted file mode 100644 index aa371353..00000000 --- a/ldap/clients/orgchart/new-branch-first.gif +++ /dev/null diff --git a/ldap/clients/orgchart/new-branch-straight.gif b/ldap/clients/orgchart/new-branch-straight.gif Binary files differdeleted file mode 100644 index 9e379047..00000000 --- a/ldap/clients/orgchart/new-branch-straight.gif +++ /dev/null diff --git a/ldap/clients/orgchart/org.bat b/ldap/clients/orgchart/org.bat deleted file mode 100644 index b807a3c1..00000000 --- a/ldap/clients/orgchart/org.bat +++ /dev/null @@ -1,38 +0,0 @@ -@rem // --- BEGIN COPYRIGHT BLOCK --- -@rem // This Program is free software; you can redistribute it and/or modify it under -@rem // the terms of the GNU General Public License as published by the Free Software -@rem // Foundation; version 2 of the License. -@rem // -@rem // This Program is distributed in the hope that it will be useful, but WITHOUT -@rem // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -@rem // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -@rem // -@rem // You should have received a copy of the GNU General Public License along with -@rem // this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -@rem // Place, Suite 330, Boston, MA 02111-1307 USA. -@rem // -@rem // In addition, as a special exception, Red Hat, Inc. gives You the additional -@rem // right to link the code of this Program with code not covered under the GNU -@rem // General Public License ("Non-GPL Code") and to distribute linked combinations -@rem // including the two, subject to the limitations in this paragraph. Non-GPL Code -@rem // permitted under this exception must only link to the code of this Program -@rem // through those well defined interfaces identified in the file named EXCEPTION -@rem // found in the source code files (the "Approved Interfaces"). The files of -@rem // Non-GPL Code may instantiate templates or use macros or inline functions from -@rem // the Approved Interfaces without causing the resulting work to be covered by -@rem // the GNU General Public License. Only Red Hat, Inc. may make changes or -@rem // additions to the list of Approved Interfaces. You must obey the GNU General -@rem // Public License in all respects for all of the Program code and other code used -@rem // in conjunction with the Program except the Non-GPL Code covered by this -@rem // exception. If you modify this file, you may extend this exception to your -@rem // version of the file, but you are not obligated to do so. If you do not wish to -@rem // provide this exception without modification, you must delete this exception -@rem // statement from your version and license this file solely under the GPL without -@rem // exception. -@rem // -@rem // -@rem // Copyright (C) 2005 Red Hat, Inc. -@rem // All rights reserved. -@rem // --- END COPYRIGHT BLOCK --- -@set path=..\..\..\bin\slapd\admin\bin;%path% -@perl org.pl diff --git a/ldap/clients/orgchart/org.pl b/ldap/clients/orgchart/org.pl deleted file mode 100755 index af1928e1..00000000 --- a/ldap/clients/orgchart/org.pl +++ /dev/null @@ -1,2066 +0,0 @@ -#!/usr/bin/env perl -# -# BEGIN COPYRIGHT BLOCK -# This Program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation; version 2 of the License. -# -# This Program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA. -# -# In addition, as a special exception, Red Hat, Inc. gives You the additional -# right to link the code of this Program with code not covered under the GNU -# General Public License ("Non-GPL Code") and to distribute linked combinations -# including the two, subject to the limitations in this paragraph. Non-GPL Code -# permitted under this exception must only link to the code of this Program -# through those well defined interfaces identified in the file named EXCEPTION -# found in the source code files (the "Approved Interfaces"). The files of -# Non-GPL Code may instantiate templates or use macros or inline functions from -# the Approved Interfaces without causing the resulting work to be covered by -# the GNU General Public License. Only Red Hat, Inc. may make changes or -# additions to the list of Approved Interfaces. You must obey the GNU General -# Public License in all respects for all of the Program code and other code used -# in conjunction with the Program except the Non-GPL Code covered by this -# exception. If you modify this file, you may extend this exception to your -# version of the file, but you are not obligated to do so. If you do not wish to -# provide this exception without modification, you must delete this exception -# statement from your version and license this file solely under the GPL without -# exception. -# -# -# Copyright (C) 2005 Red Hat, Inc. -# All rights reserved. -# END COPYRIGHT BLOCK -# - -# -#set ts=4 - -# enable the use of our bundled perldap with our bundled ldapsdk libraries -# all of this nonsense can be omitted if the mozldapsdk and perldap are -# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5) -BEGIN { - my $savedir = `pwd`; - my $dirname = `dirname $0`; - chdir $dirname; - my $sroot = `pwd`; - $sroot =~ s@/clients/orgchart/bin*@@; - chomp($sroot); - chdir $savedir; - push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl"; - if ($ENV{LD_LIBRARY_PATH}) { - $ENV{LD_LIBRARY_PATH} .= ":"; - } - $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib"; - # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms - if ($ENV{SHLIB_PATH}) { - $ENV{SHLIB_PATH} .= ":"; - } - $ENV{SHLIB_PATH} .= "$sroot/shared/lib"; -} - -# ------------ -# -# Notes for anybody reading the code below: -# -# [1] The concept of the $uid variable throughout the code -# is whatever the leftmost RDN value is for a given user DN, -# and this relates to the "attrib-farleft-rdn" setting in -# config.txt, of what the attribute name will always be. -# -# ------------ - - -use Mozilla::LDAP::Conn; -use Mozilla::LDAP::Utils qw(:all); - -use CGI; -$cg = new CGI; - -$|=1; -print "Content-type: text/html;charset=UTF-8\n\n"; - -########################################## -# -# Let's find out what browswer they are using -# -########################################## - -$agentstring = $ENV{'HTTP_USER_AGENT'}; - -# IE 6.0 : ---Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)--- -# Comm478 : ---Mozilla/4.78 [en] (Windows NT 5.0; U)--- -# Nscp622 : ---Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2--- - -$browser_is_msie = "MSIE" if $agentstring =~ /MSIE/; - -# is this Windows? -$isWindows = -d '\\'; - -########################################## -# -# Read config.txt settings, set by the administrator -# -########################################## - -&read_config_file(); - -########################################## -# -# Let's look at what is being passed in, from the user. -# -########################################## - - -# -# "data" is a generic FORM variable name from -# the topframe.html document that we receive our incoming query -# from. -# -# (See comment at start of this file about "$uid" variable.) -# -if ( defined $cg->param("data") ) -{ - $uid = $cg->param("data"); -} - -# -# For coexistence with the DSGW, when we crosslink, we need to -# make sure that the user is taken back to the correct dsgw -# context -# -$contextParamString = ""; -if ( defined $cg->param("context") ) -{ - $context = $cg->param("context"); - $contextParamString = "context=${context}&"; - $config_tokens{"url-phonebook-base"} =~ s/context=.*?&/$contextParamString/g; -} - -# -# But they may have entered this code from clicking on an org -# chart icon from an already-drawn org chart, in which case -# we know what the RDN attribute name is (cn, uid, etc.), so i -# that has priority, if present. -# -if ( defined $cg->param("$config_tokens{'attrib-farleft-rdn'}") ) -{ - $uid = $cg->param("$config_tokens{'attrib-farleft-rdn'}") -} - -if ($uid eq "") -{ - &output_html_header("no-javascript"); - print "No username selected...</BODY></HTML>"; - #print "\n</BODY></HTML>"; - exit(0); -} - -########################################## -# -# If the user has asked this org chart to be prepared for printing -# -########################################## - -if ( (defined $cg->param("print")) && ( $cg->param("print") eq "yes" ) ) -{ - $print_mode = 1; -} -else -{ - $print_mode = 0; -} - -if ( !($print_mode) ) -{ - $fontstring="<font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 11px\">"; -} -else -{ - # if printing, let's make the font smaller, to fit more org chart on one page - # - $fontstring="<font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 8px\">"; -} - -########################################## -# -# See if the user has their own preferences to use. -# -# -########################################## - -&check_myorgchart_settings(); - - -########################################## -# -# Let's configure which attributes to request from LDAP, -# based on preferences read above... -# -########################################## - -&config_ldap_return_attrib_list(); - - -########################################## -# -# global variable descriptions: -# -# $total : stores the displayed statistic of "Total # of people" that is printed under org chart -# $display_indent : helps track how deeply "indented" in the org chart hierarchy a given person is, to help -# draw an internal data structure of the hierarchy. See details in get_org_data() function. -# $tempnum : just generic variable used for different reasons, always within a very small (controllable) -# scope within a given function only, since a generic all-purpose variable -# $anothertempnum : same idea as $tempnum, just another variable for the same generic purpose -# $tempstr : same idea as $tempnum, just another variable for the same generic purpose -# -# -########################################## - -$total = 0; -$display_indent = 0; -$tempnum = 0; -$anothertempnum = 0; -$tempstr = ""; - -########################################## -# -# The $incomplete variable tracks whether an org chart cannot -# be fully drawn because the "max number of levels to draw" -# setting has been exceeded. We'll use this variable value -# to: [1] store this fact during initial LDAP data gathering, -# [2] to make sure we draw org chart icons (hyperlinks) next -# to people that have people below them purposely -# not displayed (purposely chopped off) -# -########################################## - -$incomplete = 0; - -########################################## -# -# Let's take what the end-user entered and search on it. -# If not found as an exact uid=XXX match, then let's -# broader their search to try to give them some results to -# pick from. -# -########################################## - -&search_for_enduser_query(); - -########################################## -# -# Before we draw any part of the org chart, -# let's send the javascript code needed back -# to the browser first, as well as open BODY tag -# -########################################## - -&output_html_header("with-javascript"); - - -########################################## -# -# This single DIV layer HTML code will be used as the only layer in the final output. -# It is dynamically changed, as far as its content, based on which person that the -# end-user hovers the mouse cursor over. This is much faster (WAY less code to send -# to the browser) compared to sending a unique hardcoded DIV for each and every -# person that appears on the org chart. -# -########################################## - -&print_single_div_html(); - -########################################## -# -# For some reason, Nav4 browsers ignore onMouseOver and onMouseOut -# event handlers if they are inside the DIV HTML tag itself, so -# you have to assign them to the DIV after declaring the DIV above. -# -########################################## - -&nav4_specific_event_handlers(); - -########################################## -# -# Start drawing the org chart to the browser. -# -############## -# -# Let's first put the full name of the person submitted to us in a box, -# along with their manager listed underneath them. -# -########################################## - -&print_topmost_box(); - -########################################## -# -# See if the "manager-DN-location" config.txt setting is -# either "search" or else assume "same". -# -# See config.txt file for detailed description. -# -########################################## - -if ( $config_tokens{"manager-DN-location"} eq "search" ) -{ - $tempstr = "*" -} -else -{ - # if we are assuming "same", then strip the leftmost RDN component - # out of the entered LDAP user's DN, and assume that location - # for all user entry locations we will be dealing with.be dealing with. - # - ($tempstr) = ($entry->{dn} =~ /[^,]+=[^,]+,(.+)/ ); -} - -########################################## -# -# This is where the heavy lifting is done. Generate an 2D array -# that stores all the org chart people data we need, to later draw it. -# -########################################## - -&get_org_data($entry->{$config_tokens{'attrib-farleft-rdn'}}[0], $config_tokens{'attrib-farleft-rdn'} , $tempstr); - - -########################################## -# -# Let's sort the return results array, mainly to help put -# the hierarchy in order, to help us draw the final result. -# -########################################## - -@sortedPeople = sort { $a->[0] cmp $b->[0] } @people; - - -########################################## -# -# If they exceeded max depth allowed, let's still figure out -# which people are managers of some type and make sure we -# still put an org chart icon next to their name, even if the -# people below them will not be shown because of being on the -# side that was chopped off (past the max depth), so that at -# least the end user knows people in reality report to that -# person, even though not displayed on purpose. -# -########################################## - -&detect_nonleaf_depth_exceeded(); - -########################################## -# -# This function will print just the tree branch that is below the -# topmost box. -# -########################################## - -&print_toplevel_tree_branch(); - -########################################## -# -# Now let's analyze the remaining branch structure to draw, -# and pre-markup some details about how to draw this branch structure, -# as it can get quite complex for some org charts. -# -# we need to scan up and down several times certain parts of the -# org chart data in certain areas to learn things about how to draw -# the structure to the screen. This just makes life easier at the -# final drawing stage. -# -########################################## - -&pre_markup_remaining_branches(); - -########################################## -# -# Draw the rest of the org chart. -# (with "rest" meaning non-leaf entries below the uid that the end-user entered, -# so this means both the 2nd layer of boxes that have a single name in each -# box, as well as then the tree branches under each of those boxes) -# -########################################## - -&draw_remaining_branches(); - -########################################## -# -# The org chart is basically drawn now. We just need -# to close some tables that we have open, and print the -# total number of reports shown on the entire org chart. -# -########################################## - -print "</TD></TR></TABLE></center>"; -print "\n\n"; -print "<BR><BR><HR>\n$fontstring"; -print "Total number of reports shown above: " . $total . "\n</font><BR><BR><BR><BR><BR><BR><BR><BR>"; -print "</TD><TD NOWRAP> </TD></TABLE></CENTER></BODY></HTML>\n"; - -exit; - - -#============================================================================== -# -# End of "main()" part of script. All the subroutines are below, that were -# used above. -# -#============================================================================== - - -########################################## -# -# get_org_data(): A recursive function that gets all the needed LDAP data on all people -# necessary to later draw the resulting org chart. -# -########################################## - -sub get_org_data -{ - local ($attrib_value, $attrib_name, $managerDNlocation) = @_; - local ($manager)="$attrib_name=" . $attrib_value . ",$managerDNlocation"; - local ($search) = "$config_tokens{'attrib-manager'}=$manager"; - local ($entry); - local ($conn); - - $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"}); - die "Could't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn; - $entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0, @return_attribs); - - $display_indent += 1; - - while ($entry) - { - if (not_terminated($entry) && not_own_manager($entry)) - { - $total++; - - $indentname[$display_indent] = $entry->{cn}[0]; - - $people[$total-1][0] = "/"; - for ( $tempnum = 1 ; $tempnum < $display_indent+1 ; $tempnum++ ) - { - $people[$total-1][0] = "$people[$total-1][0]$indentname[$tempnum]/"; - } - $people[$total-1][1] = $entry->{$config_tokens{'attrib-farleft-rdn'}}[0]; - $people[$total-1][2] = url_encode($entry->{dn}); - $people[$total-1][3] = $entry->{mail}[0]; - $people[$total-1][4] = $entry->{$config_tokens{"attrib-job-title"}}[0]; - - # AIM - $people[$total-1][5] = "(none)"; - - if ( $config_tokens{"icons-aim-visible"} ne "no" ) - { - if ( "$entry->{nsAIMStatusText}[0]" eq "ONLINE" ) - { - $people[$total-1][5] = $entry->{nsaimid}[0]; - } - if ( "$entry->{nsAIMStatusText}[0]" eq "OFFLINE" ) - { - $people[$total-1][5] = "OFFLINE"; - } - } - - # locator - $people[$total-1][6] = url_encode($entry->{cn}[0]); - - - if ( $display_indent < $config_tokens{"max-levels-drawn"}+1 ) - { - get_org_data($entry->{$config_tokens{'attrib-farleft-rdn'}}[0], $config_tokens{'attrib-farleft-rdn'} , $managerDNlocation); - } - else - { - $incomplete = 1; - } - - } - - $entry = $conn->nextEntry(); - } - - - $display_indent -= 1; -} - -########################################## -# -# not_terminated(): Should we leave this in the shipping version, since most companies -# may want to modify it for how they mark LDAP entries as inactive? -# -# Can't do any harm technically to leave it here, but may just look -# like loose ends to the customer and gives away part of our internal -# way of doing things. I'll leave it up to you, the code reviewer, -# to make the call. (I see pros and cons both ways.) -# -########################################## - -sub not_terminated -{ - my($person) = @_; - - for ($j=0; $person->{objectclass}[$j] ; $j++) - { - if ($person->{objectclass}[$j] eq "nscphidethis") - { - return(0); - } - } - return(1); -} - -########################################## -# -# not_own_manager(): See if person reports to himself, and if so then -# we need to tell the calling function that, so we -# don't get caught in an infinite loop while discovering -# the reporting chain. -# -########################################## - -sub not_own_manager -{ - my ($entry) = @_; - - @manager= split (/,/ , $entry->{$config_tokens{'attrib-manager'}}[0]); - @splitagain = split (/=/, @manager[0] ); - $manageruid = @splitagain[1]; - - if ( $entry->{$config_tokens{'attrib-farleft-rdn'}}[0] eq $manageruid) - { - print "ATTENTION: $entry->{cn}[0] is his own manager!<BR>\n"; - return(0); - } - else - { - return(1); - } -} - - -########################################## -# -# Print the locator icon icon next to the person's name, -# if that's what we are configured to do, and only if not in -# print mode ("print mode": if the page is not being generated -# in a stripped-down way [sans icons] for printing) -# -########################################## - -sub print_locator_icon_if_outside_layer -{ - my ($visible, $locator) = @_; - - if ( ($visible eq "forefront") && (!($print_mode)) ) - { - print " <a href=\"$config_tokens{\"url-locator-base\"}"; - print "$locator\"><img src=\"../html/mag.gif\" border=0 align=TEXTTOP></a>"; - } - - return; -} - -########################################## -# -# Print the phonebook icon icon next to the person's name, -# if that's what we are configured to do, and only if not in -# print mode ("print mode": if the page is not being generated -# in a stripped-down way [sans icons] for printing) -# -########################################## - -sub print_pb_icon_if_outside_layer -{ - my ($visible, $dn) = @_; - - if ( ($visible eq "forefront") && (!($print_mode)) ) - { - - print " <a href=\"$config_tokens{'url-phonebook-base'}"; - print "$dn\">"; - print "<img src=\"../html/ldap-person.gif \" border=0 align=TEXTTOP>"; - print "</a>"; - } - - return; -} - -########################################## -# -# Print the email icon icon next to the person's name, -# if that's what we are configured to do, and only if not in -# print mode ("print mode": if the page is not being generated -# in a stripped-down way [sans icons] for printing) -# -########################################## - -sub print_email_icon_if_outside_layer -{ - my ($visible, $email) = @_; - - if ( ($visible eq "forefront") && ( $email =~ /@/ ) && (!($print_mode)) ) - { - print " <a href=\"mailto:$email\">"; - print "<img src=\"../html/mail.gif \" border=0 align=TEXTTOP>"; - print "</a>"; - } - - return; -} - -########################################## -# -# Print the AIM icon icon next to the person's name, -# if that's what we are configured to do, and only if not in -# print mode ("print mode": if the page is not being generated -# in a stripped-down way [sans icons] for printing), and if the person is ONLINE -# -########################################## - -sub print_aim_icon_if_outside_layer -{ - my ($visible, $status, $screenname) = @_; - - if ( ($visible eq "forefront") && (!($print_mode)) ) - { - if ( $status eq "discover" ) - { - if ( ($screenname eq "(none)") || ($screenname eq "OFFLINE") ) - { - $status = "OFFLINE"; - } - else - { - $status = "ONLINE"; - } - } - - if ( $status eq "ONLINE" ) - { - $screenname =~ tr/ /+/; - print " <a href=\"aim:goim?Screenname=$screenname\">"; - print "<img src=\"../html/aim-online.gif\" border=0 align=TEXTTOP></a>"; - } - } - - return; -} - -########################################## -# -# Figure out if we are supposed to be putting the locator icon -# inside the floating layer, if that's what we are configured to do. -# If not, then return "(none)", which client-side javascript then -# knows how to react off of (to not display anything). -# -########################################## - -sub is_locator_in_layer -{ - my ($visible, $locator) = @_; - my ($returnvalue) = "(none)"; - - if ( $visible eq "layer" ) - { - $returnvalue = $locator; - } - - return ( $returnvalue ); -} - -########################################## -# -# Figure out if we are supposed to be putting the phonebook icon -# inside the floating layer, if that's what we are configured to do. -# If not, then return "(none)", which client-side javascript then -# knows how to react off of (to not display anything). -# -########################################## - -sub is_pb_in_layer -{ - my ($visible, $pb) = @_; - my ($returnvalue) = "(none)"; - - if ( $visible eq "layer" ) - { - $returnvalue = $pb; - } - - return ( $returnvalue ); -} - -########################################## -# -# Figure out if we are supposed to be putting the email icon -# inside the floating layer, if that's what we are configured to do. -# If not, then return "(none)", which client-side javascript then -# knows how to react off of (to not display anything). -# -########################################## - -sub is_email_in_layer -{ - my ($visible, $email) = @_; - my ($returnvalue) = "(none)"; - - if ( ($visible eq "layer") && ( $email =~ /@/ ) ) - { - $returnvalue = $email; - } - - return ( $returnvalue ); -} - -########################################## -# -# Figure out if we are supposed to be putting the AIM icon -# inside the floating layer, if that's what we are configured to do. -# If not, then return "(none)", which client-side javascript then -# knows how to react off of (to not display anything). -# knows how to react off of (to not display anything). -# -########################################## - -sub is_aimid_in_layer -{ - my ($visible, $status, $screenname) = @_; - - my ($returnvalue) = "(none)"; - - if ( $status eq "discover" ) - { - if ( ($screenname eq "(none)") || ($screenname eq "OFFLINE") ) - { - $status = "OFFLINE"; - } - else - { - $status = "ONLINE"; - } - } - - - if ( ($visible eq "layer") && ($status eq "ONLINE") ) - { - $screenname =~ tr/ /+/; - $returnvalue = $screenname; - } - - return ( $returnvalue ); -} - -########################################## -# -# Generic encoder function, used in several places for building -# correct URL's for the user to click on. -# -########################################## - -sub url_encode -{ - my ($tempstr) = @_; - - $tempstr =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg; - - return($tempstr); -} - -########################################## -# -# This javascript below is needed for whenever an org chart of any -# nature is drawn. It contains the DHTML-related javascript to -# dynamically construct and display (and then hide) a given floating -# layer of information and links for a given employee that is being -# -########################################## - -sub print_javascript -{ - -print "<SCRIPT> - - -var left = 0; -var top = 0; - -var W3C = document.getElementById? true : false; -var NN4 = document.layers? true : false; -var IE4 = document.all? true : false; -var MOZ5 = ((navigator.userAgent.toLowerCase().indexOf(\"mozilla\")==0) && (navigator.userAgent.toLowerCase().charAt(8) >= 5) && (navigator.userAgent.toLowerCase().indexOf(\"compatible\")<0)); -var OP = navigator.userAgent.toLowerCase().indexOf(\"opera\")>=0; - -var isOver = false; -var timer = null; - -function OverLayer() -{ - clearTimeout(timer); - isOver = true; -} - -function OutLayer() -{ - clearTimeout(timer); - isOver = false; - timer = setTimeout(\"hideLayer()\",500); -} - - -function hideLayer() -{ - if (!isOver) - { - if ( W3C ) - { - document.getElementById(\"test\").style.visibility = \"hidden\"; - } - - if ( NN4 ) - { - document.layers[\"test\"].visibility = \"hidden\"; - } - - if ( IE4 ) - { - document.all[\"test\"].style.visibility = \"hidden\"; - } - - } - - -} - - -function showLayer(cn,title,mail,dn,locator,aimid) -{ - var finalhtml; - var num = 0; - - clearTimeout(timer); - hideLayer(); - - finalhtml = '<TABLE border=1 CELLPADDING=15 BGCOLOR=\"#CCCCCC\"><TR><TD><TABLE BORDER=0>'; - finalhtml += '<TR><TD COLSPAN=2 NOWRAP>$fontstring<B>' + unescape(cn) + '</B></font></TD></TR>'; - finalhtml += '<TR><TD COLSPAN=2 NOWRAP>$fontstring' + title + '</font></TD></TR>'; - finalhtml += '<TR><TD COLSPAN=2 NOWRAP>'; - - if ( (mail == '(none)') && (dn == '(none)') && (locator == '(none)') && (aimid == '(none)') ) - { - // don't draw HR line - } - else - { - finalhtml += '<HR>'; - } - - finalhtml += '</TD></TR>'; - - if ( mail != '(none)' ) - { - finalhtml += '<TR><TD align=center><a href=\"mailto:' + mail + '\">'; - finalhtml += '<img src=\"../html/mail.gif\" border=0 align=TEXTTOP></a></TD>'; - finalhtml += '<TD NOWRAP>$fontstring '; - finalhtml += '<a href=\"mailto:' + mail + '\">Email</a></font></TD></TR>'; - } - - if ( dn != '(none)' ) - { - finalhtml += '<TR><TD align=center>'; - finalhtml += '<a href=\"$config_tokens{\"url-phonebook-base\"}'; - finalhtml += dn + '\"><img src=\"../html/ldap-person.gif\" border=0 align=TEXTTOP></a></TD>'; - finalhtml += '<TD NOWRAP>$fontstring '; - finalhtml += '<a href=\"$config_tokens{\"url-phonebook-base\"}' + dn + '\">'; - finalhtml += 'Phonebook</a></font></TD></TR>'; - } - - if ( locator != '(none)' ) - { - finalhtml += '<TR><TD align=center>'; - finalhtml += '<a href=\"$config_tokens{\"url-locator-base\"}'; - finalhtml += locator + '\"><img src=\"../html/mag.gif\" border=0 align=TEXTTOP></a></TD>'; - finalhtml += '<TD NOWRAP>$fontstring '; - finalhtml += '<a href=\"$config_tokens{\"url-locator-base\"}' + locator + '\">'; - finalhtml += 'Locator</a></font></TD></TR>'; - } - - if ( aimid != '(none)' ) - { - finalhtml += '<TR><TD align=center>'; - finalhtml += '<a href=\"aim:goim?Screenname=' + aimid + '\">'; - finalhtml += '<img src=\"../html/aim-online.gif\" border=0 align=TEXTTOP></a></TD>'; - finalhtml += '<TD NOWRAP>$fontstring '; - finalhtml += '<a href=\"aim:goim?Screenname=' + aimid + '\">'; - finalhtml += 'Currently online</a></font></TD></TR>'; - } - - finalhtml += '</TABLE></TD></TR></TABLE>'; - - - if ( W3C ) - { - document.getElementById(\"test\").innerHTML = finalhtml; - - if (navigator.userAgent.toLowerCase().indexOf('opera')>-1) - { - // Opera bug - don't use the units - document.getElementById(\"test\").style.left = left + 25; - document.getElementById(\"test\").style.top = top + 5; - } - else - { - document.getElementById(\"test\").style.left = left + 25 + \"px\"; - document.getElementById(\"test\").style.top = top + 5 + \"px\"; - } - - document.getElementById(\"test\").style.visibility = \"visible\"; - } - - - if ( IE4 ) - { - test.innerHTML = finalhtml; - - document.all[\"test\"].style.pixelLeft = left + 25; - document.all[\"test\"].style.pixelTop = top + 5; - document.all[\"test\"].style.visibility = \"visible\"; - } - - - if ( NN4 ) - { - document.test.document.write(finalhtml); - document.test.document.close(); - - document.layers[\"test\"].left = left + 25; - document.layers[\"test\"].top = top + 5; - document.layers[\"test\"].visibility = \"show\"; - } - -} - -function setMouseCoordinate(e) -{ - if (MOZ5 || NN4) - { - left = e.pageX; - top = e.pageY; - } - else if (IE4 || OP) - { - left = document.body.scrollLeft + event.clientX; - top = document.body.scrollTop + event.clientY; - } -} - - -if ( NN4 ) -{ - document.captureEvents(Event.MOUSEMOVE); -} -document.onmousemove = setMouseCoordinate; - - - -</SCRIPT> - -"; - -} - -########################################## -# -# Read the "config.txt" file for admin's desired settings. -# -# -# See the file itself for details on what each setting -# represents, and what the possible values are. -# -########################################## - -sub read_config_file() -{ -my $curdir; -if ($isWindows) { - $curdir = `cd`; chop($curdir); -} else { - $curdir = `pwd`; chop($curdir); -} -if (!open (FILE, "../config.txt") ) -{ - &output_html_header("no-javascript"); - print "\n\n<BR><BR>Can't open configuration file: $curdir/config.txt\n\n<BR><BR>Error from OS: $!\n\n"; - print "\n</BODY></HTML>"; - exit; -} - -%config_tokens = ( "ldap-host","none", - "ldap-port","none", - "ldap-search-base","none", - "ldap-bind-dn","", - "ldap-bind-pass","", - "icons-aim-visible","no", - "icons-email-visible","no", - "icons-phonebook-visible","no", - "icons-locator-visible","no", - "url-phonebook-base", "none", - "url-locator-base", "none", - "attrib-job-title", "title", - "attrib-manager", "manager", - "attrib-farleft-rdn", "uid", - "max-levels-drawn", "3", - "manager-DN-location", "same", - "min-chars-searchstring", "4", - "allowed-filter-chars", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _-" - ); - -while(<FILE>) -{ - chop; - - foreach $f (keys %config_tokens) - { - $config_tokens{$f} = $1 if ($_ =~ /^$f[ \t]+(.+)/); - } -} - -close (FILE); - - -if ( $config_tokens{"ldap-host"} eq "none" ) -{ - &output_html_header("no-javascript"); - print "<BR><BR>The administrator of this application needs to configure an LDAP host to use.<BR><BR>"; - print "\n</BODY></HTML>"; - exit(0); -} -if ( $config_tokens{"ldap-port"} eq "none" ) -{ - &output_html_header("no-javascript"); - print "<BR><BR>The administrator of this application needs to configure an LDAP port number to use.<BR><BR>"; - print "\n</BODY></HTML>"; - exit(0); -} -if ( $config_tokens{"ldap-search-base"} eq "none" ) -{ - &output_html_header("no-javascript"); - print "<BR><BR>The administrator of this application needs to configure an LDAP search base.<BR><BR>"; - print "\n</BODY></HTML>"; - exit(0); -} -if ( ($config_tokens{"url-phonebook-base"} eq "none") && ( $config_tokens{"icons-phonebook-visible"} ne "disabled") ) -{ - &output_html_header("no-javascript"); - print "<BR><BR>The administrator of this application has configured phonebook icons to be enabled, but has not yet configured a phonebook partial base URL to use for those phonebook icons.<BR><BR>"; - print "\n</BODY></HTML>"; - exit(0); -} -if ( ($config_tokens{"url-locator-base"} eq "none") && ( $config_tokens{"icons-locator-visible"} ne "disabled") ) -{ - &output_html_header("no-javascript"); - print "<BR><BR>The administrator of this application has configured locator icons to be enabled, but has not configured a locator partial base URL to use for those locator icons.<BR><BR>"; - print "\n</BODY></HTML>"; - exit(0); -} -} - - -########################################## -# -# Let's read in (and validate) any personal settings -# that the user has, which they can set from clicking -# the "Customize" link. -# -########################################## - - -sub check_myorgchart_settings() -{ - - my $query = new CGI; - my $cookie_in = $query->cookie("MyOrgChart"); - - # - # if client-side browser cookie was found... - # - if ($cookie_in) - { - @cookiedata = split (/&/ , $cookie_in); - - foreach $f (@cookiedata) - { - if ( $f =~ /=/ ) - { - @individ = split (/=/ , $f); - $cookie_tokens{$individ[0]} = $individ[1]; - } - } - } - -# ========================================================= -# -# begin ---> Check for MyOrgChart overriding settings -# (that may override settings the admin set -# in config.txt) -# -# ========================================================= - -if ( (defined $cookie_tokens{"email"}) && ($config_tokens{"icons-email-visible"} ne "disabled") ) -{ - $config_tokens{"icons-email-visible"} = $cookie_tokens{"email"}; -} -if ( (defined $cookie_tokens{"pb"}) && ($config_tokens{"icons-phonebook-visible"} ne "disabled") ) -{ - $config_tokens{"icons-phonebook-visible"} = $cookie_tokens{"pb"}; -} -if ( (defined $cookie_tokens{"maps"}) && ( $config_tokens{"icons-locator-visible"} ne "disabled" ) ) -{ - $config_tokens{"icons-locator-visible"} = $cookie_tokens{"maps"}; -} -if ( (defined $cookie_tokens{"aim"}) && ($config_tokens{"icons-aim-visible"} ne "disabled") ) -{ - $config_tokens{"icons-aim-visible"} = $cookie_tokens{"aim"}; -} -if ( defined $cookie_tokens{"maxlevels"} ) -{ - if ( $cookie_tokens{"maxlevels"} < $config_tokens{"max-levels-drawn"} ) - { - # - # Just to make life easier (coding-wise), if the user specified a - # a personal preference of having a smaller number of "maxlevels" - # (how many levels drawn for any org chart they generate) drawn than - # the admin-configured value, let's just set the admin-config'ed value - # (just in memory, so just for a few seconds) to the user's value - # - $config_tokens{"max-levels-drawn"} = $cookie_tokens{"maxlevels"}; - } -} - - -# ========================================================= -# -# end ---> Check for MyOrgChart overriding settings -# -# ========================================================= - -# Hold on, one final important step before we leave this function.... -# -# Below (as far as just this Perl CGI file is concerned only) it is a lot less code -# to just treat "disabled" settings as "no" for the icons, to accomplish the -# same end result in both cases, of not showing the given icon(s). -# -# But in the MyOrgChart.cgi, we do care about this distinction, because for the -# "disable" setting we don't want the user to have the option listed to enable -# that icon to now be displayed in some way. This is why we need to have the -# below code right after the MyOrgChart overrides above, to make sure the -# below has the final say, for the icon-related settings. -# -if ( $config_tokens{"icons-aim-visible"} eq "disabled" ) { $config_tokens{"icons-aim-visible"} eq "no"; } -if ( $config_tokens{"icons-email-visible"} eq "disabled" ) { $config_tokens{"icons-email-visible"} eq "no"; } -if ( $config_tokens{"icons-phonebook-visible"} eq "disabled" ) { $config_tokens{"icons-phonebook-visible"} eq "no"; } -if ( $config_tokens{"icons-locator-visible"} eq "disabled" ) { $config_tokens{"icons-locator-visible"} = "no"; } - -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub print_single_div_html() -{ - -print "\n<DIV id=\"test\" onMouseOver=\"OverLayer();\" onMouseOut=\"OutLayer();\" style=\"LEFT:0px;POSITION:absolute;TOP:0px;VISIBILITY:visible;Z-INDEX:0\">"; -print "</DIV>"; - -print "\n\n"; - -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub nav4_specific_event_handlers() -{ - print "<script type=\"text/javascript\">\n"; - print "\n"; - print "if ( NN4 ) \n"; - print "{\n"; - print " document.layers['test'].onmouseover=OverLayer; \n"; - print " document.layers['test'].onmouseout=OutLayer; \n"; - print "}\n"; - print "</script>\n\n"; -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub config_ldap_return_attrib_list() -{ - - @return_attribs = ("businesscategory", "cn", "dn", "mail", "$config_tokens{'attrib-manager'}", "objectclass", "ou", "telephonenumber", "$config_tokens{'attrib-job-title'}", "uid"); - - - $found = 0; - foreach $f (@return_attribs) - { - if ( $f eq $config_tokens{'attrib-farleft-rdn'} ) - { - $found = 1; - } - } - if ( $found == 0 ) - { - # - # If the RDN attribute name defined in config.txt is not already - # listed in the above @return_attribs array, then we need to add - # it to the array, so that we get the value back from searches. - # - push @return_attribs, $config_tokens{'attrib-farleft-rdn'}; - } - - - - # - # It is really expensive currently, per design of the AIM Presence plugin - # in DS 6.0x, to ask LDAP for AIM status, so let's only request this for each - # and every user in the org chart if we absolutely have to (per MyOrgChart - # preferences having AIM icons turned on) - # - if ( $config_tokens{"icons-aim-visible"} ne "no" ) - { - push @return_attribs, "nsAIMStatusText"; - push @return_attribs, "nsaimid"; - } -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub search_for_enduser_query() -{ - # - # Check that filter contains only allowed characters by comparing to - # allowed-filter-chars in config.txt. - - $allowedlist = $config_tokens{"allowed-filter-chars"}; - for($i=0; $i < length($uid); $i++) { - if(substr($uid,$i,1) !~ /[$allowedlist]/) { - &output_html_header("no-javascript"); - print "<BR><BR>\""; - print substr($uid,$i,1) . "\" is not allowed in search filters.<BR><BR>"; - print "Please modify your search and try again.<BR>"; - print "\n</BODY></HTML>"; - exit (0); - } - } - - # - # Get the full user entry of the uid entered by the end-user - # - # ...so if end user enters "steveh", then the below $search = "uid=steveh" - - $search = "$config_tokens{'attrib-farleft-rdn'}=" . $uid; - - $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"}); - die "Couldn't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn; - $entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0 , @return_attribs); - - # - # If no entries found for the above exact UID match, before we - # broaden the search filter to help the user out, let's first check how - # many characters they submitted as compared to the "min-chars-searchstring" - # setting in config.txt, to avoid potential heavy loads on the LDAP server. - - if (! $entry) - { - if ( length($uid) < $config_tokens{"min-chars-searchstring"} ) - { - &output_html_header("no-javascript"); - print "<BR><BR>I did not find an exact userid match for what you entered.<BR><BR>"; - print "Please enter at least $config_tokens{\"min-chars-searchstring\"} characters to broaden the search more.<BR>"; - print "\n</BODY></HTML>"; - exit (0); - } - } - - # if (no entries found), let's try broading the search, to give them some - # search results to pick from (I guess they did not enter an exact uid) - # - if (! $entry) - { - $uid =~ tr/ /*/; - - $search = "(|(cn=*$uid*)(mail=*$uid*))"; - - $conn = new Mozilla::LDAP::Conn($config_tokens{"ldap-host"}, $config_tokens{"ldap-port"}, $config_tokens{"ldap-bind-dn"}, $config_tokens{"ldap-bind-pass"}); - die "Couldn't connect to LDAP server $config_tokens{\"ldap-host\"}" unless $conn; - $entry = $conn->search($config_tokens{"ldap-search-base"}, "subtree", $search, 0, @return_attribs); - - $anothertempnum = 0; - while ($entry) - { - -#print "Entry Count: ".Mozilla::LDAP::API::ldap_count_entries($conn->getLD(), $conn->getRes())."\n"; - $results[$anothertempnum][0] = "<a href=\"org?${contextParamString}" . $config_tokens{'attrib-farleft-rdn'} . "=" . url_encode( $entry->{$config_tokens{'attrib-farleft-rdn'}}[0] ) . "\">"; - - $results[$anothertempnum][1] = $entry->{cn}[0]; - - if ( $entry->{telephonenumber}[0] ne "" ) - { - $results[$anothertempnum][2] = $entry->{telephonenumber}[0]; - } - else - { - $results[$anothertempnum][2] = " "; - } - - if ( $entry->{mail}[0] ne "" ) - { - if ( $entry->{mail}[0] =~ /@/ ) - { - $results[$anothertempnum][3] = "<a href=\"mailto:$entry->{mail}[0]\">$entry->{mail}[0]</a>"; - } - } - else - { - $results[$anothertempnum][3] = " "; - } - - if ( $entry->{businesscategory}[0] ne "" ) - { - $results[$anothertempnum][4] = $entry->{businesscategory}[0]; - } - else - { - $results[$anothertempnum][4] = " "; - } - - - if ( $entry->{ou}[0] ne "" ) - { - $results[$anothertempnum][5] = $entry->{ou}[0]; - } - else - { - $results[$anothertempnum][5] = " "; - } - - $lastentry = $entry; - $entry = $conn->nextEntry(); - ++$anothertempnum; - } - - if ( $anothertempnum == 0 ) - { - &output_html_header("no-javascript"); - print "<BR><BR>No search results found!<BR>"; - } - elsif ( $anothertempnum == 1) - { - # - # If we only have one match, let's display the org chart - # for that person, as opposed to just showing a single search result. - # - $entry = $lastentry; - $uid = $entry->{$config_tokens{'attrib-farleft-rdn'}}[0]; - } - else - { - -#--------------------------------------------- -# -# Let's print the LDAP entries found, that match the string entered. -# -#--------------------------------------------- - -&output_html_header("no-javascript"); -print " - -<br> -<table cellspacing=\"-1\" cellpadding=\"2\" border=\"0\" width=\"100%\"> -<tr> -<td align=\"left\" class=\"pageHeader\">Search Results: $anothertempnum users</td> -<td align=\"right\" class=\"searchHelp\"><img src=\"../html/orgicon.gif\" width=\"16\" height=\"14\" border=\"0\"> = view organization chart</td> -</tr> -<tr><td> </td></tr> -</table> -<table bgcolor=\"#FFFFFF\" cellspacing=\"-1\" cellpadding=\"3\" border=\"1\" width=\"100%\"> -<tr> - <th align=\"left\" class=\"resultsHeader\">Name</th> - <th align=\"left\" class=\"resultsHeader\">Phone</th> - <th align=\"left\" class=\"resultsHeader\">EMail</th> - <th align=\"left\" class=\"resultsHeader\">Group</th> - <th align=\"left\" class=\"resultsHeader\">Business Category</th> -</tr> -"; - - -for ( $num = 0 ; $num < $anothertempnum ; $num++ ) -{ - -print " -<tr> - <td align=\"left\" nowrap>$results[$num][0]<img src=\"../html/orgicon.gif\" width=\"16\" height=\"14\" border=\"0\" alt=\"View Organization Chart\"></a> $results[$num][1]</td> - <td align=\"left\" nowrap>$results[$num][2]</td> - <td align=\"left\">$results[$num][3]</td> - <td align=\"left\">$results[$num][4]</td> - <td align=\"left\">$results[$num][5]</td> -</tr> - -"; - -} -print "</table>"; -#--------------------------------------------- - - } - - # if there was only one search result (which we purposely - # did not print to the browser above), then let's draw the - # org chart for that single search result - # - # if zero or more than one search result, let's end things - # here, as there isn't anything else to do, code-wise. - if ( $anothertempnum != 1 ) - { - print "\n</BODY></HTML>"; - exit(0); - } - } -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub print_topmost_box() -{ - if ( !($print_mode) ) - { - # let's print the "Prepare for Printing" link if not already doing so - # - print "<font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 14px\">"; - - print "<a href=\"org?${contextParamString}" . $config_tokens{'attrib-farleft-rdn'} . "=" . url_encode($uid) . "&print=yes\" target=\"org_print_window\">Prepare this page for printing</A><BR>"; - print "</font>"; - } - - print "<CENTER><table border=0><tr><td NOWRAP>"; - - print "<center>"; - - # - # special exception: seems like when hardcopy printing org chart from IE browser, - # the boxes that people are in are not printed, so by making - # border=1, at least you can see the box on the hardcopy version - # - if ( ( "$browser_is_msie" ) && ( $print_mode ) ) - { - print "<table border=1 CELLSPACING=1 > \n"; - } - else - { - print "<table border=0 CELLSPACING=1 > \n"; - } - - print "<tr>\n"; - print "<td ALIGN=CENTER BGCOLOR=\"#000000\" NOWRAP>\n"; - print "<table border=0 CELLSPACING=0 CELLPADDING=6 >\n"; - print "<tr>\n"; - print "<td BGCOLOR=\"#CCCCCC\" ALIGN=CENTER VALIGN=CENTER NOWRAP>\n"; - print "<table cellspacing=0 border=0><tr><td NOWRAP>"; - print "$fontstring<center>"; - - $tempstr = url_encode($entry->{dn}); - $tempstr2 = url_encode($entry->{cn}[0]); - - $aimid = is_aimid_in_layer ( $config_tokens{"icons-aim-visible"} , $entry->{nsAIMStatusText}[0] , $entry->{nsaimid}[0] ); - $emailstr = is_email_in_layer ( $config_tokens{"icons-email-visible"}, $entry->{mail}[0] ); - $pbstr = is_pb_in_layer ( $config_tokens{"icons-phonebook-visible"}, $tempstr ); - $locatorstr = is_locator_in_layer ( $config_tokens{"icons-locator-visible"}, $tempstr2 ); - - if ( !($print_mode) ) - { - print "\n\n <A HREF='javascript:return false;' target=_top onMouseOver=\"showLayer('$tempstr2','$entry->{$config_tokens{\"attrib-job-title\"}}[0]','$emailstr','$pbstr','$locatorstr','$aimid');\" onMouseOut=\"OutLayer();\">"; - print "<img src=\"../html/arrow.gif\" border=0 align=TEXTTOP>"; - print "</A> \n"; - } - - print "<B>$entry->{cn}[0]</B>"; - - print_aim_icon_if_outside_layer( $config_tokens{"icons-aim-visible"}, $entry->{nsAIMStatusText}[0], $entry->{nsaimid}[0] ); - print_email_icon_if_outside_layer( $config_tokens{"icons-email-visible"}, $entry->{mail}[0] ); - print_pb_icon_if_outside_layer( $config_tokens{"icons-phonebook-visible"}, $tempstr ); - print_locator_icon_if_outside_layer( $config_tokens{"icons-locator-visible"}, $tempstr2 ); - - print "<BR>\n"; - print "$entry->{$config_tokens{\"attrib-job-title\"}}[0]<BR>\n</font>"; - - # - # Get the full name of the manager of the uid entered by the end-user - # - - @manager= split (/,/ , $entry->{$config_tokens{'attrib-manager'}}[0]); - @splitagain = split (/=/, @manager[0] ); - $manager = @splitagain[1]; - $managerSearch = $config_tokens{'attrib-farleft-rdn'} . "=" . $manager; - $managerEntry = $conn->search($config_tokens{"ldap-search-base"},"subtree", $managerSearch, 0, @return_attribs); - - print "$fontstring"; - print "Manager: "; - - if ($managerEntry) - { - $tempstr = url_encode($managerEntry->{dn}); - $tempstr2 = url_encode($managerEntry->{cn}[0]); - $managertitle = $managerEntry->{$config_tokens{"attrib-job-title"}}[0]; - - $aimid = is_aimid_in_layer ( $config_tokens{"icons-aim-visible"} , $managerEntry->{nsAIMStatusText}[0] , $managerEntry->{nsaimid}[0] ); - $emailstr = is_email_in_layer ( $config_tokens{"icons-email-visible"}, $managerEntry->{mail}[0] ); - $pbstr = is_pb_in_layer ( $config_tokens{"icons-phonebook-visible"}, $tempstr ); - $locatorstr = is_locator_in_layer ( $config_tokens{"icons-locator-visible"}, $tempstr2 ); - - if ( !($print_mode) ) - { - print "\n\n <A HREF='javascript:return false;' target=_top onMouseOver=\"showLayer('$tempstr2','$managertitle','$emailstr','$pbstr','$locatorstr','$aimid');\" onMouseOut=\"OutLayer();\">"; - print "<img src=\"../html/arrow.gif\" border=0 align=TEXTTOP>"; - print "</A> \n"; - } - - print $managerEntry->{cn}[0]; - - if ( !($print_mode) ) - { - print " <A HREF=org?${contextParamString}" . $config_tokens{'attrib-farleft-rdn'} . "=" . url_encode($manager) . "><img src=\"../html/orgicon.gif\" border=0 height=15 width=17 align=TEXTTOP></a>"; - } - - print_aim_icon_if_outside_layer( $config_tokens{"icons-aim-visible"}, $managerEntry->{nsAIMStatusText}[0], $managerEntry->{nsaimid}[0] ); - print_email_icon_if_outside_layer( $config_tokens{"icons-email-visible"}, $managerEntry->{mail}[0] ); - print_pb_icon_if_outside_layer( $config_tokens{"icons-phonebook-visible"}, $tempstr ); - print_locator_icon_if_outside_layer( $config_tokens{"icons-locator-visible"}, $tempstr2 ); - - print "</font>"; - } - - if (!$managerEntry) - { - print "<B>(no manager listed)</B>"; - } - - print"</center></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <BR>"; -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub print_toplevel_tree_branch() -{ - # - # Are there any leaf entries directly under top level person? - # - # If yes, then don't put them in their own boxes, but instead - # list them in a tree branch underneath the top level person's box. - # - - print "\n<center><table border=0><tr><td NOWRAP>"; - $anothertempnum = @sortedPeople; - for ( $tempnum = 0 ; $tempnum < $anothertempnum ; $tempnum++ ) - { - $f = $sortedPeople[$tempnum][0]; - $count = ($f =~ tr/\///); - - if ( $count == 2 ) - { - @tempdata = split(/\//, $f ); - $entry = $tempdata[1]; - - # - # if we are at the end of the array, we want to avoid - # the else block below, because we don't want to add one - # more blank element to the array with the "+1", or that - # will make our @sortedPeople value be a fake one element higher - # - if ( $tempnum == $anothertempnum-1 ) - { - $nextentry = ""; - } - else - { - $info = $sortedPeople[$tempnum+1][0]; - @tempdata = split(/\//, $info); - $nextentry = @tempdata[1]; - } - - if ( "$entry" ne "$nextentry" ) - { - print "$fontstring"; - print "\n<img SRC=\"../html/new-branch-first.gif\" align=TEXTTOP>"; - - $aimid = is_aimid_in_layer ( $config_tokens{"icons-aim-visible"} , "discover" , $sortedPeople[$tempnum][5] ); - $emailstr = is_email_in_layer ( $config_tokens{"icons-email-visible"}, $sortedPeople[$tempnum][3] ); - $pbstr = is_pb_in_layer ( $config_tokens{"icons-phonebook-visible"}, $sortedPeople[$tempnum][2] ); - $locatorstr = is_locator_in_layer ( $config_tokens{"icons-locator-visible"}, $sortedPeople[$tempnum][6] ); - - if ( !($print_mode) ) - { - print "\n\n <A HREF='javascript:return false;' target=_top onMouseOver=\"showLayer('$sortedPeople[$tempnum][6]','$sortedPeople[$tempnum][4]','$emailstr','$pbstr','$locatorstr','$aimid');\" onMouseOut=\"OutLayer();\">"; - print "<img src=\"../html/arrow.gif\" border=0 align=TEXTTOP>"; - print "</A> \n"; - } - - print "\n $entry "; - - if ( $sortedPeople[$tempnum][7] =~ /nonleaf/ ) - { - # - # If we are only supposed to draw one level for the org chart, - # and there are nonleaf entries, display org chart icon next - # to the person's name, to indicate they have people below them. - # - print "<a href=org?${contextParamString}" . $config_tokens{'attrib-farleft-rdn'} . "=" . url_encode($sortedPeople[$tempnum][1]) . ">"; - print "<img src=\"../html/orgicon.gif\" border=0 height=15 width=17 align=TEXTTOP></a>"; - } - - print_aim_icon_if_outside_layer( $config_tokens{"icons-aim-visible"}, "discover", $sortedPeople[$tempnum][5] ); - print_email_icon_if_outside_layer( $config_tokens{"icons-email-visible"}, $sortedPeople[$tempnum][3] ); - print_pb_icon_if_outside_layer( $config_tokens{"icons-phonebook-visible"}, $sortedPeople[$tempnum][2] ); - print_locator_icon_if_outside_layer( $config_tokens{"icons-locator-visible"}, $sortedPeople[$tempnum][6] ); - - print "</font><BR>\n"; - $sortedPeople[$tempnum][0] = "--skip--"; - } - } - } - - print "\n</td></tr></table></center>\n\n"; -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub pre_markup_remaining_branches() -{ - - # - # Below let's scan the org chart entries and record - # some notes next to some of the entries (to be used later on - # in drawing the final display) on which tree branch pieces - # need to be rounded, which need to be draw in a special way, etc. - # - # cc1 below ("corner case 1") is the condition where the last leaf - # user entry under a given boxed user entry (manager entry) is at - # the farthest left justification/indent level. - # - # cc2 is the trickier condition, and is anything other than cc1 above. - # Meaning there are user entries at the end of the branch that are - # indented one or more times to the right, so we need to draw - # blank space in the areas where we indent (we cannot have lines there) - # - # Below, we iterate throught the org chart data in reverse order - # (reverse order to make things easiest to program, for the marking up) - # and we save details in the same org chart array, to help the org chart - # drawing code later on know what to draw when there is indenting - # (whether to draw lines or no lines, or combination of the two) - # - - $inside_cc1 = "no"; - $inside_cc2 = "no"; - $deeper_inside_cc2 = "no"; - $last_count = 0; - - $last_manager = ""; - - $anothertempnum = @sortedPeople; - for ( $tempnum = @sortedPeople - 1 ; $tempnum >= 0 ; $tempnum-- ) - { - if ( "$sortedPeople[$tempnum][0]" ne "--skip--" ) - { - $f = $sortedPeople[$tempnum][0]; - $count = ($f =~ tr/\///) - 1; - - @tempdata = split(/\//, $sortedPeople[$tempnum][0] ); - $specvalue = $tempdata[1]; - - if ( ( $count == 2 ) && ( "$last_manager" ne "$specvalue" ) ) - { - $sortedPeople[$tempnum][8]="cc1"; - $inside_cc1 = "yes"; - $inside_cc2 = "no"; - $deeper_inside_cc2 = "no"; - } - else - { - if ( ( "$inside_cc1" eq "yes" ) && ( "$last_manager" ne "$specvalue" ) ) - { - $inside_cc1 = "no"; - } - - } - - if ( "$inside_cc1" eq "yes" ) - { - if ( ( $count >= 3 ) && ( $last_count != $count ) ) - { - $sortedPeople[$tempnum][8]="cc1"; - } - } - - - if ( ( $count > 2 ) && ( "$last_manager" ne "$specvalue" ) ) - { - $inside_cc2 = "yes"; - $deeper_inside_cc2 = "no"; - $inside_cc1 = "no"; - } - - if ( "$inside_cc2" eq "yes" ) - { - if ( ($count == 2 ) && ( "$deeper_inside_cc2" eq "no" ) ) - { - $deeper_inside_cc2 = "yes"; - $tempstr = "rounded"; - } - elsif ( ( $count >= 3 ) && ( $last_count != $count ) ) - { - $tempstr = "rounded"; - } - else - { - $tempstr = "tee"; - } - - - if ( "$deeper_inside_cc2" eq "no" ) - { - $sortedPeople[$tempnum][8]="cc2-bottom-$tempstr"; - } - else - { - $sortedPeople[$tempnum][8]="cc2-upper-$tempstr"; - } - - } - - $last_count = $count; - $last_manager = "$specvalue"; - } - } -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub draw_remaining_branches() -{ - - print "\n"; - print "<center><table border=0 cellpadding=10><tr VALIGN=top>"; - - $current_indent = 1; - $one_time_td = 0; - - $maxitems = @sortedPeople; - - for ( $tempnum = 0 ; $tempnum < $maxitems ; $tempnum++ ) - { - if ( "$sortedPeople[$tempnum][0]" ne "--skip--" ) - { - $count = ($sortedPeople[$tempnum][0] =~ tr/\///) - 1; - - while ( $count > $current_indent ) - { - $current_indent = $current_indent + 1; - } - - while ( $count < $current_indent ) - { - $current_indent = $current_indent - 1; - } - - @tempdata = split(/\//, $sortedPeople[$tempnum][0] ); - - if ( $current_indent == 1 ) - { - if ( $one_time_td == 0 ) - { - print "<TD NOWRAP>\n"; - $one_time_td = 1; - } - else - { - print "</TD><TD NOWRAP>\n"; - } - } - - - if ( $current_indent == 1 ) - { - # special exception: seems like when printing org chart from IE browser, - # the boxes that people are in are not printed, so by making - # border=1, at least you can see the box on the hardcopy version - # - if ( ( "$browser_is_msie" ) && ( $print_mode ) ) - { - print "<table border=1 CELLSPACING=1 > \n"; - } - else - { - print "<table border=0 CELLSPACING=1 > \n"; - } - - print "<tr>\n"; - print "<td ALIGN=CENTER BGCOLOR=\"#000000\">\n"; - print "<table border=0 CELLSPACING=0 CELLPADDING=6 >\n"; - print "<tr>\n"; - print "<td BGCOLOR=\"#CCCCCC\" ALIGN=CENTER VALIGN=CENTER>\n"; - print "<table cellspacing=0 border=0><tr><td NOWRAP><CENTER>"; - - # - # See comment just a few lines below about being careful on - # not moving this font tag past the IMG SRC tags - # - print "$fontstring"; - } - else - { - # - # Be careful on moving this font tag after the below IMG SRC - # tags for drawing branch pieces ---> to have the branch pieces - # stay connected on Netscape 6.x, the open FONT tag needs to be - # BEFORE the IMG SRC tags for the branch pieces.... - # - print "$fontstring"; - - if ( $sortedPeople[$tempnum][8] =~ /^cc2-bottom/ ) - { - for ( $anothertempnum = 0 ; $anothertempnum < $current_indent - 2 ; $anothertempnum++ ) - { - print "<img SRC=\"../html/new-branch-blank.gif\" align=TEXTTOP>"; - } - } - else - { - for ( $anothertempnum = 0 ; $anothertempnum < $current_indent - 2 ; $anothertempnum++ ) - { - print "<img SRC=\"../html/new-branch-straight.gif\" align=TEXTTOP>"; - } - } - - - if ( ("$sortedPeople[$tempnum][8]" eq "cc1") || ( $sortedPeople[$tempnum][8] =~ /rounded/ ) ) - { - print "<img SRC=\"../html/branch-cc1.gif\" align=TEXTTOP>"; - } - else - { - print "<img SRC=\"../html/new-branch-first.gif\" align=TEXTTOP>"; - } - } - - - $aimid = is_aimid_in_layer ( $config_tokens{"icons-aim-visible"} , "discover" , $sortedPeople[$tempnum][5] ); - $emailstr = is_email_in_layer ( $config_tokens{"icons-email-visible"}, $sortedPeople[$tempnum][3] ); - $pbstr = is_pb_in_layer ( $config_tokens{"icons-phonebook-visible"}, $sortedPeople[$tempnum][2] ); - $locatorstr = is_locator_in_layer ( $config_tokens{"icons-locator-visible"}, $sortedPeople[$tempnum][6] ); - - if ( !($print_mode) ) - { - print "\n\n <A HREF='javascript:return false;' target=_top onMouseOver=\"showLayer('$sortedPeople[$tempnum][6]','$sortedPeople[$tempnum][4]','$emailstr','$pbstr','$locatorstr','$aimid');\" onMouseOut=\"OutLayer();\">"; - print "<img src=\"../html/arrow.gif\" border=0 align=TEXTTOP>"; - print "</A> \n"; - } - - print "$tempdata[@tempdata-1] \n"; - - # - # If they are a nonleaf entry based on the next person being below them, or if they - # are a nonleaf person based on "nonleaf" value which happens when max depth is exceeded - # such that all people below them were chopped off (were on the next level that was chopped - # off, hence why we needed to previously record "nonleaf" before the chop happened) - # - # then print the org chart icon - # - if ( ( $sortedPeople[$tempnum+1][0] =~ /$tempdata[@tempdata-1]/ ) || ( $sortedPeople[$tempnum][7] =~ /nonleaf/ ) ) - { - if ( ($print_mode) && ($current_indent == 1 ) ) - { - # special exception #1 of 2: - # if we are in "prepare this page for printing" mode, and drawing a user in - # a box, then let's not print the org icon next to their name ---> not needed - # in the hardcopy printout (not helpful) - } - else - { - if ( ($print_mode) && ( $sortedPeople[$tempnum+1][0] =~ /$tempdata[@tempdata-1]/ ) ) - { - # special exception #2 of 2: if we are preparing this org chart for printing, - # and if the org icon we are about to draw is for a group of people that are - # already being printed on this same org chart under that person, there is - # no point in hardcopy printing this icon next to the person's name - # - # but in the "else" block below, we do want to print the icon next to their name - # (both for print and non-print org charts) because it signifies people underneath - # that person when we CANNOT/WON'T see those people listed under that person - } - else - { - if ( !( $sortedPeople[$tempnum+1][0] =~ /$tempdata[@tempdata-1]\/$/ ) ) - { - print "<a href=org?${contextParamString}" . $config_tokens{'attrib-farleft-rdn'} . "=" . url_encode($sortedPeople[$tempnum][1]) . ">"; - print "<img src=\"../html/orgicon.gif\" border=0 height=15 width=17 align=TEXTTOP></a>"; - } - } - } - } - - - print_aim_icon_if_outside_layer( $config_tokens{"icons-aim-visible"}, "discover", $sortedPeople[$tempnum][5] ); - print_email_icon_if_outside_layer( $config_tokens{"icons-email-visible"}, $sortedPeople[$tempnum][3] ); - print_pb_icon_if_outside_layer( $config_tokens{"icons-phonebook-visible"}, $sortedPeople[$tempnum][2] ); - print_locator_icon_if_outside_layer( $config_tokens{"icons-locator-visible"}, $sortedPeople[$tempnum][6] ); - - # - # if the person's name is being printed within a box, - # then also print their title below their name - # - if ( $current_indent == 1 ) - { - - print "<BR>$sortedPeople[$tempnum][4]"; - } - - print "</font>"; - - if ( $current_indent == 1 ) - { - print" </CENTER></td></tr> </table> </td> </tr> </table> </td> </tr> </table> "; - } - - print "<BR>"; - - } - } - -} - -########################################## -# -# If they exceeded max depth allowed, let's still figure out -# which people are managers of some type and make sure we -# still put an org chart icon next to their name, so that the -# user can tell that there is extra org chart branches that were -# chopped off. -# -# We do this by over-filling the array of the org chart structure, -# and then make sure that when we chop off the extra level below, -# we record for the manager-types that have now chopped-off people -# that they are a non-leaf item (which needs an org chart icon next -# to their name -# -########################################## - -sub detect_nonleaf_depth_exceeded() -{ - - if ( $incomplete == 1 ) - { - $indelete = 0; - $anothertempnum = @sortedPeople; - for ( $tempnum = $anothertempnum-1 ; $tempnum >= 0 ; $tempnum-- ) - { - # number of levels in current array element - # - $num = ($sortedPeople[$tempnum][0] =~ tr/\//\//) - 1; - - if ( $num > $config_tokens{"max-levels-drawn"} ) - { - splice(@sortedPeople,$tempnum,1); - $indelete = 1; - # $total is the total number of people we read in from LDAP - # as reporting to the person entered. But now that we are - # chopping people off that exceed the max depth, we better - # adjust the $total accordingly as well, or else the - # "Total Reports: XXX" summary info at bottom of org chart - # will be too high/inaccurate. - # - --$total; - } - else - { - if ( $indelete == 1 ) - { - $indelete = 0; - $sortedPeople[$tempnum][7] = "nonleaf"; - } - else - { - $sortedPeople[$tempnum][7] = "leaf"; - } - } - } - } - -} - -########################################## -# -# See location this function is called from for comments on purpose. -# -########################################## - -sub output_html_header() -{ - my ($js_output) = @_; - - print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"; - print "<HTML>\n"; - print "<HEAD>\n"; - print " <title>Directory Server Org Chart</title>\n"; - - if ( $js_output ne "with-javascript" ) - { - print " <LINK REL=stylesheet TYPE=\"text/css\" HREF=\"../html/styles.css\">\n"; - } - if ( $js_output eq "with-javascript" ) - { - &print_javascript(); - } - - print "</HEAD>\n"; - print "<BODY BGCOLOR=\"#FFFFFF\">\n"; - -} - -#=== end =================================================================== - - diff --git a/ldap/clients/orgchart/orgicon.gif b/ldap/clients/orgchart/orgicon.gif Binary files differdeleted file mode 100644 index 84ff0bd0..00000000 --- a/ldap/clients/orgchart/orgicon.gif +++ /dev/null diff --git a/ldap/clients/orgchart/starthelp.gif b/ldap/clients/orgchart/starthelp.gif Binary files differdeleted file mode 100644 index 9ce3eeca..00000000 --- a/ldap/clients/orgchart/starthelp.gif +++ /dev/null diff --git a/ldap/clients/orgchart/styles.css b/ldap/clients/orgchart/styles.css deleted file mode 100644 index 2d05b4a5..00000000 --- a/ldap/clients/orgchart/styles.css +++ /dev/null @@ -1,184 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -/* ======================================================================= * - * Style sheet for the Directory Server Org Chart application * - * ======================================================================= */ - -.bgColor7 {background-color: #66ccff;} - -/* All Links */ - -A:link { font-family: verdana, Arial, Helvetica, sans-serif; font-size: 12px} -A:active { color: #000000;} - - - -/*All Regular Table Data--for the whole application*/ - -td { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - vertical-align : middle; -} - -td.bold { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - vertical-align : middle; - font-weight: bold; -} - - -/* *********Start Page Text*************/ -td.startPage { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - color:#000000; - vertical-align : middle; -} - -A.searchlinknorm:link {color: #FFFFFF} -A.searchlinknorm:visited {color: #FFFFFF} -A.searchlinknorm:active {color: #FFFFFF} - -A.searchlinkspec:link {color: #FF0000} -A.searchlinkspec:visited {color: #FF0000} -A.searchlinkspec:active {color: #CCFFFF} - - -/* *********Search frame*************/ - -body.Search { - background-color: #000000; - font-family: Verdana, Arial, Helvetica, san-serif; - color: #ccffff; - font-size: 12px; -} - -td.appName { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 16px; - vertical-align : middle; - color: #ffffff; - font-weight: bold; -} - -.apptext { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - vertical-align: middle; - color: #ffffff; - font-weight: bold; -} - -/* *********Search results frame*************/ - -th.resultsHeader { - font-family: Verdana, Arial, Helvetica, san-serif; - color: #003366; - background-color: #CCCCCC; - font-size: 13px; -} - -td.pageHeader { - font-family: Verdana, Arial, Helvetica, san-serif; - color: #000000; - font-size: 14px; - font-weight : bold; -} - -td.searchHelp { - font-family: Verdana, Arial, Helvetica, san-serif; - color: #003366; - font-size: 12px; -} - -/* *********Org Chart frame*************/ - -td.hidden { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 19px; - vertical-align : top; -} - -tr.hidden { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 19px; - vertical-align : top; -} - -td.selected { -/* background-color: transparent; */ - color: #000000; - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight : bold; -} - -body.orgWindow { -/* background-color: transparent; */ - font-family: Verdana, Arial, Helvetica, san-serif; - color: #003366; - font-size: 12px; -} - -.thinline { - font-size : 5px; -} - -/* *********Preference "Customize View" Page*************/ -td.prefsPageHead { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 13px; - color:#000000; - font-weight: bold; - vertical-align : middle; - border : none; -} - -td.prefsPageData { - font-family: verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - color:#000000; - vertical-align : middle; - border : none; -} - -tr.prefs{ - border : none; -} diff --git a/ldap/clients/orgchart/topframe.html b/ldap/clients/orgchart/topframe.html deleted file mode 100644 index 8227e4f8..00000000 --- a/ldap/clients/orgchart/topframe.html +++ /dev/null @@ -1,122 +0,0 @@ -<!-- BEGIN COPYRIGHT BLOCK - This Program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; version 2 of the License. - - This Program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place, Suite 330, Boston, MA 02111-1307 USA. - - In addition, as a special exception, Red Hat, Inc. gives You the additional - right to link the code of this Program with code not covered under the GNU - General Public License ("Non-GPL Code") and to distribute linked combinations - including the two, subject to the limitations in this paragraph. Non-GPL Code - permitted under this exception must only link to the code of this Program - through those well defined interfaces identified in the file named EXCEPTION - found in the source code files (the "Approved Interfaces"). The files of - Non-GPL Code may instantiate templates or use macros or inline functions from - the Approved Interfaces without causing the resulting work to be covered by - the GNU General Public License. Only Red Hat, Inc. may make changes or - additions to the list of Approved Interfaces. You must obey the GNU General - Public License in all respects for all of the Program code and other code used - in conjunction with the Program except the Non-GPL Code covered by this - exception. If you modify this file, you may extend this exception to your - version of the file, but you are not obligated to do so. If you do not wish to - provide this exception without modification, you must delete this exception - statement from your version and license this file solely under the GPL without - exception. - - - Copyright (C) 2005 Red Hat, Inc. - All rights reserved. - END COPYRIGHT BLOCK --> -<HTML> -<HEAD> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> -<META HTTP-EQUIV="Expires" CONTENT="Thu, 01 Feb 1996 00:00:00 GMT"> -<SCRIPT LANGUAGE="javascript"> - -// Do the Search - -function doSearch(searchstring) -{ - - if ( searchstring == "" ) - { - alert("Please enter something in the search field..."); - return false; - } - else - { - - if ( navigator.appName == "Microsoft Internet Explorer") - { - self.parent.output_window.location="generating.html"; - // the below code in the else block seems to cause things - // not to work in internet explorer - } - else - { - totalInput = "<HTML><BODY><BR><BR><BR><BR><font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 14px\"><B>Generating...</B></font></BODY></HTML>"; - - viewFrame = self.parent.output_window.document; - viewFrame.open(); - viewFrame.write(totalInput); - viewFrame.close(); - } - - - //self.parent.output_window.location="../bin/org?data="+escape(searchstring); - return true; - - } - - -} - -</SCRIPT> -<LINK REL=stylesheet TYPE="text/css" HREF="styles.css"> -</HEAD> - - -<BODY class="Search" onLoad="self.parent.input_window.focus(); document.form2.data.focus();"> - - -<CENTER> -<TABLE BORDER="0" width="100%" cellpadding=0 cellspacing=0> - -<TR> -<TD ALIGN=LEFT VALIGN=CENTER class="appName" nowrap> Directory Server Org Chart</TD> -<TD ALIGN=LEFT VALIGN=CENTER width="75%"> - <TABLE BORDER=0> - <TR><TD nowrap VALIGN=CENTER ALIGN=CENTER> - <span class="apptext"> Search for:</span> - </TD> - <TD nowrap VALIGN=CENTER> - <span class="apptext"> - <FORM name="form2" Method=POST action="../bin/org" target="output_window" onsubmit="return doSearch(document.form2.data.value)"> - <font face=\"verdana, Arial, Helvetica, sans-serif\" style=\"font-size: 12px\"> - <INPUT TYPE="TEXT" NAME="data" SIZE=20 MAXLENGTH=20> - <input type="submit" name="Submit" value="Go"> - </font> - </span> - </TD> - </FORM> - </TR></TABLE> - </TD> - <TD ALIGN=RIGHT> - <a href="../bin/myorg" target="output_window" class="searchlinknorm">Customize</a> - </TD> -</TR> -</TABLE> -</CENTER> - - - - -</BODY> -</HTML> diff --git a/ldap/clients/orgchart/wrapper.c b/ldap/clients/orgchart/wrapper.c deleted file mode 100644 index 3a9b0c5a..00000000 --- a/ldap/clients/orgchart/wrapper.c +++ /dev/null @@ -1,126 +0,0 @@ -/* --- BEGIN COPYRIGHT BLOCK --- - * This Program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; version 2 of the License. - * - * This Program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - * - * In addition, as a special exception, Red Hat, Inc. gives You the additional - * right to link the code of this Program with code not covered under the GNU - * General Public License ("Non-GPL Code") and to distribute linked combinations - * including the two, subject to the limitations in this paragraph. Non-GPL Code - * permitted under this exception must only link to the code of this Program - * through those well defined interfaces identified in the file named EXCEPTION - * found in the source code files (the "Approved Interfaces"). The files of - * Non-GPL Code may instantiate templates or use macros or inline functions from - * the Approved Interfaces without causing the resulting work to be covered by - * the GNU General Public License. Only Red Hat, Inc. may make changes or - * additions to the list of Approved Interfaces. You must obey the GNU General - * Public License in all respects for all of the Program code and other code used - * in conjunction with the Program except the Non-GPL Code covered by this - * exception. If you modify this file, you may extend this exception to your - * version of the file, but you are not obligated to do so. If you do not wish to - * provide this exception without modification, you must delete this exception - * statement from your version and license this file solely under the GPL without - * exception. - * - * - * Copyright (C) 2005 Red Hat, Inc. - * All rights reserved. - * --- END COPYRIGHT BLOCK --- */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - - -/*********************************************************************** -** Includes -***********************************************************************/ - -#include <stdlib.h> -#include <limits.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> - -/*#include "libadmin/libadmin.h"*/ - -#ifdef XP_UNIX -#include <unistd.h> -#define PERL "../../bin/slapd/admin/bin/perl" -#define PATH_SEP '/' -#ifndef PATH_MAX -#define PATH_MAX 512 -#endif -#else -#include <direct.h> -#include <process.h> -#define PERL "..\\..\\bin\\slapd\\admin\\bin\\perl.exe" -#define PATH_SEP '\\' -#define PATH_MAX 512 -#endif - -char *get_perl_file(char *, size_t); - - -/* - * Use environment to figure out what admin perl script to execute - */ - -void -main( int argc, char **argv ) -{ - char script[PATH_MAX]; - struct stat statbuf; - - printf("Content-type:text/html;charset=UTF-8\n\n<html>Hi\n"); - - get_perl_file(script, sizeof(script)-1); - - if (strchr(script, '/') != NULL || strchr(script, '\\') != NULL) { - printf("Paths not allowed. Filenames only.\n"); - exit(0); - } - - printf("<br>script:%s</html>\n", script); - if (stat(script, &statbuf) != 0) { - printf("Can't find %s\n", script); - exit(0); - } - - execl( PERL, script, script, 0 ); -} - -char * -get_perl_file(char *script, size_t scriptsize) { - char *qs = getenv("QUERY_STRING"); - char *p1 = NULL; - char *p2 = NULL; - size_t maxsize; - - if (qs == NULL || *qs == '\0') { - printf("No QUERY_STRING found\n"); - exit(0); - } - p1 = strstr(qs, "file="); - if (p1 == NULL) { - printf("No file variable in QUERY_STRING found.\n"); - exit(0); - } - - p1 += 5; - - for (p2 = p1; *p2 != '\0' && *p2 != '&'; p2++); - - maxsize = (scriptsize < (p2-p1)) ? scriptsize : (p2-p1); - - PL_strncpyz(script, p1, maxsize); - script[maxsize] = '\0'; -} |