For an introduction to Liferay’s Service Builder tool, please refer to the Writing a Data-Driven Application learning path. This learning path demonstrates how to create easy-to-maintain data-driven applications that use Service Builder to generate locally accessible services. Locally accessible services can be invoked by other Liferay applications running on the same Liferay instance as your application. To learn how to use Service Builder to generate remotely accessible services for your application, please refer to the Creating Web Services for Your Application learning path. Remotely accessible services can be invoked from any application that can access your Liferay instance (e.g., over the internet) and has permission to do so. If, for example, you want mobile application developers to be able to create clients that can interact with your application, you should generate remote services for your application. This section’s tutorials build on the basics covered in the learning paths. They provide more details on Service Builder’s features, the code it generates, and Liferay services.

What is Service Builder?

Service Builder is a model-driven code generation tool built by Liferay that allows developers to define custom object models called entities. Service Builder generates a service layer through...

Read More

Defining an Object-Relational Map with Service Builder

In this tutorial, you’ll learn how to define an object relational map for your application so that it can persist data. The example code in this tutorial, as well as the example code in the other...

Read More

Running Service Builder and Understanding the Generated Code

This tutorial explains how to run Service Builder and provides an overview of the code that Service Builder generates. If you’d like to use Service Builder in your application but haven’t yet...

Read More

Understanding ServiceContext

The ServiceContext class is a parameter class used for passing contextual information for a service. Using a parameter class lets you consolidate many different methods with different sets of...

Read More

Creating Local Services

The heart of your service is its *LocalServiceImpl class. This class is your entity’s local service extension point. Local services can be invoked within your application or by other Liferay...

Read More

Invoking Local Services

Once Service Builder has generated your portlet project’s services, you can call them from anywhere in your application. For example, you can invoke services from your application’s *Portlet...

Read More

Creating Remote Services

Many default Liferay services are available as web services. Liferay exposes its web services via JSON and SOAP web services. If you’re running Liferay locally on port 8080, visit the following URL...

Read More

Invoking Remote Services

You can invoke the remote services of any installed Liferay application the same way that you invoke your local services. Doing so could be described as “invoking remote services locally.” One...

Read More

Service Security Layers

Liferay’s remote services are secured by default. They sit behind a layer of security that allows only local connections. If you want to invoke Liferay services from a remote client, you must take...

Read More

Finding and Invoking Liferay Services

You can find Liferay’s services by searching for them in the Javadocs: http://docs.liferay.com/portal/6.2/javadocs/. Below, we’ll show you how to search for portal services and portlet services....

Read More

Registering JSON Web Services

Liferay’s developers use a tool called Service Builder to build services. When you build services with Service Builder, all remote-enabled services (i.e., service.xml entities with the property...

Read More

Invoking JSON Web Services

Liferay’s JSON web service API can be invoked in languages other than Java, such as Beanshell, Groovy, JavaScript, Python, and Ruby. It can also be invoked via URL or cURL. Additionally, Liferay...

Read More

JSON Web Services Invoker

Using JSON web services is easy: you send a request that defines a service method and parameters, and you receive the result as a JSON object. As easy as this technique is, it can be improved. In...

Read More

JSON Web Services Invocation Examples

This tutorial provides examples of invoking Liferay’s JSON web services via JavaScript, URL, and cURL. The same two examples (getting a user and adding a user) are used for each method of...

Read More

Portal Configuration of JSON Web Services

JSON web services are enabled on Liferay Portal by default. If you need to disable them, specify this portal property setting: json.web.service.enabled=false Next, let’s look at strict HTTP...

Read More

Invoking Services Using Skinny JSON Provider

Important: The Skinny JSON Provider is a “Labs” application. Any app designated as “Labs” includes experimental features and is not supported by Liferay. This status may change without notice. Labs...

Read More

SOAP Web Services

You can access Liferay’s services via Simple Object Access Protocol (SOAP) over HTTP. The packaging protocol is SOAP and the transport protocol is HTTP. Note: An authentication related token must...

Read More

Authorizing Access to Services with OAuth

Suppose you wanted users to authenticate to your Liferay Portal plugin from a provider, like Twitter. You might think that you’d need to store the user’s credentials (e.g., the user’s Twitter...

Read More

Customizing Model Entities With Model Hints

If you’ve already used Service Builder to define your model entities and have implemented business logic for creating and modifying those entities, you might have some ideas for helping users to...

Read More

Developing Custom SQL Queries

Service Builder’s finder methods facilitate searching for entities by their attributes–their column values. Add the column as a parameter for the finder in your service.xml file, run Service...

Read More

Leveraging Hibernate’s Criteria API

Liferay allows you to use custom SQL queries to retrieve data from the database. Sometimes, however, it’s more convenient to build queries dynamically at runtime than it is to invoke predefined SQL...

Read More

Configuring service.properties

Service Builder generates a service.properties file in your project’s docroot/WEB-INF/src folder. Liferay Portal uses the properties in this file to alter your service’s database schema and load...

Read More
0 (0 Votes)
Building Liferay Faces From Source Previous