2017 © Pedro PelĂĄez
 

library auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

image

label305/auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  • Monday, October 31, 2016
  • by tscheepers
  • Repository
  • 7 Watchers
  • 6 Stars
  • 3,349 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 22 Versions
  • 0 % Grown

The README.md

Auja PHP Development Kit

Deprecated, (*1)

This repo will no longer be maintained and will be deleted in the start of 2017., (*2)

About, (*3)

Build Status Coverage Status Dependency Status Latest Stable Version Total Downloads Latest Unstable Version, (*4)

Auja is an easy-to-use, easy-to-implement admin interface. It provides an easy and intuitive way for you to view and manipulate your data, so you can focus on more important matters. Auja is designed to be both user-friendly and developer-friendly by providing you with tools to setup your admin interface in a couple of minutes., (*5)

The Auja javascript frontend provides the graphical user interface. To determine its content, it relies on a JSON web-service you implement. This repository in turn, provides an Object Oriented approach to provide these JSON messages from a PHP application., (*6)

  • Auja - The frontend JavaScript GUI
  • Auja for Laravel - An implementation of Auja for the Laravel framework

Setup

Auja-PHP is available on Packagist. Add Auja-PHP to your dependencies by running, (*7)

composer require label305/auja:v3.0.0-alpha5

Usage

Auja uses three main types:, (*8)

Each of these classes have implemented the __toString() method which returns valid JSON, accepted by the Auja JavaScript implementation. , (*9)

Main

The Label305\Auja\Main\Main class is used to define the main view of Auja. The following example will tell Auja to create a logout button, and add a single model item. It also adds an authentication form:, (*10)

$main = new Main();

$main->setTitle('My Application');
$main->setColor(Main::COLOR_MAIN, '#22bcb9');

/* Add a logout button. */
$logoutButton = new Button();
$logoutButton
  ->setTitle($logoutButton)
  ->setTarget('#logout');
$main->addButton($logoutButton);

/* Add a model. */
$item = new Item();
$item
    ->setTitle('Club')
    ->setIcon('tower')
    ->setTarget('/clubs/menu');
$menu->addMenuItem($item);

/* Add an authentication form. */
$authenticationForm = new Form();
$authenticationForm
    ->setAction('#login')
    ->setMethod('POST');

    /* Add a username text field. */
    $usernameTextFormItem = new TextFormItem();
    $usernameTextFormItem
        ->setName('username')
        ->setLabel('Username');
    $authenticationForm->addFormItem($usernameTextFormItem);

    /* Add a password field. */
    $passwordFormItem = new PasswordFormItem();
    $passwordFormItem
        ->setName('password')
        ->setLabel('Password');
    $result->addFormItem($passwordFormItem);

    /* Add a submit button. */
    $submitFormItem = new SubmitFormItem();
    $submitFormItem->setText('Login');
    $result->addFormItem($submitFormItem);

$main->setAuthenticationForm($authenticationForm);

return $main;

, (*11)

The Label305\Auja\Menu\Menu class is used to define the menus in Auja. The following example creates a menu for the Club model:, (*12)

$menu = new Menu();

/* Add a link item to add a club. */
$addMenuItem = new LinkMenuItem();
$addMenuItem
    ->setName('Add')
    ->setTarget('/clubs/create');
$menu->addMenuItem($addMenuItem);

/* Add a spacer. */
$spacerMenuItem = new SpacerMenuItem();
$spacerMenuItem->setName('Clubs');
$menu->addMenuItem($spacerMenuItem);

/* Add a placeholder for showing a list of clubs. */
$resourceMenuItem = new ResourceMenuItem();
$resourceMenuItem->setTarget('/clubs');
$menu->addMenuItem($resourceMenuItem);

return $menu;

As you can see, three MenuItem types are used:, (*13)

  • LinkMenuItem - represents a simple link to another menu or page;
  • SpacerMenuItem - represents a simple text label;
  • ResourceMenuItem - represents a collection of resources.

The ResourceMenuItem is a placeholder for the actual items to show. When its target url is called, Auja expects a Label305\Auja\Menu\Resource object, containing a list of entries:, (*14)

$resource = new Resource();

/* Add Manchester United to the list. */
$item = new LinkMenuItem();
$item
    ->setName('Manchester United')
    ->setTarget('/clubs/1');
$resource->addItem($item);

/* Add FC Bayern Munchen to the list. */
$item = new LinkMenuItem();
$item
    ->setName('FC Bayern MĂŒnchen')
    ->setTarget('/clubs/2');
$resource->addItem($item);

/* Provide a url to the next page of clubs. */
$resource->setNextPageUrl('/clubs?page=2');

return $resource;

, (*15)

Page

A page, defined by Label305\Auja\Page\Page, represents a panel to view and modify a single entry. The following example creates an edit page for the Club model:, (*16)

/* Retrieve the Club instance. */
$club = ...;

$page = new Page();

/* Add a header with a delete button. */
$pageHeader = new PageHeader();
$pageHeader->setText('Edit Club');

$deleteButton = new Button();
$deleteButton
    ->setText('Delete')
    ->setConfirmationMessage('Are you sure?')
    ->setTarget('/clubs/1')
    ->setMethod('DELETE');
$pageHeader->addButton($deleteButton);

$page->addPageComponent($pageHeader);

/* Add the form. */
$form = new Form();
$form
    ->setAction('/clubs/1')
    ->setMethod('PUT');

    /* Add a name text field.  */
    $nameFormItem = new TextFormItem();
    $nameFormItem
        ->setName('name')
        ->setLabel('Name')
        ->setValue($club->getName());
    $form->addFormItem($nameFormItem);

    /* Add a submit button. */
    $submitFormItem = new SubmitFormItem();
    $submitFormItem->setText('Submit');
    $form->addFormItem($submitFormItem);

$form->addPageComponent($form);

return $page;

Developing

To start developing for Auja-PHP, do the following: - Clone the project; - Run composer install., (*17)

To run PhpSpec, execute bin/phpspec run.
If you want to run code coverage locally, you need to execute the following: - composer require henrikbjorn/phpspec-code-coverage:~0.2 satooshi/php-coveralls:~0.6 - printf "\nextensions:\n - PhpSpec\\\\Extension\CodeCoverageExtension" >> phpspec.yml, (*18)

Do not commit these changes!, (*19)

License

Copyright 2014 Label305 B.V., (*20)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at, (*21)

http://www.apache.org/licenses/LICENSE-2.0, (*22)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License., (*23)

The Versions

31/10 2016

dev-master

9999999-dev http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

20/11 2015

v3.0.0-alpha19

3.0.0.0-alpha19 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

20/11 2015

v3.0.0-alpha18

3.0.0.0-alpha18 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

20/11 2015

v3.0.0-alpha17

3.0.0.0-alpha17 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

21/05 2015

v3.0.0-alpha16

3.0.0.0-alpha16 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

09/04 2015

v3.0.0-alpha15

3.0.0.0-alpha15 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

25/02 2015

v3.0.0-alpha14

3.0.0.0-alpha14 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

25/02 2015

dev-feature_external_link

dev-feature_external_link http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

21/02 2015

v3.0.0-alpha13

3.0.0.0-alpha13 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

21/02 2015

v3.0.0-alpha12

3.0.0.0-alpha12 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

05/02 2015

v3.0.0-alpha11

3.0.0.0-alpha11 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

04/02 2015

v3.0.0-alpha10

3.0.0.0-alpha10 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

04/02 2015

v3.0.0-alpha9

3.0.0.0-alpha9 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

16/12 2014

v3.0.0-alpha8

3.0.0.0-alpha8 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

16/12 2014

v3.0.0-alpha7

3.0.0.0-alpha7 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

15/12 2014

v3.0.0-alpha6

3.0.0.0-alpha6 http://label305.github.io/Auja

A web service development kit for communicating with the Auja javascript frontend. Auja is an easy-to-use, easy-to-implement admin interface for managing your data.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

php admin auja

07/11 2014

v3.0.0-alpha5

3.0.0.0-alpha5 http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end

07/11 2014

dev-dev

dev-dev http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end

03/11 2014

v3.0.0-alpha4

3.0.0.0-alpha4 http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end

31/10 2014

v3.0.0-alpha3

3.0.0.0-alpha3 http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end

30/10 2014

v3.0.0-alpha2

3.0.0.0-alpha2 http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end

20/10 2014

v3.0.0-alpha1

3.0.0.0-alpha1 http://www.label305.com

A PHP library for Auja - A back end interface for end users and developers

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Niek Haarman

auja back end