projects
/
gpl
/
argeo-suite.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dd0e97a
)
Improve content layer.
author
Mathieu Baudier <mbaudier@argeo.org>
Tue, 25 May 2021 04:28:39 +0000
(06:28 +0200)
committer
Mathieu Baudier <mbaudier@argeo.org>
Tue, 25 May 2021 04:28:39 +0000
(06:28 +0200)
library/org.argeo.library.ui/config/contentLayer.properties
patch
|
blob
|
history
publishing/org.argeo.publishing.ui/config/documentUiProvider.properties
patch
|
blob
|
history
publishing/org.argeo.publishing.ui/src/org/argeo/publishing/ui/DocumentUiProvider.java
patch
|
blob
|
history
diff --git
a/library/org.argeo.library.ui/config/contentLayer.properties
b/library/org.argeo.library.ui/config/contentLayer.properties
index 0f07715bd2557851b16d487a1f6356969938d48d..c1ca8e3225fbae5794cc0bfbdd829233322f1bb7 100644
(file)
--- a/
library/org.argeo.library.ui/config/contentLayer.properties
+++ b/
library/org.argeo.library.ui/config/contentLayer.properties
@@
-3,4
+3,4
@@
service.pid=argeo.library.ui.contentLayer
title=%content
icon=documents
title=%content
icon=documents
-entity.type=nt:folder,entity:space,entity:document
+entity.type=nt:folder,
nt:file,
entity:space,entity:document
diff --git
a/publishing/org.argeo.publishing.ui/config/documentUiProvider.properties
b/publishing/org.argeo.publishing.ui/config/documentUiProvider.properties
index 2b9635ff3e38c818949cb79dd1f6c3ff9dc26edd..855735da5030d65a3baee11830a93d4e2c22172d 100644
(file)
--- a/
publishing/org.argeo.publishing.ui/config/documentUiProvider.properties
+++ b/
publishing/org.argeo.publishing.ui/config/documentUiProvider.properties
@@
-1,3
+1,3
@@
service.pid=argeo.publishing.ui.documentUiProvider
service.pid=argeo.publishing.ui.documentUiProvider
-entity.type=entity:document
\ No newline at end of file
+entity.type=entity:document
,nt:file
\ No newline at end of file
diff --git
a/publishing/org.argeo.publishing.ui/src/org/argeo/publishing/ui/DocumentUiProvider.java
b/publishing/org.argeo.publishing.ui/src/org/argeo/publishing/ui/DocumentUiProvider.java
index 17292d81ad317f53094fe94b02dea781f29335b7..a2a4977276054fb979ca43a72a84c8f8751ee621 100644
(file)
--- a/
publishing/org.argeo.publishing.ui/src/org/argeo/publishing/ui/DocumentUiProvider.java
+++ b/
publishing/org.argeo.publishing.ui/src/org/argeo/publishing/ui/DocumentUiProvider.java
@@
-2,6
+2,7
@@
package org.argeo.publishing.ui;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
import org.argeo.cms.ui.CmsEditable;
import org.argeo.cms.ui.CmsUiProvider;
import org.argeo.cms.ui.CmsEditable;
import org.argeo.cms.ui.CmsUiProvider;
@@
-12,6
+13,7
@@
import org.argeo.docbook.DbkType;
import org.argeo.docbook.ui.AbstractDbkViewer;
import org.argeo.docbook.ui.DocumentTextEditor;
import org.eclipse.swt.SWT;
import org.argeo.docbook.ui.AbstractDbkViewer;
import org.argeo.docbook.ui.DocumentTextEditor;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@
-30,7
+32,17
@@
public class DocumentUiProvider implements CmsUiProvider {
page.setLayout(CmsUiUtils.noSpaceGridLayout());
AbstractDbkViewer dbkEditor = new DocumentTextEditor(page, SWT.NONE, textNode, cmsEditable);
page.setLayout(CmsUiUtils.noSpaceGridLayout());
AbstractDbkViewer dbkEditor = new DocumentTextEditor(page, SWT.NONE, textNode, cmsEditable);
-
+ return page;
+
+ } else if (context.isNodeType(NodeType.NT_FILE)) {
+ String fileName = context.getName();
+ if (fileName.endsWith(".pdf")) {
+ Browser browser = new Browser(parent, SWT.NONE);
+ String dataPath = CmsUiUtils.getDataPath(context);
+ browser.setUrl(dataPath);
+ browser.setLayoutData(CmsUiUtils.fillAll());
+ return browser;
+ }
}
return null;
}
}
return null;
}