Exposes TYPO3 procedures as Tasks and accepts and responds to RPC queries sent by clients. Uses a Request/Response form of communication where a very simple Request contains arguments for the task and a more complex Response allows for returning not just standard responses but also definitions for form fields that the client displays when asking the user to fill the arguments the task needs., (*1)
This also allows the RPC request/response to be performed over multiple steps. For example, the server can deliver a response that asks for one variable to be filled and then sends that to the server which returns a new response based on that variable. Until all arguments are filled and the task can be executed., (*2)
The RPC extension has OSX and iOS clients compatible with any Mac (el Capitan and up) and iPhone/iPad. The iOS versions are still being developed and are not yet released. Once all clients are completed a release to the official App store is planned; until then, the OSX client is available for download as a DMG archive (see below)., (*3)
Pull as composer dependency using composer require namelesscoder/rpc
on the TYPO3 site that needs RPC., (*4)
Download and install the OSX or iOS application "TYPO3 RPC Client"., (*5)
Or install the extension and use the backend module from a client TYPO3 site to connect to a TYPO3 server host., (*6)
If you are the systems administrator:, (*7)
If you are a user of the RPC client, (*8)
A collection of Tasks is included and can be configured via a PHP API:, (*9)
\NamelessCoder\Rpc\Manager\TaskManager::getInstance() ->getTaskById('help') ->getTaskConfiguration() ->setEnabled(FALSE)
And new custom Tasks can be added and manipulated via the same API:, (*10)
\NamelessCoder\Rpc\Manager\TaskManager::getInstance()->addTask( new \MyNamespace\MyExtension\MyCustomTask('my-custom-task') ); \NamelessCoder\Rpc\Manager\TaskManager::getInstance() ->getTaskById('my-custom-task') ->doSomethingToTask();
The built-in tasks are:, (*11)
list
which must be available if the RPC is going to be used from a client where tasks are listed before they are
executed. Without this task, the client must know the task ID that is going to be called without receiving it from
the server. The OSX/iOS clients do not support this mode of operation but custom implementations can do so. For the
OSX/iOS clients to work, list
must be enabled and accessible.help
which unsurprisingly returns a help message about how the RPC works from the user's perspective. This task
can be disabled or you can simply choose to not grant access to it, if your users do not require the help text. The
task shows the contents of CLIENT.md
from this extension as a response in the client.demo
which is provided both as a way to demonstrate the basics of tasks and to serve as a quick reference for making
common task types.command
tasks for the only relevant command controller shipped with TYPO3: extension install and uninstall.In addition to this a generic command
task is provided can can be used to make individual command controllers show
up as tasks, allowing you to control exactly which ones can be used - for the cases when global access to all commands
is not desired. This generic task is enabled per command controller as follows:, (*12)
\NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand( \TYPO3\CMS\Extensionmanager\Command\ExtensionCommandController::class, 'install' )->setFieldTypeForArgument( \NamelessCoder\Rpc\Implementation\Field\AvailableExtensionsField::class, 'extensionKey' ); \NamelessCoder\Rpc\Implementation\Task\CommandTask::registerForCommand( \TYPO3\CMS\Extensionmanager\Command\ExtensionCommandController::class, 'uninstall' )->setFieldTypeForArgument( \NamelessCoder\Rpc\Implementation\Field\InstalledExtensionsField::class, 'extensionKey' );
This example shows how the extension install and uninstall commands are registered. Both use a custom field type for
the extensionKey
argument - the fields deliver uninstalled or installed extension keys as a popup menu field. The
generic task's base code takes care of detecting arguments and calling the action on the controller. Use the same method
for your own command controllers, one for each action you wish to expose as RPC., (*13)
In TYPO3 it will often make a lot of sense to create your RPC tasks as command controllers and expose them using the
command controller task. This makes the tasks possible to run using the scheduler, from command line and using the
RPC client. However, for more complex tasks that for example require a lot of input arguments filled in multiple steps
or require a custom report when finished, you have to look into creating your own RPC task classes - see the demo
task's class for a quick reference., (*14)
See also "known limitations" below: command controllers are intended for a BE context but when executed this way will
actually have an FE context. Not all command controllers will support this - and some may need you to duplicate TS from
module.tx_yourext.*
into plugin.tx_yourext.*
due to the different context., (*15)
The following is a list of features, some of which are already implemented and some of which are planned for future versions of the RPC extension and complementary OSX/iOS client applications:, (*16)
General features, (*17)
Component types, (*18)
<input type="text" />
equivalent<input type="text" />
free typing and <select>
with preset values equivalents<input type="text" />
equivalent with popup date selection<input type="text" />
equivalent with value increment/decrement controls<textarea>
equivalent
<input type="checkbox" />
equivalent<input type="radio" />
equivalent<select>
equivalent
Payload features/support, (*19)
Request/Response features, (*20)
Nothing is perfect and that includes this package. I'm a beginner with Swift (these are in fact my first OSX and iOS applications without things like PhoneGap)., (*21)
The limitations are:, (*22)
The package manifest does not explicitly require TYPO3 as a dependency. You can in fact use the package without TYPO3 by installing it as a composer dependency and manually constructing an entry point (inside another framework if needed)., (*23)
To achieve this you will need:, (*24)
NamelessCoder\Rpc\Manager\TaskManagerInterface
registered with
NamelessCoder\Rpc\Manager\TaskManager::setInstance($instance);
before request is dispatched.NamelessCoder\Rpc\Manager\ClientManagerInterface
registered with
NamelessCoder\Rpc\Manager\ClientManager::setInstance($instance);
before request is dispatched.NamelessCoder\Rpc\RequestDispatcher
to call handleIncomingRequest
When used inside TYPO3 the package registers TYPO3-compatible implementations. When used outside you must manually register implementations that are compatible with whichever storage/framework you want to use the RPC with., (*25)
The included list
, help
and demo
tasks can be used anywhere - the commands
and command
implementations can
only be used with TYPO3 (but it is possible to create similar tasks for other frameworks' commands)., (*26)