Skip to content

Commit

Permalink
IVYPORTAL-18073 Create file preview for PDF .log and PNG
Browse files Browse the repository at this point in the history
- Update CMS
  • Loading branch information
chnam-axonivy committed Dec 20, 2024
1 parent 2036196 commit 5f0a0c5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ch.ivy.addon.portalkit.ui.jsf:
ApplicationName: Der Standard-Anwendungsname, der im Seitentitel angezeigt wird.
BaseQRCodeUrl: Legen Sie die Basis-URL für den anzuzeigenden QR-Code fest.
DefaultThemeMode: Der Standardthemenmodus der Anwendung
EnableDocumentPreview: 'Set to true to enable document preview for some certain file types. Supported file types are: pdf, png, txt, log.'
EnableDocumentPreview: 'Auf "true" setzen, um die Vorschau von Dokumenten für bestimmte Dateitypen zu aktivieren. Unterstützte Dateitypen sind: pdf, png, jpeg, jpg, txt, log.'
EnableSwitchThemeModeButton: Setzen Sie diesen Wert auf true, um die Schaltfläche "Thema wechseln" zu aktivieren.
GlobalSearchScopeCategoriesNote: Festlegung der Typen, nach denen bei der globalen Suche gesucht werden soll
GooglePlayURL: Legen Sie die URL fest, um die Axon Ivy-Mobilanwendung auf Google Play herunterzuladen.
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ch.ivy.addon.portalkit.ui.jsf:
ApplicationName: El nombre por defecto de la aplicación que se mostrará en el título de la página.
BaseQRCodeUrl: Establezca la URL base para mostrar el código QR.
DefaultThemeMode: El modo de tema por defecto de la aplicación
EnableDocumentPreview: 'Set to true to enable document preview for some certain file types. Supported file types are: pdf, png, txt, log.'
EnableDocumentPreview: 'Establecer en "true" para habilitar la vista previa de documentos para ciertos tipos de archivos. Los tipos de archivos compatibles son: pdf, png, jpeg, jpg, txt, log.'
EnableSwitchThemeModeButton: Establecer en true para habilitar el botón de cambio de tema.
GlobalSearchScopeCategoriesNote: Definición de los tipos que buscará la búsqueda global
GooglePlayURL: Establece la URL para descargar la aplicación móvil Axon Ivy en Google Play.
Expand Down
2 changes: 1 addition & 1 deletion AxonIvyPortal/portal/cms/cms_fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ch.ivy.addon.portalkit.ui.jsf:
ApplicationName: Le nom de l'application par défaut qui sera affiché dans le titre de la page.
BaseQRCodeUrl: Définir l'URL de base du code QR à afficher.
DefaultThemeMode: Le mode de thème par défaut de l'application
EnableDocumentPreview: 'Set to true to enable document preview for some certain file types. Supported file types are: pdf, png, txt, log.'
EnableDocumentPreview: 'Définir sur "true" pour activer l''aperçu des documents pour certains types de fichiers. Les types de fichiers pris en charge sont : pdf, png, jpeg, jpg, txt, log.'
EnableSwitchThemeModeButton: Défini à true pour activer le bouton de changement de thème.
GlobalSearchScopeCategoriesNote: Définition des types recherchés par la recherche globale
GooglePlayURL: Définir l'URL pour télécharger l'application mobile Axon Ivy sur Google Play.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import ch.ivy.addon.portalkit.service.GlobalSettingService;
import ch.ivy.addon.portalkit.util.PermissionUtils;
import ch.ivy.addon.portalkit.util.SortFieldUtil;
import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.security.IPermission;
import ch.ivyteam.ivy.workflow.ICase;
import ch.ivyteam.ivy.workflow.ITask;
Expand Down Expand Up @@ -87,12 +86,10 @@ public SortMeta getDocumentSortByCreationTimestamp() {

public boolean canPreviewDocument(IvyDocument document) {
boolean enablePreviewSetting = GlobalSettingService.getInstance().findBooleanGlobalSettingValue(GlobalVariable.ENABLE_DOCUMENT_PREVIEW);
Ivy.log().error("enablePreviewSetting is {0}", enablePreviewSetting);
if (document != null && StringUtils.startsWithIgnoreCase(document.getContentType(), "image/")) {
return enablePreviewSetting;
}
boolean isSupportedPreviewType = document != null && StringUtils.endsWithAny(document.getPath().toLowerCase(), ".pdf", ".txt", ".log");
Ivy.log().error("isSupportedPreviewType is {0}", isSupportedPreviewType);
return enablePreviewSetting && isSupportedPreviewType;
}
}

0 comments on commit 5f0a0c5

Please sign in to comment.