Skip to content

Instantly share code, notes, and snippets.

@joshmoore
Created March 22, 2012 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshmoore/2158254 to your computer and use it in GitHub Desktop.
Save joshmoore/2158254 to your computer and use it in GitHub Desktop.
HyLdap example

Example build directory.

See: http://lists.openmicroscopy.org.uk/pipermail/ome-users/2012-March/002964.html

To clone:

$ git clone git://gist.github.com/2158254.git components/hyldap
Cloning into 'components/hyldap'...
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 19 (delta 2), reused 16 (delta 2)
Receiving objects: 100% (19/19), done.
Resolving deltas: 100% (2/2), done.

To build:

$ ./build.py -f components/hyldap/build.xml
Buildfile: omero.git/components/hyldap/build.xml
Entering omero.git/components/hyldap...

retrieve:
:: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = omero.git/etc/ivysettings.xml

prepare:
Created dir: omero.git/components/hyldap/target/generated/.done
Created dir: omero.git/components/hyldap/target/generated/src
Created dir: omero.git/components/hyldap/target/generated/resources
Created dir: omero.git/components/hyldap/target/classes
Created dir: omero.git/components/hyldap/target/test-classes
Created dir: omero.git/components/hyldap/target/reports
Copying 1 file to omero.git/components/hyldap/target/generated/resources
Copying 1 file to omero.git/components/hyldap/target/classes
Copying 1 file to omero.git/components/hyldap/target/generated/resources
Copying 1 file to omero.git/components/hyldap/target/classes
Copying 1 file to omero.git/components/hyldap/target/generated/resources
Copying 1 file to omero.git/components/hyldap/target/classes
Copying 1 file to omero.git/components/hyldap/target/generated/resources
Copying 1 file to omero.git/components/hyldap/target/classes

generate:
Copying 1 file to omero.git/components/hyldap/target/classes

compile:
Compiling 1 source file to omero.git/components/hyldap/target/classes
Deleting: omero.git/components/hyldap/_omero_build_1225728604.tmp

package:
Building jar: omero.git/components/hyldap/target/hyldap.jar

install:
:: delivering :: omero#hyldap;working@Josh-Moores-MacBook-Pro.local :: 4.3.3-DEV-ice33 :: integration :: Thu Mar 22 14:10:50 CET 2012
    delivering ivy file to omero.git/components/hyldap/target/ivy.xml
:: publishing :: omero#hyldap
    published hyldap to omero.git/etc/../target/repository/hyldap-4.3.3-DEV-ice33.jar
    published ivy to omero.git/etc/../target/repository/hyldap-4.3.3-DEV-ice33.ivy

BUILD SUCCESSFUL
Total time: 9 seconds
<?xml version="1.0" encoding="utf-8"?>
<project name="hyldap" default="install" basedir=".">
<property name="main.class" value="NONE"/>
<property name="import.dir" value="${basedir}/../antlib/resources"/>
<import file="${import.dir}/global.xml"/>
<import file="${import.dir}/lifecycle.xml"/>
<import file="${import.dir}/hibernate.xml"/>
</project>
<ivy-module version="1.0">
<info
organisation="omero"
module="hyldap"
status="integration"/>
<configurations>
<conf name="build"/>
<conf name="server"/>
</configurations>
<publications>
<artifact name="hyldap" type="jar"/>
</publications>
<dependencies defaultconfmapping="build,server->default">
<!-- Internal -->
<dependency name="server" rev="${omero.version}" changing="true" conf="build->build;server->server"/>
</dependencies>
</ivy-module>
package hyldap;
import java.util.List;
import ome.security.SecuritySystem;
import ome.security.auth.*;
import org.springframework.ldap.core.LdapOperations;
/**
* Strategy for finding the appropriate groups for a given user in LDAP.
*
* @author Josh Moore, josh at glencoesoftware.com
* @see SecuritySystem
* @since Beta4.2
*/
public interface NewUserGroupBean {
/**
*
* @param config
* @param ldap
* @param provider
* @param userProperties
*/
List<Long> groups(String username,
LdapConfig config, LdapOperations ldap, RoleProvider provider,
AttributeSet attrSet);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="myldapbean" class="hyldap.MyBean"/>
</beans>
<ivy-module version="1.0">
<info
organisation="omero"
module="hyldap"
status="integration"/>
<configurations>
<conf name="test"/>
</configurations>
<publications>
<artifact name="hyldap-test" type="jar"/>
</publications>
<dependencies defaultconfmapping="test->*">
<dependency name="hyldap" rev="${omero.version}" changing="true"/>
</dependencies>
</ivy-module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment