Foren

Calendar Portlet Events

Nathan McMinn, geändert vor 17 Jahren.

Calendar Portlet Events

Junior Member Beiträge: 61 Beitrittsdatum: 14.10.05 Neueste Beiträge
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:

calendar.event.types=anniversary,appointment,bill-payment....
calendar.email.from.name=Joe Bloggs
calendar.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:

<portlet-preferences>
  <preference>
    <name>email-from-address</name>
    <value>nmcminn@company.com</value>
  </preference>
  <preference>
    <name>email-from-name</name>
    <value>Nathan McMinn</value>
  </preference>
</portlet-preferences>


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


<portlet-preferences>
  <preference>
    <name>email-from-address</name>
    <value>nmcminn@company.com</value>
  </preference>
  <preference>
    <name>email-from-name</name>
    <value>Nathan McMinn</value>
  </preference>
  <preference>
    <name>event-types</name>
    <value>Project Team Meeting,Program Go Team Meeting,Presentation</value>
  </preference>
</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?
thumbnail
Andre Kreienbring, geändert vor 16 Jahren.

RE: Calendar Portlet Events

Regular Member Beiträge: 152 Beitrittsdatum: 18.12.06 Neueste Beiträge
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:

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


This path is mapped to a struts action


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


In the Action itself the Prefs Object is manipulated.

I think:

  • editing the preferences in portlet.xml or portlet-ext.xml
  • customizing the edit_configuration.jsp form fields
  • customizing the EditConfigurationAction
  • 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é
thumbnail
Tarun S. Kayasth, geändert vor 16 Jahren.

RE: Calendar Portlet Events

Regular Member Beiträge: 162 Beitrittsdatum: 08.06.07 Neueste Beiträge
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...
thumbnail
Tarun S. Kayasth, geändert vor 16 Jahren.

RE: Calendar Portlet Events

Regular Member Beiträge: 162 Beitrittsdatum: 08.06.07 Neueste Beiträge
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, geändert vor 15 Jahren.

RE: Calendar Portlet Events

New Member Beiträge: 13 Beitrittsdatum: 23.02.09 Neueste Beiträge
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.
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
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.
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
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.
thumbnail
Auditya manikanta Vadrevu, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Master Beiträge: 621 Beitrittsdatum: 06.05.08 Neueste Beiträge
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
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
Hey Auditya,

They need to have the "add event" permission to import.
thumbnail
Auditya manikanta Vadrevu, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Master Beiträge: 621 Beitrittsdatum: 06.05.08 Neueste Beiträge
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.
thumbnail
Auditya manikanta Vadrevu, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Master Beiträge: 621 Beitrittsdatum: 06.05.08 Neueste Beiträge
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
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
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
thumbnail
Auditya manikanta Vadrevu, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Master Beiträge: 621 Beitrittsdatum: 06.05.08 Neueste Beiträge
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
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
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.
thumbnail
Auditya manikanta Vadrevu, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Master Beiträge: 621 Beitrittsdatum: 06.05.08 Neueste Beiträge
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

<portlet>

		<portlet-name>8</portlet-name>

		<display-name>Calendar</display-name>

		<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>

		<init-param>

			<name>view-action</name>

			<value>/calendar/view</value>

		</init-param>

		<expiration-cache>0</expiration-cache>

		<supports>

			<mime-type>text/html</mime-type>

		</supports>

		<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>

		<security-role-ref>

			<role-name>power-user</role-name>

		</security-role-ref>

		<security-role-ref>

			<role-name>[b]user[/b]</role-name>

		</security-role-ref>

	</portlet>


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


With Regards,
V.Auditya
thumbnail
Amos Fong, geändert vor 15 Jahren.

RE: Calendar Portlet Events

Liferay Legend Beiträge: 2047 Beitrittsdatum: 07.10.08 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: Calendar Portlet Events

New Member Beiträge: 13 Beitrittsdatum: 28.11.12 Neueste Beiträge
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?