use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto in project CzechIdMng by bcvsolutions.
the class IdmIdentityContractController method getFormValues.
/**
* Returns entity's filled form values
*
* @param backendId
* @return
*/
@ResponseBody
@RequestMapping(value = "/{backendId}/form-values", method = RequestMethod.GET)
@PreAuthorize("hasAuthority('" + CoreGroupPermission.IDENTITYCONTRACT_READ + "')")
@ApiOperation(value = "Identity contract form definition - read values", nickname = "getIdentityContractFormValues", tags = { IdmIdentityContractController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.IDENTITYCONTRACT_READ, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.IDENTITYCONTRACT_READ, description = "") }) })
public Resource<?> getFormValues(@ApiParam(value = "Identity's uuid identifier or username.", required = true) @PathVariable @NotNull String backendId, @ApiParam(value = "Code of form definition (default will be used if no code is given).", required = false, defaultValue = FormService.DEFAULT_DEFINITION_CODE) @RequestParam(name = "definitionCode", required = false) String definitionCode) {
IdmIdentityContractDto dto = getDto(backendId);
if (dto == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", backendId));
}
//
checkAccess(dto, IdmBasePermission.READ);
//
IdmFormDefinitionDto formDefinition = formDefinitionController.getDefinition(IdmIdentityContract.class, definitionCode);
//
return formDefinitionController.getFormValues(dto, formDefinition);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto in project CzechIdMng by bcvsolutions.
the class IdmIdentityController method saveFormValues.
/**
* Saves connector configuration form values
*
* @param backendId
* @param formValues
* @return
*/
@ResponseBody
@PreAuthorize("hasAuthority('" + CoreGroupPermission.IDENTITY_UPDATE + "')")
@RequestMapping(value = "/{backendId}/form-values", method = RequestMethod.POST)
@ApiOperation(value = "Identity form definition - save values", nickname = "postIdentityFormValues", tags = { IdmIdentityController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.IDENTITY_UPDATE, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.IDENTITY_UPDATE, description = "") }) })
public Resource<?> saveFormValues(@ApiParam(value = "Identity's uuid identifier or username.", required = true) @PathVariable @NotNull String backendId, @ApiParam(value = "Code of form definition (default will be used if no code is given).", required = false, defaultValue = FormService.DEFAULT_DEFINITION_CODE) @RequestParam(name = "definitionCode", required = false) String definitionCode, @ApiParam(value = "Filled form data.", required = true) @RequestBody @Valid List<IdmFormValueDto> formValues) {
IdmIdentityDto entity = getDto(backendId);
if (entity == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", backendId));
}
checkAccess(entity, IdmBasePermission.UPDATE);
//
IdmFormDefinitionDto formDefinition = formDefinitionController.getDefinition(IdmIdentity.class, definitionCode);
//
return formDefinitionController.saveFormValues(entity, formDefinition, formValues);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto in project CzechIdMng by bcvsolutions.
the class IdmRoleController method getFormValues.
/**
* Returns entity's filled form values
*
* @param backendId
* @return
*/
@ResponseBody
@RequestMapping(value = "/{backendId}/form-values", method = RequestMethod.GET)
@PreAuthorize("hasAuthority('" + CoreGroupPermission.ROLE_READ + "')")
@ApiOperation(value = "Role form definition - read values", nickname = "getRoleFormValues", tags = { IdmRoleController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.ROLE_READ, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.ROLE_READ, description = "") }) })
public Resource<?> getFormValues(@ApiParam(value = "Role's uuid identifier or code.", required = true) @PathVariable @NotNull String backendId, @ApiParam(value = "Code of form definition (default will be used if no code is given).", required = false, defaultValue = FormService.DEFAULT_DEFINITION_CODE) @RequestParam(name = "definitionCode", required = false) String definitionCode) {
IdmRoleDto dto = getDto(backendId);
if (dto == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", backendId));
}
//
IdmFormDefinitionDto formDefinition = formDefinitionController.getDefinition(IdmRole.class, definitionCode);
//
return formDefinitionController.getFormValues(dto, formDefinition);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto in project CzechIdMng by bcvsolutions.
the class IdmRoleController method saveFormValues.
/**
* Saves entity's form values
*
* @param backendId
* @param formValues
* @return
*/
@ResponseBody
@PreAuthorize("hasAuthority('" + CoreGroupPermission.ROLE_UPDATE + "')")
@RequestMapping(value = "/{backendId}/form-values", method = RequestMethod.POST)
@ApiOperation(value = "Role form definition - save values", nickname = "postRoleFormValues", tags = { IdmRoleController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.ROLE_UPDATE, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.ROLE_UPDATE, description = "") }) })
public Resource<?> saveFormValues(@ApiParam(value = "Role's uuid identifier or code.", required = true) @PathVariable @NotNull String backendId, @ApiParam(value = "Code of form definition (default will be used if no code is given).", required = false, defaultValue = FormService.DEFAULT_DEFINITION_CODE) @RequestParam(name = "definitionCode", required = false) String definitionCode, @RequestBody @Valid List<IdmFormValueDto> formValues) {
IdmRoleDto dto = getDto(backendId);
if (dto == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", backendId));
}
checkAccess(dto, IdmBasePermission.UPDATE);
//
IdmFormDefinitionDto formDefinition = formDefinitionController.getDefinition(IdmRole.class, definitionCode);
//
return formDefinitionController.saveFormValues(dto, formDefinition, formValues);
}
use of eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto in project CzechIdMng by bcvsolutions.
the class IdmTreeNodeController method getFormValues.
/**
* Returns filled form values
*
* @param backendId
* @return
*/
@ResponseBody
@RequestMapping(value = "/{backendId}/form-values", method = RequestMethod.GET)
@ApiOperation(value = "Tree node form definition - read values", nickname = "getTreeNodeFormValues", tags = { IdmTreeNodeController.TAG })
public Resource<?> getFormValues(@ApiParam(value = "Node's uuid identifier.", required = true) @PathVariable @NotNull String backendId, @ApiParam(value = "Code of form definition (default will be used if no code is given).", required = false, defaultValue = FormService.DEFAULT_DEFINITION_CODE) @RequestParam(name = "definitionCode", required = false) String definitionCode) {
IdmTreeNodeDto dto = getDto(backendId);
if (dto == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", backendId));
}
//
IdmFormDefinitionDto formDefinition = formDefinitionController.getDefinition(IdmTreeNode.class, definitionCode);
//
return formDefinitionController.getFormValues(dto, formDefinition);
}
Aggregations