Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
Leonardo Spataro
upload files in "web content", recalling "documents and media" portlet
4. April 2012 02:57

Leonardo Spataro

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 24. Januar 2012

Neue Beiträge

I hope this is the right place to post.
I have a question:
I want to upload a file directly while I’m in the web content portlet. Now, it is necessary to upload a file in “documents and media” and after it is possible to select a file in the web content portlet.
Reading the post

I have tried to add a button in the web content, to recall document and media:
In “edit_article_content_xsd_el.jsp” file:


Map<String,Object> dataDocumentsAndMediaUploadUrl = new HashMap<String,Object>();
dataDocumentsAndMediaUploadUrl.put("DocumentlibraryUrl", documentsAndMediaUploadUrl);


<liferay-portlet:renderURL portletName="20" windowState="<%= LiferayWindowState.MAXIMIZED.toString() %>" var="documentsAndMediaUploadUrl">
<portlet:param name="struts_action" value="/document_library/view" />
<portlet:param name="groupId" value="<%= String.valueOf(dlScopeGroupId) %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />

<input type="button" value="<liferay-ui:message key="file-upload" />" onClick="showUploadFilePopup();" />

<script type="text/javascript">

var showUploadFilePopup = function () {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {

var dialog = new A.Dialog({
title: '<liferay-ui:message key="file-upload" />',
centered: true,
draggable: true,
modal: true,
height: 560,
width: 940,
cssClass: "popupContentAlignCenter",
bodyContent: '<iframe src="<%=documentsAndMediaUploadUrl%>" width="850" height="450" style="border: none; overflow: auto"></iframe>'



This code inserts a new button “upload file”.

I have added iframe to open a windows as a popup. Without the iframe, it will open in full screen. The problem is that in the popup it is possible to navigate the ALL site (back to home page, user log out...).
Instead, changing the windows state, from LiferayWindowState.MAXIMIZED.toString() to POPUP, all the additional features disappear, but it is not possible to navigate inside the folders.
Is there a solution?
I hope I have explained my problem clearly!
Thanks in advance!