protected void updatePageNameInProfileEntry(final EntityUpdateDescriptor entityUpdateDescriptor, final String oldPageName) throws SInvalidPageTokenException, SBonitaReadException, SProfileEntryUpdateException { if (entityUpdateDescriptor.getFields().containsKey(SPageFields.PAGE_NAME)) { // page name has changed final String newPageName = entityUpdateDescriptor.getFields().get(SPageFields.PAGE_NAME).toString(); checkPageNameIsValid(newPageName, false); updateProfileEntry(oldPageName, newPageName); } }
protected void updatePageNameInProfileEntry(final EntityUpdateDescriptor entityUpdateDescriptor, final String oldPageName) throws SInvalidPageTokenException, SBonitaReadException, SProfileEntryUpdateException { if (entityUpdateDescriptor.getFields().containsKey(SPageFields.PAGE_NAME)) { // page name has changed final String newPageName = entityUpdateDescriptor.getFields().get(SPageFields.PAGE_NAME).toString(); checkPageNameIsValid(newPageName, false); updateProfileEntry(oldPageName, newPageName); } }
Properties readPageZip(final byte[] content, final boolean provided) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException { final Properties pageProperties; if (content == null) { throw new SInvalidPageZipInconsistentException("Content can't be null"); } try { final Map<String, byte[]> zipContent = unzip(content); pageProperties = helper.loadPageProperties(zipContent); if (isAnAPIExtension(pageProperties)) { checkApiControllerExists(zipContent, pageProperties); } else { checkZipContainsRequiredEntries(zipContent); } checkPageNameIsValid(pageProperties.getProperty(PageService.PROPERTIES_NAME), provided); checkPageDisplayNameIsValid(pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME)); } catch (final IOException e) { throw new SInvalidPageZipInconsistentException("Error while reading zip file", e); } return pageProperties; }
Properties readPageZip(final byte[] content, final boolean provided) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException { final Properties pageProperties; if (content == null) { throw new SInvalidPageZipInconsistentException("Content can't be null"); } try { final Map<String, byte[]> zipContent = unzip(content); pageProperties = helper.loadPageProperties(zipContent); if (isAnAPIExtension(pageProperties)) { checkApiControllerExists(zipContent, pageProperties); } else { checkZipContainsRequiredEntries(zipContent); } checkPageNameIsValid(pageProperties.getProperty(PageService.PROPERTIES_NAME), provided); checkPageDisplayNameIsValid(pageProperties.getProperty(PageService.PROPERTIES_DISPLAY_NAME)); } catch (final IOException e) { throw new SInvalidPageZipInconsistentException("Error while reading zip file", e); } return pageProperties; }
@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); } }