0.7.0-beta.9 • Published 2 years ago

path-framework v0.7.0-beta.9

Weekly downloads
5
License
LGPL-3.0
Repository
github
Last release
2 years ago

Path Framework

Path Framework is developed at Zurich University of Applied Sciences (ZHAW) and used in several projects. It is an application framework and rendering engine that renders your application based on a technology-independent GUI model stored in JSON format. Either mock data or any backend REST service (node, Java) may be used with Path Framework.

Path Architecture

Pros:

  • Technology independent GUI development, rendering engine may be replaced (iOS, Android, Web)
  • Extremely rapid application prototyping and development
  • GUI-based requirements engineering
  • Focus on business logic programming and GUI prototyping, not GUI programming

Live Example

Live example on Heroku Free (please wait for wakeup): https://path-example.herokuapp.com/ Source code: https://github.com/innovad/path-example

QuickStart

Run a Path example application with 4 steps:

  • Clone the Path example from https://github.com/innovad/path-example
  • Open console in project folder, run npm install (requires npm: https://www.npmjs.com/)
  • Run npm run start-dev and open web application in browser: http://localhost:8080
  • Play around with the sample GUI model in app/gui-model/guimodel.ts and reload browser window to view changes, e.g. use the following HelloWorld model which displays a single HelloWorld button showing HelloWorldForm.
{
    "application": {
        "title": "Path Demo",
        "formList": [
            {
                "id": "HelloWorldForm",
                "title": "HelloWorld",
                "formFieldList": [
                    {
                        "id": "name",
                        "type": "text",
                        "name": "Project",
                        "width": 2,
                        "required": true
                    },
                    {
                        "type": "deleteButton",
                        "name": "Delete"
                    },
                    {
                        "type": "cancelButton",
                        "name": "Cancel"
                    },
                    {
                        "type": "okButton",
                        "name": "Ok"
                    }
                ]
            },
        ],
        "pageList": [
            {
                "id": "mainmenu",
                "name": "MainMenu",
                "elementList": [
                    {
                        "type": "button",
                        "name": "HelloWorld",
                        "icon": "fa-fast-forward",
                        "color": "alizarin",
                        "form": {
                            "form": "HelloWorldForm"
                        }
                    }
                ]
            }
        ]
    }
}

GUI Model

A Path application consists of a page and form list:

{
    "application": {
        "title": "Path Example",
        "formList": [],
        "pageList": []
    }
}

Pages

A page consists of a list of page elements. Page elements may be either page buttons or lists.

{
    "id": "mainmenu",
    "name": "MainMenu",
    "elementList": [
    ]
}

Page Elements

Path displays one or more page elements on a single web page. Each element has several properties.

PropertyDescription
idThe page element id
typeThe page element type (e.g. button, list, ...)
newRowForce the layout manager to place the page element on a new row (false by default)
Page Buttons

Page buttons may either open another page, open a form or open an url. This example links to another page:

{
    "type": "button",
    "name": "Contacts",
    "icon": "fa-user",
    "color": "blue",
    "page": "contactspage"
}
Lists

A list is a dynamic set of buttons, either loaded from an url or from mock data. This example loads data from an url, and each button opens a form.

{
    "type": "list",
    "name": "TaskList",
    "icon": "fa-tasks",
    "color": "wisteria",
    "search": true,
    "url": "/task",
    "form": {
        "form": "TaskForm"
    }
}
Label

A label may contain text or HTML snippets. A label is always shown with full page width.

{
    "type": "pageLabel",
    "value": "Example <b>Text</b>"
}

Forms

Forms are usually opened from page buttons. A form contains a list of form fields.

{
    "id": "HobbyForm",
    "title": "Hobby",
    "url": "/hobby",
    "formFieldList": [
        {
            "id": "name",
            "type": "text",
            "name": "HobbyName",
            "width": 2,
            "required": true
        },
        {
            "type": "deleteButton",
            "name": "Delete"
        },
        {
            "type": "cancelButton",
            "name": "Cancel"
        },
        {
            "type": "okButton",
            "name": "Ok"
        }
    ]
}

Form fields

Form field models are objects. Fields are automatically arranged on the form with the Path layout manager based on the field properties.

PropertyDescription
idThe field id, used as JSON key when transferring data to/from the server
nameA translation key for the name of the field
typeThe field type (e.g. text, number, ...)
widthThe logical width, current 1 and 2 are supported
newRowForce the layout manager to place the field on a new row.
visibleVisibility of the field
labelVisibleVisibility of the field label
requiredMandatory field if true.
readonlyDisabled field if true.

The followings form fields can be used on a form:

Auto Complete

Autocomplete fields show a suggestion list when typing or pressing space key.

{
    "id":   "company",
    "type": "autocomplete",
    "name": "Company",
    "wordSearchEnabled": true,
    "defaultKey": "companyKey",
    "form": "CompanyForm",
    "url": "/company",
    "width": 2
}
Button

Ok, Cancel and Delete buttons are supported.

Checkbox

One or more checkboxes.

Date

Date fields show a date chooser.

{
    "id": "evtBirth",
    "type": "date",
    "name": "Birthday",
    "width": 2
}
Fieldlist

With Fieldlists you can create fields dynamically. The url should response with a list of field models. Any field (except Fieldlist itself) may be created dynamically.

{
    "type": "fieldList",
    "name": "Category",
    "width": 2,
    "url": "/category"
}
Label

Label fields.

Number

Support for numeric data. Minimum, maximum and digits can be configured.

{
    "id":   "level",
    "type": "number",
    "name": "Level",
    "width": 2,
    "min": 1,
    "max": 99999,
    "digits": 0,
    "required": true
}
Progress Bar

The value of the field is shown as progress.

Radio

One or more radio buttons.

Text

Single or multi-line text input fields.

{
    "id": "comment",
    "type": "text",
    "name": "Comments",
    "width": 2,
    "height": 4,
    "maxLength": 5000,
}
Translation

Like text fields, but with built-in support for translated text.

Path Framework Development

Read this chapter if you want to contribute to the Path Framework. If you only want to create applications using Path Framework, the following steps are not necessary.

  • Create a directory where you will put your development code
  • Clone the framework and the example application in two separate folders inside this directory:
git clone https://github.com/innovad/path.git
git clone https://github.com/innovad/path-example.git
  • Run npm install on both projects (path and path-example)
  • Unfortunately we cannot use npm link to create a local dependency from path-example to path since it is not supported by TypeScript/Angular. We use npm-link-copy to make path-example use our local path project:
npm install -g laggingreflex/npm-link-copy
  • Execute the following command in the path (framework) directory:
npm link
  • Now we can use path-framework in the path-example project. Using the -w option, it will watch for changes on the path-framework and update automatically. Execute the following command in the path-example directory:
npm-link-copy path-framework -w
  • Finally you can test your development cycle. First, change some code in the framework. Run 'npm run tsc' to compile it to TypeScript (may be done by your IDE). Now the browser (showing path-example) should automatically reload and show your changes.
0.7.0-beta.12

2 years ago

0.7.0-beta.13

2 years ago

0.7.0-beta.10

2 years ago

0.7.0-beta.11

2 years ago

0.7.0-beta.0

2 years ago

0.7.0-beta.1

2 years ago

0.7.0-beta.2

2 years ago

0.7.0-beta.3

2 years ago

0.7.0-beta.8

2 years ago

0.7.0-beta.9

2 years ago

0.7.0-beta.4

2 years ago

0.7.0-beta.5

2 years ago

0.7.0-beta.6

2 years ago

0.7.0-beta.7

2 years ago

0.6.2

4 years ago

0.6.2-beta.8

4 years ago

0.6.2-beta.7

4 years ago

0.6.2-beta.6

4 years ago

0.6.2-beta.5

4 years ago

0.6.2-beta.9

4 years ago

0.6.2-beta.4

4 years ago

0.6.2-beta.3

4 years ago

0.6.2-beta.2

4 years ago

0.6.2-beta.1

4 years ago

0.6.2-beta.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.6.0-beta.2

4 years ago

0.6.0-beta.1

4 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.4-beta.3

5 years ago

0.5.4-beta.2

5 years ago

0.5.4-beta.1

5 years ago

0.5.4-beta.0

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.19

6 years ago

0.3.18

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.23

6 years ago

0.2.22

6 years ago

0.2.21

6 years ago

0.2.20

6 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.1.0-beta.3

7 years ago

0.1.0-beta.2

7 years ago

0.1.0-beta.1

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago