To define a service for your portlet project, you must create a
file. The DTD (Document Type Declaration) file
specifies the format and requirements of the XML to use. You can create your
service.xml file manually, or you can use Liferay Dev Studio DXP. Dev Studio DXP helps you
service.xml file piece-by-piece, taking the guesswork out of
creating XML that adheres to the DTD.
If you created your project from the Blade or Dev Studio DXP template, you have
service.xml file in your
*-service module’s root folder with
entity element named Foo. Remove the entire
<entity name="Foo" ...> ... </entity> element: it’s just an example. It has no practical use for you.
If you don’t already have a
service.xml file, create one in your
module’s root folder and open the file. Liferay Dev Studio DXP provides a Diagram mode
and a Source mode to give you different perspectives of the service information
- Diagram mode facilitates creating and visualizing relationships between service entities.
- Source mode brings up the
service.xmlfile’s raw XML content in the editor.
You can switch between these modes.
Next, you’ll specify your service’s global information.