Page 1 of 1

Pure Java plugin development

PostPosted: Sat Mar 31, 2012 10:02 am
by MKej
Hello,

First of all, I'd like to say that your software is simply amazing. It gets the job done, yet it seems very lightweight, unlike other similar solutions.

It pleases me even more that it is written in Java - language I've been earning my living with since years.
I got excited when I found that there is a plugin engine and jumped into dev guide right away.

The problem I have is that plugins need to be .groovy files. Is there any possibility that I could deploy them simply as jars?
Classes that need to be implemented look like there should be no trouble in implementing them in pure Java.

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 10:52 am
by zip
Groovy is very similar to Java and you can basically write Java code in groovy classes. Give it a try, it's very nice and has a lot of features that java's missing and does a lot of things more elegantly (handling collections, dates, regex, xml, etc)

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 12:36 pm
by MKej
I agree with what you said, but the problem is rather in packaging. Say, I would like my plugin to span to multiple classes. It's possible both for Java and Groovy to place them all in one .java/.groovy file, but will make the file itself less readable.

It's a very minor thing, as most online content plugins should not be as large. But do you consider expanding the plugin architecture to other components? I'm currently working on on-the-fly converter of subtitle formats, so that not only .srt will be supported. It would be great if I could send it to you as a plugin later on.

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 3:40 pm
by kairoh
MKej wrote:I'm currently working on on-the-fly converter of subtitle formats, so that not only .srt will be supported. It would be great if I could send it to you as a plugin later on.

I've i've coded this to convert SSA -> SRT and SUB -> SRT.
It works in memory but may be written to a new srt file (maybe others transcoding option should be added).
There is 2 opened tickets : #246 and #63.

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 3:54 pm
by MKej
kairoh wrote:I've i've coded this to convert SSA -> SRT and SUB -> SRT.
It works in memory but may be written to a new srt file (maybe others transcoding option should be added).
There is 2 opened tickets : #246 and #63.

Thank you for pointing this out, although I have already completed my implementation.

There's still the question of how to integrate it with serviio, at least for private use. The only solution I see is to create a jar file overriding some of the base serviio classes and putting it in /lib/, hoping the classloader will reach them before original ones.
I'm afraid it is against serviio terms of use, though.

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 5:13 pm
by zip
MKej wrote:I'm afraid it is against serviio terms of use, though.

You can do that, for personal use.

Re: Pure Java plugin development

PostPosted: Sat Mar 31, 2012 5:14 pm
by zip
MKej wrote:But do you consider expanding the plugin architecture to other components? I'm currently working on on-the-fly converter of subtitle formats, so that not only .srt will be supported. It would be great if I could send it to you as a plugin later on.

Not at the moment.