From 90471ca4e3c959940f23f06966bae3b639bcf64f Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Wed, 4 Aug 2021 20:32:38 +0200 Subject: [PATCH] Cleanup --- .../AttachmentListDetailsModel.java | 3 - .../relatedinfo/RelatedInfoStep.java | 14 +- .../relatedinfo/RelatedInfoStepService.java | 732 +----------------- 3 files changed, 19 insertions(+), 730 deletions(-) diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/AttachmentListDetailsModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/AttachmentListDetailsModel.java index 9b4733bdc..0523fe033 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/AttachmentListDetailsModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/AttachmentListDetailsModel.java @@ -28,9 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStep.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStep.java index b4deaf0d8..c7de7e58c 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStep.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStep.java @@ -471,12 +471,12 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { } /** - * Removes an attachment list and all item attachment of the list. + * Removes an attachment list and all item attachments of the list. * * @param sectionIdentifier * @param documentPath * @param listIdentifierParam The identifier of the list to remove. - * @param confirmed The value of the confirm parameter. Must + * @param confirmed The value of the confirm parameter. Must * contain {@code true} (as string not as * boolean), otherwise this method does nothing. * @@ -889,10 +889,10 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { * * @param sectionIdentifier * @param documentPath - * @param listIdentifierParam The identifier of the list to which the - * attachment is added. - * @param assetIdentifier The identifier of the asset to use for the - * attachment. + * @param listIdentifierParam The identifier of the list to which the + * attachment is added. + * @param assetIdentifierParam The identifier of the asset to use for the + * attachment. * * @return A redirect to the list of attachment lists and attachments. */ @@ -1759,7 +1759,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep { * @param listIdentifierParam The identifier of the {@link AttachmentList} * to which the attachment belongs. * @param attachmentUuid The UUID of the attachment to remove. - * @param confirmed The value of the {@code confirm} parameter. If + * @param confirmed The value of the {@code confirm} parameter. If * the value anything other than the string * {@code true} the method does nothing. * diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStepService.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStepService.java index f7080fbd1..77b42a77d 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStepService.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/documents/relatedinfo/RelatedInfoStepService.java @@ -67,70 +67,17 @@ import javax.ws.rs.core.Response; @Path(MvcAuthoringSteps.PATH_PREFIX + "relatedinfo-service") public class RelatedInfoStepService { - private static final Logger LOGGER = LogManager.getLogger( - RelatedInfoStepService.class - ); - - /** - * The asset folder tree of the current content section. - */ - @Inject - private AssetFolderTree assetFolderTree; - - /** - * Used to build the {@link AssetPermissionsModel}. - */ - @Inject - private AssetPermissionsModelProvider assetPermissions; - - @Inject - private AssetManager assetManager; - - @Inject - private AssetRepository assetRepo; + @Inject private AttachmentListRepository attachmentListRepo; - @Inject - private ContentItemManager itemManager; - - @Inject - private ContentItemL10NManager itemL10NManager; - - @Inject - private ContentTypeRepository contentTypeRepo; - - @Inject - private DocumentFolderTree documentFolderTree; - - /** - * Used to check permissions of the current content item. - */ - @Inject - private DocumentPermissions documentPermissions; - @Inject private ItemAttachmentManager attachmentManager; @Inject private ContentItemRepository itemRepo; - @Inject - private FolderManager folderManager; - - /** - * Used to retrieve folders. - */ - @Inject - private FolderRepository folderRepo; - - @Inject - private GlobalizationHelper globalizationHelper; - - @Inject - private PermissionChecker permissionChecker; - @Inject private ContentSectionsUi sectionsUi; @@ -145,9 +92,6 @@ public class RelatedInfoStepService { final String documentPath, final RelatedInfoStepAttachmentOrder order ) { - // ToDo - LOGGER.info("order = {}", order); - final ContentSection contentSection = sectionsUi .findContentSection(sectionIdentifier) .orElseThrow( @@ -203,9 +147,9 @@ public class RelatedInfoStepService { ) ) ); - - attachmentList.setListOrder(i); - attachmentListRepo.save(attachmentList); + + attachmentList.setListOrder(i); + attachmentListRepo.save(attachmentList); } for (final Map.Entry> attachmentsOrder : order @@ -225,22 +169,23 @@ public class RelatedInfoStepService { ) ) ); - - final List> attachments = attachmentList.getAttachments(); + + final List> attachments = attachmentList + .getAttachments(); if (attachments.size() != attachmentsOrder.getValue().size()) { throw new BadRequestException( String.format( "Size of attachmentsOrder list does not match the size" - + "of the attachments list. " - + "attachmentsOrder.size = %d, " - + "attachmentsList.size = %d", + + "of the attachments list. " + + "attachmentsOrder.size = %d, " + + "attachmentsList.size = %d", attachmentsOrder.getValue().size(), attachments.size() ) ); } - - for(int i = 0; i < attachmentsOrder.getValue().size(); i++) { + + for (int i = 0; i < attachmentsOrder.getValue().size(); i++) { final String attachmentUuid = attachmentsOrder.getValue().get(i); final ItemAttachment attachment = attachments .stream() @@ -264,659 +209,6 @@ public class RelatedInfoStepService { } return Response.ok().build(); - -// -// //final Map attachmentListIndexes = } -// /** -// * Gets the asset folder tree of the current content section as JSON data. -// * -// * @param sectionIdentifier -// * @param documentPath -// * -// * @return The assets folder tree of the current content section as JSON -// * data. -// */ -// @GET -// @Path("/asset-folders") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List getAssetFolderTree( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath -// ) { -// final ContentSection section = retrieveContentSection( -// sectionIdentifier -// ); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, retrieveDocument(section, documentPath) -// )) { -// return assetFolderTree.buildFolderTree( -// section, section.getRootAssetsFolder() -// ); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// /** -// * Gets the assets in the folder as JSON data. -// * -// * @param folderPath The path of the folder. -// * @param firstResult The index of the firset result to show. -// * @param maxResults The maximum number of results to show. -// * @param filterTerm An optional filter term for filtering the assets -// * in the folder by their name. -// * @param documentPath -// * @param sectionIdentifier -// * -// * @return A list of the assets in the folder as JSON data. -// */ -// @GET -// @Path("/asset-folders/{folderPath}/assets") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List getAssetsInFolder( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath, -// @PathParam("folderPath") -// final String folderPath, -// @QueryParam("firstResult") -// @DefaultValue("0") -// final int firstResult, -// @QueryParam("maxResults") -// @DefaultValue("20") -// final int maxResults, -// @QueryParam("filterTerm") -// @DefaultValue("") -// final String filterTerm -// ) { -// final ContentSection section = retrieveContentSection(sectionIdentifier); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, retrieveDocument(section, documentPath) -// )) { -// final Folder folder; -// if (folderPath.isEmpty()) { -// folder = section.getRootAssetsFolder(); -// } else { -// final Optional folderResult = folderRepo.findByPath( -// section, folderPath, FolderType.ASSETS_FOLDER -// ); -// if (folderResult.isPresent()) { -// folder = folderResult.get(); -// } else { -// return Collections.emptyList(); -// } -// } -// return folderRepo -// .getAssetFolderEntries( -// folder, firstResult, maxResults, filterTerm -// ) -// .stream() -// .map(entry -> buildAssetFolderRowModel(section, entry)) -// .collect(Collectors.toList()); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// /** -// * Show all assets of a content section filtered by their name. -// * -// * @param sectionIdentifier -// * @param documentPath -// * @param firstResult The index of the first result to show. -// * @param maxResults The maximum number of results to show. -// * @param searchTerm An optional search term applied to the names of -// * the assets. -// * -// * @return A list of matching assets as JSON. -// */ -// @GET -// @Path("/search-assets") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List findAssets( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath, -// @QueryParam("firstResult") -// @DefaultValue("0") -// final int firstResult, -// @QueryParam("maxResults") -// @DefaultValue("20") -// final int maxResults, -// @QueryParam("searchTerm") -// @DefaultValue("") -// final String searchTerm -// ) { -// final ContentSection section = retrieveContentSection(sectionIdentifier); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, retrieveDocument(section, documentPath) -// )) { -// return assetRepo.findByTitleAndContentSection(searchTerm, section) -// .stream() -// .map(asset -> buildAssetFolderRowModel(section, asset)) -// .collect(Collectors.toList()); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// private ContentSection retrieveContentSection( -// final String sectionIdentifier -// ) { -// return sectionsUi.findContentSection( -// sectionIdentifier -// ).orElseThrow( -// () -> new NotFoundException( -// String.format( -// "No content section identified by %s available.", -// sectionIdentifier -// ) -// ) -// ); -// } -// -// /** -// * Gets the document folder tree of the current content section as JSON -// * data. -// * -// * @param sectionIdentifier -// * @param documentPath -// * -// * @return The document folder tree of the current content section as JSON -// * data. -// */ -// @GET -// @Path("/document-folders") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List getDocumentFolderTree( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath -// ) { -// final ContentSection section = retrieveContentSection(sectionIdentifier); -// final ContentItem document = retrieveDocument(section, documentPath); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, document -// )) { -// return documentFolderTree.buildFolderTree( -// section, section.getRootDocumentsFolder() -// ); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// /** -// * Gets the documents in the folder as JSON data. -// * -// * @param sectionIdentifier -// * @param documentPath -// * @param folderPath The path of the folder. -// * @param firstResult The index of the firset result to show. -// * @param maxResults The maximum number of results to show. -// * @param filterTerm An optional filter term for filtering the -// * documents in the folder by their name. -// * -// * @return A list of the documents in the folder as JSON data. -// */ -// @GET -// @Path("/document-folders/{folderPath}/documents") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List getDocumentsInFolder( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath, -// @PathParam("folderPath") -// final String folderPath, -// @QueryParam("firstResult") -// @DefaultValue("0") -// final int firstResult, -// @QueryParam("maxResults") -// @DefaultValue("20") -// final int maxResults, -// @QueryParam("filterTerm") -// @DefaultValue("") -// final String filterTerm -// ) { -// final ContentSection section = retrieveContentSection(sectionIdentifier); -// final ContentItem document = retrieveDocument(section, documentPath); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, document -// )) { -// final Folder folder; -// if (folderPath.isEmpty()) { -// folder = section.getRootDocumentsFolder(); -// } else { -// final Optional folderResult = folderRepo.findByPath( -// section, folderPath, FolderType.ASSETS_FOLDER -// ); -// if (folderResult.isPresent()) { -// folder = folderResult.get(); -// } else { -// return Collections.emptyList(); -// } -// } -// -// return folderRepo -// .getDocumentFolderEntries( -// folder, -// firstResult, -// maxResults, -// filterTerm -// ) -// .stream() -// .map(entry -> buildDocumentFolderRowModel(section, entry)) -// .collect(Collectors.toList()); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// /** -// * Show all documents of a content section filtered by their name. -// * -// * @param sectionIdentifier -// * @param documentPath -// * @param firstResult The index of the first result to show. -// * @param maxResults The maximum number of results to show. -// * @param searchTerm An optional search term applied to the names of -// * the docuemnts. -// * -// * @return A list of matching documents/content items as JSON. -// */ -// @GET -// @Path("/search-documents") -// @Produces(MediaType.APPLICATION_JSON) -// @Transactional(Transactional.TxType.REQUIRED) -// public List findDocuments( -// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) -// final String sectionIdentifier, -// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) -// final String documentPath, -// @QueryParam("firstResult") -// @DefaultValue("0") -// final int firstResult, -// @QueryParam("maxResults") -// @DefaultValue("20") -// final int maxResults, -// @QueryParam("searchTerm") -// @DefaultValue("") -// final String searchTerm -// ) { -// final ContentSection section = retrieveContentSection(sectionIdentifier); -// final ContentItem document = retrieveDocument(section, documentPath); -// -// if (permissionChecker.isPermitted( -// ItemPrivileges.EDIT, document -// )) { -// return itemRepo.findByNameAndContentSection(searchTerm, section) -// .stream() -// .map(asset -> buildDocumentFolderRowModel(section, asset)) -// .collect(Collectors.toList()); -// } else { -// throw new ForbiddenException(); -// } -// } -// -// private ContentItem retrieveDocument( -// final ContentSection section, final String documentPath -// ) { -// return itemRepo -// .findByPath(section, documentPath) -// .orElseThrow( -// () -> new NotFoundException( -// String.format( -// "No document with path %s found in content section %s.", -// documentPath, -// section.getLabel() -// ) -// ) -// ); -// } -// -// /** -// * Build the model for a row in the asset folder listing. -// * -// * @param section The content section. -// * @param entry The {@link AssetFolderEntry} from which the model is -// * build. -// * -// * @return The {@link AssetFolderRowModel} for the provided {@code entry}. -// */ -// private AssetFolderRowModel buildAssetFolderRowModel( -// final ContentSection section, final AssetFolderEntry entry -// ) { -// Objects.requireNonNull(section); -// Objects.requireNonNull(entry); -// -// final AssetFolderRowModel row = new AssetFolderRowModel(); -// if (entry.isFolder()) { -// final Folder folder = folderRepo -// .findById(entry.getEntryId()) -// .get(); -// row.setDeletable(false); -// row.setFolder(true); -// row.setFolderPath( -// folderManager -// .getFolderPath(folder) -// .substring( -// folderManager -// .getFolderPath(section.getRootAssetsFolder()) -// .length() -// ) -// ); -// row.setName(entry.getDisplayName()); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// folder.getTitle() -// ) -// ); -// row.setType( -// globalizationHelper.getLocalizedTextsUtil( -// "org.librecms.CmsAdminMessages" -// ).getText("contentsection.assetfolder.types.folder") -// ); -// row.setPermissions( -// assetPermissions.buildAssetPermissionsModel(folder) -// ); -// } else { -// final Asset asset = assetRepo -// .findById(entry.getEntryId()) -// .get(); -// row.setDeletable(!assetManager.isAssetInUse(asset)); -// row.setFolder(false); -// row.setName(entry.getDisplayName()); -// row.setNoneCmsObject(false); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// asset.getTitle() -// ) -// ); -// row.setType(asset.getClass().getName()); -// row.setPermissions( -// assetPermissions.buildAssetPermissionsModel(asset) -// ); -// } -// -// return row; -// } -// -// /** -// * Build the model for a row in the asset folder listing. -// * -// * @param section The content section. -// * @param asset The {@link Asset} from which the model is build. -// * -// * @return The {@link AssetFolderRowModel} for the provided {@code asset}. -// */ -// private AssetFolderRowModel buildAssetFolderRowModel( -// final ContentSection section, final Asset asset -// ) { -// Objects.requireNonNull(section); -// Objects.requireNonNull(asset); -// -// final AssetFolderRowModel row = new AssetFolderRowModel(); -// row.setDeletable(false); -// row.setFolder(false); -// row.setName(asset.getDisplayName()); -// row.setNoneCmsObject(false); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// asset.getTitle() -// ) -// ); -// row.setType(asset.getClass().getName()); -// row.setPermissions( -// assetPermissions.buildAssetPermissionsModel(asset) -// ); -// -// return row; -// } -// -// /** -// * Build the model for a row in the document folder listing. -// * -// * @param section The content section. -// * @param entry The {@link DocumentFolderEntry} from which the model is -// * build. -// * -// * @return The {@link DocumentFolderRowModel} for the provided -// * {@code entry}. -// */ -// private DocumentFolderRowModel buildDocumentFolderRowModel( -// final ContentSection section, final DocumentFolderEntry entry -// ) { -// Objects.requireNonNull(section); -// Objects.requireNonNull(entry); -// -// final DocumentFolderRowModel row = new DocumentFolderRowModel(); -// if (entry.isFolder()) { -// final Folder folder = folderRepo -// .findById(entry.getEntryId()) -// .get(); -// row.setCreated(""); -// row.setDeletable( -// folderManager -// .folderIsDeletable(folder) -// == FolderManager.FolderIsDeletable.YES -// ); -// row.setFolder(true); -// row.setFolderPath( -// folderManager -// .getFolderPath(folder) -// .substring( -// folderManager -// .getFolderPath(section.getRootDocumentsFolder()) -// .length() -// ) -// ); -// row.setLanguages(Collections.emptySortedSet()); -// row.setLastEditPublished(false); -// row.setLastEdited(""); -// row.setName(entry.getDisplayName()); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// folder.getTitle() -// ) -// ); -// row.setType( -// globalizationHelper.getLocalizedTextsUtil( -// "org.librecms.CmsAdminMessages" -// ).getText("contentsection.documentfolder.types.folder") -// ); -// row.setPermissions( -// documentPermissions.buildDocumentPermissionsModel(folder) -// ); -// } else { -// final ContentItem contentItem = itemRepo -// .findById(entry.getEntryId()) -// .get(); -// row.setCreated( -// DateTimeFormatter.ISO_DATE.format( -// LocalDate.ofInstant( -// contentItem.getCreationDate().toInstant(), -// ZoneId.systemDefault() -// ) -// ) -// ); -// row.setDeletable(!itemManager.isLive(contentItem)); -// row.setFolder(false); -// row.setFolderPath(itemManager.getItemPath(contentItem)); -// row.setLanguages( -// new TreeSet<>( -// itemL10NManager -// .availableLanguages(contentItem) -// .stream() -// .map(Locale::toString) -// .collect(Collectors.toSet()) -// ) -// ); -// if (itemManager.isLive(contentItem)) { -// final LocalDate draftLastModified = LocalDate.ofInstant( -// contentItem.getLastModified().toInstant(), -// ZoneId.systemDefault() -// ); -// final LocalDate liveLastModified = LocalDate.ofInstant( -// itemManager -// .getLiveVersion(contentItem, contentItem.getClass()) -// .map(ContentItem::getLastModified) -// .map(Date::toInstant) -// .get(), -// ZoneId.systemDefault() -// ); -// row.setLastEditPublished( -// liveLastModified.isBefore(draftLastModified) -// ); -// } else { -// row.setLastEditPublished(false); -// } -// -// row.setLastEdited( -// DateTimeFormatter.ISO_DATE.format( -// LocalDate.ofInstant( -// contentItem.getLastModified().toInstant(), -// ZoneId.systemDefault() -// ) -// ) -// ); -// row.setName(entry.getDisplayName()); -// row.setNoneCmsObject(false); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// contentItem.getTitle() -// ) -// ); -// row.setType( -// contentTypeRepo -// .findByContentSectionAndClass( -// section, contentItem.getClass() -// ) -// .map(ContentType::getLabel) -// .map( -// label -> globalizationHelper -// .getValueFromLocalizedString( -// label -// ) -// ).orElse("?") -// ); -// row.setPermissions( -// documentPermissions.buildDocumentPermissionsModel( -// contentItem -// ) -// ); -// } -// -// return row; -// } -// -// /** -// * Build the model for a row in the document folder listing. -// * -// * @param section The content section. -// * @param contentItem The {@link Contentitem} from which the model is build. -// * -// * @return The {@link DocumentFolderRowModel} for the provided -// * {@code contentItem}. -// */ -// private DocumentFolderRowModel buildDocumentFolderRowModel( -// final ContentSection section, final ContentItem contentItem -// ) { -// Objects.requireNonNull(section); -// Objects.requireNonNull(contentItem); -// -// final DocumentFolderRowModel row = new DocumentFolderRowModel(); -// row.setCreated( -// DateTimeFormatter.ISO_DATE.format( -// LocalDate.ofInstant( -// contentItem.getCreationDate().toInstant(), -// ZoneId.systemDefault() -// ) -// ) -// ); -// row.setDeletable(!itemManager.isLive(contentItem)); -// row.setFolder(false); -// row.setFolderPath(itemManager.getItemPath(contentItem)); -// row.setLanguages( -// new TreeSet<>( -// itemL10NManager -// .availableLanguages(contentItem) -// .stream() -// .map(Locale::toString) -// .collect(Collectors.toSet()) -// ) -// ); -// if (itemManager.isLive(contentItem)) { -// final LocalDate draftLastModified = LocalDate.ofInstant( -// contentItem.getLastModified().toInstant(), -// ZoneId.systemDefault() -// ); -// final LocalDate liveLastModified = LocalDate.ofInstant( -// itemManager -// .getLiveVersion(contentItem, contentItem.getClass()) -// .map(ContentItem::getLastModified) -// .map(Date::toInstant) -// .get(), -// ZoneId.systemDefault() -// ); -// row.setLastEditPublished( -// liveLastModified.isBefore(draftLastModified) -// ); -// } else { -// row.setLastEditPublished(false); -// } -// -// row.setLastEdited( -// DateTimeFormatter.ISO_DATE.format( -// LocalDate.ofInstant( -// contentItem.getLastModified().toInstant(), -// ZoneId.systemDefault() -// ) -// ) -// ); -// row.setName(contentItem.getDisplayName()); -// row.setNoneCmsObject(false); -// row.setTitle( -// globalizationHelper.getValueFromLocalizedString( -// contentItem.getTitle() -// ) -// ); -// row.setType( -// contentTypeRepo -// .findByContentSectionAndClass( -// section, contentItem.getClass() -// ) -// .map(ContentType::getLabel) -// .map( -// label -> globalizationHelper -// .getValueFromLocalizedString( -// label -// ) -// ).orElse("?") -// ); -// row.setPermissions( -// documentPermissions.buildDocumentPermissionsModel( -// contentItem -// ) -// ); -// -// return row; -// } }