X-CASE GmbH is a German company which is currently involved in a research project. Our task in this project is to develop a backend for a sample administration. At the moment, we are evaluating some standard software to choose from.
Having set up your server, I tried to develop my first Java module (with createModule). Although the module is recognized by the LabKey Server in "Folder setting", I am not able to add any webpart. I have also set some breakpoints in my module but neither of them is ever executed. Am I missing some information? Is there some additional information I can rely on?
My system is a Windows XP, Tomcat6, LabKey Server 11.3, IntelliJ 10.5.4. |
|
adam responded: |
2012-04-30 13:34 |
Your module class needs to return a collection of WebPartFactories that create your web parts, see the createWebPartFactories() method. The web part names defined by your factories will then appear in the <Select Web Part> drop-down of any folder where your module is enabled. The create_module template does not include any sample webparts or factories, but just about every other module does, so there are plenty of examples.
A trivial one:
protected Collection<WebPartFactory> createWebPartFactories()
{
return Collections.<WebPartFactory>singleton(new BaseWebPartFactory("Hello World") {
public WebPartView getWebPartView(ViewContext portalCtx, Portal.WebPart webPart) throws IllegalAccessException, InvocationTargetException
{
HtmlView view = new HtmlView("I'm a webpart!");
view.setTitle("Hello World");
return view;
}
});
}
Adam |
|
clemens.bartz responded: |
2012-05-10 07:29 |
Hello Adam,
Sorry for the late response, I have been working on other projects.
I did override the method in the Module file as you described it. However I am still not able to select the Webpart. The module is recognized though. The module is located in the externalModules directory, the path is set correctly in my VM settings.
Any further help would be highly appreciated.
Kind regards,
Clemens |
|
adam responded: |
2012-05-10 11:33 |
Have you enabled (checked) your module on the "folder type" page?
Have you tried setting the folder type to "custom"?
You'll need to add your .iml as a new IntelliJ module for breakpoints to work. Try setting a breakpoint in your module constructor and restarting.
Adam |
|
clemens.bartz responded: |
2012-05-14 00:52 |
Hello Adam,
yes, the module is enabled in the "folder type" page. Yes, I have changed the folder type to "custom". No success, though.
I had added the module to LabKey, but no breakpoints were ever reached. As there is no constructor in the Module file, I have created one but it is not executed. My other breakpoints at methods "init" and "startup", both are not executed as well.
Kind regards,
Clemens |
|
adam responded: |
2012-05-14 08:03 |
In that case, I have to wonder if your module is getting compiled and deployed correctly. Perhaps LabKey is continuing to load an older version of your module.
- Find the list of modules on the admin console and expand your module.
- Does the "Module Class" match the Java class of your module? It shouldn't be org.labkey.api.module.SimpleModule, since this is a Java module.
- Do the build time, build path, and extracted path match your expectations?
You could also add logging statements to your init() and startup() methods to rule out breakpoint issues. Adam |
|
|
|