Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Projet-Web
liferay-velocity-snippets
Commits
7934467e
Commit
7934467e
authored
Dec 01, 2017
by
David Barbeau
Browse files
snippet Shady Desjardins
parent
ba743eca
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
7934467e
...
...
@@ -181,6 +181,31 @@ Last modified date : <strong>$fileEntry.getModifiedDate()</strong>
```
<a
id=
"dlfileEntry-shady"
></a>
## Récupérer l'objet "DFileEntry" d'un élément document et média de type document
`$fileEntry`
est l'élément de type "document_library"
`$fileFields`
est la value de l'élément de type "document_library"
```
html
## REF : https://docs.liferay.com/portal/6.2/javadocs-all/com/liferay/portlet/documentlibrary/asset/DLFileEntryAssetRenderer.html
#set($renderer = $entry.getAssetRenderer())
## DO NOT REMOVE THE RENDER CALL!
## THIS IS SHADY!
## By calling the renderer's "render" method, file entry and file version attributes
## are injected in the request.
#set($templatePath = $renderer.render($renderRequest, $renderResponse, "abstract"))
#set($fileEntry = $renderRequest.getAttribute("DOCUMENT_LIBRARY_FILE_ENTRY").getDLFileEntry())
#set($fileVersion = $renderRequest.getAttribute("DOCUMENT_LIBRARY_FILE_VERSION"))
#set($fileVersionId = $fileVersion.getFileVersionId())
#set($fileFields = $fileEntry.getFieldsMap($fileVersionId).values().iterator().next())
$fileFields.get('xxx').getRenderedValue($locale)
```
---
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment