Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Esa Hekmat
using Joda-time instead of JDK Calendar
17 de noviembre de 2012 2:40
Respuesta

Esa Hekmat

Ranking: New Member

Mensajes: 13

Fecha de incorporación: 13 de marzo de 2012

Mensajes recientes

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 de noviembre de 2012 2:54
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

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 de noviembre de 2012 9:40
Respuesta

Esa Hekmat

Ranking: New Member

Mensajes: 13

Fecha de incorporación: 13 de marzo de 2012

Mensajes recientes

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 de noviembre de 2012 15:16
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

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 de abril de 2014 23:09
Respuesta

Banafshe Bamdad

Ranking: Junior Member

Mensajes: 50

Fecha de incorporación: 6 de noviembre de 2007

Mensajes recientes

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 de abril de 2014 0:39
Respuesta

Esa Hekmat

Ranking: New Member

Mensajes: 13

Fecha de incorporación: 13 de marzo de 2012

Mensajes recientes

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.