Fórumok

Document Library Util Methods in Liferay 6.1

Sreekanth Pola, módosítva 11 év-val korábban

Document Library Util Methods in Liferay 6.1

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.09.05. Legújabb bejegyzések
I was previously using the Liferay 6.0.6. In that we were adding files to the document library using the Document Library service util methods. They were working fine. When we migrated to Liferay 6.1, these methods completely changed. I am unable to add files and file shortcuts to the Document library in liferay 6.1

I am using the following methods of Document Library

DLFileEntryServiceUtil.addFileEntry();
DLFileShortcutServiceUtil.addFileShortcut();

The method signatures from 6.0.6 to 6.1 are completely changed. Can anyone assist me in this regard.

Thanks in advance!
thumbnail
Victor Zorin, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

Liferay Legend Bejegyzések: 1228 Csatlakozás dátuma: 2008.04.14. Legújabb bejegyzések
Have a look at DLRepositoryLocalServiceUtil, e.g. :

V6.1: DLFileEntry entry = DLRepositoryLocalServiceUtil.getFileEntry(summary.getFileEntryId());
V.6.0: DLFileEntry entry = DLFileEntryLocalServiceUtil.getFileEntry(summary.getFileEntryId());

Yes, it is a big inconvenience, so for all our portlets we had to separate out our classes that have version-dependent code into separate libraries, and insert them into portlet.war depending on target Liferay environment.
Sreekanth Pola, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.09.05. Legújabb bejegyzések
Victor Zorin:
Have a look at DLRepositoryLocalServiceUtil, e.g. :

V6.1.: DLFileEntry entry = DLRepositoryLocalServiceUtil.getFileEntry(summary.getFileEntryId());
V.6.0: DLFileEntry entry = DLFileEntryLocalServiceUtil.getFileEntry(summary.getFileEntryId());

Yes, it is a big inconvenience, so for all our portlets we had to separate out own classes with version-dependent code into separate libraries with own jar build, and insert them into portlet.war depending on target Liferay environment.


Where the class file DLRepositoryLocalServiceUtil is exactly located? can you briefly explain about each param in the methods mentioned. Some of those params are new in liferay 6.1

DLFileEntryServiceUtil.addFileEntry();
DLFileShortcutServiceUtil.addFileShortcut();
thumbnail
Victor Zorin, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

Liferay Legend Bejegyzések: 1228 Csatlakozás dátuma: 2008.04.14. Legújabb bejegyzések
They are sitting in the same jar as others (com/liferay/portlet/documentlibrary/service/), so they should be visible to you in your development environment such as Eclipse.
Or have look at the source code or online docs, e.g. DLFileEntryLocalServiceUtil.
Sreekanth Pola, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.09.05. Legújabb bejegyzések
I could not find DLRepositoryLocalServiceUtil in the poratl-service.jar. By the way how to get the fileEntryTypeId for a file that is being uploaded to the document library. I am confused with the param fieldsMap in the addFileEntry() method.
thumbnail
Victor Zorin, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

Liferay Legend Bejegyzések: 1228 Csatlakozás dátuma: 2008.04.14. Legújabb bejegyzések
Yes, I can see it is not there, let me dig into it...
Edited: It looks like the interface has been shifted again to somewhere else. Amazing, looks like we will have to do another patching for GA2.
Will send further details tomorrow.
thumbnail
Mika Koivisto, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1 (Válasz)

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
If you want to use Document Library api use DLAppServiceUtil. If you use DLFileEntry you are using internal api and many features like thumbnail generation, metadata extraction etc won't work. Also that API might change at any time.
Sreekanth Pola, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.09.05. Legújabb bejegyzések
What can be the repositoryId in the below method? Its throwing an exception when I give the ID of my folder in the Document Library.

DLAppServiceUtil.addFileEntry(repositoryId, folderId, sourceFileName, mimeType, title, description, changeLog, file, serviceContext)
thumbnail
Mika Koivisto, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
RepositoryId is the scopeGroupId for Liferay Repository.
Sreekanth Pola, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

New Member Bejegyzések: 21 Csatlakozás dátuma: 2012.09.05. Legújabb bejegyzések
Thank you.. It worked for me...emoticon
tom mahy, módosítva 11 év-val korábban

RE: Document Library Util Methods in Liferay 6.1

Junior Member Bejegyzések: 38 Csatlakozás dátuma: 2012.05.02. Legújabb bejegyzések
Ive tried this and i get an error:
Caused by: com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=0, classNameId=10008, classPK=0}

SearchContext searchContext = new SearchContext();
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Group group = GroupLocalServiceUtil.getGroup(themeDisplay.getScopeGroupId());
Hits hits = DLAppServiceUtil.search(group.getGroupId(), searchContext);



What am i doing wrong ?