2017 © Pedro Peláez
 

typo3-cms-extension px_ical

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

image

portrino/px_ical

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  • Friday, November 17, 2017
  • by portrino-dev
  • Repository
  • 7 Watchers
  • 1 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

px_ical - 0.2.0

Build Status Maintainability Test Coverage Test Coverage Issue Count Latest Stable Version Total Downloads, (*1)

Provides TYPO3 classes to render *.ics files via eluceo — iCal library., (*2)

Installation

composer require portrino/px_ical

Usage

Extbase view

You can prepend ?tx_par_pi1[format]=ical to your action controller request and extbase renders the corresponding view for you. By putting the ICalView class into the $viewFormatToObjectNameMap extbase is able to get the correct view class for your request. When you following the Domain Driven Design you have a domain model which is assigned to the view and get rendered by the different view classes., (*3)

By implementing the ICalEventInterface the ICalView class calls the __toICalEvent() method which have to be implemented by yourself. You have to return an Eluceo\iCal\Component\Event object here., (*4)

use Portrino\PxICal\Mvc\View\ICalView;
use TYPO3\CMS\Extbase\Mvc\View\JsonView;

class BookingController extends RestController
{
    /**
     * @var array
     */
    protected $viewFormatToObjectNameMap = [
        'json' => JsonView::class,
        'ical' => ICalView::class
    ];

    /**
     * Action Show
     *
     * @param \Foo\Bar\Domain\Model\Booking $booking
     *
     * @return void
     */
    public function showAction($booking)
    {
        /**
         * $booking should implement the ICalEventInterface
         */
        $this->view->assign('booking', $booking);
    }

}

...

class Booking extends AbstractEntity implements ICalEventInterface
{

    /**
     * @return Event
     */
    public function __toICalEvent()
    {
        $event = new Event();

        $event
            ->setUniqueId('foo_bar_' . (string)$this->getUid())
            ->setDtStart($this->getStart())
            ->setDtEnd($this->getEnd());

        ...

        return $event;
    }
}

If you do not have a domain model or the __toICalEvent() does not fit your needs, you can also assign the Eluceo\iCal\Component\Event object directly to the ICal view with the variable name vEvent, (*5)


use Eluceo\iCal\Component\Event; /** * Action Show * * @return void */ public function showAction() { $vEvent = new Event(); $vEvent ->setUniqueId('foo_bar_' . (string)$this->getUid()) ->setDtStart($this->getStart()) ->setDtEnd($this->getEnd()); ... $this->view->assign('vEvent', $vEvent); }

Service

This extensions provides a service class which creates an iCal file for you and put this file into: /typo3temp/px_ical folder. You just have to inject the class into your controller, ... and then you can call these methods to generates / remove the ical file., (*6)

Dependecy Injection:, (*7)

/**
 * @var \Portrino\PxICal\Service\ICalFileServiceInterface
 * @inject
 */
protected $iCalFileService;

from domain object:, (*8)

$file = $this->iCalFileService->createFromDomainObject($booking);

from event object:, (*9)

$file = $this->iCalFileService->create($vEvent);

To remove created files you just have to call the inverse method which does the job for you:, (*10)

by domain object:, (*11)

$file = $this->iCalFileService->removeByDomainObject($booking);

by event object:, (*12)

$file = $this->iCalFileService->remove($vEvent);

Authors

, (*13)

  • André Wuttig - Initial work, Unit Tests - aWuttig
  • Leopold Engst - Unit Tests - leen2104

See also the list of contributors who participated in this project., (*14)

The Versions

17/11 2017

dev-master

9999999-dev http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

typo3 cms ics ical portrino

13/11 2017

dev-nginx-travis-ci-integration

dev-nginx-travis-ci-integration http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

typo3 cms ics ical portrino

12/10 2017

0.2.0

0.2.0.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

typo3 cms ics ical portrino

19/06 2017

0.1.5

0.1.5.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino

10/05 2017

0.1.4

0.1.4.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino

10/05 2017

0.1.3

0.1.3.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino

10/05 2017

0.1.2

0.1.2.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino

10/05 2017

0.1.1

0.1.1.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino

10/05 2017

0.1.0

0.1.0.0 http://typo3.org

Provides classes to render ical via eluceo iCal lib (https://github.com/markuspoerschke/iCal)

  Sources   Download

GPL-2.0+

The Requires

 

typo3 cms ics ical portrino