I have spent the last week creating my own extension library and adding my viewpicklist and loading masks controls to it. I had lots up help because i was lost. So here are the steps i followed to get there.

1. Download the xsp starter kit from openntf.org
2. Watch Notesin9 number 64 by Tim Tripcony

Those two steps will get you a library and how to copy an existing control into your library.

Now my custom controls had css, images, and a client side js file with them. I didnt want to have to copy those to each database to use them so i had to fins a way to include the resources. One reason i told you to download the xsp starter kit was it has some classes to handle resources.

I added a new folder to my plugin project called resources, under that i had img and styles and js folders( the starter Kit already has this folder). Inside those i put my resources i needed for my custom controls. I then opened the java files for those custom controls and looked for where the resources were called. i updated the resource path like this

this is what was there

ScriptResource resources = new ScriptResource();

this is what i changed it to

ScriptResource resources = new ScriptResource();
+ “js/CustomControlLib.js”);

images i did like this
String iconExpr = ResourceProvider.RESOURCE_PATH + “/img/”
+ “#{javascript:compositeData.picklistButtonImg}”;

ResourceProvider is a class in the starter library that gives you your path to the the library and your files inside it. So all img links and hrefs need to updated to point to this location.

Since i did not start with the starter library, i didnt have the extension points in my plugin.xml to allow resources to be served. I got a error stating that it could not load an unregistered resource. Declan Lynch helped me figure out how to get those in there. Nathan T. Freeman helped me get my library working from a blank slate and installed. So unless you are well versed in eclipse and OSGI plugins use the starter library and take out the classes you dont want or need, then refactor it to whatever name you want.