Combination View Flat View Tree View
Threads [ Previous | Next ]
Bijan Vakili
Upgrading to JAMWiki 1.2.2?
September 11, 2012 3:17 PM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Hi,
Anyone know if there is a plan to upgrade to latest JAMWiki, 1.2.2 released last August?
http://jamwiki.org/wiki/en/JAMWiki_Release_Archive

I saw an Improvement-type issue was created for upgrading to 0.9.3, but none is there for 1.2.2; any plans to upgrade?
http://issues.liferay.com/secure/IssueNavigator.jspa?reset=true&jqlQuery=%28summary+~+jamwiki+OR+description+~+jamwiki+OR+comment+~+jamwiki%29+AND+issuetype+%3D+Improvement

Thanks.
Bijan
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 8:12 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Bijan,

I don't think there are short term plans to do this. In fact, I think the support to JAMWiki should be taken out of the core and moved to a plugin.

Would you be able to help with that task and also upgrade to the new version?
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 8:40 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Hi Jorge,

Yes, I would be happy to help with that task.

Thanks.
Bijan
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 8:47 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Awesome. Could you give it a first try at extracting it out and send me a pull request?
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 8:55 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Good idea; I'll decouple Wiki plugin from core and into it's own plugin.

I expect I can have something ready next Sunday 2013/01/20.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 9:22 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Great.

BTW, note that I'm only talking about decoupling the support for JAMWiki, not the whole wiki portlet.
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 9:36 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Oh, ok. I see what you mean - create new JAMWiki portlet reusing code from Liferay core, correct?
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 10:02 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Not exactly. JAMWIki is used in the implementation of one of the formats implemented for Liferay's Wiki: MediaWiki. So my proposal is to make a plugin of type hook that adds support for that format (currently it's included in the core and is enabled through portal.properties instead).

Makes sense?
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 10:20 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

To verify, extract mediawiki portal properties, e.g. below, and enable them via a hook, e.g media-wiki-hook?

#
# Set the list of supported wiki importers.
#
wiki.importers=MediaWiki

#
# Configure settings for each of the wiki importers.
#
wiki.importers.page=/html/portlet/wiki/import/mediawiki.jsp
wiki.importers.class=com.liferay.portlet.wiki.importers.mediawiki.MediaWikiImporter


Correct me if I'm wrong, the last property is not compatible to be in a hook since the MediaWikiImporter.class file would be in the hook's classloader not the portal's. As such, the mediawiki.jsp references would fail, right? Also, the com.liferay.portlet.wiki.translators.MediaWikiToCreoleTranslator depends on the MediaWikiImporter class.

Thanks for explaining this proposal.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 10:53 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Bijan,

Yes, this is exactly what I had in mind. I understand that you may need to do some changes to the implementation and maybe add some additional "hookability" that is not already there. But there should be some way of doing it that will also be helpful for others who may want to add other formats. So your work will be doubly useful emoticon
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 21, 2013 11:44 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Hi Jorge,
I succesfully extracted out the Jamwiki-related code/binaries into a hook, but ran out of time while adding new hookability feature for adding wiki engines. Would you mind commenting if following way is ok?
Basically, add some logic to the com.liferay.portal.deploy.hot.HookHotDeployListener.initPortalProperties method. Namely, to add something like:
1
2//pseudocode
3if ( isWikiProperties ) {
4   // load the wiki classes referenced
5   // update wiki engines / formatters / importers
6   // update jsps (e.g.  to remember selection of this new format
7}

Also, opened LPS-32447 to track progress
My commits will be available in about 30 minutes (after they're uploaded on GitHub) at following URIs:
Liferay Portal changes
Liferay Plugins changes

Thanks.
Bijan
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 22, 2013 12:49 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hey Bijan,

I've been taking a look at your code and it looks very good so far.

Regarding your question, we shouldn't add any code to HookHotDeployListener that is specific to these properties. What you are mentioning about the classloading is correct, but it's the same for all hook properties that also reference classes. I haven't developed a hook in a while so I cannot tell you exactly how it works, but you can take a look at the other hooks in the plugins repository for examples.

Let me know if you can't find how to do it and I'll try to look it up.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
January 22, 2013 2:00 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Ignore my last post, your approach is the only one possible at this point. We are working on an OSGi Liferay Module framework that will allow us to avoid this type of manual classloading handling, but for now you will have to modify HookHotDeployListener to add code to load the importer and formatter classes. You should add it around line 1957 (follow alphabetic order with respect to the property being read). Use the examples above for reference, for example:

 1        if (portalProperties.containsKey(
 2                PropsKeys.USERS_SCREEN_NAME_VALIDATOR)) {
 3
 4            String screenNameValidatorClassName = portalProperties.getProperty(
 5                PropsKeys.USERS_SCREEN_NAME_VALIDATOR);
 6
 7            ScreenNameValidator screenNameValidator =
 8                (ScreenNameValidator)newInstance(
 9                    portletClassLoader, ScreenNameValidator.class,
10                    screenNameValidatorClassName);
11
12            ScreenNameValidatorFactory.setInstance(screenNameValidator);
13        }
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 22, 2013 11:23 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Really good point about the OSGi Liferay Module; I will go ahead with the manual classloading approach and have an update latest by EOD Sunday.
Thanks Jorge.

Jorge Ferrer:
Ignore my last post, your approach is the only one possible at this point. We are working on an OSGi Liferay Module framework that will allow us to avoid this type of manual classloading handling, but for now you will have to modify HookHotDeployListener to add code to load the importer and formatter classes. You should add it around line 1957 (follow alphabetic order with respect to the property being read). Use the examples above for reference, for example:

 1        if (portalProperties.containsKey(
 2                PropsKeys.USERS_SCREEN_NAME_VALIDATOR)) {
 3
 4            String screenNameValidatorClassName = portalProperties.getProperty(
 5                PropsKeys.USERS_SCREEN_NAME_VALIDATOR);
 6
 7            ScreenNameValidator screenNameValidator =
 8                (ScreenNameValidator)newInstance(
 9                    portletClassLoader, ScreenNameValidator.class,
10                    screenNameValidatorClassName);
11
12            ScreenNameValidatorFactory.setInstance(screenNameValidator);
13        }
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 31, 2013 8:04 PM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Hi Jorge,
So sorry - I have not had a chance to work on this, but will definitely cut out the time to do so this weekend.
Thanks for your patience.
Bijan
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
February 1, 2013 4:39 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

No worries, looking forward to see it.
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
February 9, 2013 9:47 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Thanks again for your patience.
Just wanted to let you know I have not forgotten and will cut out time to do work on it today and tomorrow.
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
February 17, 2013 11:09 PM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

FYI, I'm documenting the steps in the wiki entry at the following URI:
http://www.liferay.com/community/wiki/-/wiki/Main/jamwiki
and committing changes to:
Liferay Portal - https://github.com/bmvakili/liferay-portal/tree/lps-jamwiki
Liferay Jamwiki Hook - https://github.com/bmvakili/liferay-plugins/tree/lps-jamwiki
Currently the Portal is building and I'm debugging to make sure the Hook builds and deploys well.
Finally, I will do some QA/testing to make sure this doesn't break something.
Thanks for your patience.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
February 19, 2013 2:17 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Awesome, Thanks Bijan. Looking forward for your pull request emoticon
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
March 2, 2013 11:18 PM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Updated code; jamwiki-hook deploys (and works!) fine, but I'm still working on the undeploy/destroy code; I need to clean it up a little more before it's ready for review, but I expect some time this week to finally hand this off to you.
Thanks for your patience.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
March 4, 2013 6:48 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

No worries. Thanks for your work Bijan!
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
April 3, 2013 5:01 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

I am very close to finishing it;
Was delayed since my two week vacation.
All that is left are the destroy methods:
Liferay Portal - https://github.com/bmvakili/liferay-portal/tree/lps-jamwiki
Liferay Jamwiki Hook - https://github.com/bmvakili/liferay-plugins/tree/lps-jamwiki
Thanks.
Jorge Ferrer
RE: Upgrading to JAMWiki 1.2.2?
April 4, 2013 12:55 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Looking forward to it. Feel free to send me pull requests whenever you want me to take a look at it.
Bijan Vakili
RE: Upgrading to JAMWiki 1.2.2?
January 9, 2013 11:03 AM
Answer

Bijan Vakili

Rank: Regular Member

Posts: 140

Join Date: March 10, 2009

Recent Posts

Hi Jorge,
Ok, thanks for the verification and guidance.
I expect to have something by 2013/01/20 still (lots on plate this weekend.)
Thanks again.
Bijan