Search in sources :

Example 1 with EntityManagerDto

use of org.entando.entando.aps.system.services.entity.model.EntityManagerDto in project entando-core by entando.

the class EntityManagerController method getEntityManager.

@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{entityManagerCode}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getEntityManager(@PathVariable String entityManagerCode) throws JsonProcessingException {
    logger.debug("Requested manager -> {}", entityManagerCode);
    EntityManagerDto dto = this.getEntityManagerService().getEntityManager(entityManagerCode);
    logger.debug("Main Response -> {}", dto);
    return new ResponseEntity<>(new RestResponse(dto), HttpStatus.OK);
}
Also used : EntityManagerDto(org.entando.entando.aps.system.services.entity.model.EntityManagerDto) ResponseEntity(org.springframework.http.ResponseEntity) RestResponse(org.entando.entando.web.common.model.RestResponse) RestAccessControl(org.entando.entando.web.common.annotation.RestAccessControl) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with EntityManagerDto

use of org.entando.entando.aps.system.services.entity.model.EntityManagerDto in project entando-core by entando.

the class EntityManagerServiceIntegrationTest method testGetManager_1.

@Test
public void testGetManager_1() {
    EntityManagerDto dto = this.entityManagerService.getEntityManager(SystemConstants.USER_PROFILE_MANAGER);
    assertNotNull(dto);
    assertEquals(SystemConstants.USER_PROFILE_MANAGER, dto.getCode());
    assertEquals(1, dto.getEntityTypes().size());
    assertEquals("PFL", dto.getEntityTypes().get(0).getCode());
}
Also used : EntityManagerDto(org.entando.entando.aps.system.services.entity.model.EntityManagerDto) Test(org.junit.Test)

Example 3 with EntityManagerDto

use of org.entando.entando.aps.system.services.entity.model.EntityManagerDto in project entando-core by entando.

the class EntityManagerServiceIntegrationTest method testGetManager_2.

@Test
public void testGetManager_2() {
    EntityManagerDto dto = this.entityManagerService.getEntityManager(JacmsSystemConstants.CONTENT_MANAGER);
    assertNotNull(dto);
    assertEquals(JacmsSystemConstants.CONTENT_MANAGER, dto.getCode());
    assertEquals(4, dto.getEntityTypes().size());
}
Also used : EntityManagerDto(org.entando.entando.aps.system.services.entity.model.EntityManagerDto) Test(org.junit.Test)

Aggregations

EntityManagerDto (org.entando.entando.aps.system.services.entity.model.EntityManagerDto)3 Test (org.junit.Test)2 RestAccessControl (org.entando.entando.web.common.annotation.RestAccessControl)1 RestResponse (org.entando.entando.web.common.model.RestResponse)1 ResponseEntity (org.springframework.http.ResponseEntity)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1