Foren

Upgrading to JAMWiki 1.2.2?

thumbnail
Bijan Vakili, geändert vor 11 Jahren.

Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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?
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
Hi Jorge,

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

Thanks.
Bijan
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Awesome. Could you give it a first try at extracting it out and send me a pull request?
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Great.

BTW, note that I'm only talking about decoupling the support for JAMWiki, not the whole wiki portlet.
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
Oh, ok. I see what you mean - create new JAMWiki portlet reusing code from Liferay core, correct?
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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?
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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[MediaWiki]=/html/portlet/wiki/import/mediawiki.jsp
wiki.importers.class[MediaWiki]=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.
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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:

//pseudocode
if ( isWikiProperties ) {
   // load the wiki classes referenced
   // update wiki engines / formatters / importers
   // update jsps (e.g.  to remember selection of this new format
}

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
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
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:

		if (portalProperties.containsKey(
				PropsKeys.USERS_SCREEN_NAME_VALIDATOR)) {

			String screenNameValidatorClassName = portalProperties.getProperty(
				PropsKeys.USERS_SCREEN_NAME_VALIDATOR);

			ScreenNameValidator screenNameValidator =
				(ScreenNameValidator)newInstance(
					portletClassLoader, ScreenNameValidator.class,
					screenNameValidatorClassName);

			ScreenNameValidatorFactory.setInstance(screenNameValidator);
		}
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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:

		if (portalProperties.containsKey(
				PropsKeys.USERS_SCREEN_NAME_VALIDATOR)) {

			String screenNameValidatorClassName = portalProperties.getProperty(
				PropsKeys.USERS_SCREEN_NAME_VALIDATOR);

			ScreenNameValidator screenNameValidator =
				(ScreenNameValidator)newInstance(
					portletClassLoader, ScreenNameValidator.class,
					screenNameValidatorClassName);

			ScreenNameValidatorFactory.setInstance(screenNameValidator);
		}
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
No worries, looking forward to see it.
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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.
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Awesome, Thanks Bijan. Looking forward for your pull request emoticon
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
No worries. Thanks for your work Bijan!
thumbnail
Bijan Vakili, geändert vor 10 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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.
thumbnail
Jorge Ferrer, geändert vor 10 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Looking forward to it. Feel free to send me pull requests whenever you want me to take a look at it.
thumbnail
Bijan Vakili, geändert vor 11 Jahren.

RE: Upgrading to JAMWiki 1.2.2?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
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