ACSCE-5X practice question 11 of 15

A custom web script is called via the URL /example/test/helloworld.html, relative to the RESTful API base URL. What value must be declared in the script’s descriptor to configure this?

Full set: 87 questions
Answer options
A: helloworld
B: /example/test/helloworld Correct answer
C: /example/test/helloworld.html
D: /example
Correct Answer:
B. /example/test/helloworld
Explanation

In the Alfresco Web Script Framework, the element within the descriptor file (.desc.xml) defines the URI path that the web script binds to. The format of the response (e.g., HTML, JSON) is specified by a file extension in the request URL (like .html) or an Accept header. The framework automatically parses this format specifier to select the appropriate response template (e.g., .get.html.ftl). Therefore, the format specifier itself should not be included in the declaration. For the request URL /example/test/helloworld.html, the correct path to declare is /example/test/helloworld.

Why Incorrect

A. helloworld: This is an incomplete path. It would only match a URL like /helloworld.html, not the nested path provided in the question.
C. /example/test/helloworld.html: This is incorrect because the format specifier (.html) must not be included in the element of the descriptor file.
D. /example: This is an incomplete path. It would match a URL like /example.html but not the full path /example/test/helloworld.html.

References

1. Alfresco Content Services 5.2 Documentation, "Web script description file": This official documentation describes the components of the web script descriptor file. It explains that the element is a "URI template that the Web Script is bound to." The examples provided, such as /folder/{folderpath}, consistently show URL paths without format extensions.

Source: Alfresco Content Services 5.2 Documentation, "Developing > API > Web Scripts > Web script description file".

2. Alfresco Content Services 5.2 Documentation, "How a URI is dispatched to a Web Script": This section details how the framework matches an incoming URI to a web script. It explicitly states, "The Web Script Framework first finds the best Web Script to handle the request by matching the request URI against all registered Web Script URIs." It later explains that the format is determined from the request to select the correct response template, separating the URI path matching from format selection.

Source: Alfresco Content Services 5.2 Documentation, "Developing > API > Web Scripts > Web Script Framework".

Scroll to Top