Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nathan McMinn
Calendar Portlet Events
March 9, 2007 8:15 AM
Answer

Nathan McMinn

Rank: Junior Member

Posts: 62

Join Date: October 13, 2005

Recent Posts

I found the events listing for the calendar portlet in portal.properties, but I need the ability to set the list of events per community. I'd like to do this using the preferences, but so far it hasn't worked. I thought perhaps since the from email and reply addresses could be customized per community that the events list could as well. For example, in portal.properties you find the following properties for the Calendar portlet:

1calendar.event.types=anniversary,appointment,bill-payment....
2calendar.email.from.name=Joe Bloggs
3calendar.email.from.address=test@liferay.com


When you use the calendar configuration to change the email from name and address fields, it creates an entry in lportal.portletpreferences that looks like this:

 1<portlet-preferences>
 2  <preference>
 3    <name>email-from-address</name>
 4    <value>nmcminn@company.com</value>
 5  </preference>
 6  <preference>
 7    <name>email-from-name</name>
 8    <value>Nathan McMinn</value>
 9  </preference>
10</portlet-preferences>


What I was hoping for was to be able to create a portlet preferences entry like this:

 1
 2<portlet-preferences>
 3  <preference>
 4    <name>email-from-address</name>
 5    <value>nmcminn@company.com</value>
 6  </preference>
 7  <preference>
 8    <name>email-from-name</name>
 9    <value>Nathan McMinn</value>
10  </preference>
11  <preference>
12    <name>event-types</name>
13    <value>Project Team Meeting,Program Go Team Meeting,Presentation</value>
14  </preference>
15</portlet-preferences>


I've entered these preferences manually into the DB, but the event type list is unaffected. If there is a way to store the event type list in the preferences it would be very helpful. Can it be done? Do I just have the preference name incorrect, or is the list alwyays populated from the properties file?
Andre Kreienbring
RE: Calendar Portlet Events
June 28, 2007 12:29 AM
Answer

Andre Kreienbring

Rank: Junior Member

Posts: 82

Join Date: December 18, 2006

Recent Posts

Hi Nathan,

if this is still interesting for you:

Take a look at the process how Portlet Preferences are written in Liferay.

Within the portlet definition there a Link to the corresponding action. In case of the calender portlet (liferay-portlet.xml) that is:

1<configuration-path>/calendar/edit_configuration</configuration-path>


This path is mapped to a struts action

1
2<action path="/calendar/edit_configuration" type="com.liferay.portlet.calendar.action.EditConfigurationAction"> ...
3</action>


In the Action itself the Prefs Object is manipulated.

I think:

  1. editing the preferences in portlet.xml or portlet-ext.xml
  2. customizing the edit_configuration.jsp form fields
  3. customizing the EditConfigurationAction
  4. redeploy your customized portlet


is the way to go.

But even if you follow this way it's most likely that it doesn't have any effect on the portlet. I've experienced the same and the reason is described in this declined JIRA Issue I reported.

In short:
Most likely theres something wrong with they way you edited the preferences in the DB emoticon

Customize like described above, give the portlet a new name or delete the old preferences from the DB.

André
Tarun S. Kayasth
RE: Calendar Portlet Events
July 6, 2007 10:36 PM
Answer

Tarun S. Kayasth

Rank: Regular Member

Posts: 160

Join Date: June 8, 2007

Recent Posts

hi,
I have problem in using calender portlet on first look.
I clicked on the export/import tab export text box had
liferay.ics
. i clicked on export button it showed error in tomcat..

05:17:45,125 ERROR [calendar.action.ExportEventsAction] com.liferay.portal.SystemException: net.fort
una.ical4j.model.ValidationException: Calendar must contain at least one component
com.liferay.portal.SystemException: net.fortuna.ical4j.model.ValidationException: Calendar must cont
ain at least one component
at com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl.exportICal4j(CalEventL
ocalServiceImpl.java:705)
at com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl.exportGroupEvents(CalE
ventLocalServiceImpl.java:419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304
)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo


I created one event for test. i exported it on my desktop, and then tried to import it. Its showing portlet in maximized mode with error and back tabs. but no error message is displayed. it shows error in tomcat :

05:28:44,406 ERROR [calendar.action.ExportEventsAction] java.lang.NullPointerException
java.lang.NullPointerException
at com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl.toTimeZone(CalEventLoc
alServiceImpl.java:1207)
at com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl.importICal4j(CalEventL
ocalServiceImpl.java:571)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304
)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy95.importICal4j(Unknown Source)
at com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.importICal4j(CalEventLocalS


i want to do more work on calender portlet but by this i can not do it smothly...
Tarun S. Kayasth
RE: Calendar Portlet Events
July 6, 2007 10:40 PM
Answer

Tarun S. Kayasth

Rank: Regular Member

Posts: 160

Join Date: June 8, 2007

Recent Posts

hi Andre,

in calender portlet while adding events, in the reminder tab how can i get reminder by sms or on YM????

Thanks,
Tarun Kayasth
Lisa Simpson
RE: Calendar Portlet Events
February 24, 2009 7:14 AM
Answer

Lisa Simpson

Rank: New Member

Posts: 13

Join Date: February 23, 2009

Recent Posts

You can't edit the event types from the administrator interface? Really??? I have to go tinker with the innards of the portlet to edit something that simple???? And something that gets edited that commonly??? That's just retarded.
Amos Fong
RE: Calendar Portlet Events
February 24, 2009 9:56 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

Lisa Simpson:
You can't edit the event types from the administrator interface? Really??? I have to go tinker with the innards of the portlet to edit something that simple???? And something that gets edited that commonly??? That's just retarded.


You can edit them using portal-ext.properties.

calendar.event.types=anniversary,appointment,bill-payment....

I think it's more efficient that way instead of storing them in database or something.
Amos Fong
RE: Calendar Portlet Events
February 24, 2009 4:51 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

Lisa,

I can see how this could be useful to have in the admin interface. Sometimes as engineers we see things more in terms of technical implementation rather than what makes sense for the end user. If you like to contribute your ideas, your input/advice would be greatly appreciated.

You can create tickets here: http://issues.liferay.com/

Or you can post new threads expressing your ideas.
Auditya manikanta Vadrevu
RE: Calendar Portlet Events
April 8, 2009 10:23 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi Amos Fong ,

As an administrator i can able to export and import calendar events .ics format , but normal users are not able to import the ics format files, it is showing "you donot have required permissions". What must be enabled to give normal users import function ? And does calendar in liferay-portal-5.1.1 supports only *.ics format events or any other also ?


thanks in advance,
V.Auditya
Amos Fong
RE: Calendar Portlet Events
April 9, 2009 11:37 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

Hey Auditya,

They need to have the "add event" permission to import.
Auditya manikanta Vadrevu
RE: Calendar Portlet Events
April 12, 2009 9:19 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi amos fong,

They need to have the "add event" permission to import.


thanks for ur reply.


I have given add event permission for organization members.Now members can import *.ics format files into calendar portlet. The event is being displayed in the list also but the problem is when a user imports an event from any other calendar of *.ics format the import of liferay calendar is working fine but it is not assigning "view" permission for that event to the user. As a result the user can import the event but could not view the event. I have seen the imported event permissions as an administrator there are no view permissions assigned in Regular roles as well as in Organization roles. How to assign view permissions automatically to user who imports the event ?


Thanks in Advance,
V.Auditya.
Auditya manikanta Vadrevu
RE: Calendar Portlet Events
April 14, 2009 9:22 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi amos fong,


any idea on " View permission" of an event which is imported from other calendar. Iam able to import successfull but the view permission is not assigned to it. So, as a result iam not able to view the imported event as normal user.



Thanks in Advance,
V.Auditya
Amos Fong
RE: Calendar Portlet Events
April 15, 2009 10:42 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

Hey,

Events will be imported with the default permissions. This is fixed in 5.1.2 with a new "owner" role.

http://issues.liferay.com/browse/LEP-7582
Auditya manikanta Vadrevu
RE: Calendar Portlet Events
April 15, 2009 9:35 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi ,

thanks for the reply. good to hear that it is fixed but in later version. Is there any alternative on how to use it in 5.1.1 ?

Thanks in Advance,
V.Auditya
Amos Fong
RE: Calendar Portlet Events
April 16, 2009 1:20 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

I don't think there's any workaround for it.

If it's ok, you can set all calendar events to give permission to that role by default in calendar.xml.
Auditya manikanta Vadrevu
RE: Calendar Portlet Events
April 16, 2009 9:18 PM
Answer

Auditya manikanta Vadrevu

Rank: Liferay Master

Posts: 621

Join Date: May 6, 2008

Recent Posts

hi amos fong,

where shall i give the view permission for calendar events (by default) . I did not found calendar.xml. I found this entry in portlet-custom.xml

 1<portlet>
 2
 3        <portlet-name>8</portlet-name>
 4
 5        <display-name>Calendar</display-name>
 6
 7        <portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
 8
 9        <init-param>
10
11            <name>view-action</name>
12
13            <value>/calendar/view</value>
14
15        </init-param>
16
17        <expiration-cache>0</expiration-cache>
18
19        <supports>
20
21            <mime-type>text/html</mime-type>
22
23        </supports>
24
25        <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
26
27        <security-role-ref>
28
29            <role-name>power-user</role-name>
30
31        </security-role-ref>
32
33        <security-role-ref>
34
35            <role-name>[b]user[/b]</role-name>
36
37        </security-role-ref>
38
39    </portlet>


shall i give <role-value>view</role-value> under user. Is that valid entry ?


With Regards,
V.Auditya
Amos Fong
RE: Calendar Portlet Events
April 17, 2009 9:22 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

Actually, if the role is user, you can just do it through enterprise admin portlet. Give view permission to calendar events.

The file is actually resource-atcions/calendar.xml, but I just realized it's for community/guest permissions.
Shibu K V
RE: Calendar Portlet Events
January 9, 2013 10:46 PM
Answer

Shibu K V

Rank: New Member

Posts: 14

Join Date: November 28, 2012

Recent Posts

Do you have any idea about adding some more role in "Viewable by" option?..., like we are having an option "Distribution scope " in Annoncement portlet?