CRISP Dev Studio Application

Overview

Info: CRISP Dev Studio is available starting from version 14.1.0.

CRISP Dev Studio simplifies the process of testing and debugging backend API calls during development. Developers often spend significant time determining the correct REST API URIs, parameters, headers, and encoding. This process becomes more complex when each developer must configure security settings, such as OAuth2 client IDs and secrets, in their preferred REST API testing tools. While debugging tools can help adjust parameters, this approach is not efficient.

CRISP Dev Studio provides a web application module that you can download and run automatically in your local development environment. This web application includes a reverse proxy servlet that uses the same CRISP ResourceServiceBroker and existing ResourceResolver configurations. By invoking the reverse proxy servlet, you can retrieve data from backend systems without manually copying base URLs, headers, or other configuration details.

For example, after enabling the CRISP Dev Studio web application in the cargo.run profile, you can execute the following command to retrieve JSON output from the backend resource space "theforce" through the internal reverse proxy servlet. This servlet invokes the ResourceServiceBroker with the specified resource space name and passes through all inputs from the HTTP client, such as the HTTP method, headers, and parameters.

$ curl -i -H "Content-Type: application/json" http://localhost:8080/crispstudio/theforce/services/data/v39.0/sobjects/Account/LAPALOMA0CCGCGBBGBG

Because the reverse proxy servlet passes all client inputs to the ResourceServiceBroker, you do not need to configure complex settings such as OAuth2 client IDs or secrets for local testing.

Limitations

CRISP Dev Studio runs as a separate web application on your local Tomcat server and does not include specific CRISP API configurations. You can use this feature only when the CRISP API is installed as a shared module. For installation details, see Install CRISP Addon as Shared Module.

Configuration

To enable the CRISP Dev Studio web application in your local development environment, add the following configuration to the cargo.run profile in your root pom.xml:

<profile> <id>cargo.run</id> <!-- SNIP --> <dependencies> <dependency> <groupId>org.onehippo.cms7</groupId> <artifactId>hippo-addon-crisp-studio</artifactId> <version>${hippo.addon-crisp.version}</version> <type>war</type> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven3-plugin</artifactId> <configuration> <!-- SNIP --> <deployables> <!-- SNIP --> <deployable> <groupId>org.onehippo.cms7</groupId> <artifactId>hippo-addon-crisp-studio</artifactId> <type>war</type> <properties> <context>/crispstudio</context> </properties> </deployable> <!-- SNIP --> </deployables> <!-- SNIP --> </configuration> </plugin> </plugins> </build> </profile>

This configuration does the following:

  • Adds a dependency on the CRISP Dev Studio web application artifact (org.onehippo.cms7:hippo-addon-crisp-studio:war).
  • Registers the CRISP Dev Studio as a deployable web application with the context path /crispstudio in the <deployables> section. The artifact is downloaded automatically from the Maven repository.
  • When you run the project with the cargo.run profile, the /crispstudio web application becomes available on your local Tomcat server.

Warning: The CRISP Dev Studio web application is intended for use in local development environments (for example, when running with the cargo.run profile). Enabling it in a deployed online environment without proper access controls can introduce severe security risks.

Command Examples

The reverse proxy servlet in the CRISP Dev Studio web application resolves the resource space name immediately following the context path. It passes the full URI path, HTTP method, headers, and body (if present) to the backend APIs using ResourceServiceBroker and ExchangeHint. The servlet then returns the backend response to the HTTP client.

You can use any HTTP method supported by the backend, including PUT and DELETE, and you can provide any supported input types.

The following examples demonstrate how to interact with backend APIs through the CRISP Dev Studio web application.

GET Request Example

This command invokes the "theforce" resource space at the path /services/data/v39.0/sobjects/Account/0012o00002R3tekAAB using the HTTP GET method and the specified headers. The backend response is returned to the client.

$ curl -i -H "Content-Type: application/json" http://localhost:8080/crispstudio/theforce/services/data/v39.0/sobjects/Account/0012o00002R3tekAAB

HTTP/1.1 200 
...
Last-Modified: Tue, 03 Dec 2019 14:04:34 GMT
Date: Fri, 13 Dec 2019 01:57:04 GMT
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Vary: Accept-Encoding
Content-Type: application/json;charset=UTF-8
Content-Length: 2341

{"attributes":{"type":"Account","url":"/services/data/v39.0/sobjects/Account/LAPALOMA0CCGCGBBGBG"},
"Id":"LAPALOMA0CCGCGBBGBG","Name":"Sebastián Iradier", ... }}

POST Request Example

This command invokes the "theforce" resource space at the path /services/apexrest/ccrz/ccproduct/v8/find using the HTTP POST method, the specified headers, and a JSON request body. The backend response is returned to the client.

$ curl -i -d '{"LOCALE":"en_US","PRODUCTLIMIT":9,"INCLUDECOUNT":true,"SEARCHTERM":"server"}' \
  -H "Content-Type: application/json" \
  -X POST \
  http://localhost:8080/crispstudio/theforce/services/apexrest/ccrz/ccproduct/v8/find

HTTP/1.1 200 
...
Date: Tue, 03 Dec 2019 20:48:22 GMT
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: application/json
Transfer-Encoding: chunked

{"productPricingData":{"a1F2o00000MvaUcEAJ":{"basePrice":{"itemType":null,"price":29.99,"priceList":"a112o00000I9iT5AAJ","sfid":"a102o00000JIJ0NAAX"}, ... }}}}

Share Feedback
Page: /build/crisp-api/introduction-config/crisp-dev-studio-application
Section: Build
Category *