private SPage addPage(final byte[] content, final String contentName, final long userId, final boolean provided, boolean hidden) throws SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException, SObjectCreationException { final Properties pageProperties = readPageZip(content, provided); final SPage page = buildPage(pageProperties.getProperty(PageService.PROPERTIES_NAME), pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME), pageProperties.getProperty(PageService.PROPERTIES_DESCRIPTION), contentName, userId, provided, hidden, pageProperties.getProperty(PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); return insertPage(page, content); }
private SPage addPage(final byte[] content, final String contentName, final long userId, final boolean provided, boolean hidden) throws SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException, SObjectCreationException { final Properties pageProperties = readPageZip(content, provided); final SPage page = buildPage(pageProperties.getProperty(PageService.PROPERTIES_NAME), pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME), pageProperties.getProperty(PageService.PROPERTIES_DESCRIPTION), contentName, userId, provided, hidden, pageProperties.getProperty(PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); return insertPage(page, content); }
protected void createPage(final ImportPageDescriptor pageDescriptor, final byte[] providedPageContent, final Properties pageProperties) throws SObjectAlreadyExistsException, SObjectCreationException { final SPage page = buildPage(pageProperties.getProperty(PageService.PROPERTIES_NAME), pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME), pageProperties.getProperty(PageService.PROPERTIES_DESCRIPTION), pageDescriptor.getZipName(), -1, true, pageDescriptor.isHidden(), pageProperties.getProperty(PageService.PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); insertPage(page, providedPageContent); }
protected void createPage(final ImportPageDescriptor pageDescriptor, final byte[] providedPageContent, final Properties pageProperties) throws SObjectAlreadyExistsException, SObjectCreationException { final SPage page = buildPage(pageProperties.getProperty(PageService.PROPERTIES_NAME), pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME), pageProperties.getProperty(PageService.PROPERTIES_DESCRIPTION), pageDescriptor.getZipName(), -1, true, pageDescriptor.isHidden(), pageProperties.getProperty(PageService.PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); insertPage(page, providedPageContent); }
@Override public SPage addPage(final SPage page, final byte[] content) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException { try { checkZipContainsRequiredEntries(unzip(content)); checkPageNameIsValid(page.getName(), page.isProvided()); checkPageDisplayNameIsValid(page.getDisplayName()); return insertPage(page, content); } catch (final IOException e) { throw new SInvalidPageZipInconsistentException("Error while reading zip file", e); } }
@Override public SPage addPage(final SPage page, final byte[] content) throws SObjectCreationException, SObjectAlreadyExistsException, SInvalidPageZipException, SInvalidPageTokenException { try { checkZipContainsRequiredEntries(unzip(content)); checkPageNameIsValid(page.getName(), page.isProvided()); checkPageDisplayNameIsValid(page.getDisplayName()); return insertPage(page, content); } catch (final IOException e) { throw new SInvalidPageZipInconsistentException("Error while reading zip file", e); } }