Menu

Home

Danish
Attachments
expando 1.PNG (10943 bytes)
expando 2.PNG (10484 bytes)
expando 3.PNG (40468 bytes)
expando 4.PNG (10090 bytes)

Some time we are having requirement that we need to upload the web content with some back date. For example one of our news based portals we were required to have an option that, user can change the create date of web content at the time of uploading.

We are going to use the Service hook. We are going to hook

com.liferay.portlet.journal.service.JournalArticleLocalService

We will use the expando bridge to get the latest created date from the user.

Create 2 custom fields as shown in the snap shots. The field name could be createDate(Date) and changeCreateDate(Boolean).

Else you can change the name and update them in the portlet.properties file.

##Specify the name of field specified in the custom fields..

1. Field to check if the user want to change the create date of a journal article or not (Boolean type)

override.change.create.date.field.name = changeCreateDate

2. Field to be scanned for the create date as set by the user (Date type)

create.date.field.name = createDate

These 2 fields will decide whether to update the create date or not.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.