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
Antwort

Leonardo Spataro

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 24. Januar 2012

Neue Beiträge

Hi,
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
http://www.liferay.com/community/forums/-/message_boards/message/10050638?_19_redirect=http%3A%2F%2Fwww.liferay.com%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_keywords%3Dweb%2Bcontent%2Bupload%2Bfile%26_19_searchCategoryId%3D1108052%26_19_breadcrumbsCategoryId%3D1108052%26_19_redirect%3Dhttp%253A%252F%252Fwww.liferay.com%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F1108052

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 %>" />
</liferay-portlet:renderURL>

<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>'
}).render();
dialog.show();
});
};


</script>



//////////////////////


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!