• No results found

5 Working with the OData Model Editor

5.7 Service Catalog

The Service Catalog feature allows you to view the metadata of an OData service in the SAP NetWeaver Gateway landscape, inside the OData Model Editor. You can browse and discover the OData services that are available in the SAP NetWeaver Gateway system.

You define the connection settings to an SAP NetWeaver Gateway so that you can browse through the system for the OData services and acquaint yourself with their capabilities.

Note

At least one connection to an SAP NetWeaver Gateway system should be configured to view underlying service.

Related Links

Viewing the Service Catalog [page 67]

On adding a connection, you can now view the services available in the connected system using the Service Catalog.The metadata of the service will be converted to OData service and will be displayed in the graphical editor.

Connection Settings: Service Catalog [page 65]

Explains how to configure the connection to the SAP NetWeaver Gateway system to view the Service Catalog.

5.7.1 Connection Settings: Service Catalog

Explains how to configure the connection to the SAP NetWeaver Gateway system to view the Service Catalog.

To create a connection to a SAP NetWeaver Gateway system proceed as follows:

1. In the Eclipse, choose Window and then Preferences.

The Preferences window appears.

2. Expand SAP NetWeaver Gateway and choose Connections.

3. Click Add to add a connection.

The Create SAP NetWeaver Gateway Connection window appears.

4. Complete the authentication to add the system.

Related Links

Viewing the Service Catalog [page 67]

On adding a connection, you can now view the services available in the connected system using the Service Catalog.The metadata of the service will be converted to OData service and will be displayed in the graphical editor.

5.7.2 Opening the Service Catalog

After configuring the connection settings to a host, such as, a specific SAP NetWeaver Gateway server, you can open the Service Catalog to explore the the OData services in the connected host.

To open the Service Catalog:

1. From the Eclipse menu, select Window > Show View > Others > SAP NetWeaver Gateway .

2. Select Service Catalog, and choose OK. The Service Catalog View displays.

5.7.3 Viewing the Service Catalog

On adding a connection, you can now view the services available in the connected system using the Service Catalog.The metadata of the service will be converted to OData service and will be displayed in the graphical editor.

Atleast one connection to a SAP NetWeaver Gateway system should be configured to view underlying service. See Connection Settings: Service Catalog [page 65] section to create a connection to the SAP NetWeaver Gateway system.

To view the service in the graphical editor proceed as follows:

1. Choose Window Show View in the Eclipse screen.

The Show View window appears.

2. Expand SAP NetWeaver Gateway folder and double click on Service Catalog.

The Service Catalog menu is now available in the Properties View, and the available connection(s) are displayed in the Service Catalog tab view.

3. Expand a connection to view the services under it.

4. Either double click on a service or right click and select Open to open the service in the graphical editor.

Note

Any services that contain errors are indicated by a red cross sign and will not be displayed in the graphical editor.

The selected service opens in the OData Model Editor in the read only mode.

Actions

The following actions can be performed in the graphical editor:

1. You can move the objects in the graphical editor.

2. You can expand and collapse the sections in the objects.

You cannot save the changes after the above actions.

Related Links

Connection Settings: Service Catalog [page 65]

Explains how to configure the connection to the SAP NetWeaver Gateway system to view the Service Catalog.

5.7.4 Browsing an OData Service

The Service Catalog view allows you to view and browse all the OData services that are available in each connected host, in a tree form.

To view and browse the services in an SAP NetWeaver Gateway system:

1. Choose the SAP NetWeaver Gateway system to expand it and to view the list of OData services in the selected system.

Note

Services that are not properly formed are marked with a red cross icon. The services are sorted in alphabetical order.

Alternatively, if you know a part of the name or the description of the service you want, you can search for it the search box containing, type filter text.

2. Expand a service to view its details, such as, the entity containers, entities, associations, function imports, for example.

The following is a description of the entity icons within a service. The entity and its icon is availabe in a service depending on the presence of the entity in the service.

Entity Icon Description

collection image Denotes a collection entry in the selected service.

navigation property image Represents a navigation property entry.

association image Represents an association entry.

Schema image Represents schema for a service in the selected SAP

NetWeaver Gateway system.

Entity Icon Description

well formed service image Represents a properly formed OData service in the selected SAP NetWeaver Gateway system.

malformed service image Represents a malformed OData service in the selected SAP NetWeaver Gateway system.

key property image Indicates a property entry as a key entry in the selected service.

property image Represents a property entry in the service.

3. Right-click a service to:

Command Description

Open Select this option to open a read-only view of the modeled service, graphically or its XML based file, in the OData Model Editor.

Alternatively, double click the service to view its modeled entities in the OData Model Editor.

Refresh Select this option to restore the connection to the selected SAP NetWeaver Gateway, or to get the updated metedata of the selected service.

Generate Service Proxy Select this option to generate a proxy for the selected service in order to use it with your custom application in the environment supported by a toolkit.

Generate Starter Application

Select this option to generate a starter application for the selected service in an environment supported by a toolkit.

Import OData Model Select this option to create a new model based on the selected service.

5.7.5 Generating a Service Proxy

You can quickly generate a service proxy for use with your custom application based on the selected OData service in the Service Catalog view.

To do so, proceed as follows:

1. Open the Service Catalog, and locate the service you want.

2. Right click the service, and choose Generate Service Proxy. The Service Proxy Generation wizard opens.

If the service is not well formed, you cannot perform this step.

Note

There is no context menu for the entries under the selected service.

3. Click Browse to select the project in which to generate the proxy.

4. From Create proxy for, select the target extension or toolkit for which you want to create the proxy, and specify the package name.

5. Choose Next. The Location of OData Service page opens.

The URL of the selected service is displays in Service URL, and the Service Details pane displays only the selected service and its entities.

6. Click Finish, to generate the proxy. If you choose Next, the SAP NetWeaver Gateway host and the URL of the selected service are provided.

5.7.6 Generating a Starter Application

You can quickly generate code for a starter application using the selected OData service in the Service Catalog view.

To do so, proceed as follows:

1. Open the Service Catalog, and browse to locate the service you want.

2. Right click the service, and choose Generate Starter Application. The Starter Application wizard opens.

Note

If the service is not well formed, you cannot perform this step.

5.7.7 Importing an OData Model from Service Catalog

You can import an OData model for further editing to suit your needs. There are two ways to import an OData model into the OData Model Editor; directly using the Eclipse main menu, or by choosing the Import OData Model command from the submenu of a selected service in the Service Catalog.

To do so:

1. Open the Service Catalog, and locate the service you want.

2. Right-click the service, and choose Import OData Model. If the service is not well formed, you cannot perform this step. The Create New OData Model wizard opens.

3. Click Browse to select the project in which to create the model.

4. In Model name, enter a name for the new OData model. The Initial OData model content pane displays only the selected service and its entities.

5. Click Finish, to create the OData model.