[GSOC Update 2] RedPen Integration

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GSOC Update 2] RedPen Integration

deshengchuan
This post was updated on .
Hi all, this is another weekly update with regards to the work on the RedPen extension.

I've more or less created a component + scriptservice that helps to validate an input string of text. How
I envision this to work is that an Event Listener would obtain the context of the document when the
user saves the page, parse it using the syntax rendering component to plain text, then run it through the
component I've made. Hence, the next week would be dedicated to writing the event listener.
I have still not designed how I am going to take in the user's validation settings, hence I have an incomplete Java class and will work on it after writing the event listener

With that in mind, I think I should request a repository on xwiki-contrib, since I already have some starting code available locally. May I know what are the required steps I need to achieve that?

Next, I understand that there are three ways that one can write an event listener, either using an XWiki Component in a jar, a Wiki Component or using Groovy. I am currently considering using Groovy to create the Event Listener directly within a wiki page. Any thoughts on that?

Lastly, I am unsure of the report format and details to submit as part of the GSOC programme. Can I get some clarifications with regards to it?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: [Update 2] RedPen Integration

vmassol
Administrator
Hi De Sheng (that’s your first name right?),

> On 11 Jun 2017, at 10:36, deshengchuan <[hidden email]> wrote:
>
> Hi all, this is another weekly update with regards to the work on the RedPen
> extension.
>
> I've more or less created a component + scriptservice that helps to validate
> an input string of text.

Cool.

> How
> I envision this to work is that an Event Listener would obtain the context
> of the document when the
> user saves the page, parse it using the syntax rendering component to plain
> text, then run it through the
> component I've made.

Yes that’s one use case to implement indeed. The other use case is to provide a UI to allow to manually run the RedPen validation checks on one or several documents.

> Hence, the next week would be dedicated to writing the
> event listener.

You’ll see it’s quite easy. Two days max is about what you’ll need I think. Don’t hesitate to talk to us on matrix/IRC.

> I have still not designed how I am going to take in the user's validation
> settings, hence I have an incomplete Java class and will work on it after
> writing the event listener

Ok. You could use a ConfigurableClass (http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration%20Application#HMakingyourapplicationconfigurablewithConfigurableClass) to provide an Admin UI to configure what checks to execute on doc save. On the other UI (the manual one described above) it would probaby be better to let the user decide the checks to execute.

> With that in mind, I think I should request a repository on xwiki-contrib,
> since I already have some starting code available locally. May I know what
> are the required steps I need to achieve that?

Yes, you should do that ASAP and commit stuff so that we can start reviewing/helping out, see http://contrib.xwiki.org/xwiki/bin/view/Main/WebHome#HRequestingaproject

> Next, I understand that there are three ways that one can write an event
> listener, either using an XWiki Component in a jar, a Wiki Component or
> using Groovy. I am currently considering using Groovy to create the Event
> Listener directly within a wiki page. Any thoughts on that?

Yes, it’s better to do it in Java since otherwise it would require the user to have Programming Rights and it’ll make the integration more fragile. So you'll need at least 3 maven modules (one that generates the script service and contains the Listener), another one that generates the XAR (the UI) and yet another one for the functional tests. You can check other contrib project and importantly you should read http://contrib.xwiki.org/xwiki/bin/view/Main/WebHome.

A good example is https://github.com/xwiki-contrib/application-blog.

> Lastly, I am unsure of the report format and details to submit as part of
> the GSOC programme. Can I get some clarifications with regards to it?

There’s no need for a report! :) All we’re asking of you is to have working releases on your contrib extensions that obeys the best practices (with automated tests) and deployed/documented on http://extensions.xwiki.org/xwiki/bin/view/Main/WebHome

Thanks
-Vincent

> Thanks.
>
>
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Update-2-RedPen-Integration-tp7604136.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: [Update 2] RedPen Integration

deshengchuan
vmassol wrote
Hi De Sheng (that’s your first name right?),
Yea it is :)

vmassol wrote
Yes that’s one use case to implement indeed. The other use case is to provide a UI to allow to manually run the RedPen validation checks on one or several documents.
Ok I'll design a UI for this after I get around to the event listener

vmassol wrote
Ok. You could use a ConfigurableClass (http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration%20Application#HMakingyourapplicationconfigurablewithConfigurableClass) to provide an Admin UI to configure what checks to execute on doc save. On the other UI (the manual one described above) it would probaby be better to let the user decide the checks to execute.
Ok I'll look into Configurable Classes for this. Thanks for the advice!

vmassol wrote
> With that in mind, I think I should request a repository on xwiki-contrib,
> since I already have some starting code available locally. May I know what
> are the required steps I need to achieve that?

Yes, you should do that ASAP and commit stuff so that we can start reviewing/helping out, see http://contrib.xwiki.org/xwiki/bin/view/Main/WebHome#HRequestingaproject

> Next, I understand that there are three ways that one can write an event
> listener, either using an XWiki Component in a jar, a Wiki Component or
> using Groovy. I am currently considering using Groovy to create the Event
> Listener directly within a wiki page. Any thoughts on that?

Yes, it’s better to do it in Java since otherwise it would require the user to have Programming Rights and it’ll make the integration more fragile. So you'll need at least 3 maven modules (one that generates the script service and contains the Listener), another one that generates the XAR (the UI) and yet another one for the functional tests. You can check other contrib project and importantly you should read http://contrib.xwiki.org/xwiki/bin/view/Main/WebHome.

A good example is https://github.com/xwiki-contrib/application-blog.
Ok, I think I'll move this discussion to a new thread which will officially request a repository.


Thanks for the help!