Class Api1

java.lang.Object
com.erudika.para.server.rest.Api1

@RestController @ConditionalOnProperty(value="para.api_enabled", havingValue="true") @RequestMapping(value="/v1", produces="application/json") public final class Api1 extends Object
This is the main REST API configuration class which defines all endpoints for all resources and the way API request will be handled. This is API version 1.0.
Author:
Alex Bogdanovski [[email protected]]
  • Constructor Summary

    Constructors
    Constructor
    Description
    No-args constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<?>
    addConstraint(String type, String field, String cname, jakarta.servlet.http.HttpServletRequest req)
    Adds a validation constraint.
    org.springframework.http.ResponseEntity<?>
    addConstraintHandler(com.erudika.para.core.App app, String type, String field, String cname, jakarta.servlet.http.HttpServletRequest req)
    Handles the addition of a validation constraint.
    org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody>
    Exports the app data as a ZIP file.
    org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody>
    backupHandler(com.erudika.para.core.App app)
    Handles the backup request.
    org.springframework.http.ResponseEntity<?>
    batchCreate(jakarta.servlet.http.HttpServletRequest req)
    Batch creates objects.
    org.springframework.http.ResponseEntity<?>
    batchCreateHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles batch creation of objects.
    org.springframework.http.ResponseEntity<?>
    batchDelete(jakarta.servlet.http.HttpServletRequest req)
    Batch deletes objects.
    org.springframework.http.ResponseEntity<?>
    batchDeleteHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles batch deletion of objects.
    org.springframework.http.ResponseEntity<?>
    batchPut(jakarta.servlet.http.HttpServletRequest req)
    Batch creates or overwrites objects.
    org.springframework.http.ResponseEntity<?>
    batchRead(jakarta.servlet.http.HttpServletRequest req)
    Batch reads objects.
    org.springframework.http.ResponseEntity<?>
    batchReadHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles batch reading of objects.
    org.springframework.http.ResponseEntity<?>
    batchUpdate(jakarta.servlet.http.HttpServletRequest req)
    Batch updates objects.
    org.springframework.http.ResponseEntity<?>
    batchUpdateHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles batch update of objects.
    org.springframework.http.ResponseEntity<?>
    checkPermission(String subjectid, String type, String method)
    Checks if a subject has permission for a resource.
    org.springframework.http.ResponseEntity<?>
    checkPermissionHandler(com.erudika.para.core.App app, String subjectid, String type, String method)
    Handles the checking of permissions.
    org.springframework.http.ResponseEntity<?>
    configOptions(jakarta.servlet.http.HttpServletRequest req)
    Returns the configuration documentation.
    org.springframework.http.ResponseEntity<?>
    create(String type, jakarta.servlet.http.HttpServletRequest req)
    Creates a new object of a given type.
    org.springframework.http.ResponseEntity<?>
    createHandler(com.erudika.para.core.App app, String type, jakarta.servlet.http.HttpServletRequest req)
    Handles the creation of a new object.
    org.springframework.http.ResponseEntity<?>
    createLink(String type, String id, String id2, jakarta.servlet.http.HttpServletRequest req)
    Creates a link between two objects.
    org.springframework.http.ResponseEntity<?>
    delete(String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Deletes an object of a given type.
    org.springframework.http.ResponseEntity<?>
    deleteAllLinks(String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Deletes all links for an object.
    org.springframework.http.ResponseEntity<?>
    deleteHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Handles the deletion of an object.
    org.springframework.http.ResponseEntity<?>
    deleteLink(String type, String id, String type2, String id2, jakarta.servlet.http.HttpServletRequest req)
    Deletes a link between two objects.
    org.springframework.http.ResponseEntity<?>
    Deletes an app setting.
    org.springframework.http.ResponseEntity<?>
    deleteSettingHandler(com.erudika.para.core.App app, String key)
    Handles the deletion of a setting.
    org.springframework.http.ResponseEntity<?>
    emails(HttpUtils.MultipartForm formData, String appid, String formid, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Sends an email (unauthenticated via public form).
    org.springframework.http.ResponseEntity<?>
    emails(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Sends an email (authenticated).
    org.springframework.http.ResponseEntity<?>
    emailsHandler(com.erudika.para.core.App app, String formId, HttpUtils.MultipartForm formData, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Handles email sending.
    org.springframework.http.ResponseEntity<?>
    Returns all validation constraints.
    org.springframework.http.ResponseEntity<?>
    Returns validation constraints for a specific type.
    org.springframework.http.ResponseEntity<?>
    getConstraintsHandler(com.erudika.para.core.App app, String type)
    Handles the retrieval of validation constraints.
    org.springframework.http.ResponseEntity<?>
    Returns all resource permissions.
    org.springframework.http.ResponseEntity<?>
    Returns resource permissions for a specific subject.
    org.springframework.http.ResponseEntity<?>
    getPermissionsHandler(com.erudika.para.core.App app, String subjectid)
    Handles the retrieval of resource permissions.
    org.springframework.http.ResponseEntity<?>
    Returns a specific app setting.
    org.springframework.http.ResponseEntity<?>
    getSettingHandler(com.erudika.para.core.App app, String key)
    Handles the retrieval of settings.
    org.springframework.http.ResponseEntity<?>
    Returns all app settings.
    org.springframework.http.ResponseEntity<?>
    grantPermission(String subjectid, String type, jakarta.servlet.http.HttpServletRequest req)
    Grants a resource permission.
    org.springframework.http.ResponseEntity<?>
    grantPermissionHandler(com.erudika.para.core.App app, String subjectid, String type, jakarta.servlet.http.HttpServletRequest req)
    Handles the granting of permissions.
    org.springframework.http.ResponseEntity<?>
    Returns the health status of the server.
    org.springframework.http.ResponseEntity<?>
    Returns the welcome message and version info.
    org.springframework.http.ResponseEntity<?>
    listTypes(jakarta.servlet.http.HttpServletRequest req)
    Lists all types for the current app.
    org.springframework.http.ResponseEntity<?>
    listTypesHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles the listing of types.
    org.springframework.http.ResponseEntity<?>
    me(jakarta.servlet.http.HttpServletRequest req)
    Returns the current authenticated user or app.
    org.springframework.http.ResponseEntity<?>
    Generates a new set of API keys for the current app.
    org.springframework.http.ResponseEntity<?>
    newKeysHandler(com.erudika.para.core.App app)
    Handles the generation of new API keys.
    org.springframework.http.ResponseEntity<?>
    overwrite(String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Overwrites an object of a given type.
    org.springframework.http.ResponseEntity<?>
    overwriteHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Handles the overwrite of an object.
    org.springframework.http.ResponseEntity<?>
    putLink(String type, String id, String id2, jakarta.servlet.http.HttpServletRequest req)
    Creates or updates a link between two objects.
    org.springframework.http.ResponseEntity<?>
    putSetting(String key, jakarta.servlet.http.HttpServletRequest req)
    Updates a specific app setting.
    org.springframework.http.ResponseEntity<?>
    putSettingHandler(com.erudika.para.core.App app, String key, jakarta.servlet.http.HttpServletRequest req)
    Handles the update of settings.
    org.springframework.http.ResponseEntity<?>
    putSettings(jakarta.servlet.http.HttpServletRequest req)
    Updates all app settings.
    org.springframework.http.ResponseEntity<?>
    read(String type, String id)
    Reads an object of a given type.
    org.springframework.http.ResponseEntity<?>
    readHandler(com.erudika.para.core.App app, String type, String id)
    Handles the reading of an object.
    org.springframework.http.ResponseEntity<?>
    Reads an object by its ID.
    org.springframework.http.ResponseEntity<?>
    readIdHandler(com.erudika.para.core.App app, String id)
    Handles reading an object by ID.
    org.springframework.http.ResponseEntity<?>
    readLink(String type, String id, String type2, String id2, jakarta.servlet.http.HttpServletRequest req)
    Reads a link between two objects.
    org.springframework.http.ResponseEntity<?>
    readLinksForType(String type, String id, String type2, jakarta.servlet.http.HttpServletRequest req)
    Reads all links of a certain type for an object.
    org.springframework.http.ResponseEntity<?>
    reindex(jakarta.servlet.http.HttpServletRequest req)
    Rebuilds the search index.
    org.springframework.http.ResponseEntity<?>
    reindexHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles the reindexing request.
    org.springframework.http.ResponseEntity<?>
    removeConstraint(String type, String field, String cname)
    Removes a validation constraint.
    org.springframework.http.ResponseEntity<?>
    removeConstraintHandler(com.erudika.para.core.App app, String type, String field, String cname)
    Handles the removal of a validation constraint.
    org.springframework.http.ResponseEntity<?>
    restore(jakarta.servlet.http.HttpServletRequest req)
    Imports app data from a ZIP file.
    org.springframework.http.ResponseEntity<?>
    restoreHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
    Handles the restore request.
    org.springframework.http.ResponseEntity<?>
    Revokes all resource permissions for a subject.
    org.springframework.http.ResponseEntity<?>
    revokePermission(String subjectid, String type)
    Revokes a resource permission.
    org.springframework.http.ResponseEntity<?>
    revokePermissionHandler(com.erudika.para.core.App app, String subjectid, String type)
    Handles the revocation of permissions.
    org.springframework.http.ResponseEntity<?>
    search(jakarta.servlet.http.HttpServletRequest req)
    Searches for objects.
    org.springframework.http.ResponseEntity<?>
    search(String querytype, jakarta.servlet.http.HttpServletRequest req)
    Searches for objects using a specific query type.
    org.springframework.http.ResponseEntity<?>
    searchHandler(com.erudika.para.core.App app, String typeParam, String querytype, jakarta.servlet.http.HttpServletRequest req)
    Handles search requests.
    org.springframework.http.ResponseEntity<?>
    searchType(String type, jakarta.servlet.http.HttpServletRequest req)
    Searches for objects of a specific type.
    org.springframework.http.ResponseEntity<?>
    searchType(String type, String querytype, jakarta.servlet.http.HttpServletRequest req)
    Searches for objects of a specific type using a specific query type.
    org.springframework.http.ResponseEntity<?>
    searchTypeDefault(String type, jakarta.servlet.http.HttpServletRequest req)
    Searches for objects of a specific type (default search).
    org.springframework.http.ResponseEntity<?>
    Initializes the root app.
    org.springframework.http.ResponseEntity<?>
    setup(String appid, jakarta.servlet.http.HttpServletRequest req)
    Initializes a new app.
    org.springframework.http.ResponseEntity<?>
    update(String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Updates an object of a given type.
    org.springframework.http.ResponseEntity<?>
    updateHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req)
    Handles the update of an object.
    org.springframework.http.ResponseEntity<?>
    utilsHandler(String method, jakarta.servlet.http.HttpServletRequest req)
    Provides utility functions like ID generation and date formatting.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Api1

      public Api1()
      No-args constructor.
  • Method Details

    • intro

      @GetMapping({"","/"}) public org.springframework.http.ResponseEntity<?> intro()
      Returns the welcome message and version info.
      Returns:
      a response containing info and version
    • setup

      @GetMapping("/_setup") public org.springframework.http.ResponseEntity<?> setup()
      Initializes the root app.
      Returns:
      a response
    • setup

      @GetMapping("/_setup/{appid}") public org.springframework.http.ResponseEntity<?> setup(@PathVariable String appid, jakarta.servlet.http.HttpServletRequest req)
      Initializes a new app.
      Parameters:
      appid - the app id
      req - the request
      Returns:
      a response
    • newKeys

      @PostMapping("/_newkeys") public org.springframework.http.ResponseEntity<?> newKeys()
      Generates a new set of API keys for the current app.
      Returns:
      a response
    • newKeysHandler

      public org.springframework.http.ResponseEntity<?> newKeysHandler(com.erudika.para.core.App app)
      Handles the generation of new API keys.
      Parameters:
      app - the app
      Returns:
      a response
    • create

      @PostMapping("/{type:[^_].*}") public org.springframework.http.ResponseEntity<?> create(@PathVariable String type, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Creates a new object of a given type.
      Parameters:
      type - the object type
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • createHandler

      public org.springframework.http.ResponseEntity<?> createHandler(com.erudika.para.core.App app, String type, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the creation of a new object.
      Parameters:
      app - the app
      type - the object type
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • read

      @GetMapping("/{type}/{id}") public org.springframework.http.ResponseEntity<?> read(@PathVariable String type, @PathVariable String id)
      Reads an object of a given type.
      Parameters:
      type - the object type
      id - the object id
      Returns:
      a response
    • readHandler

      public org.springframework.http.ResponseEntity<?> readHandler(com.erudika.para.core.App app, String type, String id)
      Handles the reading of an object.
      Parameters:
      app - the app
      type - the object type
      id - the object id
      Returns:
      a response
    • update

      @PatchMapping("/{type}/{id}") public org.springframework.http.ResponseEntity<?> update(@PathVariable String type, @PathVariable String id, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Updates an object of a given type.
      Parameters:
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • updateHandler

      public org.springframework.http.ResponseEntity<?> updateHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the update of an object.
      Parameters:
      app - the app
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • overwrite

      @PutMapping("/{type}/{id}") public org.springframework.http.ResponseEntity<?> overwrite(@PathVariable String type, @PathVariable String id, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Overwrites an object of a given type.
      Parameters:
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • overwriteHandler

      public org.springframework.http.ResponseEntity<?> overwriteHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the overwrite of an object.
      Parameters:
      app - the app
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • delete

      @DeleteMapping("/{type}/{id}") public org.springframework.http.ResponseEntity<?> delete(@PathVariable String type, @PathVariable String id, jakarta.servlet.http.HttpServletRequest req)
      Deletes an object of a given type.
      Parameters:
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
    • deleteHandler

      public org.springframework.http.ResponseEntity<?> deleteHandler(com.erudika.para.core.App app, String type, String id, jakarta.servlet.http.HttpServletRequest req)
      Handles the deletion of an object.
      Parameters:
      app - the app
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response
    • batchCreate

      @PostMapping("/_batch") public org.springframework.http.ResponseEntity<?> batchCreate(jakarta.servlet.http.HttpServletRequest req) throws IOException
      Batch creates objects.
      Parameters:
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • batchPut

      @PutMapping("/_batch") public org.springframework.http.ResponseEntity<?> batchPut(jakarta.servlet.http.HttpServletRequest req) throws IOException
      Batch creates or overwrites objects.
      Parameters:
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • batchCreateHandler

      public org.springframework.http.ResponseEntity<?> batchCreateHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles batch creation of objects.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • batchRead

      @GetMapping("/_batch") public org.springframework.http.ResponseEntity<?> batchRead(jakarta.servlet.http.HttpServletRequest req)
      Batch reads objects.
      Parameters:
      req - the request
      Returns:
      a response
    • batchReadHandler

      public org.springframework.http.ResponseEntity<?> batchReadHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
      Handles batch reading of objects.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
    • batchUpdate

      @PatchMapping("_batch") public org.springframework.http.ResponseEntity<?> batchUpdate(jakarta.servlet.http.HttpServletRequest req) throws IOException
      Batch updates objects.
      Parameters:
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • batchUpdateHandler

      public org.springframework.http.ResponseEntity<?> batchUpdateHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles batch update of objects.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • batchDelete

      @DeleteMapping("/_batch") public org.springframework.http.ResponseEntity<?> batchDelete(jakarta.servlet.http.HttpServletRequest req)
      Batch deletes objects.
      Parameters:
      req - the request
      Returns:
      a response
    • batchDeleteHandler

      public org.springframework.http.ResponseEntity<?> batchDeleteHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
      Handles batch deletion of objects.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
    • search

      @GetMapping("/search") public org.springframework.http.ResponseEntity<?> search(jakarta.servlet.http.HttpServletRequest req)
      Searches for objects.
      Parameters:
      req - the request
      Returns:
      a response
    • search

      @GetMapping("/search/{querytype}") public org.springframework.http.ResponseEntity<?> search(@PathVariable String querytype, jakarta.servlet.http.HttpServletRequest req)
      Searches for objects using a specific query type.
      Parameters:
      querytype - the query type
      req - the request
      Returns:
      a response
    • searchType

      @GetMapping("/{type}") public org.springframework.http.ResponseEntity<?> searchType(@PathVariable String type, jakarta.servlet.http.HttpServletRequest req)
      Searches for objects of a specific type.
      Parameters:
      type - the object type
      req - the request
      Returns:
      a response
    • searchTypeDefault

      @GetMapping("/{type}/search") public org.springframework.http.ResponseEntity<?> searchTypeDefault(@PathVariable String type, jakarta.servlet.http.HttpServletRequest req)
      Searches for objects of a specific type (default search).
      Parameters:
      type - the object type
      req - the request
      Returns:
      a response
    • searchType

      @GetMapping("/{type}/search/{querytype}") public org.springframework.http.ResponseEntity<?> searchType(@PathVariable String type, @PathVariable String querytype, jakarta.servlet.http.HttpServletRequest req)
      Searches for objects of a specific type using a specific query type.
      Parameters:
      type - the object type
      querytype - the query type
      req - the request
      Returns:
      a response
    • searchHandler

      public org.springframework.http.ResponseEntity<?> searchHandler(com.erudika.para.core.App app, String typeParam, String querytype, jakarta.servlet.http.HttpServletRequest req)
      Handles search requests.
      Parameters:
      app - the app
      typeParam - the object type
      querytype - the query type
      req - the request
      Returns:
      a response
    • utilsHandler

      @GetMapping("/utils/{method}") public org.springframework.http.ResponseEntity<?> utilsHandler(@PathVariable String method, jakarta.servlet.http.HttpServletRequest req)
      Provides utility functions like ID generation and date formatting.
      Parameters:
      method - the utility method
      req - the request
      Returns:
      a response
    • listTypes

      @GetMapping("/_types") public org.springframework.http.ResponseEntity<?> listTypes(jakarta.servlet.http.HttpServletRequest req)
      Lists all types for the current app.
      Parameters:
      req - the request
      Returns:
      a response
    • listTypesHandler

      public org.springframework.http.ResponseEntity<?> listTypesHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
      Handles the listing of types.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
    • me

      @GetMapping("/_me") public org.springframework.http.ResponseEntity<?> me(jakarta.servlet.http.HttpServletRequest req)
      Returns the current authenticated user or app.
      Parameters:
      req - the request
      Returns:
      a response
    • readId

      @GetMapping("/_id/{id}") public org.springframework.http.ResponseEntity<?> readId(@PathVariable String id)
      Reads an object by its ID.
      Parameters:
      id - the object id
      Returns:
      a response
    • readIdHandler

      public org.springframework.http.ResponseEntity<?> readIdHandler(com.erudika.para.core.App app, String id)
      Handles reading an object by ID.
      Parameters:
      app - the app
      id - the object id
      Returns:
      a response
    • configOptions

      @GetMapping("/_config/options") public org.springframework.http.ResponseEntity<?> configOptions(jakarta.servlet.http.HttpServletRequest req)
      Returns the configuration documentation.
      Parameters:
      req - the request
      Returns:
      a response
    • getConstraints

      @GetMapping("/_constraints") public org.springframework.http.ResponseEntity<?> getConstraints()
      Returns all validation constraints.
      Returns:
      a response
    • getConstraints

      @GetMapping("/_constraints/{type}") public org.springframework.http.ResponseEntity<?> getConstraints(@PathVariable String type)
      Returns validation constraints for a specific type.
      Parameters:
      type - the object type
      Returns:
      a response
    • getConstraintsHandler

      public org.springframework.http.ResponseEntity<?> getConstraintsHandler(com.erudika.para.core.App app, String type)
      Handles the retrieval of validation constraints.
      Parameters:
      app - the app
      type - the object type
      Returns:
      a response
    • addConstraint

      @PutMapping("/_constraints/{type}/{field}/{cname}") public org.springframework.http.ResponseEntity<?> addConstraint(@PathVariable String type, @PathVariable String field, @PathVariable String cname, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Adds a validation constraint.
      Parameters:
      type - the object type
      field - the field name
      cname - the constraint name
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • addConstraintHandler

      public org.springframework.http.ResponseEntity<?> addConstraintHandler(com.erudika.para.core.App app, String type, String field, String cname, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the addition of a validation constraint.
      Parameters:
      app - the app
      type - the object type
      field - the field name
      cname - the constraint name
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • removeConstraint

      @DeleteMapping("/_constraints/{type}/{field}/{cname}") public org.springframework.http.ResponseEntity<?> removeConstraint(@PathVariable String type, @PathVariable String field, @PathVariable String cname)
      Removes a validation constraint.
      Parameters:
      type - the object type
      field - the field name
      cname - the constraint name
      Returns:
      a response
    • removeConstraintHandler

      public org.springframework.http.ResponseEntity<?> removeConstraintHandler(com.erudika.para.core.App app, String type, String field, String cname)
      Handles the removal of a validation constraint.
      Parameters:
      app - the app
      type - the object type
      field - the field name
      cname - the constraint name
      Returns:
      a response
    • getPermissions

      @GetMapping("/_permissions") public org.springframework.http.ResponseEntity<?> getPermissions()
      Returns all resource permissions.
      Returns:
      a response
    • getPermissions

      @GetMapping("/_permissions/{subjectid}") public org.springframework.http.ResponseEntity<?> getPermissions(@PathVariable String subjectid)
      Returns resource permissions for a specific subject.
      Parameters:
      subjectid - the subject id
      Returns:
      a response
    • getPermissionsHandler

      public org.springframework.http.ResponseEntity<?> getPermissionsHandler(com.erudika.para.core.App app, String subjectid)
      Handles the retrieval of resource permissions.
      Parameters:
      app - the app
      subjectid - the subject id
      Returns:
      a response
    • checkPermission

      @GetMapping("/_permissions/{subjectid}/{type}/{method}") public org.springframework.http.ResponseEntity<?> checkPermission(@PathVariable String subjectid, @PathVariable String type, @PathVariable String method)
      Checks if a subject has permission for a resource.
      Parameters:
      subjectid - the subject id
      type - the resource type (base64 encoded path)
      method - the HTTP method
      Returns:
      a response
    • checkPermissionHandler

      public org.springframework.http.ResponseEntity<?> checkPermissionHandler(com.erudika.para.core.App app, String subjectid, String type, String method)
      Handles the checking of permissions.
      Parameters:
      app - the app
      subjectid - the subject id
      type - the resource type
      method - the HTTP method
      Returns:
      a response
    • grantPermission

      @PutMapping("/_permissions/{subjectid}/{type}") public org.springframework.http.ResponseEntity<?> grantPermission(@PathVariable String subjectid, @PathVariable String type, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Grants a resource permission.
      Parameters:
      subjectid - the subject id
      type - the resource type
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • grantPermissionHandler

      public org.springframework.http.ResponseEntity<?> grantPermissionHandler(com.erudika.para.core.App app, String subjectid, String type, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the granting of permissions.
      Parameters:
      app - the app
      subjectid - the subject id
      type - the resource type
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • revokePermission

      @DeleteMapping("/_permissions/{subjectid}/{type}") public org.springframework.http.ResponseEntity<?> revokePermission(@PathVariable String subjectid, @PathVariable String type)
      Revokes a resource permission.
      Parameters:
      subjectid - the subject id
      type - the resource type
      Returns:
      a response
    • revokeAllPermissions

      @DeleteMapping("/_permissions/{subjectid}") public org.springframework.http.ResponseEntity<?> revokeAllPermissions(@PathVariable String subjectid)
      Revokes all resource permissions for a subject.
      Parameters:
      subjectid - the subject id
      Returns:
      a response
    • revokePermissionHandler

      public org.springframework.http.ResponseEntity<?> revokePermissionHandler(com.erudika.para.core.App app, String subjectid, String type)
      Handles the revocation of permissions.
      Parameters:
      app - the app
      subjectid - the subject id
      type - the resource type
      Returns:
      a response
    • getSettings

      @GetMapping("/_settings") public org.springframework.http.ResponseEntity<?> getSettings()
      Returns all app settings.
      Returns:
      a response
    • getSetting

      @GetMapping("/_settings/{key}") public org.springframework.http.ResponseEntity<?> getSetting(@PathVariable String key)
      Returns a specific app setting.
      Parameters:
      key - the setting key
      Returns:
      a response
    • getSettingHandler

      public org.springframework.http.ResponseEntity<?> getSettingHandler(com.erudika.para.core.App app, String key)
      Handles the retrieval of settings.
      Parameters:
      app - the app
      key - the setting key
      Returns:
      a response
    • putSettings

      @PutMapping("/_settings") public org.springframework.http.ResponseEntity<?> putSettings(jakarta.servlet.http.HttpServletRequest req) throws IOException
      Updates all app settings.
      Parameters:
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • putSetting

      @PutMapping("/_settings/{key}") public org.springframework.http.ResponseEntity<?> putSetting(@PathVariable String key, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Updates a specific app setting.
      Parameters:
      key - the setting key
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • putSettingHandler

      public org.springframework.http.ResponseEntity<?> putSettingHandler(com.erudika.para.core.App app, String key, jakarta.servlet.http.HttpServletRequest req) throws IOException
      Handles the update of settings.
      Parameters:
      app - the app
      key - the setting key
      req - the request
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • deleteSetting

      @DeleteMapping("/_settings/{key}") public org.springframework.http.ResponseEntity<?> deleteSetting(@PathVariable String key)
      Deletes an app setting.
      Parameters:
      key - the setting key
      Returns:
      a response
    • deleteSettingHandler

      public org.springframework.http.ResponseEntity<?> deleteSettingHandler(com.erudika.para.core.App app, String key)
      Handles the deletion of a setting.
      Parameters:
      app - the app
      key - the setting key
      Returns:
      a response
    • health

      @GetMapping("/_health") public org.springframework.http.ResponseEntity<?> health()
      Returns the health status of the server.
      Returns:
      a response
    • reindex

      @PostMapping("/_reindex") public org.springframework.http.ResponseEntity<?> reindex(jakarta.servlet.http.HttpServletRequest req)
      Rebuilds the search index.
      Parameters:
      req - the request
      Returns:
      a response
    • reindexHandler

      public org.springframework.http.ResponseEntity<?> reindexHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
      Handles the reindexing request.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
    • backup

      @GetMapping(value="/_export", produces="application/zip") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> backup()
      Exports the app data as a ZIP file.
      Returns:
      a response
    • backupHandler

      public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> backupHandler(com.erudika.para.core.App app)
      Handles the backup request.
      Parameters:
      app - the app
      Returns:
      a response
    • restore

      @PutMapping(value="/_import", consumes="application/zip") public org.springframework.http.ResponseEntity<?> restore(jakarta.servlet.http.HttpServletRequest req)
      Imports app data from a ZIP file.
      Parameters:
      req - the request
      Returns:
      a response
    • restoreHandler

      public org.springframework.http.ResponseEntity<?> restoreHandler(com.erudika.para.core.App app, jakarta.servlet.http.HttpServletRequest req)
      Handles the restore request.
      Parameters:
      app - the app
      req - the request
      Returns:
      a response
    • emails

      @PostMapping("/_emails") public org.springframework.http.ResponseEntity<?> emails(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws IOException
      Sends an email (authenticated).
      Parameters:
      req - the request
      res - the response
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • emails

      @PostMapping(value="/_forms/{appid}/{formid}", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<?> emails(HttpUtils.MultipartForm formData, @PathVariable String appid, @PathVariable String formid, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws IOException
      Sends an email (unauthenticated via public form).
      Parameters:
      formData - the form data
      appid - the app id
      formid - the form id
      req - the request
      res - the response
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • emailsHandler

      public org.springframework.http.ResponseEntity<?> emailsHandler(com.erudika.para.core.App app, String formId, HttpUtils.MultipartForm formData, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws IOException
      Handles email sending.
      Parameters:
      app - the app
      formId - the form id
      formData - the form data
      req - the request
      res - the response
      Returns:
      a response
      Throws:
      IOException - if operation fails
    • readLink

      @GetMapping("/{type}/{id}/links/{type2}/{id2}") public org.springframework.http.ResponseEntity<?> readLink(@PathVariable String type, @PathVariable String id, @PathVariable String type2, @PathVariable String id2, jakarta.servlet.http.HttpServletRequest req)
      Reads a link between two objects.
      Parameters:
      type - the type of first object
      id - the id of first object
      type2 - the type of second object
      id2 - the id of second object
      req - the request
      Returns:
      a response
    • readLinksForType

      @GetMapping("/{type}/{id}/links/{type2}") public org.springframework.http.ResponseEntity<?> readLinksForType(@PathVariable String type, @PathVariable String id, @PathVariable String type2, jakarta.servlet.http.HttpServletRequest req)
      Reads all links of a certain type for an object.
      Parameters:
      type - the object type
      id - the object id
      type2 - the linked object type
      req - the request
      Returns:
      a response
    • createLink

      @PostMapping("/{type}/{id}/links/{id2}") public org.springframework.http.ResponseEntity<?> createLink(@PathVariable String type, @PathVariable String id, @PathVariable String id2, jakarta.servlet.http.HttpServletRequest req)
      Creates a link between two objects.
      Parameters:
      type - the type of first object
      id - the id of first object
      id2 - the id of second object
      req - the request
      Returns:
      a response
    • putLink

      @PutMapping("/{type}/{id}/links/{id2}") public org.springframework.http.ResponseEntity<?> putLink(@PathVariable String type, @PathVariable String id, @PathVariable String id2, jakarta.servlet.http.HttpServletRequest req)
      Creates or updates a link between two objects.
      Parameters:
      type - the type of first object
      id - the id of first object
      id2 - the id of second object
      req - the request
      Returns:
      a response
    • deleteLink

      @DeleteMapping("/{type}/{id}/links/{type2}/{id2}") public org.springframework.http.ResponseEntity<?> deleteLink(@PathVariable String type, @PathVariable String id, @PathVariable String type2, @PathVariable String id2, jakarta.servlet.http.HttpServletRequest req)
      Deletes a link between two objects.
      Parameters:
      type - the type of first object
      id - the id of first object
      type2 - the type of second object
      id2 - the id of second object
      req - the request
      Returns:
      a response
    • deleteAllLinks

      @DeleteMapping("/{type}/{id}/links") public org.springframework.http.ResponseEntity<?> deleteAllLinks(@PathVariable String type, @PathVariable String id, jakarta.servlet.http.HttpServletRequest req)
      Deletes all links for an object.
      Parameters:
      type - the object type
      id - the object id
      req - the request
      Returns:
      a response