com.dotmarketing.portlets.calendar.business
Class EventAPIImpl

java.lang.Object
  extended by com.dotmarketing.portlets.calendar.business.EventAPIImpl
All Implemented Interfaces:
EventAPI

public class EventAPIImpl
extends java.lang.Object
implements EventAPI


Constructor Summary
EventAPIImpl()
           
 
Method Summary
 java.lang.String createVCalendarInfo(Event event, java.util.Date recurrenceStartDate, java.util.Date recurrenceEndDate, Host host)
          This method receive an Event and return the iCal format of the event.
 Event disconnectEvent(Event event, com.liferay.portal.model.User user, java.util.Date startDate, java.util.Date endDate)
          Disconnects an event from the recurrence WILL COMMIT YOUR TRANSACTION IF YOU HAVE ONE
 java.util.List<Event> find(java.util.Date fromDate, java.util.Date endDate, java.lang.String[] tags, java.lang.String[] keywords, java.util.List<Category> categories, boolean liveOnly, boolean includeArchived, int offset, int limit, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves a list of event filtering by the given parameters, also filtering by the events that the given user is able to see, or if the given user is null it filters by all the events marked for frontend visibility
 Event find(java.lang.String id, boolean live, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves an event based on its identifier,
 java.util.List<Event> find(java.lang.String hostId, java.util.Date fromDate, java.util.Date endDate, java.lang.String[] tags, java.lang.String[] keywords, java.util.List<Category> categories, boolean liveOnly, boolean includeArchived, int offset, int limit, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves a list of event filtering by the given parameters, also filtering by the events that the given user is able to see, or if the given user is null it filters by all the events marked for frontend visibility
 Event findbyInode(java.lang.String inode, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Search for an specific event by inode also checks that the given user has permissions
 java.util.List<Event> findRelatedEvents(Event baseEvent, java.util.Date fromDate, java.util.Date toDate, boolean live, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method retrieves the related events based on the baseEvent categories and tags
 Structure getBuildingStructure()
          Retrieves the content structure used by events
 java.util.List<Category> getCategories(Event ev, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method retrieves the list of categories associated to the given event
 Structure getEventStructure()
          Retrieves the content structure used by events
 Structure getFacilityStructure()
          Retrieves the content structure used by events
 java.util.List<Contentlet> getRelatedContent(Event ev, Relationship rel, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Associates the given list of contentlets using the relationship
 void setCategories(Event ev, java.util.List<Category> cats, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This methods removes all the categories the user is able to remove from the event and then associates the categories passed as paramater
 void setRelatedContent(Event ev, Relationship rel, java.util.List<Contentlet> related, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Associates the given list of contentlets using the relationship this methods removes old associated content and reset the relatioships based on the list of content passed as parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventAPIImpl

public EventAPIImpl()
Method Detail

find

public java.util.List<Event> find(java.util.Date fromDate,
                                  java.util.Date endDate,
                                  java.lang.String[] tags,
                                  java.lang.String[] keywords,
                                  java.util.List<Category> categories,
                                  boolean liveOnly,
                                  boolean includeArchived,
                                  int offset,
                                  int limit,
                                  com.liferay.portal.model.User user,
                                  boolean respectFrontendRoles)
                           throws DotDataException,
                                  DotSecurityException
Retrieves a list of event filtering by the given parameters, also filtering by the events that the given user is able to see, or if the given user is null it filters by all the events marked for frontend visibility

Specified by:
find in interface EventAPI
Parameters:
fromDate -
endDate -
tags -
keyword -
categories -
liveOnly -
user -
Returns:
Throws:
DotDataException
DotSecurityException

find

public java.util.List<Event> find(java.lang.String hostId,
                                  java.util.Date fromDate,
                                  java.util.Date endDate,
                                  java.lang.String[] tags,
                                  java.lang.String[] keywords,
                                  java.util.List<Category> categories,
                                  boolean liveOnly,
                                  boolean includeArchived,
                                  int offset,
                                  int limit,
                                  com.liferay.portal.model.User user,
                                  boolean respectFrontendRoles)
                           throws DotDataException,
                                  DotSecurityException
Retrieves a list of event filtering by the given parameters, also filtering by the events that the given user is able to see, or if the given user is null it filters by all the events marked for frontend visibility

Specified by:
find in interface EventAPI
Parameters:
hostId -
fromDate -
endDate -
tags -
keyword -
categories -
liveOnly -
user -
Returns:
Throws:
DotDataException
DotSecurityException

find

public Event find(java.lang.String id,
                  boolean live,
                  com.liferay.portal.model.User user,
                  boolean respectFrontendRoles)
           throws DotDataException,
                  DotSecurityException
Retrieves an event based on its identifier,

Specified by:
find in interface EventAPI
Parameters:
id - Identifier of the event to find
live - true if you want to find the live version of it, false if you want the working version
Returns:
Throws:
DotDataException
DotSecurityException - If the user doesn't have permissions to see this event

findbyInode

public Event findbyInode(java.lang.String inode,
                         com.liferay.portal.model.User user,
                         boolean respectFrontendRoles)
                  throws DotDataException,
                         DotSecurityException
Description copied from interface: EventAPI
Search for an specific event by inode also checks that the given user has permissions

Specified by:
findbyInode in interface EventAPI
Returns:
Throws:
DotDataException
DotSecurityException

findRelatedEvents

public java.util.List<Event> findRelatedEvents(Event baseEvent,
                                               java.util.Date fromDate,
                                               java.util.Date toDate,
                                               boolean live,
                                               com.liferay.portal.model.User user,
                                               boolean respectFrontendRoles)
                                        throws DotDataException,
                                               DotSecurityException
Description copied from interface: EventAPI
This method retrieves the related events based on the baseEvent categories and tags

Specified by:
findRelatedEvents in interface EventAPI
Returns:
Throws:
DotDataException
DotSecurityException - This exception is thrown if the user doesn't have permission consult the baseEvent

getCategories

public java.util.List<Category> getCategories(Event ev,
                                              com.liferay.portal.model.User user,
                                              boolean respectFrontendRoles)
                                       throws DotSecurityException,
                                              DotDataException
Description copied from interface: EventAPI
This method retrieves the list of categories associated to the given event

Specified by:
getCategories in interface EventAPI
Returns:
Throws:
DotSecurityException
DotDataException

setCategories

public void setCategories(Event ev,
                          java.util.List<Category> cats,
                          com.liferay.portal.model.User user,
                          boolean respectFrontendRoles)
                   throws DotDataException,
                          DotSecurityException
This methods removes all the categories the user is able to remove from the event and then associates the categories passed as paramater

Specified by:
setCategories in interface EventAPI
Throws:
DotDataException
DotSecurityException

getRelatedContent

public java.util.List<Contentlet> getRelatedContent(Event ev,
                                                    Relationship rel,
                                                    com.liferay.portal.model.User user,
                                                    boolean respectFrontendRoles)
                                             throws DotDataException,
                                                    DotSecurityException
Description copied from interface: EventAPI
Associates the given list of contentlets using the relationship

Specified by:
getRelatedContent in interface EventAPI
user - The user is checked to see if he has the required permissions to modify the event relationship
Throws:
DotDataException
DotSecurityException

setRelatedContent

public void setRelatedContent(Event ev,
                              Relationship rel,
                              java.util.List<Contentlet> related,
                              com.liferay.portal.model.User user,
                              boolean respectFrontendRoles)
                       throws DotDataException,
                              DotSecurityException
Description copied from interface: EventAPI
Associates the given list of contentlets using the relationship this methods removes old associated content and reset the relatioships based on the list of content passed as parameter

Specified by:
setRelatedContent in interface EventAPI
related - The order in the list matters
user - The user is checked to see if he has the required permissions to modify the event relationship
Throws:
DotDataException
DotSecurityException

getBuildingStructure

public Structure getBuildingStructure()
                               throws DotDataException
Description copied from interface: EventAPI
Retrieves the content structure used by events

Specified by:
getBuildingStructure in interface EventAPI
Returns:
Throws:
DotDataException

getEventStructure

public Structure getEventStructure()
                            throws DotDataException
Description copied from interface: EventAPI
Retrieves the content structure used by events

Specified by:
getEventStructure in interface EventAPI
Returns:
Throws:
DotDataException

getFacilityStructure

public Structure getFacilityStructure()
                               throws DotDataException
Description copied from interface: EventAPI
Retrieves the content structure used by events

Specified by:
getFacilityStructure in interface EventAPI
Returns:
Throws:
DotDataException

createVCalendarInfo

public java.lang.String createVCalendarInfo(Event event,
                                            java.util.Date recurrenceStartDate,
                                            java.util.Date recurrenceEndDate,
                                            Host host)
Description copied from interface: EventAPI
This method receive an Event and return the iCal format of the event.

Specified by:
createVCalendarInfo in interface EventAPI
Parameters:
event - The event to be transformed in the iCal format.
Returns:
A String that represents the iCal format of the event and could be used for download, email, etc.

disconnectEvent

public Event disconnectEvent(Event event,
                             com.liferay.portal.model.User user,
                             java.util.Date startDate,
                             java.util.Date endDate)
                      throws DotDataException,
                             DotSecurityException
Description copied from interface: EventAPI
Disconnects an event from the recurrence WILL COMMIT YOUR TRANSACTION IF YOU HAVE ONE

Specified by:
disconnectEvent in interface EventAPI
Parameters:
event - The base event of the recurrence
startDate - The startDate of the event to disconnect
endDate - The endDate of the event to disconnect
Returns:
The disconnected event with the given start and end dates
Throws:
DotDataException
DotSecurityException


Copyright © 2013 dotCMS Inc. All Rights Reserved.