Passing Prompt answers by REST in CMS 10.1
In previous versions of CMS there were two options to pass prompt parameters in REST. If the prompt answer was a single value, you could pass a value like p_COUNTRY=United States. You could also post an XML form of the prompt answers for more complicated prompting scenarios. However, forming the prompt XML was tedious for REST clients compared to using serialized objects in SOAP.
In 10.1 the simplified prompt format has been enhanced so that all types of prompt answers can be sent to the server.
The following forms are now accepted:
- Multiple Values: p_Country=Canada&p_Country=Argentina&p_Country=United States
- Range Values: p_OrderNum=1500:3500
- Bounded Range Values: p_OrderNum=<MIN>:3500 &p_InventoryCount=5000:<MAX>
- Null Values: p_ProductName=<NULL>
- Blank Values: p_SalesPerson=
- Dates: p_IntroductionDate=<![CDATA[2005-10-31-10:15:00Z]]>
The <![CDATA> modifier can be used to escape the “:” character and any special XML chars that appear in the prompt answer.
These simplified prompts answers can be used to run reports and can also be used to run through the new LDX prompt page API.
LDX prompt pages
In previous versions, the promptDescription resource gave CMS
developers access to an XML description of the prompt controls but
the context of the prompt page was unavailable. The prompt pages could be moved through on a forward only basis, and an XML document needed to be maintained between calls. The new reportPrompts
mechanism replaces this with a much simpler API that allows you to
move back and forth through the prompt pages and get a full LDX
output of the prompt page so that some of the vital context and
layout that isn't contained in the prompt control itself can be
presented to the user. However, 10.1 is completely backwards compatible with 8.4 and 8.4.1 applications, and the older promptDescription mechanism will continue to be supported.
Moving through the prompt pages is easy with the forward,back, reprompt, and finish operations. In the sample above, there is a single drop down prompt control that answers the report parameter cname. To move forward to the next page, simply append /forward?p_cname=Aegis%20Systems to the URL. If it's the final page, you'll be presented with all of the previously selected prompt answers that you can pass directly to the /reportData or /pagedReportData requests via the xmlData parameter.