[Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

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

[Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

deshengchuan
This post was updated on .
Hi all. I am De Sheng, a student from Singapore. Thank you for choosing me for gsoc. This is my first open-source project, so I do hope that you guys would be tolerant towards any potentially "newbie" questions that I may ask.

My project is to integrate RedPen into the XWiki platform. What I'll be planning to do would be to parse user inputs when they create an XWiki app or page into a separate database, then run RedPen, a word-editing software onto it.
I'll make an extension with UI to allow the user to set natural language rules.

As for now I have not fixed any JIRA issues yet as I've only just finished setting up the maven environment on my desktop. (I had previous custom maven repositories and settings which I had to undo so I took much longer than expected). Now that I'm ready to debug, I am going to bug everyone with questions and possible issues (Please don't kick me out for that pun.)

As with Sarthak's example, I also created a design page. (http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration)

Thank you in advance for the guidance!

P.S. This was actually to be posted a couple of days ago but I had some issues with subscribing to the mailing list. Sorry for the delay.
P.P.S. Sorry in advance for any long delays in my replies. It is GMT +8 over here so I will probably be asleep during the active hours for most of the developers here.
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

Guillaume Delhumeau
Welcome De Sheng!

2017-05-09 19:30 GMT+02:00 deshengchuan <[hidden email]>:

> Hi all. I am De Sheng, a student from Singapore. Thank you for choosing me
> for gsoc. This is my first open-source project, so I do hope that you guys
> would be tolerant towards any potentially "newbie" questions that I may
> ask.
>
> My project is to integrate RedPen into the XWiki platform. What I'll be
> planning to do would be to parse user inputs when they create an XWiki app
> or page into a separate database, then run RedPen, a word-editing software
> onto it.
> I'll make an extension with UI to allow the user to set natural language
> rules.
>
> As for now I have not fixed any JIRA issues yet as I've only just finished
> setting up the maven environment on my desktop. (I had previous custom
> maven
> repositories and settings which I had to undo so I took much longer than
> expected). Now that I'm ready to debug, I am going to bug everyone with
> questions and possible issues (Please don't kick me out for that pun.)
>
> As with Sarthak's example, I also created a design page.
> (http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration)
>
> Thank you in advance for the guidance!
>
> P.S. This was actually to be posted a couple of days ago but I had some
> issues with subscribing to the mailing list. Sorry for the delay.
>
>
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.
> com/Proposal-RedPen-Integration-into-XWiki-as-Extension-Gsoc-Project-2017-
> tp7603812.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.
>



--
Guillaume Delhumeau ([hidden email])
Research & Development Engineer at XWiki SAS
Committer on the XWiki.org project
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

Ecaterina Moraru (Valica)
Welcome De Sheng!

Having the design page is the first step, so you are on a good start. Jira
is next. Don't be shy and also ask questions on IRC and mailinglists.

Have fun,
Caty

On Wed, May 10, 2017 at 10:54 AM, Guillaume Delhumeau <
[hidden email]> wrote:

> Welcome De Sheng!
>
> 2017-05-09 19:30 GMT+02:00 deshengchuan <[hidden email]>:
>
> > Hi all. I am De Sheng, a student from Singapore. Thank you for choosing
> me
> > for gsoc. This is my first open-source project, so I do hope that you
> guys
> > would be tolerant towards any potentially "newbie" questions that I may
> > ask.
> >
> > My project is to integrate RedPen into the XWiki platform. What I'll be
> > planning to do would be to parse user inputs when they create an XWiki
> app
> > or page into a separate database, then run RedPen, a word-editing
> software
> > onto it.
> > I'll make an extension with UI to allow the user to set natural language
> > rules.
> >
> > As for now I have not fixed any JIRA issues yet as I've only just
> finished
> > setting up the maven environment on my desktop. (I had previous custom
> > maven
> > repositories and settings which I had to undo so I took much longer than
> > expected). Now that I'm ready to debug, I am going to bug everyone with
> > questions and possible issues (Please don't kick me out for that pun.)
> >
> > As with Sarthak's example, I also created a design page.
> > (http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration)
> >
> > Thank you in advance for the guidance!
> >
> > P.S. This was actually to be posted a couple of days ago but I had some
> > issues with subscribing to the mailing list. Sorry for the delay.
> >
> >
> >
> > --
> > View this message in context: http://xwiki.475771.n2.nabble.
> > com/Proposal-RedPen-Integration-into-XWiki-as-
> Extension-Gsoc-Project-2017-
> > tp7603812.html
> > Sent from the XWiki- Dev mailing list archive at Nabble.com.
> >
>
>
>
> --
> Guillaume Delhumeau ([hidden email])
> Research & Development Engineer at XWiki SAS
> Committer on the XWiki.org project
>
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

Thomas Mortagne
Administrator
Welcome again De Sheng !

Don't hesitate to ask questions on IRC or the mailing list.

On Wed, May 10, 2017 at 10:33 AM, Ecaterina Moraru (Valica)
<[hidden email]> wrote:

> Welcome De Sheng!
>
> Having the design page is the first step, so you are on a good start. Jira
> is next. Don't be shy and also ask questions on IRC and mailinglists.
>
> Have fun,
> Caty
>
> On Wed, May 10, 2017 at 10:54 AM, Guillaume Delhumeau <
> [hidden email]> wrote:
>
>> Welcome De Sheng!
>>
>> 2017-05-09 19:30 GMT+02:00 deshengchuan <[hidden email]>:
>>
>> > Hi all. I am De Sheng, a student from Singapore. Thank you for choosing
>> me
>> > for gsoc. This is my first open-source project, so I do hope that you
>> guys
>> > would be tolerant towards any potentially "newbie" questions that I may
>> > ask.
>> >
>> > My project is to integrate RedPen into the XWiki platform. What I'll be
>> > planning to do would be to parse user inputs when they create an XWiki
>> app
>> > or page into a separate database, then run RedPen, a word-editing
>> software
>> > onto it.
>> > I'll make an extension with UI to allow the user to set natural language
>> > rules.
>> >
>> > As for now I have not fixed any JIRA issues yet as I've only just
>> finished
>> > setting up the maven environment on my desktop. (I had previous custom
>> > maven
>> > repositories and settings which I had to undo so I took much longer than
>> > expected). Now that I'm ready to debug, I am going to bug everyone with
>> > questions and possible issues (Please don't kick me out for that pun.)
>> >
>> > As with Sarthak's example, I also created a design page.
>> > (http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration)
>> >
>> > Thank you in advance for the guidance!
>> >
>> > P.S. This was actually to be posted a couple of days ago but I had some
>> > issues with subscribing to the mailing list. Sorry for the delay.
>> >
>> >
>> >
>> > --
>> > View this message in context: http://xwiki.475771.n2.nabble.
>> > com/Proposal-RedPen-Integration-into-XWiki-as-
>> Extension-Gsoc-Project-2017-
>> > tp7603812.html
>> > Sent from the XWiki- Dev mailing list archive at Nabble.com.
>> >
>>
>>
>>
>> --
>> Guillaume Delhumeau ([hidden email])
>> Research & Development Engineer at XWiki SAS
>> Committer on the XWiki.org project
>>



--
Thomas Mortagne
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

vmassol
Administrator
In reply to this post by deshengchuan
Hi deshengchuan,

Welcome aboard!

> On 9 May 2017, at 19:30, deshengchuan <[hidden email]> wrote:
>
> Hi all. I am De Sheng, a student from Singapore. Thank you for choosing me
> for gsoc. This is my first open-source project, so I do hope that you guys
> would be tolerant towards any potentially "newbie" questions that I may ask.

Of course :)

> My project is to integrate RedPen into the XWiki platform. What I'll be
> planning to do would be to parse user inputs when they create an XWiki app
> or page into a separate database, then run RedPen, a word-editing software
> onto it.

It’s not really a word-editing software. It’s more a text validation framework, see https://github.com/redpen-cc/redpen (see also http://redpen.cc/):

"RedPen is an open source proofreading tool to check if your technical documents meet the writing standard. RedPen supports various markup text formats (Markdown, Textile, AsciiDoc, Re:VIEW, reStructuredText and LaTeX).”

Here are some ideas for your work (This is how I envision this integration but let me know if you have other ideas):

* Provide a UI in XWiki so that RedPen can be executed in a job on various pages of the wiki (let the user select on what pages to run it: all (sub)wikis, a given wiki, a given page and children, a given page only. It would generate some report about violations.
* Provide an Admin part to configure the RedPen rules to execute
* Provide the ability to add new rules defined in wiki pages (through a mechanism similar to UIExtensions - See http://redpen.cc/docs/latest/#extending-with-java on the redPen side).
* Provide a Script Service so that scripts in wiki pages can validate any content using RedPen. Same from Java (the Script Service would call the Java Component).
* Provide an Admin option so that RedPen executes when a wiki page is saved (turned off by default). This would be implemented as an XWiki Event Listener and would cancel the save if there are violations.
* Note that the RedPen integration should be developed as an XWiki extension in xwiki-contrib.
* Research how to embed redPen as a library (as a JAR dependency) and not as a standalone server. That should probably be your first task. If not possible we’ll need to have it installed as a server but that would make using the XWiki RedPen Extension much more complex.
* (Optional and to be done after the rest is implemented and if enough time is left) Contribute to the RedPen project itself by contributing support for the XWiki Syntax 2.1 markup text format. This would allow to make XWiki and XWiki Rendering more known to users of RedPen.

WDYT?

Let’s discuss these points one by one here because it’s important you fully understand each of them so that we are all in sync about the expectations.

If you agree it would be nice if you could update http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration with it.

>  I'll make an extension with UI to allow the user to set natural language
> rules.
>
> As for now I have not fixed any JIRA issues yet as I've only just finished
> setting up the maven environment on my desktop. (I had previous custom maven
> repositories and settings which I had to undo so I took much longer than
> expected). Now that I'm ready to debug, I am going to bug everyone with
> questions and possible issues (Please don't kick me out for that pun.)

Please do! :)

> As with Sarthak's example, I also created a design page.
> (http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration)

Thanks I’ve checked it and it’s a bit light ATM with some stuff that are not clear and that are not using XWiki’s terminology so we need to be sure we’re talking about the same thing. This is why I’ve listed above the way I see it as a starting point to agree about what you’ll do.

Don’t hesitate to talk on IRC (using Riot for ex, see http://dev.xwiki.org/xwiki/bin/view/Community/Chat) when you need some quick answer. For more complex things that require agreement and thinking the list is best.

So your first step is to fully understand the scope of the work and to make http://design.xwiki.org/xwiki/bin/view/Proposal/RedPenIntegration as detailed as possible so that we all agree about the work.

I’m very happy to have you on board! :)

Thanks
-Vincent

>
> Thank you in advance for the guidance!
>
> P.S. This was actually to be posted a couple of days ago but I had some
> issues with subscribing to the mailing list. Sorry for the delay.
>
>
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Proposal-RedPen-Integration-into-XWiki-as-Extension-Gsoc-Project-2017-tp7603812.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

deshengchuan
Thank you for the advice to get me on track!

I will think through about all the points you have stated, and will reply with responses over the next day (it is evening in here already)

So far I have been looking into the architecture of the code and I will also be asking questions about it once I have digested enough to get started.

Seeing the priority is to embed RedPen as a library, I will try to research on it, maybe even consult some of my university professors for help as soon as possible.

Lastly, I have to confess that I have been spending somewhat less time with XWiki as I have promised, as I have been still busy with some university course matters (Administrative work regarding some industrial attachments and overseas exchange in late Aug), and I apologise for that. Most of the stuff would be complete by this week and I promise I would go full speed ahead after that.
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

deshengchuan
In reply to this post by vmassol
Hi these are my thoughts and questions on your suggestions.
I have also updated the design page. Thank you for the guidance!

>* Provide a UI in XWiki so that RedPen can be executed in a job on various pages of the wiki (let the >user select on what pages to run it: all (sub)wikis, a given wiki, a given page and children, a given >page only. It would generate some report about violations.
>* Note that the RedPen integration should be developed as an XWiki extension in xwiki-contrib.

If it were an extension, I would think to create an Xwiki component then export as JAR, instead of creating wiki pages and exporting as XAR. This is because I’m not sure if functionality implemented through separate wiki pages would be able to operate throughout the platform. Also, I am not sure if I can configure RedPen Validators through creating an extension within an XWiki instance. Correct me if I’m wrong.

>* Provide an Admin part to configure the RedPen rules to execute
This can be integrated in the UI component so there should be no problems. Most likely component will pass props using an EventListener that will determine the command line to execute towards RedPen

>* Provide the ability to add new rules defined in wiki pages (through a mechanism similar to >UIExtensions - See http://redpen.cc/docs/latest/#extending-with-java on the redPen side).

I’ll create a Validator plugin, which is the harder method but ensures I can edit the Validator source code without touching RedPen’s source tree.

>* Provide a Script Service so that scripts in wiki pages can validate any content using RedPen. Same >from Java (the Script Service would call the Java Component).

I was reading this http://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Module but I am still unable to grasp the concept of scripts and how the Java Component interacts with it. Do you have any other articles that I can reference from?

>* Provide an Admin option so that RedPen executes when a wiki page is saved (turned off by default). >This would be implemented as an XWiki Event Listener and would cancel the save if there are >violations.

If I’m writing a JAR based extension, then I guess I’ll write the EventListener as a Java component as well. Please correct me here if you feel that there are other easier methods.

>* Research how to embed redPen as a library (as a JAR dependency) and not as a standalone server. >That should probably be your first task. If not possible we’ll need to have it installed as a server but >that would make using the XWiki RedPen Extension much more complex.

As stated, I will ask around first to get started. Will update the design page with what I find.

>* (Optional and to be done after the rest is implemented and if enough time is left) Contribute to the >RedPen project itself by contributing support for the XWiki Syntax 2.1 markup text format. This would >allow to make XWiki and XWiki Rendering more known to users of RedPen.

I can find time when I’m free to look at the contributing community at RedPen. Perhaps I can also establish communication with them, while asking them about the possibility of using RedPen without setting up a server.
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] RedPen Integration into XWiki as Extension (Gsoc Project 2017)

vmassol
Administrator
Hi,

> On 14 May 2017, at 10:36, deshengchuan <[hidden email]> wrote:
>
> Hi these are my thoughts and questions on your suggestions.
> I have also updated the design page. Thank you for the guidance!
>
>> * Provide a UI in XWiki so that RedPen can be executed in a job on various
> pages of the wiki (let the >user select on what pages to run it: all
> (sub)wikis, a given wiki, a given page and children, a given >page only. It
> would generate some report about violations.

Note that by “job” I meant http://extensions.xwiki.org/xwiki/bin/view/Extension/Job%20Module

>> * Note that the RedPen integration should be developed as an XWiki
> extension in xwiki-contrib.
>
> If it were an extension, I would think to create an Xwiki component then
> export as JAR, instead of creating wiki pages and exporting as XAR.

There’s no such thing as “export as JAR” :)

But yes the extension will have several maven modules, some for JAR files and some for wiki pages. Check other extensions to understand, for example https://github.com/xwiki-contrib/application-ircbot

> This is
> because I’m not sure if functionality implemented through separate wiki
> pages would be able to operate throughout the platform. Also, I am not sure
> if I can configure RedPen Validators through creating an extension within an
> XWiki instance. Correct me if I’m wrong.

Maybe you’re misunderstanding what an XWiki extension is. An XWiki extension can be a JAR or a XAR. Each single JAR or XAR is an extension but an extension can depend on other extensions. Users would install the “RedPen Integration Application” (the UI part, ie the XAR one) and doing so will install the dependent JAR extension.

So first thing to do is request a repository on xwiki-contrib, you need to read fully http://contrib.xwiki.org/.

>
>> * Provide an Admin part to configure the RedPen rules to execute
> This can be integrated in the UI component so there should be no problems.
> Most likely component will pass props using an EventListener that will
> determine the command line to execute towards RedPen

I don’t understand what you mean… In any case the first step is to verify if we can embed redpen as a library.

>
>> * Provide the ability to add new rules defined in wiki pages (through a
> mechanism similar to >UIExtensions - See
> http://redpen.cc/docs/latest/#extending-with-java on the redPen side).
>
> I’ll create a Validator plugin, which is the harder method but ensures I can
> edit the Validator source code without touching RedPen’s source tree.

Indeed, you absolutely must noy touch RedPen core sources nor rebuild RedPen :)

>
>> * Provide a Script Service so that scripts in wiki pages can validate any
> content using RedPen. Same >from Java (the Script Service would call the
> Java Component).
>
> I was reading this
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Module but I
> am still unable to grasp the concept of scripts and how the Java Component
> interacts with it. Do you have any other articles that I can reference from?

http://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Module is really pretty clear. So I need to know what you don’t understand in order to help you further.

* ScriptService component implementations (in Java) calls other Java Components.
* Scripts in wiki pages call ScriptService through the “services” binding. e.g. $services.<component hint>.<…> in Velocity.

Actually I have an idea. Maybe you could follow this tutorial since it includes writing a script service too:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents

>
>> * Provide an Admin option so that RedPen executes when a wiki page is saved
> (turned off by default). >This would be implemented as an XWiki Event
> Listener and would cancel the save if there are >violations.
>
> If I’m writing a JAR based extension, then I guess I’ll write the
> EventListener as a Java component as well. Please correct me here if you
> feel that there are other easier methods.

Correct. But you’re not writing only a JAR based extension. You’ll be writing several extensions: one or several JARs and one XAR.

>
>> * Research how to embed redPen as a library (as a JAR dependency) and not
> as a standalone server. >That should probably be your first task. If not
> possible we’ll need to have it installed as a server but >that would make
> using the XWiki RedPen Extension much more complex.
>
> As stated, I will ask around first to get started. Will update the design
> page with what I find.

Yep. Could you paste the link to the thread where you asked so that we can follow?

>
>> * (Optional and to be done after the rest is implemented and if enough time
> is left) Contribute to the >RedPen project itself by contributing support
> for the XWiki Syntax 2.1 markup text format. This would >allow to make XWiki
> and XWiki Rendering more known to users of RedPen.
>
> I can find time when I’m free to look at the contributing community at
> RedPen. Perhaps I can also establish communication with them, while asking
> them about the possibility of using RedPen without setting up a server.

Sure.

Thanks!
-Vincent

> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Proposal-RedPen-Integration-into-XWiki-as-Extension-Gsoc-Project-2017-tp7603812p7603860.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.