Interface FormResource


@Path("form") public interface FormResource
Resource for forms
  • Method Details

    • list

      @GET FormListResponse list(@BeanParam com.gentics.contentnode.rest.resource.parameter.InFolderParameterBean inFolder, @BeanParam com.gentics.contentnode.rest.resource.parameter.FilterParameterBean filter, @BeanParam com.gentics.contentnode.rest.resource.parameter.SortParameterBean sorting, @BeanParam com.gentics.contentnode.rest.resource.parameter.PagingParameterBean paging, @BeanParam com.gentics.contentnode.rest.resource.parameter.WastebinParameterBean wastebin, @BeanParam com.gentics.contentnode.rest.resource.parameter.PublishableParameterBean publishable) throws Exception
      List forms.
      The result can be filtered by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      Parameters:
      inFolder - parameter bean
      filter - parameter bean
      sorting - parameter bean
      paging - parameter bean
      wastebin - parameter bean
      publishable - parameter bean
      Returns:
      response containing a list of forms
      Throws:
      Exception
    • create

      @POST FormResponse create(FormModel form) throws Exception
      Create a new form in the folder
      Parameters:
      form - form
      Returns:
      response containing the created form
      Throws:
      Exception
    • get

      @GET @Path("{id}") FormResponse get(@PathParam("id") String formId, @QueryParam("package") String stagingPackageName) throws Exception
      Load a form
      Parameters:
      formId - form ID
      stagingPackageName - name of a content staging package, to check the form status in the package
      Returns:
      response containing the form
      Throws:
      Exception
    • update

      @PUT @Path("{id}") FormResponse update(@PathParam("id") String formId, FormModel form) throws Exception
      Update a form
      Parameters:
      formId - form ID
      form - form data to update
      Returns:
      updated form
      Throws:
      Exception
    • delete

      @DELETE @Path("{id}") com.gentics.contentnode.rest.model.response.GenericResponse delete(@PathParam("id") String formId, @QueryParam("disableInstantDelete") Boolean disableInstantDelete) throws Exception
      Delete a form
      Parameters:
      formId - form ID
      disableInstantDelete - don't delete the item from the content repo immediately
      Returns:
      response
      Throws:
      Exception
    • publish

      @PUT @Path("{id}/online") FormResponse publish(@PathParam("id") String formId, @QueryParam("at") @DefaultValue("0") int at, @QueryParam("keepVersion") @DefaultValue("false") boolean keepVersion) throws Exception
      Publish a form
      Parameters:
      formId - form ID
      at - timestamp for scheduled publishing (0 for publishing immediately)
      keepVersion - true to keep the currently scheduled version (if "at" is not 0 and a form version is currently scheduled to be published)
      Returns:
      response containing the form
      Throws:
      Exception
    • takeOffline

      @DELETE @Path("{id}/online") FormResponse takeOffline(@PathParam("id") String formId, @QueryParam("at") @DefaultValue("0") int at) throws Exception
      Take a form offline
      Parameters:
      formId - form ID
      at - timestamp for scheduled taking offline (0 for taking offline immediately)
      Returns:
      response containing the form
      Throws:
      Exception
    • removePublishAt

      @DELETE @Path("{id}/publish/at") FormResponse removePublishAt(@PathParam("id") String formId) throws Exception
      Remove the time for scheduled publishing
      Parameters:
      formId - form ID
      Returns:
      response containing the form
      Throws:
      Exception
    • removeOfflineAt

      @DELETE @Path("{id}/offline/at") FormResponse removeOfflineAt(@PathParam("id") String formId) throws Exception
      Remove the time for scheduled taking offline
      Parameters:
      formId - form ID
      Returns:
      response containing the form
      Throws:
      Exception
    • lock

      @PUT @Path("{id}/lock") FormResponse lock(@PathParam("id") String formId) throws Exception
      Lock the form
      Parameters:
      formId - form ID
      Returns:
      response containing the locked form
      Throws:
      Exception
    • unlock

      @DELETE @Path("{id}/lock") FormResponse unlock(@PathParam("id") String formId) throws Exception
      Unlock the form
      Parameters:
      formId - form ID
      Returns:
      response containing the unlocked form
      Throws:
      Exception
    • listVersions

      @GET @Path("{id}/version") com.gentics.contentnode.rest.model.response.ItemVersionListResponse listVersions(@PathParam("id") String formId) throws Exception
      Get the versions of a form
      Parameters:
      formId - form ID
      Returns:
      response containing a list of versions
      Throws:
      Exception
    • getVersion

      @GET @Path("{id}/version/{version}") FormResponse getVersion(@PathParam("id") String formId, @PathParam("version") String version) throws Exception
      Load a version of a form
      Parameters:
      formId - form ID
      version - version number
      Returns:
      response containing the version number
      Throws:
      Exception
    • restoreVersion

      @POST @Path("{id}/version/{version}/restore") FormResponse restoreVersion(@PathParam("id") String formId, @PathParam("version") String version) throws Exception
      Restore a version of the form
      Parameters:
      formId - form ID
      version - version number
      Returns:
      response containing the restored form
      Throws:
      Exception
    • removeFromWastebin

      @DELETE @Path("wastebin/{id}") com.gentics.contentnode.rest.model.response.GenericResponse removeFromWastebin(@PathParam("id") String formId) throws Exception
      Remove a form from the wastebin
      Parameters:
      formId - form ID
      Returns:
      response
      Throws:
      Exception
    • restoreFromWastebin

      @POST @Path("wastebin/{id}/restore") FormResponse restoreFromWastebin(@PathParam("id") String formId) throws Exception
      Restore a form from the wastebin
      Parameters:
      formId - form ID
      Returns:
      response containing the restored form
      Throws:
      Exception
    • move

      @PUT @Path("{id}/folder/{folderId}") FormResponse move(@PathParam("id") String formId, @PathParam("folderId") String folderId) throws Exception
      Move the form to the given folder
      Parameters:
      formId - form ID
      folderId - target folder ID
      Returns:
      folder response
      Throws:
      Exception
    • preview

      @GET @Path("{id}/preview/{language}") @Produces("text/html") String preview(@PathParam("id") String formId, @PathParam("language") String language) throws Exception
      Render a preview of the form in the given language
      Parameters:
      formId - form ID
      language - language code
      Returns:
      rendered preview
      Throws:
      Exception
    • preview

      @POST @Path("{id}/preview/{language}") @Produces("text/html") String preview(@PathParam("id") String formId, @PathParam("language") String language, FormModel formModel) throws Exception
      Render a preview of the form in the given language
      Parameters:
      formId - form ID
      language - language code
      formModel - form model
      Returns:
      rendered preview
      Throws:
      Exception
    • listData

      @GET @Path("{id}/data") javax.ws.rs.core.Response listData(@PathParam("id") String formId, @BeanParam FilterFormDataParameterBean filter, @BeanParam com.gentics.contentnode.rest.resource.parameter.PagingParameterBean paging) throws Exception
      List data entries from Mesh, which have been submitted to the form
      Parameters:
      formId - form ID
      filter - parameter bean
      paging - parameter bean
      Returns:
      response
      Throws:
      Exception
    • getData

      @GET @Path("{id}/data/{dataId}") javax.ws.rs.core.Response getData(@PathParam("id") String formId, @PathParam("dataId") String dataId) throws Exception
      Load a single data entry from Mesh, which has been submitted to the form
      Parameters:
      formId - form ID
      Returns:
      response
      Throws:
      Exception
    • deleteData

      @DELETE @Path("{id}/data/{dataId}") javax.ws.rs.core.Response deleteData(@PathParam("id") String formId, @PathParam("dataId") String dataId) throws Exception
      Permanently delete a single data entry from Mesh, which has been submitted to the form
      Parameters:
      formId - form ID
      Returns:
      response
      Throws:
      Exception
    • downloadDataBinaryField

      @GET @Path("{id}/data/{dataId}/binary/{field}") @Produces("*/*") javax.ws.rs.core.Response downloadDataBinaryField(@PathParam("id") String formId, @PathParam("dataId") String dataId, @PathParam("field") String field) throws Exception
      Download the binary data for a single field in a data entry
      Parameters:
      formId - form ID
      dataId - data ID (uuid of the data node in Mesh)
      field - field name
      Returns:
      response
      Throws:
      Exception
    • exportData

      @GET @Path("{id}/export") javax.ws.rs.core.Response exportData(@PathParam("id") String formId, @BeanParam FormDataExportParameterBean exportFormat, @BeanParam FilterFormDataParameterBean filter) throws Exception
      Export data from Mesh, which has been submitted to the form

      Note that this endpoint will download the export immediately, and block for as long as it takes the Mesh plugin to create it. Use requestExport(String, FormDataExportParameterBean, FilterFormDataParameterBean) and downloadFile(String, String) for asynchronous downloads.

      Parameters:
      formId - form ID
      exportFormat - parameter bean
      filter - filter bean
      Returns:
      response
      Throws:
      Exception
    • exportStatus

      @GET @Path("{id}/export/status") javax.ws.rs.core.Response exportStatus(@PathParam("id") String formId, @BeanParam FormDataExportParameterBean exportFormat, @BeanParam FilterFormDataParameterBean filter) throws Exception
      Check available export downloads for the given form.

      The response will contain whether there are export downloads ready which match the given exportFormat and filter (field "downloadReady"), and if so the downloads UUID and creation timestamp (fields "downloadUuid" and "downloadTimestamp").

      When a download is currently being prepared, the field "downloadPending" will be true.

      Any errors will be in the field errors.

      Parameters:
      formId - The forms ID.
      Returns:
      The response from the Mesh forms plugin.
      Throws:
      Exception
    • requestExport

      @POST @Path("{id}/export") javax.ws.rs.core.Response requestExport(@PathParam("id") String formId, @BeanParam FormDataExportParameterBean exportFormat, @BeanParam FilterFormDataParameterBean filter) throws Exception
      Request an asynchronous export download for the given forms data.

      The response will contain the UUID of the generated download node. Whether the download is ready has to be checked via requests to exportStatus(String, FormDataExportParameterBean, FilterFormDataParameterBean).

      Parameters:
      formId - The forms ID.
      Returns:
      The response from the Mesh forms plugin.
      Throws:
      Exception
    • downloadDataBinaries

      @GET @Path("{id}/binaries") @Produces("application/zip") javax.ws.rs.core.Response downloadDataBinaries(@PathParam("id") String formId) throws Exception
      Download binary data from Mesh, which has been submitted to the form

      Note that this endpoint will download the binaries immediately, and block for as long as it takes the Mesh plugin to create it. Use requestDataBinaries(String) and downloadFile(String, String) for asynchronous downloads.

      Parameters:
      formId - form ID
      Returns:
      response
      Throws:
      Exception
    • dataBinariesStatus

      @GET @Path("{id}/binaries/status") javax.ws.rs.core.Response dataBinariesStatus(@PathParam("id") String formId) throws Exception
      Check available binary downloads for the given form.

      The response will contain whether there are binary downloads ready (field "downloadReady"), and if so the downloads UUID and creation timestamp (fields "downloadUuid" and "downloadTimestamp").

      When a download is currently being prepared, the field "downloadPending" will be true.

      Any errors will be in the field errors.

      Parameters:
      formId - The forms ID.
      Returns:
      The response from the Mesh forms plugin.
      Throws:
      Exception
    • requestDataBinaries

      @POST @Path("{id}/binaries") javax.ws.rs.core.Response requestDataBinaries(@PathParam("id") String formId) throws Exception
      Request an asynchronous binary download for the given forms data.

      The response will contain the UUID of the generated download node. Whether the download is ready has to be checked via requests to dataBinariesStatus(String).

      Parameters:
      formId - The forms ID.
      Returns:
      The response from the Mesh forms plugin.
      Throws:
      Exception
    • downloadFile

      @GET @Path("{id}/download/{downloadUuid}") javax.ws.rs.core.Response downloadFile(@PathParam("id") String formId, @PathParam("downloadUuid") String downloadUuid) throws Exception
      Download the requested binary archive.

      The downloadUuid must be a valid UUID returned the the requestDataBinaries(String) method.

      Parameters:
      formId - The forms ID.
      downloadUuid - The UUID of the download node.
      Returns:
      The response from the Mesh forms plugin.
      Throws:
      Exception
    • getTotalUsage

      @GET @Path("/usage/total") com.gentics.contentnode.rest.model.response.TotalUsageResponse getTotalUsage(@QueryParam("id") List<Integer> formId, @QueryParam("nodeId") Integer nodeId) throws Exception
      Get the total usage information of the given forms.
      Parameters:
      formId - list of form IDs
      nodeId - ID of the node
      Returns:
      Total usage response
      Throws:
      Exception
    • getPageUsageInfo

      @GET @Path("/usage/page") com.gentics.contentnode.rest.model.response.PageUsageListResponse getPageUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> formId, @QueryParam("nodeId") Integer nodeId, @QueryParam("pages") @DefaultValue("true") boolean returnPages, @BeanParam com.gentics.contentnode.rest.resource.parameter.PageModelParameterBean pageModel) throws Exception
      Get the pages using one of the given forms
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      formId - list of form IDs, for which the usage shall be fetched
      nodeId - ID of the node
      returnPages - true (default) if the pages shall be returned, false for only returning the counts
      pageModel - page model parameters
      Returns:
      list of pages using the given forms
      Throws:
      Exception
    • getTemplateUsageInfo

      @GET @Path("/usage/template") com.gentics.contentnode.rest.model.response.TemplateUsageListResponse getTemplateUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> formId, @QueryParam("nodeId") Integer nodeId, @QueryParam("templates") @DefaultValue("true") boolean returnTemplates) throws Exception
      Get the templates using one of the given forms
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      formId - list of form ids, for which the usage shall be fetched
      nodeId - id of the node
      returnTemplates - true (default) if the templates shall be returned, false for only returning the counts
      Returns:
      response
      Throws:
      Exception