@Override public void pageDeleted(final SPage page) throws SBonitaReadException, SDeletionException { if (SContentType.API_EXTENSION.equals(page.getContentType())) { List<SPageMapping> mappings; do { mappings = pageMappingService.get(page.getId(), 0, MAX_RESULTS); for (final SPageMapping mapping : mappings) { pageMappingService.delete(mapping); } } while (mappings.size() == MAX_RESULTS); } }
@Override public void pageDeleted(final SPage page) throws SBonitaReadException, SDeletionException { if (SContentType.API_EXTENSION.equals(page.getContentType())) { List<SPageMapping> mappings; do { mappings = pageMappingService.get(page.getId(), 0, MAX_RESULTS); for (final SPageMapping mapping : mappings) { pageMappingService.delete(mapping); } } while (mappings.size() == MAX_RESULTS); } }
private void updateMappings(final SPage page, final Properties apiProperties) throws SObjectCreationException, SBonitaReadException, SDeletionException { final List<String> keys = getKeysOfPageMappings(apiProperties); final List<String> existingKeys = new ArrayList<>(); List<SPageMapping> mappings; do { mappings = pageMappingService.get(page.getId(), 0, MAX_RESULTS); for (final SPageMapping mapping : mappings) { if (keys.contains(mapping.getKey())) { existingKeys.add(mapping.getKey()); } else { pageMappingService.delete(mapping); } } } while (mappings.size() == MAX_RESULTS); keys.removeAll(existingKeys); for (final String key : keys) { pageMappingService.create(key, page.getId(), Collections.<String> emptyList()); } }
private void updateMappings(final SPage page, final Properties apiProperties) throws SObjectCreationException, SBonitaReadException, SDeletionException { final List<String> keys = getKeysOfPageMappings(apiProperties); final List<String> existingKeys = new ArrayList<>(); List<SPageMapping> mappings; do { mappings = pageMappingService.get(page.getId(), 0, MAX_RESULTS); for (final SPageMapping mapping : mappings) { if (keys.contains(mapping.getKey())) { existingKeys.add(mapping.getKey()); } else { pageMappingService.delete(mapping); } } } while (mappings.size() == MAX_RESULTS); keys.removeAll(existingKeys); for (final String key : keys) { pageMappingService.create(key, page.getId(), Collections.<String> emptyList()); } }
@Override public PageURL resolvePageOrURL(String key, Map<String, Serializable> context, boolean executeAuthorizationRules) throws NotFoundException, ExecutionException, UnauthorizedAccessException { final PageMappingService pageMappingService = retrievePageMappingService(); try { return ModelConvertor.toPageURL(pageMappingService.resolvePageURL(pageMappingService.get(key), context, executeAuthorizationRules)); } catch (final SObjectNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SExecutionException e) { throw new ExecutionException(e); } catch (final SAuthorizationException e) { throw new UnauthorizedAccessException(e); } }
@Override public PageURL resolvePageOrURL(String key, Map<String, Serializable> context, boolean executeAuthorizationRules) throws NotFoundException, ExecutionException, UnauthorizedAccessException { final PageMappingService pageMappingService = retrievePageMappingService(); try { return ModelConvertor.toPageURL(pageMappingService.resolvePageURL(pageMappingService.get(key), context, executeAuthorizationRules)); } catch (final SObjectNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SExecutionException e) { throw new ExecutionException(e); } catch (final SAuthorizationException e) { throw new UnauthorizedAccessException(e); } }