Where to find the Wicket Stuff annotation package? - wicket

Where I can find wicketstuff-annotation.jar? It's used to be available at least in a Maven repo at http://wicketstuff.org/maven/repository but that doesn't exist anymore, and the Wicket Stuff homepage is not very helpful either.
Specifically, I need org.wicketstuff.annotation.mount.MountPath because I want readable URLs in my Wicket app and find annotations an elegant way to mount pages. (I wonder why this kind of stuff isn't included in core Wicket distribution...)
(Any place to download the jar from would be fine; I don't use Maven in current project.)

You can just mount your pages anywhere in your application, typically in your Application's init() method, like:
#Override
protected void init() {
mountBookmarkablePage("/users", UsersPage.class);
}
That said, if you want to use the annotations package, it is available from Maven Central

Update from Wicket 1.5:
You should use the method mountPage() instead of mountBookmarkablePage() as that method has been removed from Wicket 1.5.
#Override
protected void init() {
mountPage("/users", UsersPage.class);
}
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html

This is the URL. You can click on Binary link to download the required jar.

A community user today contributed an upgrade of the library to Wicket 1.5, so it will be available for next release (1.5-RC6). Until then the users of 1.5 can use it from Github repo.

Related

LobbySystem not working? Minecraft Plugin

I have a problem:
I wrote a lobby plugin for a Minecraft server and now it doesn't quite work anymore.
In what way:
As soon as I reinstall the plugin, everything works perfectly. But as soon as I change something in a config file, only one method of the plugin loads.
I have linked the plugin here:
Plugin
Source Code
Would be cool if you guys can help me.
The issue appear because of lines like this one:
new File("plugins//Lobysystem//preandsuffixes.yml");
1) Don't write your own folder
Spigot already has API to do it. In the onEnable method, you can do saveDefaultConfig() that will create the folder for the plugin's config.
2) Use Spigot's informations
Such as spigot have multiple way to make config file fastly, you can do something like this (already with the plugin instance):
new File(getDataFolder(), "preandsuffixes.yml");
3) The static method will no longer work
Yes, if you have to use the plugin instance, all of the static {} method will not work. If you really want to keep a static method to load everything, you can do something like that:
public static loadConfig(Main plugin) {
myconfig = new File(plugin.getDataFolder(), "preandsuffixes.yml");
}
#Override
public void onEnable() {
loadConfig(this);
}
4) Stackoverflow guidelines
It's off-topic for an answer, but few tips :
Try to don't include link to download unknow source
Add a minimal reproductible example instead of just giving all the code
Don't decompile plugin.
Take the time to identify problem and to be more clear than "it was working but now it's no longer working"

Customizing content proposal in Xtext for web editors

I have a DSL written in Xtext. In order to add custom content proposal, I have edited the MyDslProposalProvider class in the ui project. The new proposals are present when I debug the plugin in Eclipse, but not in the web editor, which is ultimately what I want. I want to set the custom proposals at a single place and all generated editors to use them. Is it possible to do that with Xtext?
As I had the same problem and struggled a little bit with the solution (as I would like to use both, Eclipse editor and Web editor) I would like to provide some more detailed feedback on a possible solution here, which worked well for me.
In my solution I did the following steps.
Implement a MyDslIdeContentProposalProvider in my.dsl.ide sub project extending from IdeContentProposalProvider, package my.dsl.ide.contentassistant (newly created); an example of such an implementation may be found here.
The implementation is not such convenient as at the well known UI proposal provider for Eclipse. I had to implement switch cases based on MyDslGrammarAccess elements instead of structural grammar elements like in the UI proposal provider. On the other hand, I have only one proposal implementation for all editor cases that way (DRY principle!).
Register the MyDslIdeContentProposalProvider at MyDslIdeModule in the same project (only with that it works already in the web editor).
def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
MyDslIdeContentProposalProvider
}
Register the new MyDslIdeContentProposalProvider and the forwarding class UiToIdeContentProposalProvider at the MyDslUiModule in the my.dsl.ui sub project. (That's what took the longest investigation as it cannot be logically derived.)
override Class<? extends IContentProposalProvider> bindIContentProposalProvider() {
return UiToIdeContentProposalProvider
}
def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
return JavaPOSConfigLanguageIdeContentProposalProvider
}
For an full example see here.
As I had implemented the MyDslIdeContentProposalProvider in the newly created package my.dsl.ide.contentassistant, this package has to be exported in the MANIFEST.MF file of the sub project my.dsl.ide (the subsequent 2 exports were already there). Otherwise i would get an an error Access restriction: The type is not accessible due to restriction on required project in the MyDslUiModule.
Export-Package: my.dsl.ide.contentassist,
my.dsl.ide.contentassist.antlr,
my.dsl.ide.contentassist.antlr.internal
That way it worked well for for both editors, Eclipse and web.
Thanks Christian again for the initial hint!
... If I could make a wish, I would like to have the same structural grammar element access in the MyDslIdeContentProposalProvider as we have it today in UI proposal provider.
you need to subclass org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider and bind it in YourDslIdeModule and YourDslUiModule. Then (in Xtext 2.13) you can use org.eclipse.xtext.ui.editor.contentassist.UiToIdeContentProposalProvider bound in YourDslUiModule to delegate to that in eclipse ui.

Third party plugin not override in joomla

I have created a search plug-in in joomla that is "my-plug-in". When i tried to override this plug-in in joomla templates its not working.If i try to override any existing plug-in joomla its working. I have checked below link as well. This is working
This link
How i override my plug-in in joomla template.
I have added my plug-in below place.
plugins/search/my-plug-in
to
templates/{TEMPLATENAME}/html/plg_search_my-plug-in
If you have thoroughly checked the link that you have given you will find a line "However you can only do it if the plugin is ready to allow overrides. "
and
Joomla provides a mechanism to override a plugin but this feature is not supported by all the plugins. Right now the only plugin in Joomla 3.x core that allow overrides is the Pagenavigation Content plugin that shows previous/next article links in article view of content component. There may be other plugins from third party developers allowing it and more core plugins will be overridable in the future.
Do you have a tmpl folder inside your plugin as quoted here "You will know when a plugin is overridable because has a /tmpl/ folder in it. "
Also have you used JPluginHelper::getLayoutPath(). These are the requirements that need to be completed before you override layouts.
Check this code in pagenavigation plugin
// Output.
if ($row->prev || $row->next)
{
// Get the path for the layout file
$path = JPluginHelper::getLayoutPath('content', 'pagenavigation');
// Render the pagenav
ob_start();
include $path;
$row->pagination = ob_get_clean();
$row->paginationposition = $this->params->get('position', 1);
// This will default to the 1.5 and 1.6-1.7 behavior.
$row->paginationrelative = $this->params->get('relative', 0);
}
They have used JPluginHelper::getLayoutPath(); and you have to use
$path = JPluginHelper::getLayoutPath('search', 'my-plug-in');
You can check the pagenavigation plugin thoroughly to get a good idea.

Server-side GWT events; alternative to Vaadin

I'm wondering is there a similar framework like Vaadin built on top of GWT which wraps the original GWT components but with server-side only event handling? (I know that Vaadin is built on top of GWT. I'm looking for an alternative solution.)
Vaadin is nice because of it's precompiled nature. I found compile times with GWT horrific the last time i've worked with it. Also it's a bit easier to maintain security if event handling code runs on the server. It would be nice if the standard GWT could be used in a similar way.
I don't think there is another like vaadin. and vaadin is already server-side..
see this http://vaadin.com/learn for more info
Have you seen this? - http://code.google.com/p/gwteventservice/
For server-side alternative, you might take at a look at ZK too.
Notice that its client side is based on jQuery, not GWT. However, you won't notice it at all since they both are server-side solutions and using pure Java.
Event handlers that you normally deal with are in server-side Java code. Consider this:
final Button testButton = new Button("Test Button");
testButton.addListener(new Button.ClickListener()
{
#Override
public void buttonClick(ClickEvent event)
{
mainWindow.showNotification("I am server-side code!");
}
});
As you said, you need to compile GWT code only when adding a custom component to your code. Vaadin's built in components are already compiled and put in the jar file. Although sometimes your IDE might detect your project as a GWT project and try to compile the widgetsets every time you change the code, when you might want to ask it to ignore.
If you look for alternatives to Vaadin you might have a look at Echo2.

Navigate between GWT modules

I've divided my GWT app into multiple modules, what's the best way to navigate between them?
Currently I'm using Window.Location.assign("foo.html#bar") but is there a better way?
History.newItem only works for history within the current module. To change to another page I think the best way is to use Window.Location.assign.
I don't fully remember the issue (and perhaps it has been fixed now), but in our application we stopped using relative URLs as they would sometimes break (we have a comment referencing http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/f79e7d5e002b48f6).
To this end we had a method that did the following:
public void goToRelativePage(final String relativeURL) {
Window.Location.assign(GWT.getHostPageBaseURL() + relativeURL);
}