Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Amit Sharma
Metadata based UI and Business Logic
August 31, 2012 9:07 AM
Answer

Amit Sharma

Rank: New Member

Posts: 6

Join Date: August 29, 2012

Recent Posts

Hi, I have a requirement to display customer specific UI depending on customer data (e.g. Customer's country). Do we have something out of the box in Liferay to support this requirement so that it can identify customer attribute and trigger specific business logic and UI ?

Thanks for help in advance.

Regards,
Amit Sharma
David H Nebinger
RE: Metadata based UI and Business Logic
August 31, 2012 9:13 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7444

Join Date: September 1, 2006

Recent Posts

Each user has a locale that they can change in their profile page.

The locale is used by Liferay to render labels, etc., in the native language of the user, but outside of that will not alter the general 'appearance' of a page, nor does it have any impact on business logic OOTB.

That said, you can use the user's locale in your own portlets to adjust the presentation as well as the business logic...
Amit Sharma
RE: Metadata based UI and Business Logic
August 31, 2012 9:16 AM
Answer

Amit Sharma

Rank: New Member

Posts: 6

Join Date: August 29, 2012

Recent Posts

Thank you David H Nebinger.
Do you suggest that I get the user locale in my portlet and trigger specific business logic and redirect to different view depending on the user locale ?

Thanks,
Amit Sharma
David H Nebinger
RE: Metadata based UI and Business Logic
August 31, 2012 11:34 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7444

Join Date: September 1, 2006

Recent Posts

Sure, if you need to.

For the UI, though, most times the layout/content remains the same, it's just the localization that's necessary. If this is the case for you, then a resource bundle would be the way to go (rather than multiple views, you have one view that uses the resource bundle for localization). If it is truly a different layout/content per locale, then you can use the user's locale to determine the view.

For business logic, you can use the locale to invoke different logic when necessary.
Hitoshi Ozawa
RE: Metadata based UI and Business Logic
September 1, 2012 5:05 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Do you suggest that I get the user locale in my portlet and trigger specific business logic and redirect to different view depending on the user locale ?


The best thing to do actually is to modify liferay so page display can be determined by rules. User's locale and other attributes may be part of a rule to determine the display.

Liferay's mobile rule and business rule are in the right direction but kind of fell short. :-)