Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Ay Kay
VAADIN File upload to LR DMS
25 settembre 2013 12.05
Risposta

Ay Kay

Punteggio: Junior Member

Messaggi: 52

Data di Iscrizione: 17 novembre 2011

Messaggi recenti

Hi there.

As title says, I want to insert an upload stream seamlessly into the LR DMS. The portlet is based on VAADIN.

The UI Widget of VAADIN to handle the upload is
com.vaadin.ui.Upload
I extended
com.vaadin.ui.Upload.Receiver
Here the decisive method returns an OutputStream:
public OutputStream receiveUpload(String fileName, String mimeType)

Okay, on to the LR DMS part.

The method I use is:
DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.addFileEntry(userId, groupId, repositoryId, folderId, fileName, mimeType, fileTitle, description, changeLog, fileEntryTypeId, fieldsMap, file, inputStream, fileLength, new ServiceContext());

On my first take I implemented this using the file system only and it worked, of course. Now all actions on the file system must be removed. I need to go directly to the DMS.

I am kind of lost on the VAADIN part, as well as on the LR part. I would greatly appreciate hints, docs or code snippets.
Thanks, and have a good one!
David H Nebinger
RE: VAADIN File upload to LR DMS
26 settembre 2013 20.14
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11295

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

You can do vaadin uploads to memory; you can then create a ByteArrayinputStream to pass to Liferay's DMS.