I want to get the Form Model JSON Codes finally by REST, to show rendered HTML forms on my external web app.
Then I am trying to get a Form Model by FormDefinition(as described here), but I think this also must be corrected as you’ve shown. So, it should look like the following:
/form-repository/forms/{formDefinitionId}/model
Actually, Form Definition resource locator had been already specified in the response data as bellow.
I can imagine it’s a bit confusing. But the only the form definitions collection resource had the wrong mapping.
The other ones; like the form model by form definition; are as described in the docs.
Did you try that?
public static final String SEGMENT_FORMS_RESOURCES = "forms";
....
/**
* URL template for a form collection: <i>/form-repository/forms/{0:formId}</i>
*/
public static final String[] URL_FORM_COLLECTION = { SEGMENT_REPOSITORY_RESOURCES, SEGMENT_FORMS_RESOURCES };
/**
* URL template for a single form: <i>/form-repository/forms/{0:formId}</i>
*/
public static final String[] URL_FORM = { SEGMENT_REPOSITORY_RESOURCES, SEGMENT_FORMS_RESOURCES, "{0}" };
/**
* URL template for a single form model: <i>/form-repository/forms/{0:formId}/model</i>
*/
public static final String[] URL_FORM_MODEL = { SEGMENT_REPOSITORY_RESOURCES, SEGMENT_FORM_RESOURCES, "{0}", SEGMENT_FORM_MODEL };
/**
* URL template for the resource of a single form: <i>/form-repository/forms/{0:formId}/resourcedata</i>
*/
public static final String[] URL_FORM_RESOURCE_CONTENT = { SEGMENT_REPOSITORY_RESOURCES, SEGMENT_FORM_RESOURCES, "{0}", SEGMENT_DEPLOYMENT_ARTIFACT_RESOURCE_CONTENT };
I think plobably that SEGMENT_FORMS_RESOURCES should be set “form-definitions” instead of “forms”.
(Also the [i tag] in the comment of these methods.)