论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Markus Feindler
Document Library Service - Parameter questions - repositoryid?
2009年8月20日 上午11:51
答复

Markus Feindler

等级: New Member

帖子: 8

加入日期: 2009年8月20日

最近的帖子

Hello guys,

I have got a huge problem in understanding the document library service (DLService).
I just want to add a File to a certain library via addFile:

1
2static void     addFile(long companyId, java.lang.String portletId, long groupId, long repositoryId, java.lang.String fileName, java.lang.String properties, java.lang.String[] tagsEntries, java.io.File file)


What the hell is the repositoryid? I cannot find any information about it (thanks to the non existing doc!)
Where is the targetfolder specified?

I have got every parameter information but the repositoryid. Could it be, that the repositoryid, is the FolderName? But that would be strange, because there is another method "addDirectory" (if I remember right) which also needs a repositoryid as a parameter.

EDIT:
Whats with the properties??


Thanks for help!

Bye
Thomas
Alexander Boldt
RE: Document Library Service - Parameter questions - repositoryid?
2011年2月9日 上午6:58
答复

Alexander Boldt

等级: New Member

帖子: 12

加入日期: 2011年1月6日

最近的帖子

if you still have this problem:

found this in DLFileEntryImpl

1public static long getRepositoryId(long groupId, long folderId) {
2        if (folderId == DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
3            return groupId;
4        }
5        else {
6            return folderId;
7        }
8    }


So RepoID is the folderId or groupID
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID -> 0L, this should be the case if it is the root folder.

In addition found that in
DLFolderImpl
1public boolean isRoot() {
2        if (getParentFolderId() == DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
3            return true;
4        }
5        else {
6            return false;
7        }
8    }


bye, alex
Alexander Boldt
RE: Document Library Service - Parameter questions - repositoryid?
2011年2月9日 上午7:38
答复

Alexander Boldt

等级: New Member

帖子: 12

加入日期: 2011年1月6日

最近的帖子

now something about properties.

Look @DLFileEntryLocalServiceImpl
1dlLocalService.addFile(
2            user.getCompanyId(), PortletKeys.DOCUMENT_LIBRARY,
3            fileEntry.getGroupId(), fileEntry.getRepositoryId(), name, false,
4            fileEntryId, fileEntry.getLuceneProperties(),
5            fileEntry.getModifiedDate(), serviceContext, is);


Properties -> fileEntry.getLuceneProperties()
now look @DLFileEntryImpl and you find what is properties.
Tom Mahy
RE: Document Library Service - Parameter questions - repositoryid?
2012年12月18日 上午3:13
答复

Tom Mahy

等级: Junior Member

帖子: 38

加入日期: 2012年5月2日

最近的帖子

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}

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


What am i doing wrong ?