README revision 0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swiftThis folder contains source code for an example "Hello World" style
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swiftplugin. It features a plugin which has a configurable message (the
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swiftdefault being "Hello World") which is displayed as a notice message
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5markwhen OpenDJ directory server is started.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swiftIn order to build and use this example plugin, perform the following
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5marksteps while the server is stopped:
7fe1ba967cdfff4b1a7eb394c9e5c7889fcbe991jcambon
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 1. Then unzip the example-plugin.zip (in place):
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift unzip example-plugin.zip
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 2. Go into the example-plugin source folder:
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift cd example-plugin
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 3. And build the plugin (this requires Ant version 7 and Xalan-Java):
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift ant install
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark If this step fails for you as is, you can find Ant 7 and Xalan-Java
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark in the OpenDJ ext/ directory after checking the source out with
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark Subversion. Substitute your full path to OpenDJ sources for /src
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark in the following command:
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark /src/ext/ant/bin/ant -Dxalan.directory=/src/ext/xalan-j/ install
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 4. This will copy the following files into the parent OpenDJ
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift installation:
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift lib/extensions/example-plugin.jar
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift config/example-plugin.ldif
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift config/schema/99-example-plugin.ldif
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 5. Add the plugin's config to the server configuration.
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark cd ../bin
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark ./start-ds
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark ./dsconfig -h `hostname` -p 4444 -D "cn=Directory Manager" -w password
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark create-plugin --plugin-name "Example Plugin" --type example
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark --set enabled:true --set plugin-type:startup
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark --set java-class:com.example.opends.ExamplePlugin -X -n
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark 6. Restart the server and look for the "hello world" notice in the start
bb8874d71cdd8e5288297b9727703437c6dfcfedmatthew_swift up log:
7fe1ba967cdfff4b1a7eb394c9e5c7889fcbe991jcambon
0ceb23810523c23d3aaa1a942f4ab9319d1bd6e5mark ./stop-ds --restart