Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Esa Hekmat
using Joda-time instead of JDK Calendar
17. November 2012 02:40
Antwort

Esa Hekmat

Rang: New Member

Nachrichten: 13

Eintrittsdatum: 13. März 2012

Neue Beiträge

using Liferay Localization is not enough to use localized calendar systems(Calendar systems like Japanese or Hijri(Persian)Calendar, not just translating Georgian calendar to other languages). so I decide to make liferay to use other Calendar systems(changing in Portal Source Code or using Ext Plugin). as Liferay use JDK Calendar standard and extending JDK default Calendar system to implement a new Calendar like Hijri is almost impossible, the new idea is changing liferay to use another Calendar liberaries like Joda-Time(which has a great power for localization).
I summarize my solution to use custom Calendar Systems:

changing the CalendarFactory Service API for changing method signature to use Joda-Time Classes instead of java.util.Calendar
implement new CalendarFactoryImpl
correcting all the side-effect Errors(couse they expect java.util.Calendar not org.joda.time.DateTime)

I have two Question.
1. am I correct in this path?
2.how can I use Ext Plugin to change the Core Service API, I mean changin the CalendarFactory/Util interfaces (change return types...)and manage other side-effects?
Hitoshi Ozawa
RE: using Joda-time instead of JDK Calendar
17. November 2012 02:54
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

It's not that's simple. You'll also have to modify AlloyUI's calendar to change the popup calendar.
Esa Hekmat
RE: using Joda-time instead of JDK Calendar
19. November 2012 09:40
Antwort

Esa Hekmat

Rang: New Member

Nachrichten: 13

Eintrittsdatum: 13. März 2012

Neue Beiträge

it seems you'r right. yes I should change AlloyUI Component too, but I didn't get my answer
Hitoshi Ozawa
RE: using Joda-time instead of JDK Calendar
19. November 2012 15:16
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

You'll just want to change how calendar is presented to the user instead of how dates are kept in the system. That is, you'll want to wrap the liferay's calendar system instead of modifying it. Have your presentation layer call your wrapper methods instead of liferay.
Banafshe Bamdad
RE: using Joda-time instead of JDK Calendar
21. April 2014 23:09
Antwort

Banafshe Bamdad

Rang: Junior Member

Nachrichten: 56

Eintrittsdatum: 6. November 2007

Neue Beiträge

Dear Mr. Hekmatizadeh,

I am using liferay6.2 and AlloyUI V.2. I need to have calendar portlet in Jalali date. I am a java programmer and a beginner in AlloyUI. I had changed calendar in previeus version of liferay to show jalali dates, It was simple because I just modified the JSP and Java files. I am completely confused about the new version of calendar portlet.

Any help about this issue would be greatly appreciated!
Banafshe
Esa Hekmat
RE: using Joda-time instead of JDK Calendar
22. April 2014 00:39
Antwort

Esa Hekmat

Rang: New Member

Nachrichten: 13

Eintrittsdatum: 13. März 2012

Neue Beiträge

you are right in this version, the core code of Calendar portlet UI is not in JSP and java files. its a new alloy-UI element(http://alloyui.com/examples/scheduler/) which written in javascript. to localize these type of elements we should first localize alloy-ui components(standard way) or use another javascript elements like JQueryUI or KendoUI (it's not recommended).
as there isn't any localized component in Alloy-ui components for Jalali Calendar(no datepicker and no Scheduler) I change the main source code to use jQueryUI datepicker for Persian Language pages for my personal use. but I believe the correct way is contribute to localize alloy-ui elements first.
sako izadpanahj
RE: using Joda-time instead of JDK Calendar
21. Januar 2015 13:09
Antwort

sako izadpanahj

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 22. Dezember 2014

Neue Beiträge

salam banafshe khanum man az liferay 6.1.2 estefade mikonam va badjoor tu in taqvime farsi gir kardam mishe begid daqian kojaharo bayad modify konam ?
Banafshe Bamdad
RE: using Joda-time instead of JDK Calendar
22. Januar 2015 05:12
Antwort

Banafshe Bamdad

Rang: Junior Member

Nachrichten: 56

Eintrittsdatum: 6. November 2007

Neue Beiträge

Salam,
Which type of calendar do you have? Ancient Liferay's Calendar portlet (with java code) or AlloyUI scheduler (with JavaScript code)?