Fórumok

Customize View "New Web Content"

Maik Gruhne, módosítva 8 év-val korábban

Customize View "New Web Content"

New Member Bejegyzések: 3 Csatlakozás dátuma: 2015.05.06. Legújabb bejegyzések
Hello everyone,

We have a customer requirement to change liferay "Web Content" - Component standard behaviour in control panel. In Detail there is a subview "Schedule" where you can adjust "Display Date" and "Expiring Date". Now the goal is to adjust these values to fill the fields with fixed date and time values instead of the current timestamp. Furthermore the checkboxes should be unchecked by default.
Has anyone an idea which liferay jsps to be hooked or rather properties to set for that?

Here is the path to get to the view: "Control panel" -> "Web Content" -> "Add" (or edit) -> "Basic Web Content" -> "Schedule"

Liferay Version: 6.1.1

Thanks a lot,
Maik
thumbnail
Vishal Kumar, módosítva 8 év-val korábban

RE: Customize View "New Web Content"

Regular Member Bejegyzések: 198 Csatlakozás dátuma: 2012.12.12. Legújabb bejegyzések
you have to go with hook.
thumbnail
Andew Jardine, módosítva 8 év-val korábban

RE: Customize View "New Web Content"

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hi Maik,

JSP hook the file /html/portlet/journal/article/schedule.jsp -- you'll see the fields in there for publishing and expiration.
Maik Gruhne, módosítva 8 év-val korábban

RE: Customize View "New Web Content"

New Member Bejegyzések: 3 Csatlakozás dátuma: 2015.05.06. Legújabb bejegyzések
Hi,
As Andrew said I've written a hook in /html/portlet/journal/article/schedule.jsp

Setting up the calender values, which should be set:
boolean newArticle = article == null;
GregorianCalendar displayDate = new GregorianCalendar();
GregorianCalendar expirationDate = new GregorianCalendar();
if(newArticle){
displayDate.set(Calendar.HOUR_OF_DAY, 9);
...

Then you can use these values in the aui-tags:
<aui:input formName="fm1" name="displayDate" value="<%= displayDate %>"/>
<aui:input disabled="<%= neverExpire %>" formName="fm1" name="expirationDate" value="<%= expirationDate %>"/>

Thank you guys