Platforms

JavaScript

PHP

  • Mesh PHP Example - This example shows how to use Gentics Mesh in combination with the Silex PHP routing framework.

Java

Vert.x Frontend Example

Clients

You can add the following maven dependency and repository to your project to get the Gentics Mesh client dependencies.

…
	<dependency>
		<artifactId>mesh-rest-client</artifactId>
		<groupId>com.gentics.mesh</groupId>
		<version>${mesh.version}</version>
	</dependency>
…
	<repositories>
		<repository>
			<id>maven.gentics.com</id>
			<name>Gentics Maven Repository</name>
			<url>https://maven.gentics.com/maven2</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>
…

REST Client

The REST client can be used to interact with all Gentics Mesh API Endpoints.

Usage:

MeshRestClient client = MeshRestClient.create("localhost", 8080, false);
client.setLogin("username", "password");
client.login().toCompletable().blockingAwait();

NodeListResponse nodes = client.findNodes("demo", new NodeParametersImpl().setLanguages("en")).blockingGet();
for (NodeResponse nodeResponse : nodes.getData()) {
	System.out.println(nodeResponse.getUuid());
	System.out.println(nodeResponse.getFields().getStringField("name").getString());
}

Monitoring Client

The monitoring client can be used to interact with the Monitoring Endpoints.

Usage:

MonitoringRestClient client = MonitoringRestClient.create("localhost", 8081);

client.status().toSingle().subscribe(status -> {
	System.out.println(status.getStatus());
}, System.err::println);