All Projects → JsonSchema-JavaUI → sf-java-ui

JsonSchema-JavaUI / sf-java-ui

Licence: MIT license
Json Schema Form java based library allow developers to define schema and form using field annotations

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to sf-java-ui

angular-schema-form-bootstrap
Bootstrap decorator for Angular Schema Form
Stars: ✭ 50 (+117.39%)
Mutual labels:  json-schema, angular-schema-form, json-schema-form
Angular Schema Form
Generate forms from a JSON schema, with AngularJS!
Stars: ✭ 2,456 (+10578.26%)
Mutual labels:  json-schema, angular-schema-form, json-schema-form
Newtonsoft.json.schema
Json.NET Schema is a powerful, complete and easy to use JSON Schema framework for .NET
Stars: ✭ 167 (+626.09%)
Mutual labels:  schema, json-schema
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+1000%)
Mutual labels:  schema, json-schema
Movement
Movement is an easier, simpler way to explore and use NIEM. Want to join the Movement and contribute to it? Start here.
Stars: ✭ 19 (-17.39%)
Mutual labels:  angularjs, json-schema
Autocomplete Json
Atom autocomplete for JSON files
Stars: ✭ 60 (+160.87%)
Mutual labels:  schema, json-schema
Schema Registry
Confluent Schema Registry for Kafka
Stars: ✭ 1,647 (+7060.87%)
Mutual labels:  schema, json-schema
Invenio
Invenio digital library framework
Stars: ✭ 469 (+1939.13%)
Mutual labels:  angularjs, json-schema
Json Schema To Ts
Infer TS types from JSON schemas 📝
Stars: ✭ 261 (+1034.78%)
Mutual labels:  schema, json-schema
magnet
A JSON/BSON schema generator
Stars: ✭ 16 (-30.43%)
Mutual labels:  schema, json-schema
joyce
Joyce is a highly scalable event-driven Cloud Native Data Hub.
Stars: ✭ 37 (+60.87%)
Mutual labels:  schema, json-schema
Schm
Composable schemas for JavaScript and Node.js
Stars: ✭ 498 (+2065.22%)
Mutual labels:  schema, json-schema
Plank
A tool for generating immutable model objects
Stars: ✭ 449 (+1852.17%)
Mutual labels:  schema, json-schema
Typedload
Python library to load dynamically typed data into statically typed data structures
Stars: ✭ 120 (+421.74%)
Mutual labels:  schema, json-schema
Vue Json Ui Editor
Edit JSON in UI form with JSON Schema and Vue.js
Stars: ✭ 392 (+1604.35%)
Mutual labels:  schema, json-schema
schema.tl
📜 Easy-to-use TL-Schema viewer
Stars: ✭ 55 (+139.13%)
Mutual labels:  angularjs, schema
typescript-to-json-schema
Generate JSON schema from your Typescript sources
Stars: ✭ 54 (+134.78%)
Mutual labels:  schema, json-schema
fform
Flexibile and extendable form builder with constructor
Stars: ✭ 26 (+13.04%)
Mutual labels:  schema, json-schema
Jsonschema
An implementation of the JSON Schema specification for Python
Stars: ✭ 3,474 (+15004.35%)
Mutual labels:  schema, json-schema
another-json-schema
Another JSON Schema validator, simple & flexible & intuitive.
Stars: ✭ 48 (+108.7%)
Mutual labels:  schema, json-schema

SF JAVA UI

Schema Form Java based library allow developers to define schema and form using field annotations.

Join the chat at https://gitter.im/JsonSchema-JavaUI/sf-java-ui Build Status Quality Gate Technical debt ratio Coverage Status Download PR Stats Issue Stats

The SF Java UI library is a server side extension for the Json Schema Form library. It make your development easier, you will not care about how to define your schema and your screen form definition. Just annotate your fields, and get your screen.

If you use SF Java UI in your project/company please let us know.

Documentation

You can find all documentation here, it covers all the different field types and their options.

Run the Demo

The attached demo application is a Spring Boot + Angular web application. To run the app please go to the demo directory and run the commands below:

bower install

This will install the basic web dependencies.

mvn spring-boot:run

This will run the application

Quick start

Using SF Java UI is simple. Follow the steps below to get your first screen.

Backend

First, add the SF Java UI library to your java web project:

<dependency>
  <groupId>io.sfjava.ui</groupId>
  <artifactId>sf-java-ui</artifactId>
  <version>RELEASE</version>
</dependency>

Add the oss repository:

The official version Not yet deployed to sonatype.

Please find the required instruction to configure bintray.com repository to your setting.xml

Or you can configure the repository directly in your pom.xml file:

// Your pom file
<dependencies>...</dependencies>

// To be added in the pom file in order to specify the remote repo to download the library 
<repositories>
   <repository>
        <snapshots>
           <enabled>false</enabled>
        </snapshots>
	<id>bintray-jsonschema-javaui-sf-java-ui</id>
	<name>bintray-plugins</name>
	<url>https://dl.bintray.com/jsonschema-javaui/sf-java-ui</url>
    </repository>
</repositories>

Using spring boot

If you a are using spring boot to develop your project, you can add the annotation below to your main spring boot class in order to run the servlet context loader to inialize the library

@ServletComponentScan(basePackages = { "io.asfjava.ui.core" })

You can follow the example below used in the demo application

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

@SpringBootApplication
/*
 * The annotation below used to scan the servlet context loader added to the sf-java-ui library
 * in order to initialize the library @ server startup
 * 
 * */
@ServletComponentScan(basePackages = { "io.asfjava.ui.core" })
public class DemoApplication {
	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}
}

Using other java web project

You may add this line of code on your custom server startup listener.

SFJavaUi.initialize();

Let's code

Create a new Rest Web Service. (example using spring)

import com.fasterxml.jackson.databind.JsonMappingException;

import io.asfjava.ui.core.schema.UiFormSchemaGenerator;
import io.asfjava.ui.dto.UiForm;

/**
 * REST controller for managing Ui.
 * The rest controller handle the JsonSchemaForm request. It call the SF JAVA UI library to 
 * generate the json schema and the form definition
 */
@RestController
@RequestMapping("/api")
public class DemoRestService {

	public DemoRestService() {
	}

	@RequestMapping("/ui")
	public UiForm renderUI() throws JsonMappingException {
		return UiFormSchemaGenerator.get().generate(DemoForm.class);
	}
}

Then create the DemoForm class:

import java.io.Serializable;

import io.asfjava.ui.core.form.ComboBox;
import io.asfjava.ui.core.form.TextArea;
import io.asfjava.ui.core.form.TextField;

/**
 * Pojo represent the view to display. It must implement java.io.Serializable.
 * We are using SF JAVA UI Annotations to define the different fields layout
 */
public class DemoForm implements Serializable {

	@TextField(title = "First Name", placeHolder = "Your first name", description="This is a description for your first name field")
	private String firstName;

	@TextField(title = "Last Name", placeHolder = "Your last name")
	private String lastName;

	@ComboBox(title = "Gender", values = { "Male", "Female" })
	private String gender;

	@TextArea(title = "Address", placeHolder = "Fill your address please", description = "This is a textarea")
	private String address;

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getGender() {
		return gender;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}

Front

First, add to your java web project the required client side library in order to use json schema form. After, inject the json schema form into your html page and add your Js controller to call the backend.

For the example below we will use Angular schema form. You can follow the official documentation.

Put the code below into your view.html:

<div ng-controller="FormController">
    <form sf-schema="schema" sf-form="form" sf-model="model"></form>
</div>

Add the angular controller below:

angular.module('MyModule', ["schemaForm"]).controller('FormController', function($scope,$http) {
  $http.get('/api/ui').then(successCallback, errorCallback);
  function successCallback(response){
    $scope.schema = response.data.schema;
    $scope.form = response.data.form;
    $scope.model = {};
  }
  function errorCallback(error){
    //error code
  }
});

Run your app and go to your screen. Enjoy :)

Reporting Issue

SF Java UI uses GitHub’s integrated issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:

  • Before you log a bug, please search the issue tracker to see if someone has already reported the problem.

  • If the issue doesn’t already exist, create a new issue.

  • Please provide as much information as possible with the issue report, we like to know the version of SF Java UI that you are using and the Json Schema Form version as well as your Operating System and JVM version.

  • If you need to paste code, or include a stack trace use Markdown ``` escapes before and after your text.

Contributing

Contributions are welcome! Please see Contributing.md for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].