Hello again,

big thank you to both of you! You really shed some light for me on that issue.
I have been working with Java and Eclipse already, but I have problems with 
importing my own custom java code to Magnolia and compiling it correctly. So 
you really helped me already here.

I have been following these steps of you, Richard:
[quote]Create a new Java Project.
Edit your Project's "Build Path" and add all the libraries from Magnolia's 
WEB-INF/lib folder using the "Add external JARs" button.
Add your class to the project.
Your class should now compile.
Find the .class file within the project folder (usually in a folder called 
"bin") and copy it to WEB-INF/classes.
Restart tomcat.[/quote]

In Eclipse I created a package "commands" so my class looks like this now:

[code]
package commands;

import info.magnolia.commands.MgnlCommand;
import info.magnolia.context.Context;

public class TestCommand extends MgnlCommand {
        public boolean execute(Context ctx) {
                System.out.println("TEST COMMAND");
                return true;
        }

}
[/code]

Note that the method is boolean now as the super class and its interfaces need 
me to implement the method like that. The class is compiling without errors and 
I copied both files in here:

/opt/magnolia-4.5.2/apache-tomcat-6.0.32/webapps/magnoliaAuthor/WEB-INF/classes/commands/TestCommand.class
/opt/magnolia-4.5.2apache-tomcat-6.0.32/webapps/magnoliaAuthor/WEB-INF/classes/commands/TestCommand.java

Then I adapted the "class" node to "commands.TestCommand" (but it's still in 
the "myModule" and "myCatalog" folder).
Unfortunately it's still not working:

[code]mgnl> cm = info.magnolia.commands.CommandsManager.getInstance()
===> info.magnolia.commands.CommandsManager@1f701045
mgnl> command = cm.getCommand("myCatalog", "myCommand")
===> null[/code]

So I still return null. Why is that...do you have a clue?

Thanks once again!

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=487971f2-483f-4373-a929-b5f1f50edc05


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to