private void checkPageNameIsValid(final String name, final boolean provided) throws SInvalidPageTokenException { if (name == null || name.isEmpty() || !provided && !name.matches(PAGE_TOKEN_PREFIX + "\\p{Alnum}+")) { throw new SInvalidPageTokenException("Page name is not valid, it must contains only alpha numeric characters and start with " + PAGE_TOKEN_PREFIX); } }
public Page createPage(final String contentName, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { try { return convertToPage(pageService.addPage(content, contentName, userIdFromSession)); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name defined in page zip content"); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
public Page createPage(final String contentName, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { try { return convertToPage(pageService.addPage(content, contentName, userIdFromSession)); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name defined in page zip content"); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
public Page createPage(final PageCreator pageCreator, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { final SPage sPage = constructPage(pageCreator, userIdFromSession); try { final SPage addPage = pageService.addPage(sPage, content); return convertToPage(addPage); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name " + pageCreator.getName()); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
private void checkPageNameIsValid(final String name, final boolean provided) throws SInvalidPageTokenException { if (name == null || name.isEmpty() || !provided && !name.matches(PAGE_TOKEN_PREFIX + "\\p{Alnum}+")) { throw new SInvalidPageTokenException("Page name is not valid, it must contains only alpha numeric characters and start with " + PAGE_TOKEN_PREFIX); } }
public Page createPage(final PageCreator pageCreator, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { final SPage sPage = constructPage(pageCreator, userIdFromSession); try { final SPage addPage = pageService.addPage(sPage, content); return convertToPage(addPage); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name " + pageCreator.getName()); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
public void updatePageContent(final long pageId, final byte[] content) throws UpdateException, UpdatingWithInvalidPageTokenException, UpdatingWithInvalidPageZipContentException { final SPageUpdateBuilder pageUpdateBuilder = getPageUpdateBuilder(); pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); try { final SPage page = pageService.getPage(pageId); pageService.updatePageContent(pageId, content, page.getContentName()); pageService.updatePage(pageId, pageUpdateBuilder.done()); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw new UpdatingWithInvalidPageZipContentException(e.getMessage(), e); } catch (final SBonitaException sBonitaException) { throw new UpdateException(sBonitaException); } }
public void updatePageContent(final long pageId, final byte[] content) throws UpdateException, UpdatingWithInvalidPageTokenException, UpdatingWithInvalidPageZipContentException { final SPageUpdateBuilder pageUpdateBuilder = getPageUpdateBuilder(); pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); try { final SPage page = pageService.getPage(pageId); pageService.updatePageContent(pageId, content, page.getContentName()); pageService.updatePage(pageId, pageUpdateBuilder.done()); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw new UpdatingWithInvalidPageZipContentException(e.getMessage(), e); } catch (final SBonitaException sBonitaException) { throw new UpdateException(sBonitaException); } }
public Properties getPageProperties(final byte[] content, final boolean checkIfItAlreadyExists) throws InvalidPageTokenException, AlreadyExistsException, InvalidPageZipMissingPropertiesException, InvalidPageZipMissingIndexException, InvalidPageZipInconsistentException, InvalidPageZipMissingAPropertyException { try { return getProperties(content, checkIfItAlreadyExists, pageService); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage()); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SInvalidPageZipMissingAPropertyException e) { throw new InvalidPageZipMissingAPropertyException(e.getFields()); } catch (final SInvalidPageZipInconsistentException e) { throw new InvalidPageZipInconsistentException(e.getMessage(), e); } catch (final SInvalidPageZipMissingIndexException e) { throw new InvalidPageZipMissingIndexException(); } catch (final SInvalidPageZipMissingPropertiesException e) { throw new InvalidPageZipMissingPropertiesException(); } }
public Properties getPageProperties(final byte[] content, final boolean checkIfItAlreadyExists) throws InvalidPageTokenException, AlreadyExistsException, InvalidPageZipMissingPropertiesException, InvalidPageZipMissingIndexException, InvalidPageZipInconsistentException, InvalidPageZipMissingAPropertyException { try { return getProperties(content, checkIfItAlreadyExists, pageService); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage()); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SInvalidPageZipMissingAPropertyException e) { throw new InvalidPageZipMissingAPropertyException(e.getFields()); } catch (final SInvalidPageZipInconsistentException e) { throw new InvalidPageZipInconsistentException(e.getMessage(), e); } catch (final SInvalidPageZipMissingIndexException e) { throw new InvalidPageZipMissingIndexException(); } catch (final SInvalidPageZipMissingPropertiesException e) { throw new InvalidPageZipMissingPropertiesException(); } }
throw new AlreadyExistsException(e); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e);
throw new AlreadyExistsException(e); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e);